Performance problems with a sandbox game made with godot

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kyla


This is a game I made like Terraria.
I have a problem now, that is, I want to create a lot of squares.
The structure of a block is
Staticbody2d
–sprite
It will be stuck when you create more, and it will not respond for a long time when you enter the game creation.
Exiting the game will also not respond
what should I do

Have you implemented chunks? In other words splitting your world into loadable parts so the whole world is not loaded at once.

Sprowk | 2018-07-30 09:35

:bust_in_silhouette: Reply From: Lucas Coelho

What you need to do is a Chunk System, it’ll consume less memory while playing because you’re going to load/generate chunks while the player goes to them. It’s kinda complicated to explain the algorithm to do that, but I think that this answer gives a good explanation about it.