FPS dropping to nothing after changing scenes for a while

  • It’s a bullet hell game with open world exploration so different zones are different scenes
  • lots of bullets, lots of collission sensitive actions, lots of global variables, lots of global objects
  • all objects(bullets enemies etc) are deleted when far away enough from the player
  • Enemies use pathfinding behavior, they are given the order to move every 0.5 seconds, not at all times
  • Most scenes are set to “never preload” and “unload at scene exit”
  • Not a lot of things load when the scene starts, only the player and the map, enemies appear at random as the player moves with the exception of the starting zone and the tutorial, one enemy is there in each
  • Enemy bullet patterns and actions are determined by individual object timers
  • Scene timers are about 5 per scene
    *** after playing for a while, an arbitrary while, you switch between 5 to 25 scenes as you travel and in a random scene the FPS drops to nothing** the glitch happens RIGHT AS you are entering the new area
  • other than that, the game runs extremely smooth at ALL TIMES, no matter how many projectiles and enemies the player is interacting with
  • After closing and opening the game, you can enter the same area where you had the glitch happen, and it won’t happen again, it can happen in any scene after playing for a while

Any clues of what could be the cause? lmk if you need more info

1 Like

Hey @garbagedev!

First of all, Welcome to the Forum! We are so glad to have you here!

Not sure exactly what could be causing this, but it might be that the scenes are set to “Never Pre-load” and “Un-load at scene exit” which could rlly drop the FPS if a bunch are loading at once.

Sorry if I didn’t understand, just thought I’d mention this just in case it is the problem you are facing! :smile:

1 Like

Hi … usually when the fps drops like that it’s due to objects being created every frame as there’s no condition to prevent it. You could try putting the events that create objects in event groups and running the profiler and when it happens check the the profiler to see which event group is causing the problem.
Might be useful to see a screenshot of the events that create objects

3 Likes

Hi, @SnowyRawrGamer thank you! That cannot be since I made them have that setup recently(to attempt a fix) and the problem already existed before.

@petlimpet I’m certain every object created is limited to Trigger Once.
However, trying to pinpoint the culprit by isolating the event groups and check is a good idea, very time consuming, but a good idea, I will attempt it.

2 Likes

Hi @garbagedev!

I agree with all. I suspect the pathfinding tasks to be guilty, in your case.

I think you should choose a ennemy (and not all) and only apply pathfinding only at this ennemy.
Also, disable ennemis’s moves when outside of the screen (use extension for that)

A+
Xierra