p.enthalabs

OpenRA

openra.net · Read Story HN original

Comments

Has anyone built better AIs for this?
I might suck but I found it really hard iirc :^(
AI in strategy games always cheats I haven’t seen a single game where the AI wasn’t built around cheating. Once you figure out how it cheats it’s usually a combination of resource multipliers, build time multipliers and not having a fog of war it becomes much essier to beat at any difficulty.
Often, but not always.

I hate the term "AI" applied to games, since AI means so many things and usually implies something smart, "intelligent". But in reality, it is more like a "bot" or a "computer player". And the main goal is not to be super-smart, but to be plausible enough and provide an appropriate challenge to the human player.

There are some "fair" bots in games - like in my favorite turn-based Mechanized Assault and Exploration from the mid 90s. Computer players follow the same rules as the human ones - e.g., if something is not visible to the radar, the computer will not see it. The only "cheat" is the resource boost computer players can have on the higher difficulty settings, but it is totally optional. And as an experienced player, you always let the computer have it, since you want a challenge, and without that boost, it has no chance whatsoever.

Real-time strategy AI is absolutely AI in the standard Russell & Norvig sense of AI. There's nothing about the computer science concept of AI that implies "super-smart" or always trying to outsmart the player (rather than trying to be entertaining).

Continuously shifting the goalposts of what "AI" is is, of course, a well-known phenomenon, giving rise to what's called the AI effect or Tesler's theorem [1].

[1] https://en.wikipedia.org/wiki/AI_effect

Maybe it is, given that the classical AI definition is so broad, it can mean almost anything. But for me, there's a fundamental difference between something that "tries to be intelligent" and something that "tries to appear to be intelligent".

That is why I prefer to call them "bots" or "computers" - just to separate them from a shifting mess of definitions of what "AI" actually means. It reminds me of "Destination Void" by Frank Herbert, where the main characters were trying to build artificial consciousness and were struggling to define what it actually means.

Thanks for introducing me to the article! I’ve experienced this myself but didn’t know it had a name.
Not always.

For a lot of games it can be surprisingly easy to make an AI which beats the median player even when limited to just basic strategies, simply by not getting distracted by the gut feelings that humans have.

Even for more complex strategy games like say Starcraft II where that's not enough, there's this: https://en.wikipedia.org/wiki/AlphaStar_(software)

There's a whole scene around making bots for Starcraft: Broodwar, using an API (BWAPI) that doesn't allow cheating. They're quite good now, better than most humans. But the top bots still can't beat a pro, or even a high ranked ladder player.
Pitching in on this with a tangent - how good are LLMs with RTS games these days? As someone without friends into that genre, it’d be pretty cool to play eg. AoE II against a capable computer that play like a real human…
It's improving but sota models are now too slow for a real time game. Training a specialized neural network would be more effecient.
Depends on what you mean, LLMs can probably _make_ pretty good AIs. It'll have all the AI scripts in the base game, including the three iterations (base, FE, DE) all the user generated ones ( including barbarian ) and then able to consume the language schema. Rig up a baby model that takes the matchup during loading and hot swaps one of your pregenerated AI scripts.

If you meant _playing_ raw based on LLM input - that's probably the wrong tool for the job. The latency for you to react to a mango shot is faster than a billion tok/s lol

Instead of driving the agent with an llm, it might work to use the agent to hard code heuristics, and use some kind of a simulation to benchmark its skills? Then feeding the results back to the agent so it can improve the heuristics?
When I was a teen I was mostly writing RA2 custom map scripts and rules/units for my friends and watch them battle with my rules in internet cafes. When that was not possible, I was creating custom RA2 AIs, but it was very hard.

These days, I'm having incredible fun developing good old AI scripts with LLMs, for my own vibe-coded RTS game. Just choose all AI players here to make them battle each other: https://egeozcan.github.io/unnamed_rts/game/

I even let the LLM generate a tournament script to make AI scripts from different LLMs battle (headless): https://github.com/egeozcan/unnamed_rts/blob/main/src/script... GPT-5.5 leaves all in the dust currently. I cannot beat most in the game I set the rules myself :)

If you are like me, you can just make LLMs create your personal RTS game and also develop custom AIs. It's so much fun.

Were you familiar with my modding site RA2Factory?
Yes! I downloaded a lot of shps voxels and map packs from your site! I think it was the beginning of 2000s? Anyway, a very delayed thank you!
Amazing! You're welcome. Yes it must've been around 2000, I was around 13-14 when I built Tiberian Sun Factory and then RA2 Factory.

To be honest I didn't play with mods much myself because I was consumed enough with the joy of building tools (such as for INI editing and voxels) and the websites, and connecting with the community and other site/tool builders. I did play the vanilla games a lot though.

I contacted the community manager at Westwood Studios and was granted the chance to visit once during a trip through Vegas. I remember him and others being very friendly, giving me a tour through the office, seeing the reality of the life of game testers, having some time with the Yuri's Revenge expansion before release, and being given some merch - a Dune II box, a C&C poster, which I still have in storage. Just to share some more of what I can recall from those days.

You are awesome, thank you for being such a magical part of my childhood
Ha glad to hear it! I was also a child, I made Tiberian Sun Factory and then RA2 Factory when I was around 14.

I left some more details here https://news.ycombinator.com/item?id=48703769

Huh. You know, I wonder. The API provided to AI scripts must have enough info for limited strategies, but I've never seen what's what. You have.

What are the possibilities for just giving Claude that each turn. Yes, insane over kill, but in a couple of years Claude level AI will run locally on laptops...

I'm really not sure about the timelines, but I can easily speak to the state of things for today: LLMs are very wasteful and slow for real-time decisions. The "thinking" ones have no chance and if you disable thinking, they really struggle with querying the context with the right calls. For the once in a moonshot scenarios that they have enough context and ample time to react, they are great!

Developing AI scripts, however? They are crazy good! I try to re-balance the game to give a little edge to the humans, then it takes a single iteration for your not-even-sota LLM to destroy me. I mean I'm not the fastest RTS player but for the lack of skill, I have the advantage of being the designer of the game :)

About the RA2 AI scripts: You can react to enemy faction, composition etc. but it's impossible to program it to pull back its tesla tanks when they are under threat from a bunch of rocketeers. Those things are hard-coded in the game engine. I think the only exception was the DeeZire mod which patched the game exe, if I'm not hallucinating.

I recently tried playing OpenRA with GPT-5. Didn’t have enough time to put into it properly, but the solution I reached would plan future actions in batches based on game state, including decisions to make based on conditions/thresholds being met.

Maybe something like Gemini Flash would do a much better job.

IMHO, this is a very good idea. I suppose it would help a lot with the macro, but again, "decisions to make based on conditions/thresholds being met" is the definition of the good old AI script :)
Even if it worked, it most likely wouldn't be fun. Game devs have talked about the fine line one walks with AI in strategy games: your goal is to challenge the player, not to beat him. It's not impossible to make AI which can beat the player, but that wouldn't actually be fun to play against. So the challenge becomes trying to create something which will hit the sweet spot of challenging but beatable for most people.
I think the issue is less winning and losing, and more feeling and seeming real. Game AI opponents do absurd things that break the immersion; suddenly, you realize you're just playing a dumb game on a machine.

