AI optimization

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