Setting up the Unity3D world for Windows
THIS PAGE IS OBSOLETE
This page describes the steps to set up OpenCog in such a way that they can run the Embodiment module together with the Unity world, using Windows as the host system for running the Unity 3D standalone player, while running Ubuntu 12.04 inside a virtual machine to run OpenCog and its Embodiment module.
This page has the following prerequisites:
- A computer with Windows as the main OS, preferably 64-bit since not all parts of OpenCog work in 32-bit right now.
- A running Ubuntu virtual machine. See Building OpenCog on Windows or Setting up Ubuntu in VMWare for Noobs for instructions.
Once you have completed the prerequisites above (setting up Ubuntu) you may proceed here.
The steps we need to take next are:
- Setting up Embodiment on the OpenCog side
- Setting up the Unity player to connect to OpenCog
- Running Embodiment
- Running the Unity player
- Connecting to Embodiment
- Interacting with the AGI
Setting up Embodiment on the OpenCog side
First, make sure you have already downloaded and built OpenCog
cd opencog/build cmake .. make -j$(nproc)
To run embodiment, we need to run a script. You may need administrative permissions for this (sudo)
cd ~/opencog/scripts/embodiment ./make_distribution
This will copy the required files to your ~/opencog/build/dist/embodiment folder.
Setting up the Unity player to connect to OpenCog
At this point, you ought to have one of two needs. If you are experimenting with OpenCog, you are most likely running the Unity3D game world directly from a standalone Unity player. The Unity player is automatically built every time there is a commit to the master branch on GitHub. If this is the case, keep reading. Alternatively, if you are a Unity3D developer and you are trying to setup the Unity Editor for embodiment, skip this section for Editor-specific instructions.
You can download the player here: http://buildbot.opencog.org/players/
You will need both the executable and the entire data folder:
You can use a tool such as wget to download it: http://gnuwin32.sourceforge.net/packages/wget.htm
Next you'll need to modify the shortcut to pass the IP address of your Ubuntu VM to it. So right click on the shortcut, select properties, to open the screen shown below:
Go to the end of the 'Target' field and change the IP address there (127.0.0.1 by default) into the address of your Ubuntu VM. To find out the IP address of your Ubuntu VM, open a terminal window in Ubuntu and type:
The item circled below is the IP address of your Ubuntu VM.
Click 'OK' in the shortcut properties window to close it.
Alternative: Setting up the Unity Editor for OpenCog
If you used the previous section to setup your unity player, skip this section. This section is for Unity3D developers who are trying to set up the Unity Editor for embodiment.
To set up the Unity Editor, you will need to open the game's project folder and navigate to:
The important lines to change are near the top of the file, in two separate blocks:
MY_IP = 10.0.25.30 ROUTER_IP = 10.0.25.30
To run Embodiment, we need to go back to the Ubuntu VM. In the terminal window, go to the right folder:
And start the Embodiment server:
You should see the output shown below, or something similar. Don't worry about the processes that aren't found, these are just check to kill / restart processes.
learningServer_CogServer: no process found oac: no process found router: no process found learningServer: no process found spawner: no process found LSMocky: no process found pbTester: no process found pvpSimulator: no process found Listening on port 17001 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME spawner 8675 alex 7u IPv4 17895 0t0 TCP *:16313 (LISTEN)
Now you have Embodiment up and running!
Running the Unity Player or Editor
Now everything is ready, you can start up the Unity player by running the shortcut we created earlier. After the Unity splash screen, choose 'Start game' and 'Blockset 1', to make the game screen come up. Alternatively, you can run the game in the Unity Editor by pressing 'Play' at the top of the editor.
You should see some characters and a Unity terrain.
Use the mouse and WASD keys to move around the world. You may need to give it a few seconds to generate more terrain from time to time, unless you are using a pre-defined map of course.
Connecting to Embodiment
Press tilde (`) (the key under your Esc key) to bring up the console. You can use this to execute some commands.
For now, press the up arrow until the load option for the AGI robot appears, and hit Enter to start loading the AGI controlled character and connecting to Embodiment. If all goes well, a robot should appear as well as the OpenPSI panel in the bottom right corner of the screen which indicates the AGI's simulated physiological and emotional states. As time goes by, the energy level will go down, so the AGI needs to find some energy in the form of batteries.
Interacting with the AGI
To feed the AGI, you need to create battery blocks for it to find and consume. Press the 'E' button to bring up the block selection panel (similar to Minecraft) and click on the last block in the set (the purple one). Press 'E' again to close the panel.
Now point at the ground somewhere and hit the right mousebutton to create a battery. After a few moments, the robot will detect the block and make a plan to reach its position. You can experiment with some hard to reach blocks, that require block destruction or creation, to test how smart the AGI's planner is.
Keep an eye on the log on the OpenCog side of things to see what is being planned and executed. Then just sit back and watch the robot find (or if necessary: create) a path to the battery! Have fun!
- Then please leave them here.