Godot Version
4.3
Question
so im making a metroidvania(platformer) but the tilemap is really big and can cause performance issues on other devices. so i thought to make a chunk system(every tile outside the screen will be hidden/queue_free() but i dont know how.
if you know the answer, pls reply and if it has some things that are no code, pls post a screenshot. thanks!
So, I’m on my phone so typing code can be tough.
The basics of chunking isn’t everything off the screen is unloaded, otherwise you are constantly updating it.
You take your map, and break it into ‘chunks’.
So, you have a map 1000x1000. You will break that map up into chunks, so say you want 50x50 tile chunks now you have 20x20 chunks, now of these chunks you’ll be checking distance from player to middle of current chunk. This will tell you when to load and deload chunks.
With this the most chunks you’ll have loaded is 4.
So, max size of 100x100 map 1/10 of the size of the original.
ive already fixed it by myself by adding a metroidvania system but that is helpful for other people so THX
1 Like