What is AI4U?
AI4U is a neat and easy way to connect a Unity application to Python code. Therefore, it is possible with AI4U plugin connecting games and virtual reality applications to vast libraries set written in Python. Moreover, One provides integration with the latest algorithms implemented by OpenAI, e.g., PPO and PPO2. So, people interested in AI4U can use more recent advances given by OpenAI researchers.
Features
- Some examples.
- Support for multiple environment configurations and training scenarios
- Flexible SDK that can be integrated into your game or custom Unity scene
- API agnostic, but one provides support to all algorithms implemented by stable-basiles.
- Integrated A3C implementation.
- Tools for facilated no-markovian decision making.
- AI4U can be integrated to Imitation Learning through Behavioral Cloning or Generative Adversarial Imitation Learning present on stable-baslines.
- Train robust agents using environment randomization.
- Flexible agent control with On Demand Decision Making.
- Train using multiple concurrent Unity environment instances.
- Unity environment partial control from Python.
- Wrap Unity learning environments as a gym.
Projects
Some projects were developed with AI4U. The list of major projects is shown in Table 1.
Table 2: Documentation.
Tutorial | Link |
---|---|
MazeWorld | Link |
MemoryV1 | Link |
BoxChaseBall | Link |
TMazeRegretExperiment | Link |
How to use the AI4U?
AI4U has two components: * the server-side code written in C#. The second is the * client-side code written in Python.
For using AI4U, we recommend to have some version of Unity 2019 and start by looking at the examples available in the repository AI4UExamples. Start by example AI4UExamples/CubeAgent for the first look in AI4U. Also, see the documentation available in directory doc. See the complete documentation in Table 2.
Table 2: Documentation.
Tutorial | Link |
---|---|
API Overview | doc/README.md |
AI4U with OpenAI Gym | doc/ai4ugym.md |
A3C Implementation | doc/a3cintro.md |
GMPROC (multiprocessing) | GMPROC |
Installation
First, it needs to install clientside component. Open the Ubuntu command-line console and enter in directory clientside/ai4u. Run the following command:
pip3 install -e .
Waiting for the installation ends, this may take a while. To install gym and a3c algorithm support, go to directory clientside/gym and run the following command:
pip3 install -e .
Waiting for the installation ends.
Now, run Unity and open project available in exemples/BallRoller. Then open the BallRoller scene (available on Assets/scenes) if it is not already loaded.
Then, press the play button and run the random_ballroller.py script located in examples/BallRoller/Client.
python3 random_ballroller.py
Output logs:
If no error message was displayed, then AI4U was installed correctly.
Requirements
Tested Systems
-
Operation System: Ubuntu 18.04, and 19.10.
- Python >= 3.7.5.
- Unity >= 2019.4 (64 bits for GNU/Linux).
-
Operation System: Ubuntu >= 20.04
- Anaconda Python “3.7” version
- Unity >= 2019.4 (64 bits for GNU/Linux).
-
Operation System: Windows 10
- Anaconda Python “3.7” version.
- Unity >= 2019.4 (64 bits for Windows)
Unfortunately, AI4U does not have support for mobile applications.
Maintainers
AI4U is currently maintained by Gilzamir Gomes (gilzamir@ufc.alu.br), Creto A. Vidal (cvidal@dc.ufc.br), Joaquim B. Cavalcante-Neto (joaquimb@dc.ufc.br) and Yuri Nogueira (yuri@dc.ufc.br).
Important Note: We do not do technical support, nor consulting and don’t answer personal questions per email.
#How To Contribute To any interested in making the AI4U better, there is still some documentation that needs to be done. If you want to contribute, please read CONTRIBUTING.md guide first.
Acknowledgments
AI4U was created in the CRab (Computer Graphics, Virtual Reality and Animations) Labs at UFC (Universidade Federal do Ceará).