Extremely poor FPS in sandbox game

I am attempting to create a 2D sandbox game similar to terraria, however I am encountering a rather large issue. After my world generation is completed, the resulting thousands of individual tiles cause the game to lag greatly, reducing 60fps to around 10. I am not sure how to fix this, and I am requesting help.

Below is a short gif that may better visually show the issue.
Preview of test 2023-08-26 17-30-57

Hi, I hope someone else can give you a more informed answer than I can do, but it seems that if you really create all the tiles at once, you will inevitably run into performance issues in any engine. It seems Terraria is not building the entire world completely rendered, so aside from the question what your events look like (some optimizations may be possible and here is a guide for doing that: How to troubleshoot poor game performance - GDevelop documentation), you probably need to consider a different approach for generating your world.

I found this discussion and there is some good info about what you could do to generate your world. procedural generation - How does Terraria generate such large worlds initially? - Game Development Stack Exchange
The basic layout of the world is created in several steps but the actual tile placement/rendering only happens in chunks (at least to my understanding).

3 Likes

ah, thank you for providing what help you could.