Update on my “RTS” prototype and the work on pathfinding.
I previously tried having agents claim a tile at the end of the path, each their own. They follow the flow field to the target area (green circle), and then move to their claimed tile.

The problem was that it became very complicated to assign them relevant, compacted tiles when there were many agents, especially when they were coming from very different parts of the map.

There are multiple ways to fix that, you just have to look at how good RTS games handle it. Check out Beyond All Reason and how they pack units around a point, Age of Empires IV, or even the relatively simple approach used in Starcraft 2.
But I’m aiming more for organic crowd management rather than precise RTS-style movement. Just to try it out, I completely ditched the tile-claiming system and let agents go to a single target tile, organizing themselves around it using steering forces like avoidance and wall repulsion, with a small timer adjusted based on group size.
And honestly, the result fits my system much better and is a lot simpler. So for now, I’ll stop overthinking it and keep it this way.
I might just add a simple local A* calculation for agents that need more precise movement, like workers going back and forth to a mine, to avoid having to compute a full flow field. But that’s probably all I’ll do.
Check it out in action with the explosion force I added too. It’s not perfect yet, agents in the center shouldn’t be thrown farther than the ones on the edges, but it’s getting there.
Leave a Reply