Another Dungeon Keeper Project

Re: Another Dungeon Keeper Project

Postby Flipflop » 03 Feb 2013, 15:22

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?
User avatar
Flipflop
 
Posts: 181
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Another Dungeon Keeper Project

Postby Flipflop » 03 Feb 2013, 18:20

The Code and Sources/Assets can be Found now under the Google-Code Project Page: https://code.google.com/p/jadex-agentkeeper/
User avatar
Flipflop
 
Posts: 181
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Another Dungeon Keeper Project

Postby Skorpio » 03 Feb 2013, 22:43

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.
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Another Dungeon Keeper Project

Postby paul424 » 04 Feb 2013, 00:00

Yes , please very much :) .
User avatar
paul424
OD Moderator
 
Posts: 644
Joined: 24 Jan 2012, 13:54

Re: Another Dungeon Keeper Project

Postby Skorpio » 04 Feb 2013, 22:41

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.
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Another Dungeon Keeper Project

Postby paul424 » 19 Feb 2013, 20:42

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 ?
User avatar
paul424
OD Moderator
 
Posts: 644
Joined: 24 Jan 2012, 13:54

Re: Another Dungeon Keeper Project

Postby Flipflop » 19 Feb 2013, 23:28

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
User avatar
Flipflop
 
Posts: 181
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Another Dungeon Keeper Project

Postby paul424 » 20 Feb 2013, 09:59

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 ?
User avatar
paul424
OD Moderator
 
Posts: 644
Joined: 24 Jan 2012, 13:54

Re: Another Dungeon Keeper Project

Postby Flipflop » 20 Feb 2013, 11:00

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.
User avatar
Flipflop
 
Posts: 181
Joined: 19 Dec 2012, 13:31
Location: Hamburg, Germany

Re: Another Dungeon Keeper Project

Postby Skorpio » 20 Feb 2013, 18:07

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
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Another Dungeon Keeper Project

Postby paul424 » 20 Feb 2013, 20:47

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.
User avatar
paul424
OD Moderator
 
Posts: 644
Joined: 24 Jan 2012, 13:54

Re: Another Dungeon Keeper Project

Postby Danimal » 20 Feb 2013, 21:12

So new walls soon? Thats good news!!
User avatar
Danimal
OD Moderator
 
Posts: 1327
Joined: 23 Nov 2010, 13:50

Re: Another Dungeon Keeper Project

Postby Skorpio » 20 Feb 2013, 23:38

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
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Another Dungeon Keeper Project

Postby paul424 » 21 Feb 2013, 14:05

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 ?
User avatar
paul424
OD Moderator
 
Posts: 644
Joined: 24 Jan 2012, 13:54

Re: Another Dungeon Keeper Project

Postby Skorpio » 21 Feb 2013, 15:38

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.
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Another Dungeon Keeper Project

Postby paul424 » 21 Feb 2013, 22:54

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 ?
User avatar
paul424
OD Moderator
 
Posts: 644
Joined: 24 Jan 2012, 13:54

Re: Another Dungeon Keeper Project

Postby Skorpio » 23 Feb 2013, 00:15

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.
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Another Dungeon Keeper Project

Postby paul424 » 24 Feb 2013, 19:52

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 ?
User avatar
paul424
OD Moderator
 
Posts: 644
Joined: 24 Jan 2012, 13:54

Re: Another Dungeon Keeper Project

Postby Skorpio » 24 Feb 2013, 20:54

I'll check that later, my head hurts too much right now.
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Another Dungeon Keeper Project

Postby paul424 » 26 Feb 2013, 10:17

Huh someone should create two branches at SVN one for old and one for new Tile set ...
User avatar
paul424
OD Moderator
 
Posts: 644
Joined: 24 Jan 2012, 13:54

Re: Another Dungeon Keeper Project

Postby Skorpio » 26 Feb 2013, 23:40

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. ;)
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Another Dungeon Keeper Project

Postby paul424 » 27 Feb 2013, 17:03

>>The first two were numbered incorrectly, though. <<


By me , by you , or by my program ?

EDIT: ahh something new in the SVN repo , ok .
User avatar
paul424
OD Moderator
 
Posts: 644
Joined: 24 Jan 2012, 13:54

Re: Another Dungeon Keeper Project

Postby paul424 » 03 Mar 2013, 17:47

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


User avatar
paul424
OD Moderator
 
Posts: 644
Joined: 24 Jan 2012, 13:54

Re: Another Dungeon Keeper Project

Postby Skorpio » 03 Mar 2013, 21:21

Does only this specific mesh cause the error or all meshes?
User avatar
Skorpio
OD Moderator
 
Posts: 775
Joined: 05 Dec 2009, 18:28

Re: Another Dungeon Keeper Project

Postby paul424 » 03 Mar 2013, 21:32

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 ?
User avatar
paul424
OD Moderator
 
Posts: 644
Joined: 24 Jan 2012, 13:54

Who is online

Users browsing this forum: No registered users and 1 guest