Example of easy implementation of Skorpios Tileset

Example of easy implementation of Skorpios Tileset

Postby Flipflop » 20 Dec 2012, 15:27

Hallo Everyone,

I am using Skorpios Tilesets for my Dungeon Keeper Project.
So he ask me to share my Ideas with this Project and the Coders here, he suggest to post it in the Code Area, so thats what I am going to do in this Thread. As a very thankful gesture to Skorpio and to this amazing Project you have here!

I think my Idea is a good an simple solution and will work in every Programming Language (My Project is written in Java).

The Basic Idea:

Every Tile has 8 Neighbors. So you Could just check the Neighbors and do complicated if-then-else Code. Or you just develop a Code that identificates every Tile in an easy way to use it inside an algorithm:

tabelle01.PNG


As you can see every Neighbor has a Number. These Number represent the Position in a 8-Bit Binary Code.
So the Tile in the Example shown has no Neighbor. So that Code would be just 00000000.

So in the First step you have to rename every Tile Skorpio has Build (or in My Case i just rename them in Blender an re-export them):
blend.JPG
b


The Tile in this Picture has the code 10000011. Because he has 3 Neighbors. one at Position 0, 1 and 7. (Remember you Read Binary Code from Right to Left).

So you have all the Tiles in an easy-to-use Binary Code:


dirtexample.PNG
drt


The Selected one has the Code 00111110. The c is just an identifier later in the alogrithm that there are several alternatives with the same Binary Code. So what you can see is the Filename. All the Files are already created in the correct Binary Code.

So all you have to do is to check the neighbors, calculate the code, concat it to the File-Adress-String and then Load the File which has the matching Binary Code!


In my Solution all the Objects for one Szene are Loaded over an .XML File with the XML-Parser we created. (To ensure that also people without programming skill can use our 3d support).
So the Code for that is:

xml.PNG
xml


The "?" in the modelpath-url show my Program that there has to be an Calculation done before loading the Model.
I have a Dataholder for every Object in the Szene in Java with Propertys.
I save the Neighborhood Property in the Data-Representations of the Objects in Java.
The Neighborhood Property are set when I load the map and "recalculated" every time one of the neighbors changes. (Like destroying a wall by IMP or something). Its pretty fast an efficient.
The Class to Load the 3d Objects use this Property to Find the correct Tile in the Folder.


You also need an exception handler after calculating the algorithm.
Normally there would be 2^8 = 256 different Tiles.
There are less (47 or something) because several cases are the same with the tilesets of Skorpio.
You have to set the position of the corners 0, 2, 6 and 4 to zero if they don´t have at least one direct neighbor. (for 0 pos 7 and 1, for 2 pos 1 and 3 and so on...).

The result is than this (in the first 2 pictures you can see the neighborhood value):



example01.JPG





Hope it helps you, i will post more examples or pictues if needed.

- Flipflop

PS: sorry for my bad english .)
Last edited by Flipflop on 23 Dec 2012, 23:57, edited 1 time in total.
User avatar
Flipflop
 
Posts: 180
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Example of easy implementation of Skorpios Tileset

Postby paul424 » 20 Dec 2012, 16:09

In my Solution all the Objects for one Szene are Loaded over an .XML File with the XML-Parser we created. (To ensure that also people without programming skill can use our 3d support).

What is the Szene ? The schwartz, right ?

http://youtu.be/IjVatNQr-GM?t=3m32s

Edit:
Arght the Scene .
Well pun intending I thought it;s really the "Steel Rail " like Szyna in Polish. :P
Last edited by paul424 on 20 Dec 2012, 16:24, edited 1 time in total.
User avatar
paul424
OD Moderator
 
Posts: 578
Joined: 24 Jan 2012, 13:54

Re: Example of easy implementation of Skorpios Tileset

Postby Julius » 20 Dec 2012, 16:14

Nice explaination... don't let Paul424 distract you from your aweZome German typing skillZ :p
“You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete” - Buckminster Fuller
User avatar
Julius
Moderator
 
Posts: 1411
Joined: 06 Dec 2009, 14:02
Location: Kampala

Re: Example of easy implementation of Skorpios Tileset

Postby Flipflop » 20 Dec 2012, 16:25

Hehe, I got the Point ^^ Of course i mean the scene.... :)
User avatar
Flipflop
 
Posts: 180
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Example of easy implementation of Skorpios Tileset

Postby Skorpio » 20 Dec 2012, 16:41

Very nice. :) I'll upload an updated blend file with the water and lava tiles tomorrow, if you want to integrate them, too.
User avatar
Skorpio
OD Moderator
 
Posts: 771
Joined: 05 Dec 2009, 18:28

Re: Example of easy implementation of Skorpios Tileset

Postby Flipflop » 20 Dec 2012, 16:52

Hehe, sure, would be nice. My Lave Tiles are at the moment just Planes with a low res Texture....
User avatar
Flipflop
 
