Creating Tilemaps from JSON

Hi!
I would like players to be able to create their own tilemaps for my game.
I was inspired by this post
But it was in 2017. Does something changed?

In my game, I have big open world. I already splitted huge tilemap into small sections into chunks.
But now I have idea to create, for example 9 empty tilemap chunks collections, and as player move, load data from JSON and use set_tile accordingly.

Thanks to that, gamers would be able to export maps in JSON and load them into my game.
How about performance of this option?
Also Defold evolved, maybe there is other solution?

1 Like

The recommendation is always to measure the performance on your target platforms. My guess is that the performance will be acceptable.

It is still a valid solution. Try it!

2 Likes

The topic came up again, so I ran some tests. Unfortunately, clearing and loading 9 tilemaps, each measuring 96x96 and 5 layers, takes about 100 ms. So this is not the optimal solution :frowning:

I have made some progress in optimization. It is a good idea to load only one chunk per frame. This significantly increases the smoothness of loading.

So if anyone is wondering whether it’s worth it, I would say yes. However, I think that I will ultimately implement a hybrid solution. The game map I created will be in the form of a collection proxy with ready-made tilemaps. The second solution I mentioned will be intended for maps created by players.

1 Like