I suspect LLMs might be able to do that better. Even their hallucinations are less frequent and more convincing, very generally speaking, than game AIs IME.

Does the project allow AI?
Old-skool AI, aka cpu opponent.
I know you meant player AI, but now I'm imagining an RTS where every unit is running a small reasoning LLM.
It's already in the works. NDA but the studio I gig at, their Ai love to send NPCs off cliffs.

Because there is no collision between the sky and floor it determines that this is the quickest route. Even with zoning it does something you'll never think of.

Using LLMs as NPCs can be hilarious to watch.

I need to hear more. That or start my own NPC circus.
If you play the original and then OpenRA you will be amazed how well OpenRA is balanced.

As an example, while in the original game using allied artillery against soviet tesla coils was a dead sentence in OpenRA is great to be able to fire well beyond its range forcing you to come out of the base to defend it.

They also added a ton of features which make the game truly enjoyable and fun to play.

Well done OpenRA team!

Tangential, but I got introduced to Red Alert C&C through various 'Hell March' videos by random fans of various militaries on YouTube. It's funny how it vibes with nearly every military you throw it over.
I love using the RA OST for coding. The songs are fun and fast paced with low lyrics.

It helps that this is a childhood favorite game of mine.

Try the Doom ones.
I'll have to give them a shot, but admittedly the nostalgia is almost certainly a big reason I love the RA OST (and starcraft as well).

