New topic: 

Anyone got a simple Tile Terrain Tranistion algorithm?

<http://forums.realsoftware.com/viewtopic.php?t=45220>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        DaveS          Post subject: Anyone got a simple Tile Terrain 
Tranistion algorithm?Posted: Sun Sep 02, 2012 6:37 pm                           
      
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4067
Location: San Diego, CA                I have a tile based game where the 
terrain is made up of combination of eight(8) tiles (grass, sand, alphalt, 
dirt,water etc.)
I have figured out a quick easy way to create edge transitions giving each tile 
type a priorty (grass is highest, water is lowest)  and using grayscale masks
but it only works for top, bottom, left and right edges.... I cannot figure how 
to make the corners look good.
This is most probematic when a corner has multiple types of terrains involved. 
99% of the "tutorials" on the web talk about terrain consisting of two types of 
tiles (grass and water)..  I need at least 3 (grass, sand, water) but would 
prefer the 8 I have.

I have come up with two concepts.... but am still perplexed about handling 
corners.

+---+---+---+
|  1  | 2  | 3 |
+---+---+---+
|  8  |  X | 4 |
+---+---+---+
|  7  | 6  |  5  |
+---+---+---+


Assuming "X" is the tile being analyzed.... my first idea would be to examine 
the 8 neighbors and create a mask to apply to "X" that would allow each of its 
neighbors to encroach inside "X"
The other would be to create masks to have "X" encroach outside onto each of 
its neighbors

But either way... the corners are the issue.   If 2,3 and 4 were all the same 
terrain ... no problem... but if each were different..... then what do you 
show? and how do you show it?

My terrain tiles are 102 x 102 pixels so I have enough resolution to work with. 


Any specific help would be great!

and gee.. if anyone even felt like taking my tiles and writing a little 
demo.... 

here is a partial screenshot of what I have so far (as you can see it REALLY 
needs some blending)




Note.. the TRACKS are a layer all their own.... so there is one image of 
TERRAIN tiles (above) and another for TRACK (and soon to be another for 
Buildings and bushes)

The (hopefully) end result will be a virtual "toy" train set.   Build your 
layout.... place your trains. Drive them around the layout... all without 
losing 3/4 of your garage.      
_________________
Dave Sisemore
MacPro, OSX 10.7.3 RB2011r3
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to