Creating Top Down Maps with Multiple Tile Layers
by Aaron Miller · in Torque Game Builder · 01/28/2010 (7:29 pm) · 2 replies
I think I have a solution but want to check it against what folks here might have experienced already:
I'm trying to figure how best to make tile maps for a top down game. My main challenge is in trying to hold down the combinatorial explosion that results from having to make transitions between several different types of tiled terrain (desert to forest, desert to jungle, forest to jungle, etc.).
One approach is to use alpha blending and make certain partially clear tiles overlay others. But as I understand it you can't put more than one tile into a given position within a tile layer.
So I was thinking of this approach:
* Keep the data of what's in the map (units, cities) separate from the actual map display
* Visually represent the map in maybe 5 or 6 tile layers, positioned on atop the other
* Set each tile layer to a different rendering layer
* Cascade changes to the map (like clearing forests or unit movement) through the layers as needed
Seems cumbersome but I'm not really sure of another approach. Any suggestions?
I'm trying to figure how best to make tile maps for a top down game. My main challenge is in trying to hold down the combinatorial explosion that results from having to make transitions between several different types of tiled terrain (desert to forest, desert to jungle, forest to jungle, etc.).
One approach is to use alpha blending and make certain partially clear tiles overlay others. But as I understand it you can't put more than one tile into a given position within a tile layer.
So I was thinking of this approach:
* Keep the data of what's in the map (units, cities) separate from the actual map display
* Visually represent the map in maybe 5 or 6 tile layers, positioned on atop the other
* Set each tile layer to a different rendering layer
* Cascade changes to the map (like clearing forests or unit movement) through the layers as needed
Seems cumbersome but I'm not really sure of another approach. Any suggestions?
#2
I guess the question comes down to what the cost of empty tiles are. If there's little overhead then it's maybe just a matter of how much synchronizing I want to do between different layers. (I think)
01/29/2010 (12:59 am)
Thanks for the response Ken. That could work, although what do you do at the corners if you have several different types meet (say jungle to the west, forest to the south, grass to the east and maybe desert to the north)?I guess the question comes down to what the cost of empty tiles are. If there's little overhead then it's maybe just a matter of how much synchronizing I want to do between different layers. (I think)
Torque Owner Ken Lao
Do you need 5-6 tile layers (and a separate data map)?
Can't you use just 2 tilelayers?
Tilelayer #1 with basically everything in it (including maps, city data, etc.) except that at the transition tiles (say, jungle->forest) you just pick one terrain type: (jungle->transparent).
Tilelayer #2 which is mostly completely empty, except at the transition locations you put the other background type (forest).
Tilelayer #1 is on top of Tilelayer #2.