The Schola project is an effort to build a toolkit/plugin for controlling Objects in Unreal with Reinforcement Learning. It provides tools to help the user create Environments, define Agents, connect to python based RL Frameworks (e.g. Gym, RLLib or Stable Baselines 3), and power NPCs with RL during games.
Release 1.0 of this this project is designed for Unreal Engine 5.4 which is available for Download and is tested on 5.4.3 and 5.4.4. Release 1.1 supports Unreal Engine 5.5 (It is not compatible with Unreal Engine 5.4).
Important for Visual Studio Users Only MSVC v143 Build Tools should be selected during install including other build tools will cause linking errors. Sepcifically, use
MSVC14.X
whereX>34
from Visual Studio 2022, andWindows 10.0.22621.0 SDK
to avoid linking errors
To use schola in an existing Unreal Engine Project copy this repository to the /Plugins
folder of your project, and pip install the schola python package in /Resources/python
See setup.py
for python dependencies. Installing schola via pip will automatically install all python dependencies.
All C++ dependencies for using Schola are bundled with the plugin under /Source/ThirdParty
.
Third party dependencies, specifically gRPC and Protobuf can be built using Schola\Plugins\Schola\Resources\Build\windows_dependencies.bat
or Schola\Plugins\Schola\Resources\Build\linux_dependencies.sh
depending on your OS. This will update the plugin ThirdParty folder to include copies of the dependencies including .lib/.a files, and copy protoc, and relevant plugins to the tools directory.
To generate code for gRPC and Protobuf run /proto/compile.py
. This will generate *.pb.cc
, *.pb.h
and *.pb.py
files to the correct folders as well as fix several bugs in the default generator (e.g. ignore warnings in C++ code, and fix relative imports for python)
Documentation for Schola is build using a combination of Doxygen + Sphinx + Breathe.
- Install Doxygen from the website
- Install sphinx, breathe, and the Read The Docs theme for sphinx using pip
pip install sphinx breathe sphinx_rtd_theme sphinx-tabs sphinx-copybutton
- Generate xml to
/Docs/Doxygen/xml
using the Doxyfile in/Docs/Doxygen
- From the
Docs/Sphinx
folder runbreathe-apidoc -o API/Unreal ../Doxygen/xml
- Run sphinx-build or make to generate the unified docs.
All unreal code with be styled following the Unreal Style Guide in the Unreal Documentation.
One potential auto-formatter is the Clang Formatter which has visual studio support.
Comments are based on doxygen /** style to match closely with javadoc (which Unreal uses) but support handy visual studio features such as comment previews. To enable autogenerated doxygen stubs go to Tools -> Options -> Text Editor -> C/C++ -> Code Style -> General and change the option from XML to Doxygen (/**). This will enable autogeneration of stubs with ctrl + /, or whenever you type /** in visual studio.
All python code will be styled( and formatted) following the Black style guide.
as well as pep.
Black has an automatic formatter as well as Visual Studio support.
Docstrings in python are in numpydoc style and can use any rst directives supported by sphinx. Inherited functions and members can be left undocumented if the implementation doesn't require any additonal details to explain.
Testing is implemented through pytests in the ScholaExamples repository. These tests build a fresh copy of this project before running unit tests on Python + Unreal. This tests whether all examples run with each framework and are functional based on the API.