Hi everyone, I've just started making a top down 2D game (yes it's a Zelda remake; no it won't be yet another ugly clone ). And I'm wondering how I should build my maps : given that some tiles will be used in different environments – the only difference being the color of the ground – what do you think would be best?
1) To draw shared tiles (without ground) and empty ground tiles, then build a base layer with the various ground tiles + a complementary layer above with the shared tiles?
2) To draw all combinations of ground + tiles beforehand, then build the whole map on a single layer thanks to the comprehensive tileset?
I'm thinking performance and memory usage here. I've read the blog posts about how tiled backgrounds work in Construct 2, as opposed to tilemaps (but I think Construct 2 does crunch tilemaps into as few tiled backgrounds as possible, when exporting? not sure). And so I wonder if I'd better use fewer tiles, using separate layers to combine whatever ground+tile need to be combined on runtime... or do the opposite: "hardcode" all tiles combinations in the tileset in order to have a plain, one-layer tilemap on runtime.
Sorry I haven't any pics or capx to show, I've only just started (but I'm thinking forward ^^)!
I hope my question is clear enough.
I... guess I wasn't clear enough, then... ( ; _ ; )
Develop games in your browser. Powerful, performant & highly capable.
You're not wrong, this is so confusing. Are you trying to build the whole game in one layout? That's what it reads like but there's no need to do that. The tilemap will always be fine performance-wise as long as you don't use it to display large images. You mention 'draw' a lot so I assume you are concerned about performance issues around loading so many tiles. The game will only load a layout at a time, so just do one level per layout, should be fine?
Hi, and thank you for your answer.
I'm not especially trying to build the whole game in one layout (actually it would be much better NOT to do that xD ). I just don't know how much having several layers per layout is a good or bad idea, performance-wise.
But here's a picture I've assembled, in order to explain myself better! This should help.
So in the first example, I would be using several layers per layout to build my map but this would allow me to use fewer tiles. In the second example, I would be using only one layer per layout to build my map but this would require more tiles to begin with.
This picture makes it simple but you can imagine how quick the number of tiles could grow (of course there will be many more) if I was to use a third ground color besides green and brown... Yet everything would be on one layer, so I don't know?
I'd go with separate "blob" tilemaps for each material and mix to taste.
And you'll only have to include the smaller tilemaps for the materials you actually use in each layout (forest level: grass, cliffs, trees... ; north pole level: snow, cliffs, icy rocks...)
Indeed! Well that sums it up... I think I'll go for less tiles x several layers. After all, performance matters at runtime but so does the time required to make and handle my tiles' graphics! And method #2 certainly would become a more complex task towards the end.
Thanks for your answer(s)! I'll come back and post some WIP stuff as soon as I make significant progress.