News for hackers. Stuff that matters.
Re:0 A.D. Release 28: Boiorix by card_zero on Monday February 23, 2026 @06:54AM (#47121141)
There certainly are naive ways, although whatever I suggest here will be poorly thought out and will lead to the next problem. But OK, I suggest a scent trail. Each unit paints where it's been and prefers not to go that way again. Then of course it could paint itself into a corner, so it needs a local-maximum-busting strategy too, which probably means marching off in an arbitrary direction to see if it gets unstuck.

This would be behaving like a caged animal, and in a game, that's good, and better than a smarter algorithm. You don't want them to be idiots, but you don't want them to be magic, either.

The old "follow the left-hand wall" maze-solving strategy is another naive way to get out of a trap. It's not fun gameplay, but it's naive and it exists, so better naive strategies do too.

Re:0 A.D. Release 28: Boiorix by hluska on Monday February 23, 2026 @08:33AM (#47122094)
That’s pathfinding. I thought you were opposed to pathfinding?
Re:0 A.D. Release 28: Boiorix by card_zero on Monday February 23, 2026 @10:32AM (#47123615)
Well, ish. My theory is that you can have units make individual local choices that add up to somewhat inept pathfinding, and it works out cheaper than maintaining live-updated whole-map pathfinding information.
Re:0 A.D. Release 28: Boiorix by tshaddox on Monday February 23, 2026 @10:24AM (#47123497)
Not only is that pathfinding, it sounds like an especially complex pathfinding algorithm that would be pretty challenging to implement efficiently.
Re:0 A.D. Release 28: Boiorix by card_zero on Monday February 23, 2026 @10:34AM (#47123661)
In what way?
Re:0 A.D. Release 28: Boiorix by tshaddox on Monday February 23, 2026 @11:38AM (#47124697)
Well, if each unit leaves its own scent trail, that’s a lot of per-unit state, and little to nothing that you can pre-compute for the entire map. You could have all units trails on a global “scent layer” that all units read from, but then you’re basically just building up a graph of common paths that could have been precomputed for the entire map.

It also doesn’t at all address inter-unit collisions, which is a big topic in RTS pathfinding.