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... :wink:
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).]
- Alhexx
- edit -
BTW: What will I be when crossing the 100 Posts Border?
- edit 2 -
mirex: Hey, I've also written a prog named Renamer (well, I named it RE-Name-ER), and it also renames (many) files...
I've compiled Version 2.10 of WinRE-Name-ER, but it isn't published yet. (B'cause my 'main homepage' is under construction (see http://alhexx.tripod.com ))
[This message has been edited by Alhexx (edited July 30, 2001).]
Additional - value3
--------------------------------------------------------
Number of Colors:
Additional - Value3
--------------------------------------------------------
Number of Polygons:
When Value3 = 0
NumPolys - Value3 + 6
When Value3 > 0
NumPolys
========================================================
Start of the Color Pool:
$80 + (NumVerts + Additional) * 12 + value3 * 8
(I though it was only (numverts+additional)*12 b'cause of
an internal function of ultima...)
--------------------------------------------------------
Start of The Polygon Pool:
$80 + (NumVerts + Additional) * 12 + value3 * 8 + (Additional + NumPolys + NumLines) * 4
(The same as above, just another mathematical formula.
========================================================
This times im surer (or more sure?) that the values are correct...or at least correcter tha the old ones :D
- Alhexx
- edit -
Just forgot to mention, that I've released a new version of ultima supporting this shit above...
[This message has been edited by Alhexx (edited July 30, 2001).]
alhexx, saint, all: Could you guys write some comment to my pformat ?
[This message has been edited by mirex (edited August 02, 2001).]
- Alhexx
- edit -
I've just had a look at my Ultima topic (ehm, .p, battle...) and I've seen, that Fice has coded the DLL...
[This message has been edited by Alhexx (edited August 02, 2001).]
Does anybody know how to decode the texture coords?
I mean, I know that the coords are located directly after the vertexes, but I can't figure out which vertexes use textures? Understand my problem? I don't know how many polygons to skip...
- Alhexx
- edit -
wrote one ' - Alhexx' too much...
[This message has been edited by Alhexx (edited August 09, 2001).]
Okay, I won't post the structure of the header here, I'm just postin the Offsets.
Here's how my List is build: 1. Offset (2. name in Fice's description) 3. Result when changing value
code:[/quote]
Offset Fice's Name mirex' Name Default Result when changed
---------------------------------------------------------------------------
$00 - - 1 -
$04 - - 1 -
$08 - - 1 OpenGL-Colors deactivated
$0C Additional A(long) - model invisible / FF7 crash
$10 Numverts A1(long) - FF7 crash
$14 - - 0 FF7 crash
$18 Value3 T(long) - FF7 crash
$1C - V(long) - FF7 crash
$20 Numlines E(long) - FF7 crash
$24 Numpolys P(long) - Win hangup
$28 - - 0 FF7 hangup
$2C - - 0 FF7 hangup
$30 - H(long) - FF7 hangup
$34 - I(long) - FF7 crash
$38 - G(long) - FF7 crash
$3C - - 1 -
As you can see, the only thing interesting is Offset $08. It is usually set to
1, b'cause every model in FF7 uses OpenGL Colors. But you can set it to 0. Then,
the model will be full white (RGB: 255/ 255/255). BUT: If it is a model which
uses textures, too, the textures are displayed. I think, with this option it'd
be possible use a model with no OpenGL Colors, but full textured.
Oh, if anyone's interested: I've been testing with file 'rxao' (Yuffie's Head).That's all 4 now. I'll keep on testing.
- Alhexx
- edit -
Had to insert that crap as 'code'[This message has been edited by Alhexx (edited August 18, 2001).]
under descriptions
- Alhexx
As for the names: I didn't want to invent new names, so I used yours...
- Alhexx
The Color Pool consists of vertex-colors and poly-gon colors. If you want to view the model using poly-colors, read the following:
Start: $80 + (Additional + NumVerts) * 12 + Value3 * 8 + additional * 4
Length: Numpolys
Polygon 1 uses Color 1 and so on...I guess that could be useful for your .p-to-3df converter...
- Alhexx
But thanks anyhow Alhexx
:)
[This message has been edited by mirex (edited August 22, 2001).]
- Alhexx
Okay, I've found out sth 'bout the hundrets pool: It's for the textures. It says which texture is used where. I haven't been able to hack the important functions out of it, but it seems like only 3 bytes are really needed...
- Alhexx
- edit -
Wanna post what I've found out 'bout the hundrets pool:
Most of the values aren't needed. Here's what's needed:
$08 - no idea what it is
$0C - no idea...
$10 - specifies which of the loaded textures are used. Ascensing order (0, 1, ...)
These values are for every of the hundret bytes. You can set every other byte to 0, it won't do harm.
- Alhexx
[This message has been edited by Alhexx (edited August 23, 2001).]
- Alhexx