How are bodfiles structured?

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
User avatar
Nedimar
Posts: 1077
Joined: Sun, 11. Oct 09, 20:15
x4

How are bodfiles structured?

Post by Nedimar » Fri, 7. May 21, 21:12

I've been trying to teach myself some Python and I decided to try and write a bod to obj (and back) converter.
One issue I ran into is that I can't figure out how the faces are defined (well, everything except for geometry).

Take this sample from terran_drone.bod:

Code: Select all

0; 0; 2; 1; -25; 2; 0.615067; 0.063126; 0.519440; 0.142517; 0.614639; 0.123596; /! N: { 0.057968; -0.994690; -0.085007; 0.481567; -0.875534; 0.038818; 0.058350; -0.995163; -0.078827; } !/ // 0
0;                           # id of the material that is used for the face
0; 2; 1;                     # id of the vertices forming the face
So far, so good. I can export the geometry of the main model and its LODs without a problem. However, textures are another story.
These were my inital assumptions about the remaining code:

Code: Select all

-25;                           # no idea
 2;                            # no idea either
 0.615067; 0.063126; 0.519440; # face normals
 0.142517; 0.614639; 0.123596; # uvw texture coordinates
 /! N: { 0.057968; -0.994690; -0.085007; 0.481567; -0.875534; 0.038818; 0.058350; -0.995163; -0.078827; } !/ // 0 # stuff related to smoothing, not present in older bod files
However, I tried several variations on importing these and nothing I try seems to work. I always end up with a garbled mess of a texture.
Any ideas?

User avatar
Zeron-mk7
Posts: 571
Joined: Sat, 23. Feb 08, 12:38
x3

Re: How are bodfiles structured?

Post by Zeron-mk7 » Sun, 9. May 21, 12:57

As far I remember, only for X2 there are "X2_GFX_Modding.pdf" where are describe some BOD file structure, It can found in X²: The Threat Modder Kit (Rev. 1.4)
Into the Russian game forum, author "DIMOSUS.X", few years ago write "BOD to OBJ" 3d mesh converter tool, here is image, where you found link to forum, where can download it
Image

User avatar
Nedimar
Posts: 1077
Joined: Sun, 11. Oct 09, 20:15
x4

Re: How are bodfiles structured?

Post by Nedimar » Sun, 9. May 21, 20:26

Thank you, that helps :)

EDIT: I now also found doubleshadows source code. Time to reverse engineer it seems.

Purls
Posts: 7
Joined: Sat, 4. Jul 20, 07:13
x4

Re: How are bodfiles structured?

Post by Purls » Sat, 7. Aug 21, 08:53

Nedimar wrote:
Sun, 9. May 21, 20:26
Thank you, that helps :)

EDIT: I now also found doubleshadows source code. Time to reverse engineer it seems.
Hello! Any luck in reverse engineering it? Plus where did you find the source code for it?

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 24950
Joined: Sun, 2. Apr 06, 16:38
x4

Re: How are bodfiles structured?

Post by X2-Illuminatus » Sun, 8. Aug 21, 17:04

The source code of doubleshadow's Bod Compiler is available from doubleshadow's website here.
Nun verfügbar! X3: Farnham's Legacy - Ein neues Kapitel für einen alten Favoriten

Die komplette X-Roman-Reihe jetzt als Kindle E-Books! (Farnhams Legende, Nopileos, X3: Yoshiko, X3: Hüter der Tore, X3: Wächter der Erde)

Neuauflage der fünf X-Romane als Taschenbuch

The official X-novels Farnham's Legend, Nopileos, X3: Yoshiko as Kindle e-books!

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”