Dev Build Update (Performance with AI) (Patreon)
Content
Hi!
Here's a little update what I'm currently doing.
Yesterday night I played few rounds with the AI in that expanded Village map and here's few thoughts.
The recent AI system that I have designed (AI overhaul) is implemented around 3-5 active AI agents per map with pathfinding. It's also designed around upcoming AI events and bosses (Q4 this year) which will cause "resource spike" when the AI count suddenly rises, for example "Bandit Van" event can suddenly bring a group of new AI's to the map with a vehicle (this is a rare event though).
This being said, the previous map size was quite balanced with 3 active agents (enough action), but when I playtested the expanded map size yesterday with 3 agents, it's far too little since the AI can hide in so many places and wander really far, so there's definitely too little action with 3 agents.
The most straightforward solution would just to pump up the active AI count, let's say for something around 6, but then when you consider those upcoming AI events and bosses that number could actual turned into something like 9 agents.
Then few technical things about active AI's. The most resource intensive part of the AI is physics and pathfinding, since each agent must independently calculate physics and the shortest path to certain targets. Having something like 9 agents per maps individually calculating paths / physics requires few custom tools (navigation mesh chunks) in order to avoid sudden lag spikes and generally keep the performance stable.
So, in order to trying to think a bit further ahead and implement things smartly, I did some changes to map sizes to keep things a bit more compact, so there's less empty space and more action with the AI. This way I don't need to increase that active agent count so much and there's less work needed for custom tools, especially considering this upcoming demo.
I have few Village map variations almost ready for this next dev build with the AI and I will choose one of those that I think could provide the most balanced size with the 3-4 active AI agents.
I will spend this day fixing some of the bugs / issues that you mentioned with the last build and add the remaining buildings that were missing. I will share more info about the upcoming build after that.
ps. These kinds of balancing / performance topics might be a bit boring posts to read, but I decided to cover this anyway since developers need to often worry about these kind of things :)
-Antti (Developer)