Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, 1 invisible), 584 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Tile blending ideas... #401566
05/21/12 18:25
05/21/12 18:25
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
I'm creating a tile based game but I hate the look of the independant tiles ending abruptly...
I have come up with an idea of using a shader but I would like some feedback/input of other approaches you guys may have.

So far my idea is to use simple entities (2 polygon square) instead of sprites so I can have multimple skins.
Each entity will have four skins. At creation the first three skins are the same (the base texture of the tile) and the fourth is a "blend-map". An example of the fourth skin is shown above.
when the level is created each tile will have it's second skin set as the same as the tile to the north, and the third skin set the the same as the tile to the east.
My initial idea is to use a simple shader that will sample the first skin and blend it with the 2'nd and 3'rd using the fourth. Where the fourth is coloured black the shader will sample the first skin, where it is red the second skin will be blended over it, and where the fourth skin is green it will blend the third skin.

But I am not too happy with the results this shader would produce... I have tried to come up with different "blend-skins" but the results all seem to be terrible when i duplicate and colour it in to see what the shapes would look like. An example for the tile skin shown above would be this:


I am not asking for the shader to be done for me nor asking for code. What I want are concepts... I know many games blend tiles pretty well but I can't seem to figure out how they do this.

So basically what I have is a design problem, I'll deal with the programming myself once I know what to program. I have a couple questions for anyone that has any ideas for this.

-If this shader idea is the best route... Could I get any examples of what you think the fourth (blend-map) skin should look like for this to look good?

-Do you have any better ideas? Mabe it is much simpler than what I am trying to think about. Mabe there is a better approach to this shader, mabe three skins are not needed, mabe it can be done some other way withought using a shader alltogether! I am all ears for any other concepts you guys come up with.


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: Tile blending ideas... [Re: Carlos3DGS] #401567
05/21/12 18:32
05/21/12 18:32
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
hmm..
One way is to create Tiles that fit perfectly together and build a transition between two ground/wall types. But thats much work to create all the middle tiles

another way would be, for example, to put a red and a yellow tile to be half overlapping each other.
And the shader now blends the pixels of the tile obove, to the tiles below.

But i always think that could be ugly, so in my early projects, i used my first method ^^"


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Tile blending ideas... [Re: Espér] #401570
05/21/12 19:11
05/21/12 19:11
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
I thought of that at first, pre-defined tiles for touching tiles. (If I understood you correctly that is what you are saying?)

If that is the case, I discarded that idea when I realized the amount of tiles I would need.
Click to reveal..
Say I only had two types of tiles (water and sand) represented with a "W" and an "S", there are only a few cases to consider:

we are only looking at the case of the middle tile here:

-water surrounded by water:
WWW
WWW
WWW
here we only need one tile to represent this case

-water with one sand:
WWW
WWS
WWW

WSW
WWW
WWW

WWW
SWW
WWW

WWW
WWW
WSW
four different cases, if the texture can only tile in one orientation we need four textures for all the cases, if the texture can be tiled in all orientations (which would be very odd for water due to the wave orientation) we would only need one tile.

-surrounded by 2 sand would be two types or 8 depending if it can be rotated or not.
WSW
WWW
WSW X4

WSW
WWS
WWW X4
multiply these two cases by four if they cannot be rotated (like waves in water for example because it would look wierd)

-surrounded by 3 sand:
WSW
WWS
WSW X4
one case if it can be rotated, if not then four cases

-surrounded by 4 sand:
WSW
SWS
WSW X1
here there is never need for rotation so it would be only one special transition tile in either case.


When dealing with tileable textures the usual case is that they cannot be rotated due to wave orientation, grass orientation etc... Only some textures can be tileable even when rotated like stone pebble texture for example (and even then would be hard to create such a texture).

So just for two types of tiles we would need 19 diffrent textures! (counting all rotation cases + the two basic tiles), and that is only if diagonals do not affect the tiles (which in some cases they might).

If we only go up to 3 different tile types (water, sand, grass) the combinations of surrounding tiles is inmense!
WGS
SWG
SWG
above is just one example to get an idea of how many wierd combinations could be possible...

If we go up to 6 (water, sand, grass, dirt, stone, snow), which is still pretty basic for a game, the amount of tiles needed to take account for every possible combination is prohibitly high.



Just putting my thoughts out there about how many blended pre-made tiles would be necessary. Mabe I'm just over-thinking it and it would require much less tiles?

I have not fully understood your second idea and am very interested if you could explain that a little more. Mabe I have a thick skull today, but I do not understand the second idea no matter how many times I read it.


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1
Re: Tile blending ideas... [Re: Carlos3DGS] #401734
05/23/12 19:34
05/23/12 19:34
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline
Expert
Puppeteer  Offline
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen

Last edited by Puppeteer; 05/23/12 19:38.

Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Re: Tile blending ideas... [Re: Puppeteer] #401761
05/24/12 09:55
05/24/12 09:55
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
what I found a practical way in case of tiles, to have first a map filled with a default 24b tile (or have a 24b base image in case of using terrain as a base), and then put the 32b tiles having borders with alpha fade out for good blending with the images placed previously.

As a better and more randomized approach, later I used a separate grey-scale image storing the alpha fade out values, and used large texture files instead of tiles. Their repetition is dependent on their size, so can be different for each texture, while you can also change randomly the alpha fade out image - if you make more versions.

It was my first trial project with 3DGS laugh I used it for tile aligned painting of terrain texture (using a multi-terrain system, so neighbouring terrains were also painted), plus during painting tile settings are also can be managed. You need an editor for this, or create randomly.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: Tile blending ideas... [Re: sivan] #401777
05/24/12 14:22
05/24/12 14:22
Joined: Oct 2008
Posts: 513
Carlos3DGS Offline OP
User
Carlos3DGS  Offline OP
User

Joined: Oct 2008
Posts: 513
thanks!


"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1

Moderated by  checkbutton, mk_1 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1