Posts: 180
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Example of easy implementation of Skorpios Tileset

Postby Skorpio » 21 Dec 2012, 17:21

The water and lava tiles are now in the repository (in the OD_Tilesets2 file). I just noticed that there are some lighting seam issues which I could maybe fix with sharp edges around the bottom, but sharp edges are not optimal either. The materials are not perfect yet, too. By the way, do you have an idea for texture/alpha splatting across different tiles? I think Lips of Suna has texture splatting between different materials. TheAncientGoat can you tell us how it works?
User avatar
Skorpio
OD Moderator
 
Posts: 771
Joined: 05 Dec 2009, 18:28

Re: Example of easy implementation of Skorpios Tileset

Postby paul424 » 21 Dec 2012, 21:11

I just reverted to the current HEAD of development and the AngelScript version is bad ( at least I get it's virtual machine crash at startup _)

God Have a Mercy upon Us ... >_>
User avatar
paul424
OD Moderator
 
Posts: 578
Joined: 24 Jan 2012, 13:54

Re: Example of easy implementation of Skorpios Tileset

Postby Flipflop » 22 Dec 2012, 10:42

@Skorpio, they look preety awesome!

I upload a better Screen when i found the time to rename every tile and re-export them ( you know christmas....). Then I can just simply use them in my algorithm and calculate the correct one like i did with the other tiles.


As you can see i make the water half transparent.

Happy Christmas, i hope i found time to do that these days :)
Last edited by Flipflop on 23 Dec 2012, 20:20, edited 1 time in total.
User avatar
Flipflop
 
Posts: 180
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Example of easy implementation of Skorpios Tileset

Postby Skorpio » 22 Dec 2012, 14:04

Happy Yaksmas! Good job. I think I have to make some bridges, too. ;)

Have you already tried to combine the dirt walls with the claimed walls in the blend file?
User avatar
Skorpio
OD Moderator
 
Posts: 771
Joined: 05 Dec 2009, 18:28

Re: Example of easy implementation of Skorpios Tileset

Postby Flipflop » 22 Dec 2012, 15:05

TSome bridges would be very nice. Think i have time so rename them in my Binarycode After Xmas....
what Do You Mean By The Claimed Wall? The Castlelook tiles? I Think Thete Are Not That Matching From The Style. I Am Right Now Using The Dirt Meshes With The Claimed Ground Texture As You Can See In the Other Screenshots.
User avatar
Flipflop
 
Posts: 180
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Example of easy implementation of Skorpios Tileset

Postby Flipflop » 22 Dec 2012, 15:27

Sorry for the wierd text, Not used to my phone yet:-)
User avatar
Flipflop
 
Posts: 180
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Example of easy implementation of Skorpios Tileset

Postby Flipflop » 23 Dec 2012, 19:22

so, some screens from the water tilesets, i finnaly found an hour time ^^

not sure which color & transparency looks best.

waterbig.jpg
water1

water001.JPG
water2

water002.JPG
water2
Last edited by Flipflop on 23 Dec 2012, 23:54, edited 1 time in total.
User avatar
Flipflop
 
Posts: 180
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Example of easy implementation of Skorpios Tileset

Postby Flipflop » 23 Dec 2012, 19:41

..........and the Lava Tilesets.

Not sure what should happend if water is neighbor from lava...any Ideas?
lava.JPG


Dont know (yet) how to use the emit texture in JMonkey. There are lots of options, dont have time to read the documentation atm ^^
Last edited by Flipflop on 23 Dec 2012, 23:53, edited 1 time in total.
User avatar
Flipflop
 
Posts: 180
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Example of easy implementation of Skorpios Tileset

Postby Skorpio » 23 Dec 2012, 19:48

Cool, good job! I think lava and water shouldn't be neighbors at all or you need to figure out texture splatting. ;) However, it would be cool, if you could dig a trench and then let the lava flow through it when the enemies try to enter it. :twisted:
User avatar
Skorpio
OD Moderator
 
Posts: 771
Joined: 05 Dec 2009, 18:28

Re: Example of easy implementation of Skorpios Tileset

Postby Flipflop » 23 Dec 2012, 19:58

yeah....lava + water is some ultra hard material in minecraft I remember, obsidian, would also be cool :)
User avatar
Flipflop
 
Posts: 180
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Example of easy implementation of Skorpios Tileset

Postby Flipflop » 23 Dec 2012, 23:49

or I use this amazing reflection and wave-generations for your water tilesets......the Problem is: i need a skybox for good reflections (or the water is just totally black with only reflections from the buildings/creatures....)

But a sky is totally not matching for a dungen keeper game...i mean....its in a DUNGEON and UNDERGROUND!! :).....have to think about it....but looks pretty awesome...or? :)

water.JPG
water/skybox


Happy x-mas btw! :)
User avatar
Flipflop
 
