Dec 30 Update and Optimization exploration

 I've been trying to do further optimization due to large fps drops on my budget pc on empty scenes with just a few character controllers. This looked like it was mainly from two things, creating rayshapes/raycasts spontaneously (its ok if they're already created) and too many bones on one character controller. I went from 112->58 bones on my main character, and this gave me back about 20 fps. Removing all runtime created rayshapes and raycasts was also about 15 fps. Notably, my character controllers are fairly complex at this point, with rayshapes for hurtboxes and attack areas, and the enemies constantly poll for player location - yet these were not the bottlenecks (I tested out disabling them) - however, I do set the navigation polling for enemies to every 2 seconds and not every frame. I also moved all processing for the state machine from a node tree to internal classes, but I didn't notice too much of a difference. It gave me a chance to refactor a lot of the code so that was good anyways.

Other than that, enemies can now patrol a set path and can be "escaped" when the player leaves their view range for long enough. Hitting enemies when they're unaware will alert them no matter how far away the player is. I just need to have them return to patrolling and allow them to interact with objects as well and be distracted (sort of a hint as to what I'm working on next), but that's after all the optimizations are done.

Ill also be doing some changes to the controls as well allowing for mouse and needed controller support. I'm not too sure how I'll handle character aiming with a controller, but I'll figure something out. I do plan to at least bring the optimizations back to the itch.io prototype, I don't think I've broke too many things with the new code.

Implemented object pooling for projectiles properly. This fixed the issues with projectiles lagging on first creation, seems to keep fps more stable too.  Practice Round now runs at a fairly smooth 30fps, 1920x1080p, 0.75 fsr scaling on my A8-7600 processor using integrated graphics. 

Comments

Popular posts from this blog

March 17 update

First Post

July 16 Update