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.

DarkBASIC Professional Discussion / New DBO converter for X files

Author
Message
Vues3d on Kalimee
19
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 20th Sep 2005 15:13 Edited at: 15th Nov 2005 10:20
Hi there!
Since I have updated DBPro & experienced many DBO file problems, I've created a new DBO converter tool that will convert your .x files into .dbo files.

THE RULES:
Copy the program in the folder that contains the .x files & run it.
It will convert ALL the .x files into .dbo files.
Once the conversion terminated you'l find in the same directory the .x & .dbo files.

Hope this will help some of you as it helped me!


Imprvements & comments welcome.
When I'll have some more time, I'll try to create a user-friendly interface...



Here the link:
ONLY FOR THE DBP 5.8 & Higher!
http://www.vues3d.com/kalimee/X_DBO_converter.zip
(4.7Mb)
Updated: V. 1.02
Downloads: 523 (15.11.2005)

DISCLAIMER: Please, take care to have a back-up of your .x files in order to prevent data loss if program fails.
This shouldn't happen... but... we never know.

FXTC
19
Years of Service
User Offline
Joined: 3rd Jul 2004
Location: CzechRepublic
Posted: 20th Sep 2005 17:49
nice thanks

AMD 2,4 512MB RAM,2x200GB hdd,GforceFX5700GT128MB
Maleck
19
Years of Service
User Offline
Joined: 12th May 2004
Location: US
Posted: 22nd Sep 2005 00:34
What all features does it convert over? Animations, multitextures,etc?

I am glad someone created an updated version for 5.8 support.
Vues3d on Kalimee
19
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 22nd Sep 2005 10:14
This covers the multitexturing, lightmaps & so on.
Honestly I haven't tryied the animated Objects.
I'll have a try tonight to see if animated objects are converted correctly. But, theorically, it should work also for animated objects.
In the meantime, if someone have a try with animated models, thanx to report if all is OK or not.

CPU
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 23rd Sep 2005 16:04
Is there perhaps a possibility of source code??

CPU

[center]K-OS Battlefields
IS
///---///---///---UNDER CONSTRUCTION---\\\---\\\---\\\
[center]
Manic
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Completely off my face...
Posted: 24th Sep 2005 17:26
hmm, intresting! as far as i remember, the x file format doesn't support multitexturing natively, IE you can't build an x file that has a bump map built in (altho, using a dds you can add alpha mapping)... so is there some sort of facility to add a bump/normal map etc on the fly. you could achieve this by using a file naming convention that lets the program pick up any other textures that you might like to be added to the model.

releasing the source code to this would be well handy, with the full input of the community, it could become an exceedingly powerful tool.

