Okay then after implementing my spanning trick
Just alter the spawns to be not in the same point
Make 3 regions for each wave to spawn at
1/3 Zombies Close sonthey will get every tick other 2/3 on a distant enough points tomapplyna distance optimization trick.
In this case Assuming you don’t have other bottle necks you might be able to reach 60-70 FPS.
The key is to cull the process - ot to process all of them in 1 frame - but process closest in 1 frame and span other accross multiple frames to cull of CPU bottle neck.
Also take a look of movement component - should your zombies ever fall somewhere ? if not - then tell MovementComponent not to check floor… etc etc…
My Optimization texhnique as is seems not to help you since it delas with the Zombies that are not rendered to screen, in your Screen shot I understand that you can see all of them - I would suggest to alter the trick a bit: I would still use the whole part of ocluded optimization, but I would add a distance sorting as well for instance I would tick Zombies in 2-3 groups 1 tick function for a close zombies and 2 more for a distant zombies while those who are pretty close should get every tick the distant zombies can skip ticks as well lets say you will devide them in 2 groups and tick group 1 on every even tick and group 2 on each odd tick…
In best case you get twice performance on an average case you will get 1/3 performance improve…
Picking a good distances treshholds will result for a human eye as a perfect movement even though you are skipping some ticks.
But 80 ai to 40 fps I have suspicions that you are failing at something else as well.
I would assume these hitboxes are a pitfall - but you shall measure the performance for a bottle necks first.
This trick lets call it a Tick span - won’t jump your FPS from 40 to 90
It may be beneficial with the addition Indeseibed here to get around 60fps…
Then go ahead and measure the other bottlenecks and try to optimize them 1by1
I will just add that I suppose that the screen shot is not an actual game play… Maybe if you post a screen shot from an actual gameplay I would assist more.
Hard to say what that would be like because I haven’t figured out the best way to spawn them on the map yet. Thinking random chance of a spawn point on a tile. I can drop a bunch of zombies in the game and show you what that might look like in view
I think that the most useful part for me was dropping BehaviourTrees
and tranferring the most heavy parts of AI to a separate thread
this alone allowed me to have ~ 100 AI with 120 FPS.
If you want you can take a look at my WIP game where I used it.
Run accross the map spawn as much AI as you can (by just running around the map , avoid werewolfs they are too strong) and look at the performance vs quality
80 ai with best and worse scenarios on screen, captured in game from the htc vive. Still don’t have your fix in yet. Wanted to show what I have going on. This was still in the editor technically, it wasn’t launched as a standalone game.
A separate thread for ai in general should always be a thing in my opinion.
I have 3 screens, my vive, and a chromecast. then theres plenty of chrome tabs and what not. I’ve looked and removing all those things doesn’t change anything.
I can see the profiler on screen but I can’t get it to log anywhere. what am I doing wrong here?