Skip to content

Communicating with godot engine through shared memory

License

Notifications You must be signed in to change notification settings

Xwdit/GodotAIGym

This branch is up to date with lupoglaz/GodotAIGym:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2c06f0a · Jan 23, 2022

History

94 Commits
Jan 10, 2022
Jan 10, 2022
Jan 23, 2022
Oct 9, 2020
Jan 10, 2022
Jan 2, 2022
Mar 23, 2019
Jan 10, 2022
Jan 10, 2022
Jan 10, 2022

Repository files navigation

GodotAIGym

logo

Make your Godot project into OpenAI Gym environment to train RL models with PyTorch. This project only runs on Linux systems for now.

Requirements

  1. Godot Engine version == 3.2 compiled from source (not tested with the later versions)
  2. Boost interprocess and time (apt install libboost-container-dev libboost-system-dev libboost-locale-dev)
  3. Pytorch version == 1.10
  4. Python setuptools

Installation

First, in setup.py change the variable GODOT_PATH to the root directory of godot engine source. Then run:

python setup.py

This script does several things:

  1. Downloads libtorch (v1.10) cpu only version, unpacks it
  2. Copies GodotSharedMemory module and compiles standard godot editor (x11 platform).
  3. Compiles x11 export template and dev tools
  4. Installs python module GodotEnv that is used to communicate with the engine.

Docs

InvPendulum tutorial shows how to make an environment, speed up its execution, train a model and deploy back to the engine.

API lists classes and function in python and godot.

TODO

  1. Check if it's possible to use GDNative + shared libs instead of the engine recompilation.
  2. Windows compatibility

About

Communicating with godot engine through shared memory

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 44.8%
  • C++ 32.9%
  • GDScript 11.1%
  • GAP 10.4%
  • Other 0.8%