Skip to content

About

EmbodiedUE is an open-source reinforcement learning framework for Unreal Engine with robot training and in-game policy deployment.

Resources

Contributing

Security policy

Stars

20 stars

Watchers

1 watching

Forks

Repository files navigation

EmbodiedUE — Train Robots for Unreal Games

English | 简体中文

A robot training and deployment platform for Unreal Engine game developers. Train a control policy in UE 5.8 / Chaos, then run it on a physics-driven robot in your game.

The goal is to give game robots movement that responds to their physical state and surroundings. Developers define the robot, the training task, and the gameplay commands. A learned policy controls the robot's joints while Chaos simulates its bodies and contacts.

From training to gameplay

  1. Build a robot. Define its bodies, joints, collision geometry, and actuators.
  2. Teach a behavior. Define observations, commands, rewards, and training conditions in Python.
  3. Measure the result. Evaluate command tracking, stability, and performance in the target conditions.
  4. Use it in a game. Export the policy and connect the UE runtime to gameplay commands.

Game code decides what the robot should do. The policy handles the trained physical control task. The game runs the exported network; training uses Python and rsl-rl. Training and deployment share observation and action plans and use the same physics backend.

CartPole provides a small starting example. PhantomX provides the current locomotion and game-deployment example. They exercise reusable platform interfaces for future robot integrations. See product direction for the intended audience, current scope, and design priorities.

Demos

Walking

phantomx-walk.mp4

Terrain

phantomx-terrain-readme.mp4

Watch the walking demo · Terrain demo

These videos show sample policies from earlier runs. Use them to see the intended interaction; evaluate each new policy in its target scene.

Project status: Early-Stage

EmbodiedUE is in active development. The repository contains training, evaluation, export, and in-game inference paths. Reliable adaptive robot behavior across game scenes remains a development goal. A completed training run or a successful import does not establish that behavior.

APIs, artifact formats, and procedures can change without backward compatibility. Production readiness requires measured policy quality, target-scene behavior, and clean-host build and packaging results. See release readiness for the remaining release requirements.

The Egypt gameplay scene is an optional Fab installation. Acquire Stylized Egypt through your own account. The listing displayed Free on 2026-10-03. Its source assets are not in this tree. The default game map is the empty Engine Entry map. For gameplay, open the installed Egypt map explicitly. CartPole and procedural-terrain Task maps are unchanged.

What is included

  • Request-driven physics stepping and batched robot instances in a UE world.
  • CartPole balancing and PhantomX walking, terrain, and pursuit tasks.
  • Fixed physics steps with variable control intervals for PhantomX: 5 ms physics steps and 1–7 steps per action.
  • Training, checkpoint inspection, playback, recording, export, and deployment through uerl.
  • .uerlpol2 artifacts containing observation/action plans, timing, robot metadata, and an ONNX policy for UE NNE inference.
  • Python, protocol, cross-language parity, UE Automation, and end-to-end tests.

Getting started

Prerequisites

The integrated training and deployment procedure targets Windows x64 and UE 5.8. The documented procedure does not validate other UE versions or Linux/macOS UE execution. Python-only inspection and tests can run without UE.

Before you use these commands, install the required tools:

Requirement Purpose
Git and Git LFS Check out source and retrieve .uasset / .umap content
Unreal Engine 5.8 and its Windows C++ build toolchain Build UERLHostEditor Win64 Development and run the Chaos Worker
Python 3.11 and uv Install the Python package and locked dependencies
NVIDIA GPU with a driver compatible with the pinned CUDA 12.8 PyTorch build Default PhantomX policy training on cuda:0; --device cpu selects CPU policy execution

Chaos simulation runs in UE. CPU policy execution still requires UE. Use the C++ compiler and Windows SDK accepted by your UE 5.8 installation. This repository does not pin their versions. The project pins torch==2.11.0+cu128, torchvision==0.26.0+cu128, and rsl-rl-lib==5.4.2. The project has no established minimum RAM, GPU memory, or throughput guarantee.

The training host enables the bundled UERLEngine and UERLTraining plugins alongside the engine dependencies ProceduralMeshComponent and NNERuntimeORT. Game deployment requires only UERLEngine and NNERuntimeORT. Before the build, make sure that these engine plugins are available. See troubleshooting.

Install and build

Replace the placeholder paths with your paths. From the checkout root, run these commands in PowerShell.

git lfs install
git lfs pull
uv sync --locked

$ueRoot = 'C:\Program Files\Epic Games\UE_5.8'
$project = (Resolve-Path 'engine/UERLHost.uproject').Path
& "$ueRoot\Engine\Build\BatchFiles\Build.bat" UERLHostEditor Win64 Development $project -WaitMutex

An LFS pointer is not a usable UE asset. Before training, make sure that LFS access works. Complete the Editor build. Obtain Unreal Engine separately. This repository does not grant redistribution rights for Unreal Engine or third-party content.

