|Topic was automatically imported from the old Question2Answer platform.
I am making a 2D game and am hitting some major performance issues. With ~ 70 entities on screen FPS drops to ~ 30 or less. In game this appears as ~ 30 enemies and ~ 40 bullets, with only the main player shooting. I have disabled most Particle Effects, stopped the enemies from shooting, and pool multiple types of resources. A similar, though less dramatic perf loss occurs when it’s just the player shooting and there are no enemies.
What can I expect here? Are there any examples of 2D Godot Games that can handle a significant number of entities on screen, or is it just performance limited? Any ideas?
What are typical resource hogs in Godot? Adding/removing from scene tree, animations, particles, etc?
Edit: I gutted my project: removed unnecessary nodes, switched KinematicBody2Ds for Area2Ds, and moved some FX from _physics_process to process (like turning on/off visibility or Particle2D emissions). It’s now 60FPS. Hard to say what had the most impact, but I tested a little as I went and it seemed like it was switching to Area2Ds. Before I was using
move_and_collide and am now looping over
I don’t think you should be experiencing that big a hit on performance with so few objects on screen. You may have accidentally done something in a non-optimal way leading to the issue. In any event, I am interested to know if the Godot experts have any insight into the typical performance bottlenecks of Godot.
Diet Estus | 2018-04-13 12:19
It would be interesting to see your project.
Zylann | 2018-04-13 12:48
The profiler shows the vast majority of the processing time is spent Idle. Something like this.
jarlowrey | 2018-04-14 16:12