Skip to content
All work

[ N-04 / 07 ]Simulation and AI·2026·Android · Kotlin + C++ (NDK)

Iron Doctrine

A tactical game for Android where squads learn to fight on their own over thousands of simulated battles instead of following a fixed script.

Engine
C++ (Android NDK)
Brain
GRU neural network
Generations of learning
224
Status
in progress
Iron Doctrine: AI training, a night-theme building assault and capture the flag
Iron Doctrine: AI training, a night-theme building assault and capture the flag

AWhy it exists

In most games the enemy follows rigid rules and soon becomes predictable. I wanted to see whether squads could work out tactics on their own, on an ordinary phone, without a cloud server.

BWhat came out of it

After 224 generations of learning, a squad wins every engagement against the computer opponent in both training programmes (“Range” and “Manoeuvres”). The building generator created 2,000 maps without a single error. Two combat scenarios (capture the flag and a hostage rescue), three maps and three difficulty levels are ready. I am now working on a campaign and a store release.

CFor technical readers: how it is built

A C++ simulation engine over JNI (NDK, CMake): entities, map, brain and ES trainer. The brain evolved from a simple net into a recurrent GRU with residual connections; inputs include “hearing” (8 sectors, attenuated by walls), a compass to the flag and squad radio. Evolution-strategies training runs in a foreground service with a wake lock. A CQB building generator guarantees a path through every building. The UI was rewritten in Jetpack Compose with ViewModel and StateFlow, a command-map canvas with camera and gestures, in Polish and English.

→How it works, briefly

  1. 01
    Compose UI
  2. 02
    ViewModel
  3. 03
    JNI
  4. 04
    C++ engine
  5. 05
    ES trainer

↳What it does

Technologies

  • Kotlin
  • Jetpack Compose
  • C++
  • Android NDK
  • CMake
  • JNI

01

Hearing

Soldiers hear shots from eight directions, and walls muffle the sound.

02

Hostages

Missions with civilians who react in their own way. Every civilian loss costs points.

03

Background training

Both squads keep learning even with the phone screen locked.

04

Command map

Pan and zoom the map with your fingers, and tap a soldier to see their status. Works on phones and tablets.

05

Live orders

Tap a soldier and give an order: move, attack, hold, retreat. You can also hand command to the computer.

06

Day, night and colour-blind modes

Day and night themes in uniform colours, a colour-blind mode and a battery saver.

▢Screens

Five screens: start, training, capture the flag, building assault, settings
Five screens: start, training, capture the flag, building assault, settings
The building assault (CQB) in day and night themes
The building assault (CQB) in day and night themes

↗Contact

Got an app worth testing? Get in touch.

Next project · N-05

RONDO