I've been workin' on the .p file format tonight. And that's
what I've found out.
Here we go:
--------------------------------------------------------
Number of Vertexes:
Additional (w/o numverts !)
--------------------------------------------------------
Number of Colors:
Additional + Value3 (w/o numverts, too!)
--------------------------------------------------------
Number of Polygons:
Numpolys (sometimes you've got to subtract some polys, but I haven't found that value in the file header yet)
========================================================
Start of Vertex Pool:
$80 (128 in decimal)
--------------------------------------------------------
Start of the Color Pool:
$80 + (NumVerts + Additional) * 12
--------------------------------------------------------
Start of the Polygon Pool (I'm not sure 'bout this, but it worx):
$80 + (Additional + NumVerts) * 12 + (value3 + Additional) * 4 + (NumPolys + NumLines + value3) * 4 ========================================================
I don't understand what's in '(NumPolys + NumLines + value3) * 4', but I'll keep workin' on it. Perhaps it's got to do with texture alignment or something like that...
So I said that reading out the color pool in the 'numpolys + additional'-way was a waste of memory? Heh, ALMOST THE *WHOLE* WAY we decoded the .p files was just a HUGE waste of memory...
I guess nobody else found out this, b'cause nobody has programmed a 2D View for the .p files. I was just looking at Yuffie's head and I found some useless Vertx around the Point at 0 / 0 / 0. I wondered what these Verts were and I started deleting some source out of ultima and voila: These verts were read out unnecessarily...
Something else I found out:
NumVerts does only appear in field files (char.lgp), NumVerts in battle files is always 0.
Value3 does only appear in models which have textures (mostly heads). That's why I think Value3 has got something to do with Textures.
I think that's it for now.
- Alhexx
- edit -
Corrected Syntax
- edit 2 -
Forgot to mention that I've uploaded some screenshot to this topic on my site...
[This message has been edited by Alhexx (edited July 29, 2001).]