Page 3 of 4

Re: Another Dungeon Keeper Project

PostPosted: 03 Feb 2013, 15:22
by Flipflop
Sorry, my bad. But the Tilesets are also in the OpenDungeons-Sources. And on OGA. So...thats why I was confused. Sorry Paul :)

Uploading the Code right now to GoogleCode. Clean up the Sources and hope I dont forget to organize all the Credits correctly. First Time I made an Open Source Project. Licencing ist GPLv3, good Choice?

Re: Another Dungeon Keeper Project

PostPosted: 03 Feb 2013, 18:20
by Flipflop
The Code and Sources/Assets can be Found now under the Google-Code Project Page: https://code.google.com/p/jadex-agentkeeper/

Re: Another Dungeon Keeper Project

PostPosted: 03 Feb 2013, 22:43
by Skorpio
paul424 {l Wrote}:Could someone explain , how I can extract from that Skorpio's New Tile's Set ?
The new tiles are in our repository. They just need to be renamed if you want to use Flipflop's method. I could do that now if you want.

Re: Another Dungeon Keeper Project

PostPosted: 04 Feb 2013, 00:00
by paul424
Yes , please very much :) .

Re: Another Dungeon Keeper Project

PostPosted: 04 Feb 2013, 22:41
by Skorpio
The renamed set is in the repository now ("OD_Tilesets_binary"). The exported tiles are here. I haven't double checked them so there could be errors. ;) BTW, the current tiles in OD are scaled incorrectly and are 10 times smaller than they should be. This needs to be changed in the code. Also, the new tiles have a size of 2.5 * 2.5 Blender units, so the OD grid size has to be changed.

Re: Another Dungeon Keeper Project

PostPosted: 19 Feb 2013, 20:42
by paul424
I have been sick and I haven't had my head for coding . After examining TileBinarySet I saw that it does not resembles the neightbourhood coding showed by FliFlop, that is for example each postfix should be diffrent modulo rotation by 2 bits to the right. Tomorrow I will have acess to Windows --> OgreMeshy so I could see what;s idea behind your coding ...
Claimed_00100000.mesh
Claimed_00001000.mesh

As I understand those two are the same , right ?

Re: Another Dungeon Keeper Project

PostPosted: 19 Feb 2013, 23:28
by Flipflop
If this question was in my Direction:

Yes, the two Tiles you mentioned are identical. Just with different Rotation and both with only one Neighbour, just at a different position.

You can of course use less tiles and calculate the rotation in code but in this case (and mainly because Skorpio already prepared them in all possible rotations) it makes the code much easier if you just simply set the binarys by only looking at the neighbours.

If you look inside my code: "^" is in Java the XOR operator. Java Notes: Bitwise Operators

So this Method (from /jadex/agentkeeper/util/Neighborhood.java):
{l Code}: {l Select All Code}
      // Now we adress the concrete Tiles:
      for(Neighborcase ncase : neighborcases)
      {
         ret = ret ^ ncase.getValue();
      }

Just build the binary-value with the different "neighborcases" I calculated somewhere else.

And then I parse it to an binary-string (to concat it with the prefix to load the concrete tile)
and calculate the "alternatives" for the ones who have 2 or 4 alternatives.
{l Code}: {l Select All Code}
      
// System.out.println("ret als byte " + Integer.toBinaryString(ret));
String stringret = Integer.toBinaryString(ret);   
return parseTilesets(stringret, alternatives);


The values for each neighborcase-position are (read it as Vector(x,y), VALUE) from my Neighborcass-Enum (/jadex/agentkeeper/util/Neighborcase.java):
( implizit are 1 = 00000001, 2 = 00000010, ... ,128 = 10000000)
{l Code}: {l Select All Code}
   CASE1(new Vector2Int(-1, -1), 1),
   CASE2(new Vector2Int(0, -1), 2),
   CASE3(new Vector2Int(1, -1), 4 ),
   CASE4(new Vector2Int(1, 0), 8 ),
   CASE5(new Vector2Int(1, 1), 16),
   CASE6(new Vector2Int(0, 1), 32),
   CASE7(new Vector2Int(-1, 1), 64),
   CASE8(new Vector2Int(-1, 0), 128),


Hope that helps you!

cheers,

Flipflop

Re: Another Dungeon Keeper Project

PostPosted: 20 Feb 2013, 09:59
by paul424
OK , many thanks for the quick ansewer FlipFlop, the actual question was to Scorpio tough , I thought that the Tile enumeration is somehow botched ;) .
When several tiles are possible ( i.e. they postfixes are equal modulo rot ) , can you pick any ? Or as with dirt they won't create a continuous "SEAM " between the two ?

