How Tool compiles model files

Everything about HD, MD, and their mods.

Moderator: Halo Moderators

Post Reply
Sparky
Delta Force
Posts: 4194
Joined: Wed Mar 31, 2004 8:59 pm
Location: New Jersey, USA
Contact:

How Tool compiles model files

Post by Sparky » Mon Jun 10, 2013 6:58 pm

Consider the following test I just performed:

Code: Select all

C:\Program Files\Microsoft Games\Halo Custom Edition>tool_pro model reverse_engineering\geometry_test
Couldn't read map file './toolbeta.map'
### geometry_test.jms
### WARNING found #112 degenerate triangles.
EAX: 0xFFFFFFFE
EBX: 0x05C70201
ECX: 0x0012F120
EDX: 0x000002CC
EDI: 0x0012F120
ESI: 0x00000000
EBP: 0x0012EFF8
ESP: 0x0012EFE8
EIP: 0x7C90E514, C3 8D A4 24 ?????
EXCEPTION halt in \halopc\haloce\source\memory\array.c,#130: index>=0 && index<array->count

C:\Program Files\Microsoft Games\Halo Custom Edition>tool_pro model reverse_engineering\geometry_test
Couldn't read map file './toolbeta.map'
### geometry_test.jms
### WARNING found #112 degenerate triangles.

          detail        worst-case      worst-case
          level          vertices       triangles
        ---------       ----------      ----------
         superlow            17083           32766
              low            17083           32766
           medium            17083           32766
             high            17083           32766
        superhigh            17083           32766

C:\Program Files\Microsoft Games\Halo Custom Edition>
You can see that the first attempt failed and the second attempt was successful.
In the first attempt, I had a .jms model that contained (32768 + 112) triangles. The array could not hold 32768 entries, and so the memory array error occurred. In the second attempt, I had the same .jms model that contained (32766 + 112) triangles. The array could hold 32766 triangles, and so it compiled the .gbxmodel (mod2) tag successfully.

Tool takes all the vertices and triangles from the .jms tag and puts them into two arrays. Then it determines in its opinion if there are any degenerate triangles and removes them from the array (tosses them out) before adding the remaining triangles and vertices to their respective blocks in the tag, essentially duplicating the vertices into "uncompressed vertices" and "compressed vertices" blocks and associating the indices of three vertices to each entry in the "triangles" block. It also lists the UV texture coordinates for each compressed and uncompressed vertex.

So the maximum number of triangles you can have in a scene is 32767 -- but you only really have 32766. And this does not include degenerate triangles which are not added to the mod2 tag.

Note that when I try to compile a collision-geometry tag with that model, the degenerate triangles which are tossed out of the array cause the model to have open edge (red) errors.
Either you are groping for answers, or you are asking God and listening to Jesus.

WaeV
Peon
Posts: 126
Joined: Tue Aug 28, 2012 11:21 pm
Contact:

Re: How Tool compiles model files

Post by WaeV » Tue Jun 11, 2013 5:09 am

Huh, that's a good limitation to know of. Sounds like it's bounded by MAX_INT32.
Image

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 33 guests