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>
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.