🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

AI Simulation For Distant Agents?

Started by
1 comment, last by Alberth 3 years, 4 months ago

Hi,

This has been bothering me for a while but I have found no concrete answer to this.

I have a huge Open World which uses Origin Shifting to keep the coordinates closer but I need to make sure that AI Agents keep impacting the world without player ever noticing them(I don't want the world to move around the player) i.e A Raiding party moving on the other side of map to its own goal or a Convey going from port to port.

right now AI only activates depending on the distance meaning the Convey or a raiding party will deactivate as soon as player moves away, I don't want that I want that AI to keep simulating tho in a very low Quality and precise way but it should keep working.

btw the AI path finding Algo A* is my custom but I haven't managed to reduce its pathfinding cost I was thinking that maybe if the player is far away I could make the algo faster by making it a bit less precise but no luck in that since it's Grid based and the position needs to calculate its neighbors all the same.

Or maybe I could keep the AI enabled but swap out its Movement component so instead of moving smoothly it moves by snapping to next grid (don't know if this will improve my performance by lot or not).

Advertisement

I don't quite see an actual question, so I am guessing AI movement away from the player is the problem?

I am not even sure an AI should have to move at all. I mean, pick a random location and a random delay-time until the raid, and done! You could see it as a simulation of several independent AI groups.

If you do want movement-time into account, you could compute distance as a straight line, and take eg 80-90% of their speed to compensate for local detours.

If you do want them to take real roads, make a kind of highway system with pre-computed travel times (or travel distances). Likely not optimal, but an AI surely would like to take an easy road every now and then, wouldn't it? ?

If you have uniform grid costs (every where, the cost to travel to a neighbour cell is the same), you could switch to JPS instead of A*, which is faster as it exploits the uniform grid properties.

This topic is closed to new replies.

Advertisement