Posts: 180
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Example of easy implementation of Skorpios Tileset

Postby Julius » 23 Dec 2012, 23:58

hmm... maybe one could try a fancy looking underground skybox? Something with red glowing crystals or such?
“You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete” - Buckminster Fuller
User avatar
Julius
Moderator
 
Posts: 1411
Joined: 06 Dec 2009, 14:02
Location: Kampala

Re: Example of easy implementation of Skorpios Tileset

Postby Skorpio » 24 Dec 2012, 12:18

Nice realtime reflections. Yeah, a "cave skybox" would fit better than a real sky. ;)

Merry Xmas everybody!
User avatar
Skorpio
OD Moderator
 
Posts: 771
Joined: 05 Dec 2009, 18:28

Re: Example of easy implementation of Skorpios Tileset

Postby Danimal » 24 Dec 2012, 15:36

i kind of remember seeying a skybox like that somewhere, i will look around a for it.
User avatar
Danimal
OD Moderator
 
Posts: 909
Joined: 23 Nov 2010, 13:50

Re: Example of easy implementation of Skorpios Tileset

Postby Flipflop » 25 Dec 2012, 22:06

I tried out some of the alternatives in JMonkey. I tried a lot with the Post Water Filter. Also looks nice. Fits perfectly with the Tilesets from Skorpio. Maybe i should upload a Video sometimes....the moving waves looks awesome!

post_water01.JPG
Post Water with Sun and Foam

post_water02.JPG
Post Water without Sun and with Foam

post_water03.JPG
Post Water with Sun and without Foam and more Transparency


and what do you all think about the sun? looks nice, but a dungeon dont have a sun ^^ And the Foam? Looks good or better without?
User avatar
Flipflop
 
Posts: 180
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Example of easy implementation of Skorpios Tileset

Postby Julius » 25 Dec 2012, 23:41

definitely better without foam. I guess with a bit of tweaking it could be made to look like the photo attached :) Just do an google image search and you will find more references like that.

P.S.: @ skorpio: did you ever make some spec and normal-maps for your tileset? I guess then the shader based water wouldn't look quite as out of place ;)

Edit: and without sun. How about you add some under-water rocks and maybe some glowing crystals under the water to have it look similar to those flashlights in the back of the photo I added? Still think a cave like skybox with stalactites etc. might be worth a shot.
Attachments
cave_lake.jpg
Last edited by Julius on 26 Dec 2012, 11:12, edited 1 time in total.
“You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete” - Buckminster Fuller
User avatar
Julius
Moderator
 
Posts: 1411
Joined: 06 Dec 2009, 14:02
Location: Kampala

Re: Example of easy implementation of Skorpios Tileset

Postby Flipflop » 26 Dec 2012, 00:56

The new Water I am right now trying out is generated from JMonkey. I dont have much influence on them, just a setting list.

I made a Video for you guys so you can see the Effect better:

https://vimeo.com/56299411

The Settings for that Video are:

Vector3f lightDir = new Vector3f(1f, -1f, 1f);
WaterFilter water = new WaterFilter(rootNode, lightDir);
water.setWaterHeight(-0.2f*appDimension);
water.setUseFoam(false);
water.setUseRipples(true);
water.setDeepWaterColor(ColorRGBA.Cyan.mult(0.1f));
water.setWaterColor(ColorRGBA.Cyan.mult(0.15f));
water.setWaterTransparency(0.001f);
water.setMaxAmplitude(0.3f);
water.setWaveScale(0.008f);
water.setSpeed(0.5f);
water.setShoreHardness(1.0f);
water.setRefractionConstant(0.2f);
water.setShininess(0.3f);
water.setSunScale(1.0f);
water.setColorExtinction(new Vector3f(10.0f, 20.0f, 30.0f));
fpp.addFilter(water);


@Julius as you can in the older Screens Skorpio made some Spec and Bump maps for his Water. That also looks really cool. But I just wanted to try out moving Waves. Yeah, but we really should give a crystal Skymap or something a try.
User avatar
Flipflop
 
Posts: 180
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Example of easy implementation of Skorpios Tileset

Postby Danimal » 26 Dec 2012, 12:16

Sorry i have been unable to find that skybox set, maybe asking OGA is worth a shot
User avatar
Danimal
OD Moderator
 
Posts: 909
Joined: 23 Nov 2010, 13:50

Re: Example of easy implementation of Skorpios Tileset

Postby Julius » 26 Dec 2012, 17:23

You could try this one:

Image
http://www.3delyvisions.com/sky19.zip

It comes from this set:
http://www.3delyvisions.com/skf1.htm

License CC-by according to that page; made with Bruce.
“You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete” - Buckminster Fuller
User avatar
Julius
Moderator
 
Posts: 1411
Joined: 06 Dec 2009, 14:02
Location: Kampala

Who is online

Users browsing this forum: No registered users and 1 guest