Re: Another Dungeon Keeper Project

PostPosted: 20 Feb 2013, 11:00
by Flipflop
paul424 {l Wrote}:[...]
When several tiles are possible ( i.e. they postfixes are equal modulo rot ) , can you pick any ? Or as with dirt they won't create a continuous "SEAM " between the two ?


Hm, thats a good question. Never tried it, just focused on keep the algorithm as easy as possible with always only one possible tile (including the alternative-tiles for the straightforward tiles). Maybe Skorpio knows that, or you just give it a try.

Re: Another Dungeon Keeper Project

PostPosted: 20 Feb 2013, 18:07
by Skorpio
I'm afraid I didn't understand the questions correctly. Do you have a problem with the numbering? I used Flipflops naming scheme, but there could be mistakes.

Regarding seams, if you just rotate a dirt tile, then the textures will be rotated with it, so you get seams. That's why I created multiple versions of the same tiles just with rotated UVs.
Is it maybe possible to use blended box mapping in OGRE? That could be a better alternative.

BTW, if you want to place a claimed beside a dirt wall, you have to put a special mesh between them, otherwise there would be a gap. I called these meshes "Connect" and you can find them in the tile set source file. I haven't exported them yet, because I'm not sure how I should number them in binary. Here's a screenshot:
Wall_connection.jpg

Re: Another Dungeon Keeper Project

PostPosted: 20 Feb 2013, 20:47
by paul424
AFter further examination I noticed that you don't mind the diagonal Neightbour Tile if it does not have common neightbours with our tile -- vertical or horizontal .... That's why there are none infix 01 in tile name when looking it modulo 2.


I wrote some testing program first , and was surprised that so many binary suffix crated from 1,2,3 .... 255 does not have any representation in NST* , cheers ! :D



*New Scorpio Tileset.

Re: Another Dungeon Keeper Project

PostPosted: 20 Feb 2013, 21:12
by Danimal
So new walls soon? Thats good news!!

Re: Another Dungeon Keeper Project

PostPosted: 20 Feb 2013, 23:38
by Skorpio
paul424 {l Wrote}:AFter further examination I noticed that you don't mind the diagonal Neightbour Tile if it does not have common neightbours with our tile -- vertical or horizontal .... That's why there are none infix 01 in tile name when looking it modulo 2.

Do you mean the special case where two corner tiles are placed diagonally besides each other (for example Dirt_11100000 and Dirt_00001110)?
I wasn't sure what to do in this case, but I think you could just use copies of these models and rename them to Dirt_11100100 and Dirt_01001110.

Actually I think it would be better to find a different solution for this diagonal corner case, because there will be a big gap between the corners that looks like the creatures could walk through it. Maybe the tiles could be arranged like in this screenshot (the 4 tiles at the right side), but then the 2 corner tiles will occupy empty fields.
Wall_corners.jpg

Re: Another Dungeon Keeper Project

PostPosted: 21 Feb 2013, 14:05
by paul424
Let's say I implemented , first working iteration of NST. But it lacks Lava , Gold and Rock tiles , can you export them as well , Scorpio ?

Re: Another Dungeon Keeper Project

PostPosted: 21 Feb 2013, 15:38
by Skorpio
Can't you just switch the textures? I think that's what Flipflop does in AgentKeeper. The tiles are identical only the textures are different.

Re: Another Dungeon Keeper Project

PostPosted: 21 Feb 2013, 22:54
by paul424
Ehh I would come out as a fool , but for the OD sake every sacriface is possible ;) .
I cannot find the proper textures ( assuming there are new one , either at your page of opengameart nor at svn repo ) .... Maybe we could discuss some issues by irc.freenode.org / #opendungeons ?

Re: Another Dungeon Keeper Project

PostPosted: 23 Feb 2013, 00:15
by Skorpio
The textures are in the this folder. There are some scripts, but I wasn't sure what to do about the lava and water, because they are animated and the water is transparent, so they don't have new scripts. I don't know how to animate the materials in the new format that Oln has introduced.