Inspect tasks without starting UE

uv run uerl tasks
uv run uerl config --task UERL-PhantomX-ContinuousTerrain-v0
uv run uerl check task UERL-PhantomX-ContinuousTerrain-v0

The Task check validates Python declarations. It does not validate the installed UE binary, content loading, or GPU readiness. Use uv run uerl check host for static CartPole host file checks. Use a host profile to save reusable paths.

Run a small training smoke test

After the Editor build succeeds:

uv run uerl train --task UERL-CartPole-Direct-v0 --num-envs 2 --max-iterations 1 --device cpu --run-name smoke

Save custom engine and project paths in the host profile. The commands train, play, and export use these paths in launch mode. The options --ue-executable and --project replace individual profile fields. These commands do not automatically read UE_ROOT. This smoke test starts UE and trains a policy.

Train PhantomX

uv run uerl train --task UERL-PhantomX-ContinuousTerrain-v0 --run-name terrain

The command prints [RUN] directory=.... Keep that directory with its resolved configuration, logs, and checkpoints. Generated runs/ output is not distributed with the source. Continuous-terrain training defaults to 64 Slots. Flat-ground walking defaults to 512 Slots. Before you change parallelism or resume an older checkpoint, read training and evaluation.

Evaluate and record

$runDir = 'runs/UERL-PhantomX-ContinuousTerrain-v0/<run-directory>'
uv run uerl play --task UERL-PhantomX-ContinuousTerrain-v0 --run $runDir --terrain-level 0 --steps 4000 --presentation none
uv run uerl play --task UERL-PhantomX-ContinuousTerrain-v0 --run $runDir --terrain-level 0 --record artifacts/walk.mp4

Playback uses one robot and starts with the registered Task curriculum. Use --terrain-level to select a procedural tier for evaluation. With variable decimation, a control-step count does not specify a fixed duration. See recording and playback for keyboard control, recording options, and result interpretation.

Export and deploy

uv run uerl export --task UERL-PhantomX-ContinuousTerrain-v0 --run $runDir
uv run uerl deploy --project '<target-project-directory>' --demo phantomx --task UERL-PhantomX-ContinuousTerrain-v0 --artifact $runDir

Export uses export_contract.yaml recorded during training to build .uerlpol2 offline when present. Pass --online (or export an older Run without a contract) to open a UE Session instead. Deployment copies the runtime, changes target project settings, and prints an import command. After the target Editor build succeeds, add --import to execute that import. Use deploy --check for read-only preflight. Use the deployment guide for Blueprint setup, physics settings, and packaging.

Tasks

Task ID Purpose Default Slots
UERL-CartPole-Direct-v0 CartPole balance and training smoke test 64
UERL-PhantomX-Walk-v0 Flat-ground locomotion 512
UERL-PhantomX-ContinuousTerrain-v0 Eight levels of continuous terrain 64
UERL-PhantomX-DiscreteTerrain-v0 Six levels of discrete obstacles 64
UERL-PhantomX-Pursuit-v0 Pursuit in an optional locally installed Egypt map 1

Use uerl config --task <TaskID> for resolved defaults. Robot declarations are in src/uerl/assets/robots/. Task factories can replace base YAML settings. See configuration.

Documentation and development

I want to… Read
Configure a host, train, evaluate, or record Training guide
Add a robot, external Task, or numeric input declaration Extending EmbodiedUE
Troubleshoot, diagnose runs, and debug rollouts Troubleshooting and diagnostics
Import a policy, connect gameplay commands, validate, and package Deployment guide
Understand interfaces, units, timing, and extension contracts Architecture
Write tests, run checks, or measure runtime cost Testing
Propose, review, validate, or merge a contribution Contributing

Find or open a GitHub Issue before implementation. Follow the development roadmap for priorities and dependencies.

For Python-only development after installation:

uv run pytest -q

UE Automation, end-to-end training, recording, and packaging require the Windows/UE host. Measure policy quality in addition to software correctness. See Security, Changelog, and release readiness for project policy.

License

Original EmbodiedUE project code, documentation, and configuration are licensed under Apache-2.0. Third-party code and content retain their respective rights; this license does not cover Unreal Engine, Fab/Epic assets, or robot assets, policy artifacts, and media without an explicit project licensing statement. See Third-party notices and asset inventory.

Unreal Engine is obtained separately under Epic's applicable agreements. The owner has confirmed that Stylized_Egypt comes from Fab. Its raw assets are excluded from the current tree; historical Git/LFS copies remain a publication blocker. Other content provenance is still under review. See release readiness.

About

EmbodiedUE is an open-source reinforcement learning framework for Unreal Engine with robot training and in-game policy deployment.

Resources

Contributing

Security policy

Stars

20 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages