#### Archived

This topic is now archived and is closed to further replies.

# Terrain Transitions

This topic is 6165 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi everybody, I am working on my own isometric engine. Now, I am trying with the terrain transitions, I will use 16 tiles for each terrain transition (ie Grass to Dirt, Dirt to Water) When I create a new map (with my editor) I put the selected terrain tile (grass, water, dirt) but I need to calculate the correct tile for the neighbour cells. (Like in Warcraft editor) Do you have an algoritm to do that? Thanks to all Arcangel

##### Share on other sites
Firstly, create a terrain overlay priority and STICK TO IT!

IE. Hills over forest over grass over desert over swamp over water.

Once you''ve worked this out, when you draw your tiles across and down the screen, make each tile check the two tiles ABOVE that touch it. Depending on the terrain of both (tile above is hill, tile being drawn is grass) draw the overlay on either the current terrain or the checked terrain. As you go down the screen, each tile generates it''s own overlays instead of drawing the screen, then having to go back down the screen AGAIN to check the overlays.

Maybe follow this better for above-left tile (map[x] is the map class):
Hills = 0;
Forest = 1;
.....
Water = 5;
x = width;
y = height;
Current_Terrain = map[x + (y * map_width)].Terrain;
Check_Terrain = map[(x-1) + ((y - 1) * map_width)].Terrain;
if(Current_Terrain < Check_Terrain)
// Draw overlay on Current_Terrain tile.
if(Current_Terrain > Check_Terrain)
// Draw overlay on Check_Terrain tile.

1. 1
2. 2
frob
20
3. 3
Rutin
18
4. 4
5. 5

• 26
• 13
• 10
• 9
• 18
• ### Forum Statistics

• Total Topics
632555
• Total Posts
3007055

×