Skip to content
IpsedoPublic

About

A project for an desktop game with self-trained agents using LibTorch and Jolt physics engine !

Topics

Resources

Stars

2 stars

Watchers

2 watching

Forks

Latest commit

 

History

1,993 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArenAI

A physics-based tank arena where every enemy is a reinforcement-learning agent that sees the world through its own camera.

CI Release C++20 LibTorch Vulkan Platforms

Play · Train · How it works · Docs


Highlights

  • 🎮 Playable game — drive a tank in a battle royale against trained agents (16 enemies by default, configurable), keyboard or gamepad, fully remappable controls.
  • 👁️ Pixels in, actions out — each agent sees only what its tank sees: a 256×128 canon camera and a 360° panorama, rendered offscreen with Vulkan.
  • ⚙️ Real physics — Jolt Physics for terrain, tracks, turret and ballistic shells.
  • 🧠 From-scratch RL in C++ — PPO, PPO with a liquid time-constant (LTC) recurrent core, and PPG, written on LibTorch; no Python in the training loop.
  • 📈 Self-play curriculum — 32 tanks driven by the same agent; the arena grows from 250 m to 1000 m as they learn to hit each other.
  • 📦 Bundled agents — pretrained ppo, ppo_liquid and ppg checkpoints ship with the game.

How it works

flowchart LR
    J["Jolt physics<br/>tanks · shells · terrain"] --> R["Vulkan offscreen renderer<br/>canon camera + panorama"]
    J --> S["Proprioception<br/>state vector"]
    R --> A["Agent (LibTorch)<br/>CNN encoders + MLP / LTC trunk"]
    S --> A
    A -->|"move · aim · fire · zoom"| J
    J -->|"reward: damage, kills, shell cost"| T["PPO / PPG update"]
    T -.-> A
Loading

Each tank outputs four continuous actions (chassis and canon joysticks, tanh-squashed Gaussian) and two discrete ones (fire, zoom, Bernoulli). Network details: docs/neural_architecture.md.

Play

Prebuilt binaries

Download the archive for your platform from the latest release (Linux x86-64 / arm64, Windows, macOS arm64 — experimental).

macOS: the app is not signed

Unzip the archive, then in the folder containing ArenAI.app:

xattr -dr com.apple.quarantine ArenAI.app

Build from source

Linux, with dependencies and LibTorch installed (docs/BUILD.md):

git clone https://github.com/Ipsedo/ArenAI.git
cd ArenAI
./build_linux.sh
./build/arenai_desktop/arenai_desktop

Windows (Visual Studio 2022, C++ workload), in PowerShell:

.\install_dependencies.ps1
.\build_windows.ps1

Train your own agent

./build/arenai_agent/arenai_agent_train \
    --output_folder outputs/train_001_ppo \
    --resources_folder resources \
    --cuda ppo
agent trunk memory
ppo MLP none
ppo_liquid LTC cell (128 neurons) recurrent, TBPTT
ppg MLP none, auxiliary value phase

Then load save_K/actor.pt from the game menu, or judge it under the game rules with arenai_agent_match. All options and defaults: docs/USAGE.md.

Documentation

BUILD.md dependencies, build per platform, CMake options, tests, golden images
USAGE.md play, train, evaluate, Python tooling, every CLI option
ARCHITECTURE.md modules, class diagrams, frame and training sequences
neural_architecture.md inputs, encoders, trunks, heads

Project structure

arenai_utils        caches, file reading, logging
arenai_controller   input handling
arenai_view         Vulkan renderer (window + offscreen agent vision)
arenai_model        Jolt physics, tanks, shells, items
arenai_core         environment, enemy handling, thread pool
arenai_agent        PPO / PPO liquid / PPG / SAC, training & evaluation executables
arenai_desktop      the playable game (RmlUi menus, HUD)

Known issues

Periodic freezes on GNOME

The system-monitor GNOME Shell extension stalls the game periodically. Disable it while playing:

gnome-extensions disable system-monitor@gnome-shell-extensions.gcampax.github.com

Contributing

Bug reports, build failures and ideas are welcome — open an issue. Code style is enforced with pre-commit (clang-format); see docs/BUILD.md.

About

A project for an desktop game with self-trained agents using LibTorch and Jolt physics engine !

Topics

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages