Operation : Optimization


Ah Optimization,

A topic that will always hurt my poor little brain, I have spent weeks trying to further optimize the AI and pretty much every aspect of the game in general and as of right now it seems to be going well, and hopefully it will continue going well....hopefully.
So what did I do to improve performance?

Well In terms of the AI I stopped the ai constantly running a query to see where the character was every tick, Now its on a "queued" schedule.

Batches of ai are broken into groups and sorted to a list that then runs a piece of code that tells each ai in said group where the player or their objective is, And these get done one by one, This has saved some performance but not as much as I had hoped, Most notably though it helped stutters when AI got stuck and their pathfinding went crazy trying to find a path out of their eternal hell.

So ai didn't make a huge difference outside of some edge cases where AI gets stuck (WHICH THEY SHOULDN'T) but what I was more focused on was performance regarding the player and how their actions are handled in the code. So here's what I did to optimize that part of the code.

Firstly I noticed a huge problem with the gun's muzzle flash, On high RPM guns this would cause a noticeable frame drop, Sometimes upwards of 20fps if there was some zombies around. That's crazy!

So I ended up looking into it and seen the bounds for the particles were way too big, So how did this happen? Well first we need to understand how the players first person mesh is handled, The players FPMesh as we will call it is scaled down very small but kept in a fixed point on the camera so you don't notice its just a tiny little model, The reason I do this is to stop the weapon clipping into walls, But in doing so the particles bounds were not being updated infact they were being enlarged even though the actual particles were scaled properly with the FPMesh, No clue why...Epic plz fix, So I changed these bounds to match with the smaller size the models would have and I also made the particles GPUCompute particles And that helped performance alot, No longer are we dropping frames when shooting our gun!

That's pretty much it outside of some graphical tweaks but I really cant fit them all in here as I really should start working on the next part of the game. The networking!

This is my first real one of these "dev-logs" So I apologize if its terribly written or worded, I'm not the best with this kind of stuff haha.

Get Project DEShot Zombie survival game - NEW UPDATE

Leave a comment

Log in with itch.io to leave a comment.