In order to fully use the toxic waste gym library, you need to install a virtual python environment. To that end you can follow the next commands:
git clone https://github.com/anavc97/Toxic_Waste_Gym.git toxic_waste_env
cd toxic_was_env
./install_python_env.sh
After the script runs, the alias activateWaste is added to the bash aliases making it easier to activate the environment solely by running the alias. If the script ends without any errors, you have the python environment fully installed. If you see any errors installing a specific package, try installing the specific packages isolated.
- Start virtual environment (activateWaste)
- Open Unity in Scene "Intro"
- Open terminal and run
python3.10 socket_game_server.py --field-size 15 15 --max-env-players 2 --max-game-players 2 --max-objects 6 --max-steps 200 --cycles-second 5 --game-id 000 --levels level_one level_two --layer-obs --centered-obs --nlayers 2 --buffer 1000 --layer-size 256 --version 2 --cnn --vdn --ddqn --tau 0.1
- Run Unity Scene "Intro"
- Press Start button
Server and Unity should be synced - server should be sending states, Unity should be sending actions
- Build game with WebGL (In player Settings >> Publishing Settings >> Compression format, chosse Disabled)
- Go to the Build folder
- Run
python3 -m http.server
- Open localhost:8000 on browser
- Socket Error: Address already in use solution: usually works to just wait a bit.