Timbermar
Oct 30th, 2000, 12:14 PM
I'm trying to make a program to create complete tilesets for RPG type games. I started making this when I tried to create my own RPG, and while drawing some of the tiles, I noticed a lot of repeating the same thing, over and over again. so I named these peices "Stamps" and I thought that if I could draw the "Stamp" alone, that I could create a VB program to place the "stamp" in a tile, along with other "stamps" needed to make up the tile. but I can't get a picture box to use more than one stamp at a time. so I think I need to Mask the stamps, whatever that means. can somebody help me figure this out?
HarryW
Oct 30th, 2000, 02:21 PM
I think I vaguely know what you're talking about...
Do you mean like if you had 3 terrain types - grass, stone and forest, you would have to have tiles like this, depending on what terrain was next to the tile:
G = grass, S = stone, F = forest,
GGG GGG GGG GGG GGG GGG GGG GGG GGG
G G G G G G G G G G G G G G G G G G
GGG GGS GGF GSG GSS GSF GFG GFS GFF etc.
Which means you need to have absolutely loads of different tiles.
I think that's what you mean, tell me if I'm wrong.
In this case what you culd do is to make a limited set of tiles for each terrain type, with masks where necessary, and give each terrain type a precedence so that you can overlay the tiles. So, for each terrain type, you make a set of 15 tiles and your base tile:
Base tile: OOO
OOO
OOO
Plus overlapped tile patterns:
X = terrain pattern of adjacent tile
O = terrain pattern of this tile
XOO OOO OOO XOO OOO XOO XXO XOO XXO XXX XXX XXO XXX XXO XXX
OOO XOO OOO XOO XOO XOO XOO XOO XOO XOO XOO XOO XOO XOX XOX
OOO OOO XOO OOO XOO XOO XOO XXO XXO XOO XXO XXX XXX XXX XXX
If you have that tileset, you can get any pattern between 2 terrain types by rotating the overlapped tile pattern.
You might set stone to have priority 1, grass to have priority 2, and forest to have priority 3. The highest priority terrain type is applied on top of the others.
Say you had 9 tiles set out like this:
GGG FFF GGG
GGG FFF GGG
GGG FFF GGG
GGG GGG SSS
GGG GGG SSS
GGG GGG SSS
FFF GGG SSS
FFF GGG SSS
FFF GGG SSS
Your central tile (grass), instead of being a plain stone texture, would have other terrain types overlaid over the edges of it according to the precedence you specified. So the central grass tile in the above example would look like this:
GFG
GGG
FGG
and the whole 9 tiles would look like this:
GGF FFF FGG
GGF FFF FGG
GGF FFF FGG
GGF FFF FGG
GGG GGG GSS
FFF FGG GSS
FFF FGG GSS
FFF FGG GSS
FFF FGG GSS
Okay, now I'm confused... ;)
I hope you know what I'm getting at. I saw a website on this kind of thing ages ago but I've completely forgotten where it was and now I can't find it. I seem to remember it being similar, but maybe not.
[Edited by HarryW on 10-30-2000 at 03:25 PM]
HarryW
Oct 30th, 2000, 04:03 PM
Take a look at this:
http://www.gamedev.net/reference/programming/features/terrain_trans/
It's a very good explanation of what I think you're getting at.