AI optimization

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

https://drive.google.com/open?id=0B0IdKcPdt9ldRG1mZHJYS0liN2c

Good Luck Implementing!
Making AI on a separate thread is a huge work to do.
Go for it!

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.

Daunting task for a noob. Also I played your game example and I get 90-120 fps with 20 or so ai on screen

I get ball park 90 fps with 20 zombies on my screen. Whats funny is that when I run it outside of vr mode, I get like 300 fps

My game is not for VR - and yes I have 300+ FPS
Then I suppose CharacterMovementComponent is not your bottleneck.

Please post your profiling results

TBH didnt even know it can run in VR

sorry i meant my game outside of vr mode

kind of new to profiling. what should I be testing

90-120 FPS in my game ?
Hmm what is your hardware ?

Profiling start from posting:

in console:
stat.unit
stat Unit or something like that
look here

I get such FPS on intel hd on I-3 CPU
which I consider as a great performance :slight_smile:

i7-3770k

16 gb ddr3 1600mhz

500 gb ssd

gtx 980ti classified

profiling now

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?

oh wait I got it. needed stat start file

Stat Dump

Your hardware is close to
my, you should have around 270-300 FPS…
Unless you are not on 4K display bit then again it would be a GPU bottleneck.

I don’t know, post a screen shot :slight_smile:

I don’t know how to open this, just post a screen shot