The old format looked like that:
{l Code}: {l Select All Code}
material Lava
{
   receive_shadows on
   technique
   {
      pass
      {
         ambient 0.0 0.0 0.0 1.000000
         diffuse 0.8 0.8 0.8 1.000000
         specular 0.0 0.0 0.0 1.000000 0.250000
         emissive 0.99 0.99 0.99 1.000000
         texture_unit
         {
            texture Lava.png
            wave_xform scroll_x sine 0.1 0.2 0.0 0.1
            wave_xform scroll_y sine 0.01 0.22 0.0 0.18
            scroll_anim 0.1 0.2
            scale_anim 0.7 0.9
            tex_address_mode wrap
            filtering trilinear
         }
      }
   }
}


And this is the new format for normal mapped models (I have no idea how to animate this material and how transparency works or if I can add more maps like gloss or emission maps):

{l Code}: {l Select All Code}
import base_material from "general.material"
material Lava : base_material
{
    set_texture_alias diffuseMap Lava.png
    set_texture_alias specMap Lava_spec.png
    set_texture_alias normalMap Lava_nor.png
}


We can meet tomorrow (Saturday) on irc. I'll try to be online around 16:00 GMT.

Re: Another Dungeon Keeper Project

PostPosted: 24 Feb 2013, 19:52
by paul424
Ok, on a hotspot feedback , at least those tiles are lacking to be in Model directory :


Dirt_10111000.mesh
Dirt_00111010.mesh
Dirt_00111011.mesh
Dirt_00101011.mesh
Dirt_10110011.mesh
Dirt_00101111.mesh
Dirt_00001011.mesh
Dirt_10111001.mesh
Dirt_10111101.mesh

Surely I can write code which would roll around the postfixes .... but from what I understood you said I won't need do that , Scorpio ?

Re: Another Dungeon Keeper Project

PostPosted: 24 Feb 2013, 20:54
by Skorpio
I'll check that later, my head hurts too much right now.

Re: Another Dungeon Keeper Project

PostPosted: 26 Feb 2013, 10:17
by paul424
Huh someone should create two branches at SVN one for old and one for new Tile set ...

Re: Another Dungeon Keeper Project

PostPosted: 26 Feb 2013, 23:40
by Skorpio
I've checked the list and most of these tiles are just duplicates. The first two were numbered incorrectly, though.

Dirt_10111000.mesh
Dirt_00111010.mesh
Dirt_00111011 = Dirt_00111010
Dirt_00101011 = Dirt_00101010
Dirt_10110011 = Dirt_10100011
Dirt_00101111 = Dirt_00101110
Dirt_00001011 = Dirt_00001010
Dirt_10111001 = Dirt_10111000
Dirt_10111101 = Dirt_10111000

paul424 {l Wrote}:Huh someone should create two branches at SVN one for old and one for new Tile set ...
Go ahead and do it. ;)

Re: Another Dungeon Keeper Project

PostPosted: 27 Feb 2013, 17:03
by paul424
>>The first two were numbered incorrectly, though. <<


By me , by you , or by my program ?

EDIT: ahh something new in the SVN repo , ok .

Re: Another Dungeon Keeper Project

PostPosted: 03 Mar 2013, 17:47
by paul424
Something wrong with those additional tiles in NST , after trying to use I get :

{l Code}: {l Select All Code}

Mesh: Loading Dirt_10111000.mesh.
An internal Ogre3D error ocurred: OGRE EXCEPTION(2:InvalidParametersException): Header chunk didn't match either endian: Corrupted stream? in Serializer::determineEndianness at /home/abuild/rpmbuild/BUILD/ogre_src_v1-8-1/OgreMain/src/OgreSerializer.cpp (line 89)
Internal Ogre3D exception: OGRE EXCEPTION(2:InvalidParametersException): Header chunk didn't match either endian: Corrupted stream? in Serializer::determineEndianness at /home/abuild/rpmbuild/BUILD/ogre_src_v1-8-1/OgreMain/src/OgreSerializer.cpp (line 89)
*** ERROR: Internal Ogre3D exception: OGRE EXCEPTION(2:InvalidParametersException): Header chunk didn't match either endian: Corrupted stream? in Serializer::determineEndianness at /home/abuild/rpmbuild/BUILD/ogre_src_v1-8-1/OgreMain/src/Og



Re: Another Dungeon Keeper Project

PostPosted: 03 Mar 2013, 21:21
by Skorpio
Does only this specific mesh cause the error or all meshes?

Re: Another Dungeon Keeper Project

PostPosted: 03 Mar 2013, 21:32
by paul424
So far :

tiles from 3 weeks ago do work ;

Dirt_10111000.mesh cause that , I don't feel like find any hackish way of testing all those tiles ... Do I have to ... Can you just use old exporting method on those new NST ?