I didn't play enough doom to really love it in the same way.

It's the same backend, so it's a bit like a fun theme difference. I played Dune2 first, and like RA too.
They're talking about Doom, not Dune.
Heh, yes, right you are.
Right, it's less about the nostalgia, and more about the tempo that I find really enjoying.
Man the Terran tracks are so incredible
Total annihilation had an amazing score.. it was a young media giving talent a way to shine without first having to do a pilgrimage through some elder legends sweatshop.
Against all the evil that Hell can conjure, all the wickedness that mankind can produce, we will send unto them... only you. Rip and tear, until it is done.

And then I pay bills for eight hours.

Frank Klepacki is a legend of a musician.
APC + flamethrowers was the new WTF in OpenRA, if I remember correctly.
If you play online and have a low rating of course buddy is gonna try this
Weird. I find the balance for player vs AI to be actually pretty horrible. AI can outrange artillery sight so you have no choice but to push forward always or micro manage units. I have a fork of OpenRA on my GitHub where I try to address this, along with pathfinding bugs, enabling Tiberian Sun and fixing bugs with that. I also updated it to cross platform .NET 10 and bumped the performance up about 6-10x fixing minor bugs. Debating if I'll roll any of the code over as pulls to the main project ever after I tried to fix a random bug before and they were not welcoming to me but that was like a decade ago.
The comparison was against the original game. I haven't played on the computer since ages, but that was my impression the times I played it. I'm not deep into all the nuances of the game just that it was considerably better that the 1995 release.
1995 was the original "Command and Conquer" not "Red Alert". In the original C&C the computer wouldn't attack sandbox walls which was basically godmode since you could just fence them off heh.
The computer player would always target your nothern-most structure for airstrikes or nuclear weapons. This persisted to at least Generals Zero Hour (I never played the campaign of C&C3 or 4 so can't comment on them).
The load/save is what kills me. It's a great project, but having to wait 2 hours for a game to load, fans blaring on my laptop, makes it less playable.

For context, I love huge, massive maps with loads of players. OpenRA replays the entire game to restore, it doesn't have a save-current-state routine.

So 20 hours of massive map + 8 players means 2 hours of pegged CPU to reload the save.

Heartbreaking.

> So 20 hours of massive map + 8 players means 2 hours of pegged CPU to reload the save.

It's super impressive this works at all.

Starcraft 2 has the same overall design. If you disconnected and rejoined in an online match you could watch it scrub through the entire game to get back to the synchronization point (not theoretically necessary I guess, but probably avoids a lot of headaches). 10:1 for simulation to real-time feels pretty on-par with what I remember blizzard could achieve.
OpenRA has that ... for single-player saves!
Now, that is what I call taking the "Command Design Pattern" to heart!
Perhaps because their focus is on multiplayer, where saving and loading isn't as in demand as SP
I want a VCS that works this way:

1. download current version of Linux

2. an MS-DOS/Minix dualboot VM starts with Linus beating Prince of Persia

3. fast-forward all the way through the history of Linux to him merging the relevant patchset

Does that apply even for single player saves?
Why is saving the state hard for them? So many games and other software save their state .... Imagine Excel 'replaying' the spreadsheet to return to the latest state.
it sounds so stupid u know i am curious Why on earth people would do this. How it is not possible to dump some memory as save/load. is the game state not known?? :/
Save files are not just memory dumps, you need to have a serialisation/deserialisation mechanism for the game state. But this is not generally a viable way to do RTS multiplayer, so you either need to build both a save game system and a deterministic replay system (which might each make the other more complicated), or go for the latter which you need to do anyway and then reuse it for saving the game as well.
Factorio manages to pull it off and I'd argue they are tracking far more individual entities.
It's not impossible, it's just a question of if it's worth the effort. Factorio was kind of forced into it, because a) they built a save system before they went multiplayer, and b) it's impractical to replay a factorio save when loading a game, because it lasts a lot longer.

(note that factorio does a hybrid: multiplayer works like an RTS but starting from a save game instead of from scratch. If your PC can barely keep up with a server that you're joining, it can take a long time to actually get into the game or actually just not be possible)

To add to my comment above: If the game doesn't know the current state, how does it compute the outcome of the next move? Does it replay from scratch again? (Obviously not.)

How do they develop it? The developers must have to save and restart the game more than anyone.

I'm curious about how it's designed, which must be different than most other games and software. (I'm not saying they are crazy, etc. I'm certain they've thought about this issue.)

I suspect the answer is that we are misunderstanding something and that it can save and restore state relatively efficiently.

The main thing is that synchronizing the state is hard: with hundreds of units and low latency being important, there's big advantages to having a deterministic simulation and relaying the player's commands instead of the whole game state, in fact unless you know everyone playing the game has a very good internet connection it's the only viable option. As an added bonus, it also allows you to hide small amounts of latency without rollbacks or stuttering by having a small delay on command execution. Once you've got that it's obvious that the best way to make a replay file is to save the stream of commands, and this also doubles as a save file, as opposed to making a seperate mechanism for saving and loading state which might introduce it's own bugs.

(It's not impossible to do both: while it's not strictly an RTS, Factorio has the same difficulty of synchronising the whole game state in multiplayer, but also has the disadvantage of quite long-lived and simulation-intensive games. So it uses a hybrid approach: it has a deterministic engine and a game state save, and when someone joins a multiplayer server, the server snapshots and sends the game state, which may take a few minutes, then it sends a replay to catch that player up to the current state of the game. But this is something that took them a lot of work to get into a reliable state and was kind of forced onto them by the constraints they had to work with)

Thank you for explaining.

> there's big advantages to having a deterministic simulation and relaying the player's commands instead of the whole game state, in fact unless you know everyone playing the game has a very good internet connection it's the only viable option.

If I understand, running it all on a server and just updating player UIs doesn't work for an RTS because some user Internet connections bottleneck the updates, putting those users at a disadvantage. You need to keep as much on the client as possible.

Yeah, the bandwidth requirements quickly become very high. With modern internet connections you could maybe keep up with an old-school RTS.
I don't understand why checkpoints couldn't be introduced. Surely someone could insert breakpoints and figure out a way to serialize relevant state.
Link to your GitHub? I'd love to play the version with your improvements!
ReCNC I think is published - this is the new fork
I'd love to build this on Linux. Is it known to be broken?
It should work but you'll need .net 10 and powershell. works on macos, win64 and winarm64 so far I just haven't uploaded binaries since it's just work between a friend and I on weekends to fine tune or fix things
Binaries would suck. Buildable source enables inclusion in distro repositories.
Why would publishing binaries prevent using the source elsewhere?
They don't.
> AI can outrange artillery sight so you have no choice but to push forward always or micro manage units.

Since when is having to micro your units viewed as an issue in an RTS?!

Not all RTS have such a big emphasis on micro: TA-type RTS tend to have mechanics that try to avoid a huge amount of micro being required (though, in any RTS, there is still some advantage to be gained from it).
I actually loved the imbalance of OG RA, I live for vaporizing my foes with tesla coils!
To me in second grade, Red Alert was literally just building Tesla Coils.
The slow creep of telsa coil towrds the enemy base was my favorite.
doesn't that ruin the point of the tesla coils?
based, been playing this for months with my friend, over anything else.

EDIT> My fav setup is to join a free empty server , set up 2 teams, 2 AI and 1 human vs 2 AI and 1 human. And then play with my friend. Great fun. The AI adds a bit of a randomness to the games. Easy smooth quick interface. Just perfect for a quick free RTS game with a friend.

I just wish I still had the original games to use as content packs.

Every time I've tried to install this previously, this was my wall :(

Has anyone turned it into a browser game?
Chrono Divide is insane. It is wild to see a single dev completely leapfrog every other team that spent years making RTS engines.
I've been using AI to replicate it for browser play.

I'm able to get the mechanics down. But I can't get the graphics past RA1 level yet without killing the process power.