Work / AlienWars Gym
Reinforcement learning · C, CUDA, WebAssembly · 2026

AlienWars Gym

AlienWars Gym trains vehicle agents in procedurally generated 3D worlds. PufferLib 5 trains PPO controllers on CUDA. The same C simulation, sensors and trained policies also run in the browser through WebAssembly.

Map Lab runs the full simulation in the browser. It can take a while to start.

Temperate AlienWars map with bases, roads and lakes
Temperate map with raised bases, roads, lakes and an extended ocean. Seed 73.
Trainer
PufferLib 5, PPO on CUDA
Runtime
C, Flecs, Raylib
Browser
WebAssembly
Vehicles
12 across land, sea, air and underwater

Worlds

Wave Function Collapse connects terrain tiles, road grades and tunnel profiles. Each seed produces coastlines, hills, beaches, cliffs and lakes, with bridges and mountain passes fitted to the terrain. The ocean floor uses the same geometry that sonar and submarines navigate.

Maps can be symmetric or asymmetric, with bases up to ten floors high, in Temperate, Desert or Frozen palettes.

Agents

There are twelve vehicles: three ground vehicles, three boats, three aircraft and three submarines. Each has its own hull, speed, turning limits and sensor range. Fixed-wing aircraft hold forward airspeed; the quadcopter can hover and strafe; boats respect draft; submarines travel below the surface.

A* plans global routes and PPO controls local navigation. Five family policies train at the same time in shared worlds, and each vehicle has its own destination and recurrent memory. The browser loads the selected trained checkpoints.

Sensors

Units carry LiDAR, sonar, RF and depth cameras. Equipment changes the policy inputs; overlays only change the display. Generation, collision, navigation and sensing share one C model that does not depend on the renderer, and sensor sampling runs without graphics during training.

Sensor overlays for all units
Range fans, camera fields and radio links for every unit on the map.

Evaluation

The September 18, 2026 reliability test added sensor-history anticipation, yielding, braking checks and recovery limits, and ran 49.5 million more steps across three seeds with frozen historical traffic. The candidate failed the reliability and endurance gates, so the public demo still uses the September 16 checkpoints.

Run report · Reliability results

Scenes to open

Video

The game dev harness: a coding agent and reinforcement learning in one development loop.