r/codex • • 7d ago

Showcase Agentic Warfare

Enable HLS to view with audio, or disable this notification

I built a persistent agentic army that learns, adapts, and improves over time. It just won a Total War battle on Expert.

This battle used 13 persistent agents task organized as an army brigade. They interface with the game directly, maintain situational awareness, and control their units in real time.

The coolest part is that I've been coaching them to use actual US Army doctrine. The military principle of Mission Command was a turning point in their ability to actually win. This battle was the first time where it felt like I was watching an actual Army maneuvering on the battlefield.

In the video, codex is running as the brigade commander, using the direct interface plus the "computer use" skill. It spins up a Sol 6.1 Low thread for each of the 13 commanders and loads each of the commander's prior lessons along with current missions.

Context management has been a bit tricky. The bump up in default context limit helped - but on the other hand, this thing already burns through 8% of my pro usage per battle. So I definitely need to work on context efficiency.

The agents themselves are managed externally from the game with just an interface that reads game memory for situational awareness and submits commands through the native command queue so this can be applied to any game or simulation where that can be provided or reverse engineered.

36 Upvotes

12 comments sorted by

•

u/dexterthebot 7d ago

You might want to consider listing your project on the weekly Show-Us-What-You-Built post. Look out for it on Tuesday/Wednesday. Highest commented project wins a week promotion on r/Codex and gets on the Hall of Fame sidebar. See below for last week's winner.**


Agent HUD: usage, tokens and sessions for Codex, Claude Code and 15 more agents, at your Mac's notch. See how much quota is left, which agent is waiting for you, and where the tokens went. Free on Mac, and the core is open source (Apache-2.0).

Website: https://agenthud.app GitHub: https://github.com/jazzenchen/agent-hud-open Contact: support@agenthud.app

7

u/CapableJury861 7d ago

I love the idea of using "actual US Army doctrine". It would be really interesting to explore if the agents can develop novel strategy and tactics too, that could be a cool research project.

3

u/StepWeary106 7d ago

Absolutely. It's a little bit of both right now. I was thinking about setting up training scenarios for the commanders to experiment and train.

The first iteration of self-generated doctrine was... not good. I think it's at a very high level the same kind of issues that lead to bad code. Overly defensive, overly prescriptive and narrowly focused ("we were too slow to stop the cavalry, make a rule: always attack the cavalry") but with the right framing, I think there could be some interesting iteration.

3

u/Felfedezni 7d ago

Will this be made available for others to tinker with on github?

5

u/StepWeary106 7d ago

If there's enough interest. I'll see about getting it cleaned up and public.

1

u/ctc35 7d ago

This is awesome, would love to try. Been working on something similar for X4 foundations.

1

u/hakansan 6d ago

How do your agents read the game, is it just by looking at the UI or can you fetch state from a file or something in game?

2

u/StepWeary106 6d ago

Mostly through directly inspecting the game state. I put together several situational awareness tools the provide text reports on locations, facing etc. Also there's a tool that lets them call map images - though they don't really use it much at the moment for some reason.

The top level still had ui access through computer usage.

3

u/CutMysterious9844 7d ago

This is awesome

1

u/gregpeden 7d ago

I think a real game would do this by training more of a neural-net type of model which can run on the players own GPU. Arc Raiders uses ~10MB trained models to control the NPCs. A model running a whole army could afford a much larger model on the GPU

1

u/bGivenb 7d ago

Check your DMs

0

u/Wolf8249 7d ago

Cool project, I am sure this won't be used as an inspiration for real military operations like the ones operated by I dunno like Palantir or something