News:

Zatikon is back and free to play! https://www.chroniclogic.com/zatikon.htm

Main Menu

Help on custom objects

Started by Jonathan_NL, September 10, 2004, 08:45:19 PM

Previous topic - Next topic

Jonathan_NL

I want to try to create custom objects (vehicles and props). The files are binary, they're full of floats, and I can find some logic in track.pfo, but I don't really get anywhere.

If I figure out something in the meantime, I'll post it here.
I rarely check this forum anymore. Feel free to send me a PM if you want my attention.

Jonathan_NL

Okay... the first int is the number of vertices-1. The following floats are the vertices itself in meters. For track.pfo, on the bridge positive (assuming you're in front of it) is (right, up, away from you), but (left, up, closer to you) on the ground, and they're not visible at all in shadows and reflections (I think that's intentionally).
I rarely check this forum anymore. Feel free to send me a PM if you want my attention.

Jonathan_NL

Haven't been busy with it for a while... but this is pfo (all LSB first):
Code Sample
int number_locationsinspace;
float[number_locationsinspace][3];
int number_pointsinspace;
int pointsinspace[number_pointsinspace][3];
float texturelocations[number_pointsinspace][3][2];

Edit: made a few corrections... but below everything was OK.

So here is track.pfo decoded to something readable by human: http://www.pontifex2.com/iB_html/non-cgi/emoticons/smile.gif" border="0" valign="absmiddle" alt=':)'>
Code Sample
4 // locations in space
-1.75 0.0  2.5 // 0
1.75 0.0  2.5 // 1
1.75 0.0 -2.5 // 2
-1.75 0.0 -2.5 // 3

2 // triangles
1 0 3 // 1.75 0.0 2.5  -1.75 0.0  2.5  -1.75 0.0 -2.5
1 3 2 // 1.75 0.0 2.5  -1.75 0.0 -2.5   1.75 0.0 -2.5

// texture locations for each triangle
1.0 1.0  0.0 1.0  0.0 0.0
1.0 1.0  0.0 0.0  1.0 0.0

// final triangles: x y z u v for each point... you can't easily get smooth shading with this data
// 1.75 0.0 2.5 1.0 1.0  -1.75 0.0  2.5 0.0 1.0  -1.75 0.0 -2.5 0.0 0.0
// 1.75 0.0 2.5 1.0 1.0  -1.75 0.0 -2.5 0.0 0.0   1.75 0.0 -2.5 1.0 0.0

The texture used for object/*.pfo is texture[low]/*.tga.

Alex/Josiah, can you set the font-family of #CODE in /iB_html/non-cgi/Skin/Default/ikonboard.css to monospace, and add white-space:pre; to it? Then you'll get a fixed-width font (the one the user chose in the browser's preferences) and preserved whitespace.

Now I have seen the stylesheet I know it can be improved further... I'll post it in the miscellaneous forum when done.
I rarely check this forum anymore. Feel free to send me a PM if you want my attention.


Jonathan_NL

Well, it isn't that hard to see that 04 00 00 00 represents an LSB first integer 4, and that 00 00 e0 bf is probably a float. Edit: And if you have minimal knowledge about OpenGL you'll recognize the structure.

Btw, my hexeditor has some nice features, including swapping and displaying the selected byte(s) like "1234" for int types (from char to long), and "12.34" for float types (float and double). It doesn't transform 9d 0c 00 00 in gish.his to 1:04.58 though. http://www.pontifex2.com/iB_html/non-cgi/emoticons/laugh.gif" border="0" valign="absmiddle" alt=':laugh:'>

Now only pfp (pontifex properties?) is left. I think they refer to several pfos with relative locations and tell BCS how to use the final object. But I can't confirm anything about them yet... (I didn't look at them)

Edit: hmmm... they're all filled with 50 floats. They go as low as -2.0 and as high as 500000.0, and that's just the first file I looked at. Now I'm going to find some logic... at least to find how car bodies and wheels are put together, if not hard-coded.
I rarely check this forum anymore. Feel free to send me a PM if you want my attention.

Jonathan_NL

Haven't done much with pfp - doesn't look interesting to me.

http://home.filternet.nl/~eo000199/jonathan/bridgebuilders/hatchbck.tiff.bz2" target="_blank">The result of one of my pfo experiments
It's a bzip2 compressed uncompressed TIFF, because PNG is about 5 times as large (FIVE TIMES AS LARGE) and even JPEG of reasonable quality is bigger.
I rarely check this forum anymore. Feel free to send me a PM if you want my attention.

Chronic Logic

We do actual have tools that create both those files.  They are not user friendly or polished at all, but it might be possible to release them.

Jonathan_NL

Anything is better than nothing, even though the format is so simple. http://www.pontifex2.com/iB_html/non-cgi/emoticons/smile.gif" border="0" valign="absmiddle" alt=':)'>

I now found what the 500000 is. It is the weight of the steam loc. At least all my bridges crashed when the steam loc hit them with float 0x60 set it to 50000000.

Edit: http://home.filternet.nl/~eo000199/jonathan/bridgebuilders/bcs/sailboat.png" target="_blank">sailboat?!?
I rarely check this forum anymore. Feel free to send me a PM if you want my attention.