![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Mejisto |
I am coming from a game framework background where i have complete visibility over my main loop so i was trying to get a better understanding of how godot works.
I placed a lot of static bodies, no sprite, just static bodies with a rectangle collision shape to test the impact on performance. For my tests i did not collide with them, just observed.
I noticed even if the static bodies dont have a component that needs to get rendered they still get processed.
Having a lot of static bodies inside of the camera area made a big impact on framerate.
Having them outside of the camera area improved framerate but the framerate was still significantly impacted by their existence.
So it seems that when inside the camera some heavier process is happening, and even if they are not inside the bounds of the camera, nodes still get processed. What is actually happening in these cases?
Is a process function called at all times regardless of having a script attatched?
How would one go about having many nodes and not have them be processed if outside of the camera bounds? To be abie to keep them stored in memory when not needed, because the only way around this that i see is to destroy them and re-instance them when required again.
Same behavior happened when placing lots of sprites, of course when visible within the camera bounds the performance hit was the most significant, but even if they exist outside of the camera bounds it seems that there is a performance hit.
Im not familiar with c++ to dive into the source code and start investigating, maybe there is some explanation/guide that i have missed.
I hope im making sense. Thanks!