CreatorsOk
roadtovostok
roadtovostok

patreon


Dev Build Update (Performance with AI)

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)

Comments

I would have fixed that by increasing the hearing range of the A.I. Gun shot sounds carry much farther than most games simulate. One gun shot and there is no reason that A.I. within 500 meters should not have been able to decide whether to investigate or not. That would have allowed the game to have both the ghost town feel of STALKER and the intense combat of Tarkov. If the loot is decreased in the future that would require players to investigate more of the map and eventually run into someone.

TacShooter

I find these dev topics actually quite interesting, so I would welcome more posts like this one if an opportunity arises. :DD

Feruen

Is there any room for being scrappy and not doing the physics business when out of sight or out of range of a player / players? Does the AI need to do the fancy / precise pathfinding and behavior when there is no immediate chance of player interaction? If no one is looking -- maybe they just suck on their thumbs and teleport short distances? I grasp the trade-off you're making, just thinking out loud.

ea

Not sure if this is the right place but a few things I noticed playing the dev build was that foliage would kind of like stretch and support when walking through it. Also I was unable to use any items and in the inventory when you clicked on something it would disappear, than reappear when you clicked on another box, basically the drag and drop system but with no dragging and dropping

RækØ Ŧæĸø

This week :)

Road to Vostok

No AI in this dev build. That will come next week :)

Infinity

The issues is not the spawning since I already use a pooling system for that, it's individual active ai pathfinding process which becomes expensive / performance heavy with large terrains. This happens because the AI uses so called navigation mesh for pathfinding and bigger the navmesh, bigger the pathfinding time per active agent. There's multiple solutions to this available and the most common approach is to divide the large navmesh to chunks and then the AI only needs those smaller chunks instead one large navmesh. I will definitely implement that chunk system at some point but currently the most convinient method is just to tweak the map layout a bit so the AI don't need to calculate those relatively empty border areas. I have backups and different size versions from all the maps for this next Public Demo, so it's just a matter of choosing the most convient size and layout to keep the navmesh size fairly compact, so I don't need to worry about implementing those custom tools yet. But I think when you test this new map variant size that I'm currently running with the AI, I would assume that it feels pretty balanced and there's still those new elements, buildings and visuals present.

Road to Vostok

Exactly

Infinity

totally agree. Even this "boring" Updates are pretty interesting when it comes to watch "behind the scenes" and also we still can give some input and ideas.

SavRoyale

Could not agree more

TastyMilk

did you put a normal AI spawn in consideration? So let all of them spawn while loading the Map to minimize stutters instead of spawning them like they do right now? I think it should be possible to keep the size and amount of AI (9-10) without too much issues. Event Spawns will most likely always cause issues.

SavRoyale

I played with a load in from the previous build. I scoured the village and found no AI. Is it because I used a load in and not a new game?

xaspr8

the dev build from yesterday has no AI. As mentioned in the title.

SavRoyale

Played for more than a hour today and i heavnt got any Fights yet.

Kamado Tanjiro

This is super interesting stuff, I feel like one of the things that is least discussed in this genre from a dev perspective is the design of AI and the balancing act of performance vs. complexity. Highly appreciate posts like these!

Fonzi

Please do not stop posting these "boring" updates. I really like them lol. Plus it is rare for a Dev to give so much feedback about their progress and projects

Infinity


More Models and Creators