well done on the program, its gonna benefit a lot of people, and is gonna make downloads much smaller (the dbo is one of the smallest but most comprehensive file formats i've seen... infact i think TGC should start licencing it out to get a bit more cash!)

Manic

PS... its a shame they screwed up the link to this on the newsletter.

I don't have a sig, live with it.
Vues3d on Kalimee
19
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 28th Sep 2005 12:30
Hi there...
I'll try to put the code in the next few weeks, but as it's integrated in the game I have to clean it a little in order to be clear & easy to read...

AtomR
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 21st Oct 2005 01:55 Edited at: 21st Oct 2005 01:56
Hmm doesn't work for me. It says no 3d objects found and the object are defnatelly in the project folder :s

What x-files does it support? the Old one or the new version that supports bones and mesh deformations etc?

Take care
AtomR
Aslyum
20
Years of Service
User Offline
Joined: 21st Jan 2004
Location:
Posted: 22nd Oct 2005 09:21
launch the converter from the same directory containing the files you want to convert and try changing the .X to .x It works for me when the extension is in lower case.

I still can't get it to display lightmaps yet

AsylumHunter
Aslyum
20
Years of Service
User Offline
Joined: 21st Jan 2004
Location:
Posted: 22nd Oct 2005 10:07
can someone help explain what settings or material settings I need to use for my exporter (i'm using panda with max 6) to properly export multiple uv's that will work with this convertor?

I see the seperate materials when I use either composite or multisub materials and export, but ONLY when these materials use maps in the diffuse channels, however, for the life of me I can't seem to get it to export mutli UV layers, even though I have set up the channels with seperate UV settings.

If the convertor can convert from x to dbo and preserve the multi uv's then maybe I'm using the wrong .x exporter

Any help would be great

cheers
AsylumHunter
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 22nd Oct 2005 15:13 Edited at: 22nd Oct 2005 15:14
Quote: "If the convertor can convert from x to dbo and preserve the multi uv's then maybe I'm using the wrong .x exporter"


Looks like the converter just uses the inbuild LOAD OBJECT and SAVE OBJECT commands to do the converting. Pretty much like this code.


Since it's using LOAD OBJECT to load the .x file anything the dbpro .x loader can't cope with will not end up in the .dbo file.
I'm 99% sure dbpro doesn't load multiple uv's in .x files as I think people often complain about it.

--
AtomR
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 23rd Oct 2005 14:16
No way!! Why would anybody need that? AND why would Rich mention it in the newsletter?

Take care
AtomR
Baggers
19
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 23rd Oct 2005 17:17
AtomR, hush down...wait till Veus gets back and explains. Maybe he's just saving everyone a little coding time (especially for the newbies) or maybe theres a little more to it than has met our eyes.
Jesus, its like listening to someone who just read on a website that the pope is made of cheese "Really thats insane!...why is he the head of a massive religious community ? why do people stand for it" Maybe your source is wrong ?!

the_winch: Not insulting your deductive skills of course..you could be completly right !

AtomR
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 24th Oct 2005 01:47
Don't u hush me LOL

Ok, the_winch can be right but I just can't help but find that kind of incredible. Even if it is true. Vues is not exactly a newbie around here so I don't see how he could find such a program useful.

Better yet, its wishfull thinking on my part that vues had made a converter from scratch so that he could teach me how he did it. A couple of months ago (when 5.8 came out) I was doing a program that converted .x files into .dbo files so that multi stages were setup correctly. I know the .dbo format quite well but I just couldn't organise the data properly so i just let the program sit on the backburner untill such a time when I can get back to it. So here's hoping Vues will be my lord and saviour LOL

Take care
AtomR
Vues3d on Kalimee
19
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 24th Oct 2005 13:39
... Hi there...
So, here some explanations... (even if I don't understand exactly why I've to give explanations on this...!!)

The DBO converter is a simply to use tool that converts .x files into DBo files.
This is the first draft of the tool that, for the moment, manage only simply x files to dbo files in order to have "lighter" models loading in the games.

This version use a simply Load object command & save object command, with some checks in order to see if the object is a valid one.
(there's no conversions for the bad ones.)
This was intended for the people (especially newbies that doesn't know how to manage this) that wants to earn time in coding.
there's no pretention in this first version... I just thought that there would be usefull for the ones that wont spend time coding it or find the way to do it.
when I was a newbie... I've been looking for a long time in a converter... so, I just created this one to help people finding it easely & use it without thinking about the code.
As it manage a large number of files... it can convert full folders.

As I work BEFORE on x files & then, once I'm OK with them, I convert them in DBO files. this was intended for my game & posted here in order to give the possibility to everyone to have it...
This saves around 1 hour of code...

Also, the next version, will mamange multi UV & I'm planning to integrate the animated models too.
As I've found a way to use multi texturing on a single file, I'm planning to create a second version with more model conversion such as 3ds.

Quote: "AtomR: No way!! Why would anybody need that? AND why would Rich mention it in the newsletter?
"

maybe you know how to do it... but many don't... & naturally this answer to your 2d question... it was in the newsletter because this is maybe usefull for other people than you.
Also... why shoudn't it be mentioned in the newsletter? In a past time I'd be very glad to find such program...
&... thanx bagger for the explanations that was exactly the reason why I've created it...

If you don't have a usage of this... you're not obliged to download it...
As you can see on the first post there has been, until today, 392 downloads. So, even if some of them would not use it... I guess that some will do & if even only one person have found it usefull, then he makes my day...

This forum is intended to HELP people & not FLAME them...

AtomR
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 24th Oct 2005 14:45
I apologize if I was in some way insulting. I realise some newbies may need this. I just think that the way it was advertised in the newsletter made it look like it did more then it actually does, for now.

"X to DBO Converter
Guido from vues3d.com has released his X to DBO conversion program. This works perfectly with DBPro 5.8, handles multi-texturing, lightmaps and even batch converts a whole folder full."

How do these files handle multi-texturing and lightmaps? I'm honestly asking the question not trying to be smart or anything. I want to know how to use this files with multi texturing.

Take care
AtomR
CTF Freak
18
Years of Service
User Offline
Joined: 27th Oct 2005
Location: In your base
Posted: 5th Nov 2005 04:45
call me a noob if you want but how do you make a .dbo without the coverter?
is there some command or dll for it?
CTF Freak
18
Years of Service
User Offline
Joined: 27th Oct 2005
Location: In your base
Posted: 5th Nov 2005 15:53
sorry for the double post but it didn't put this at the top of the list the first time
so what makes a .dbo?
AtomR
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 5th Nov 2005 16:03
For now the only ways to make a dbo are:

- Use a modeling package that exports to .dbo like Gile[s], Cartography shop etc.

- Make your objects as .x in a modeling package, load them in DBPro and use the save object command to save the object as a .dbo.

- Study the .dbo format and make your own converter I dare ya

Are there any other ways? Don't think so but feel free to correct me.

Take care
AtomR
CTF Freak
18
Years of Service
User Offline
Joined: 27th Oct 2005
Location: In your base
Posted: 6th Nov 2005 02:13 Edited at: 6th Nov 2005 02:20
Sounds like a good challenge I will work on that
I don't know much about file format but I think I can figure it out

edit:
how do you veiw the data?
if I open it in notepad it has stuff like:

is this how to do it or should I try to read it in darkbasic?
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 6th Nov 2005 05:43
its probably important enough for a sticky thread, unless somene else thinks of a better location for this post.

If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself 
Vues3d on Kalimee
19
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 6th Nov 2005 12:15
Hi...
First of all... sorry for the long late, but I guess I have some problems at work with the forum. I think we have a Proxy that, sometimes, makes some SQL errors & I cannot post on Forums...
Anyway...

Quote: "I apologize if I was in some way insulting. I realise some newbies may need this. I just think that the way it was advertised in the newsletter made it look like it did more then it actually does, for now. "

All is OK... I don't hate you!!

Quote: "
How do these files handle multi-texturing and lightmaps? I'm honestly asking the question not trying to be smart or anything. I want to know how to use this files with multi texturing.
"


This could be some "wording misunderstood"...
Handling of Lightmaps is only because the lightmap models created with Cshop are optimized & will load faster than a simple .x file.

Also, the "Multitexturing" is handled by Cshop & here the prog. just makes the conversion without having any conflict. In fact in Cshop, you can texture, for example, a cube with 6 different textures,but, naturally, you cannot texture one face with 2 (or more) textures...


PEH16: The .dbo file is a DBP native file, so, when you convert a 3ds or .x file into .dbo file, DBP will load & handle it faster... & sometimes, you can earn some usefull seconds of loading time.

To view the "Header" for the DBO files, you should download the "supplementary" files located in the 5.9 beta 3 upgrade thread.
If you open directly a .dbo file with notepad... hum.. you've seen the result...

I just would remember that this converter is only a "little" tool I've created for my game in order to convert ALL my .x files into the newest vertsion of .dbo files. & as I have my object files separated in each level folder, it could be fastidious to open each object, one by one, & save it in a .dbo format..

I think I will make soon an upgrade, but i'm waiting for the final upgrade of DBP..
I will probably add some other features... but still waiting on final release.

Cheers... & have a great week-end...

CTF Freak
18
Years of Service
User Offline
Joined: 27th Oct 2005
Location: In your base
Posted: 6th Nov 2005 15:17
Quote: "PEH16: The .dbo file is a DBP native file, so, when you convert a 3ds or .x file into .dbo file, DBP will load & handle it faster... & sometimes, you can earn some usefull seconds of loading time.
"

I knew that

Quote: "To view the "Header" for the DBO files, you should download the "supplementary" files located in the 5.9 beta 3 upgrade thread.
"

this is where it get confusing
Quote: "
I just would remember that this converter is only a "little" tool I've created for my game in order to convert ALL my .x files into the newest vertsion of .dbo files. & as I have my object files separated in each level folder, it could be fastidious to open each object, one by one, & save it in a .dbo format.."


do you just open a file and use like a save object command?
I thought they took that command out of the pro version.
AtomR
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 6th Nov 2005 15:45
@PEH16: AFAIK that is what this program does.
Checks the folder for .x files, loads them and them saves them as.dbo using the SAVE OBJECT command.

A couple of months ago I studied the .dbo format so I can tell you how to interpret it. I'm at work right now but as soon as I get home i'll post a small explanation on how to read it using the file commands.

Take care
AtomR
CTF Freak
18
Years of Service
User Offline
Joined: 27th Oct 2005
Location: In your base
Posted: 6th Nov 2005 19:12
I thought the save object command was taken out of pro?
or was was this made with classic?
AtomR
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 6th Nov 2005 20:05 Edited at: 6th Nov 2005 20:06
I'm back. PEH16, here is the file that has the dbo format specs for update 5.8. This is the only official version of the dbo format. I hear that the current version 5.9 has changed but for now the specs haven't been released so we are left with these.

The commands that are needed to read a dbo file are.
OPEN TO READ filenumber, filename$
READ LONG filenumber,variable ---- Reads a LONG WORD = 4bytes
READ WORD filenumber, variable ---- Reads a WORD = 2bytes
READ FLOAT filenumber, variable ---- Reads a FLOAT = 4bytes
READ BYTE filenumber, variable ---- Reads a Byte = 1byte
CLOSE FILE filenumber

NOTE: In the dbo format specs file a LONG WORD is refered as DWORD (double word) so when reading DWORDs you have to use the READ LONG command. And strings are refered to as Char*.
As far as I can remember everything else is the same as in DBP.

So, for example, the HEADER of the dbo file is declared like this


This means that the first 4 bytes of the dbo tell us the length of the string that follows it. The value of this DWORD is always 8. So the next 8 bytes contain a string. There is a command in DBP that is READ STRING and it would read the string correctly without needing to know how many bytes long the string was BUT this command would also read one extra byte and we can't have that because the extra byte it would read has information needed for the next dword. So instead we are going to read the 8 bytes with the READ BYTE command. One byte at a time. The next DWORD have the version of the dboformat on the file being read. For now its 1 because that is the only version released.
The other two DWORDs are reserved and have a value of 0.
So this is what a DBO Header would look like if it was a text file
8
MAGICDBO
1
0
0

Next is the code to read the header in DBP



I'll be back with explanations on how to understand the format soon.

Take care
AtomR

Attachments

Login to view attachments
AtomR
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 7th Nov 2005 00:52 Edited at: 7th Nov 2005 00:53
The dbo file format is a bit confusing when you look at it for the first time. And for the 1000th aswel LOL but u start to make sense of it.

Let me see if I can get around explaining this. After reading the header its time to read what TGC Developers call the frames. Everything in the DBO format is defined by frames with their unique identifying number.
For instance, when you read a value of 103 you know (because you read the specs that the data contained within that frame is the mesh data. When u read frame 128 the data within the mesh is the texture data. What every frame ID means is explained in detail in the documentation. Another thing that is important to understand is that these frames have a hierarchy to them. Starting with the ROOT FRAME with the ID of 1. The root frame is ALWAYS the first frame that exists after the header and all other frames are nested in it. The other frames are called sub frames. Another important frame ID is the 0 (ZERO). This frame marks the end of the current frame that is being read.

Here is a very simple example of what i just said using very simple and imaginary frame names and IDs.

1
___101
___OBJECT NAME
___102
___OBJECT
___103
___TEXTURE
______110
______TEXTURE NAME
______111
______TEXTURE FILTER
______0
___0
0

See how every frame end with a zero and how they are nested inside each other. (110)TEXTURE NAME and (111)TEXTURE FILTER are sub-frames nested inside the (103)TEXTURE sub-frame that is nested inside (1)ROOT FRAME allong with sub-frames (101)OBJECT NAME and (111)OBJECT COLOR.

Every frame/sub-frame is composed of a dword with the frame ID, another dword containing the size in bytes of the data block and the data block itself.

Example:

101
10
6
sphere

In this case you have sub-frame 101. The size of the data block is 10 bytes and the data block itself is the 6sphere. Acording to the specs in sub-frame 101 you have a dword for the size of a string and the string. dword=4bytes and the string has 6 bytes. 4+6=10 q.e.d.

A harder example:

102
64
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

Sub-frame 102 contains the translation matrix of the object. So in this case, frame 102 has 64bytes. That's a matrix of 4*4dwords=4*4*4=64 q.e.d.


A couple of months ago i did a program that parses a dbo file from binary to text so that I could understand the format faster. Here is a dbo file parsed into text for those of u interested in knowing the format. All line started with # were added by me to sorta comment the data so I knew what everything was. Obviously those lines aren't in the original dbo files. Also added were the "|" symbols to help separate and tidy up the data.

I hope some of you got anything from these rambling and i'll leave u to ponder or ignore this completely.

Take care
AtomR

Attachments

Login to view attachments
Sleek
18
Years of Service
User Offline
Joined: 10th Nov 2005
Location: Ohio
Posted: 17th Nov 2005 20:26
This is great, thank you. I hope you continue to update it.
x1b
19
Years of Service
User Offline
Joined: 19th Sep 2004
Location:
Posted: 25th Nov 2005 16:50
converted a few of my model buildings. now missing chunks of the model. Like goudging holes in the walls

- Do it, Do it Right, Do it right now..
x1bwork
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 28th Nov 2005 16:45
Still no reply huh? Cant use this app on anything above 20kb.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 28th Nov 2005 23:14
It's because you are using 5.9 and this was based on the 5.8 format probably. I'll find you a work around when I get home.

x1b
19
Years of Service
User Offline
Joined: 19th Sep 2004
Location:
Posted: 29th Nov 2005 02:30
Ahhhh. cool. Any plans for an remake of this,vues?

- Do it, Do it Right, Do it right now..
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 29th Nov 2005 05:58 Edited at: 29th Nov 2005 11:28
I think the_winch has posted a code that will work for you x1b. I cannot test this as I am at work, but it looks like it should work at first glance.



[edit2] No this code also has the lost brushes. Seems there is a bug with save object. It is possible that it wasn't updated when the format was.

Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 5th Dec 2005 00:25
lmao - with every upgrade we must suffer some downgrades

Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 5th Dec 2005 02:11
I think this may be linked to a bug I posted. CSHOP exports models with more than 1 texture per limb, DBP loads them ok, but the texturename and image index feedback commands don't work on them. This may be causing the missing faces when using the save object command.

The admiral
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location:
Posted: 8th Dec 2005 08:44
Is this going to be upgraded for 5.9??

The admiral
Vues3d on Kalimee
19
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 11th Dec 2005 13:33
Have been away for a while... & haven't now - for the moment - the possibility to connect every day on Internet.

I upgraded with the last beta & have to say that is a quite good one. Except for the new dbo format, all seems working really better.

I'm now looking closely to the new commands & the objects commands to upgrade the converter.
Noticed now that there are some problems with the loading of 3ds objects.

x1b
19
Years of Service
User Offline
Joined: 19th Sep 2004
Location:
Posted: 29th Dec 2005 12:37
still doesnt work with large scale models. meshes missing all over.

- Do it, Do it Right, Do it right now..

Login to post a reply

Server time is: 2024-04-19 04:27:45
Your offset time is: 2024-04-19 04:27:45