Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / 3d Tileset possibility?

Author
Message
FlexiCat
14
Years of Service
User Offline
Joined: 15th Jun 2010
Location:
Posted: 4th Jul 2011 20:43
Heyo forum,

I am working on a game that is graphically similar to diablo and a few of its new incarnations but I have a question as to how to work some of the graphics in DarkGDK.

I have a system all set up to make maps and I am currently (just to test it atm) rendering them as 2d tilesets like any standard 2d game would do however I want to use a lot more of the powers of DarkGDK and do the game in 3d however I have no clue how one would make a "3d Tileset" and by this I mean I want to have a set of 3d objects all a standard x/y/z size that I can snap together in a 3d environment.

The reason it would have to be a tileset and not have a complete map file is that much of the game if not all will be procedurally generated and thus it makes a map tile by tile.

So how would one make/contain these tiles best and how would i implement them so as to make many recurring 3d "tiles" appear as a single seamless map at runtime?

I swear to the programmers bible that I shall not harm the FPS.
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 4th Jul 2011 21:41
This is certainly possible, but the way you achieve it depends on what type of tiles you want.
I can imagine two possible types:

A) Plane objects with different textures
Pretty simple: Just create plane objects with the same size and position them in a grid. Then apply textures. You could also use a tileset image from your 2D artwork and place it on the plane tiles by shifting the tileset around.

B) Mesh objects (models)
Not too difficult either. Just make sure each of these tile objects (with as detailed geometry as you want) is the same size in X and Z directions. Maybe create a base tile first (in your modeller program) and create new tiles from this. The same size of the tiles makes it possible for you to align them on a grid. If you really wanted you could also not care about the size when modelling at all, and resize the tile objects to the desired grid size after loading.

FlexiCat
14
Years of Service
User Offline
Joined: 15th Jun 2010
Location:
Posted: 4th Jul 2011 22:11 Edited at: 4th Jul 2011 22:12
It would defiantly be method B as I want the levels to look like a full 3d game as if it was made like a fps level (I don't mean my game will be first person but rather that the entire level will have full geometric detail not just planes that are flat that the player stands on) but to be clear with this you are saying I can "spawn" say 3 models in the game and then just what "move" them directly beside each other and it would just work?

sorry but I have NO experience with 3d in DarkGDK lol.

I swear to the programmers bible that I shall not harm the FPS.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 6th Jul 2011 08:21
Yes, it's possible. You can create (or load from disk) one base model of each tile, then use dbInstanceObject to multiply them as needed, and dbPositionObject to move them to the correct location.

You can also try dbCloneObject for multiplying, but I suggest instancing to save memory. Instancing means that the copied object will take most of its data from the master object and it won't copy everything for itself, so it's good for static tiles that look alike and have no individual behaviour (like animation).
FlexiCat
14
Years of Service
User Offline
Joined: 15th Jun 2010
Location:
Posted: 6th Jul 2011 11:06
thanks mate!

I swear to the programmers bible that I shall not harm the FPS.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 6th Jul 2011 15:11
Instancing an object will mean the texture will have to be the same. If that's what you want, then that's a good way to go. If you want different textures, then you need to clone. I suggest a hybrid approach. When you load the data for your level, check to see if there is a tile that is the same mesh and the same texture. If it is, then instnce. If it's not, then load/clone and texture.

The fastest code is the code never written.

Login to post a reply

Server time is: 2024-11-19 09:40:31
Your offset time is: 2024-11-19 09:40:31