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 / exporting a level made from primitives

Author
Message
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 1st Jan 2009 14:14
I was looking around the forums about this but im still a bit confused and need some help.

I am making a 3d level editor for my game, it used to be tile based using many different primitives with each tile having its own texture. I would then reload this tile structure in the actual game and that would be the level.

I was wondering if there was a way to export all the diffrent primitives as one big game level object.

1. Is using meshes the way to do this? e.g. dbSaveMesh? Do I need
to group objects together as limbs and then make a mesh?

2. How to I keep the texture data for each object when I load the
level in the game?

3. Is this better (performance wise) than a 3D tile system? Since
In the tile system I am running box collision for all the hundreds of tiles, if it was one big object I would just use
polygon colision on the one object

thanks for any help.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 1st Jan 2009 23:02
I think objects can be converted to meshes, limbs can be also... Not enough information has been given to suggest a good method of saving it all bro.

#2 - Are you loading the textures separate or are they coming from loaded objects? You said primitives so I assume you are making prim's and then loading and applying textures. You want to save that stuff together? There are a number of ways you could do it... A simple text file, or xml if you prefer, could have something like:

[SomeObjectName]
box 10 5 20 ./media/textures/wood.bmp

#3 - collision like sparky's just takes longer to set up - no matter how you do it - there is work involved. You're smart in thinking about it.. I don't know the definitive answer .. but I'd assume that it depends how you employ the collision detection - and if you use native versus sparky's or something.

RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 2nd Jan 2009 11:33
Thank you for the reply...

I have found that I can make a primitive in code and then add another primitive as a limb and then save it as a mesh, this is great since it saves the complete object it as one X file. Unfortuanitly the Mesh does not save texture data.

Thanks for the suggestion of using text files.
My level editor uses a tile class and then the game has a similar class that I feed tile data to using the txt file. It all works great but if I was able to load the whole tile structure as one big textured object, it would be much better. I am hoping to make a seamless game world that would load these level objects around the player depending on his postion in the game world.

I guess using text files are better, since you can also store level data such as NPCs, effects, enemies and items.

The thing that sparked this question was that I saw a lot of people making World editors in the Program Announcements board. They some how save the worlds in dbo format.

Thanks again
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd Jan 2009 14:29
You're Welcome. DBO's are really easy to save... and having a text file with the NPC info etc etc and the filename for the DBO's (or mesh + texture file names) are all possibilities.

Making a DBO I am pretty sure is as easy as save object "myobject.dbo",MyObjectID and I THINK the texture will go with it.

The TROUBLE IS... (depending on your point of view) is if you load objects multiple times - the textures might come in separate each time chowing ram unneccessarily. Where instancing a loaded DBO object wont, nor will loading a mesh, and loading a texture separate and applying said to text to as many mesh as you like.

Note instanced objects behave slightly diff3erent than cloned (which are copies made in mem - clones save time loading from disk again - but are more efficient than loading two of the same object from disk)

sounds like you have some good ideas brewing...

--Jason

RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 2nd Jan 2009 16:22
Thanks, that is very helpful, I could not find dbSaveObject in the manuel. When you mentioned it I then found it in the Basic3D header file. Thats exactly what I was looking for.

I am almost finshed with a 2d game that would like to upload. So now im starting to make the engine for a future 3D game project (if I ever get the time) including level editor, GUI,basic AI and path finding for NPCs, Effects and weapon system and also a world editor using a grid to build a seamless game world from map files. But other than that I dont have an actual game idea, but with an engine like that I could make any kind of action/fps/rpg game. Its amazing how endless the posibilities are with DGDK and there is alwas a better way to use code more dynamicly. Thanks
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd Jan 2009 16:27
No Problem - I truly enjoy when I can help a budding programmer/game developer get a leg up and moving forward... I enjoy helping those that have been around a long time too

The possibilities are pretty endless - and the only "warning" I have is there is alot of non-stop research that though plentiful and seemingly endless - is always good because the more you know - typically the "smarter" you system designs are.

By the way there is a source code release of FPSC - I'm not sure if its fully recompilable - I just want to make sure you know that from DarkGDK definately, DBPro likely - you can make levels in FPSC than make a program that can use those saved levels - e.g. a quick level editor/object placement system in a snap.

Note I also know the value - and at least personal reward of making your own from scratch - have a blast.

--Jason

Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 3rd Jan 2009 23:23
http://forum.thegamecreators.com/?m=forum_view&t=142143&b=22
KaosScript is the answer. KaosScript was made for saving levels.

Login to post a reply

Server time is: 2024-09-30 15:32:15
Your offset time is: 2024-09-30 15:32:15