The Forum is up for sale: XeNTaX Forum looking for new owner

Halo Wars ugx files. Just need an expert's opinion.

Post questions about game models here, or help out others!
Post Reply
User avatar
ptowery
n00b
Posts: 12
Joined: Thu Aug 18, 2011 11:56 pm
Has thanked: 6 times
Contact:

Halo Wars ugx files. Just need an expert's opinion.

Post by ptowery »

Okay I have been, for a very long time, trying to crack this model format myself. I'm using maxscript and Hex Workshop and I've been able to import other model formats from other games but this format confounds me.

RoadTrain has found the Header and Block Definition data for me, but I'm still unable to find the data that makes up the vertices, I can't even find how many verts a file has.

Here's what I know:

This game was made by Ensemble Studios, so the model file might resemble one of their previous games.

File is either aligned to 16 or 32 bytes. Data is in Big Endian.
The files are a modified version of Granny3d's .gr model file, but I don't see how that's of any help.
All files have at least 1 bone: "GranyRootBone" and I think, but I'm not sure, that the files have lod data too.

Code: Select all

struct tHeader
{
  long magic;
  long headerLength; //?? =32 bytes
  long unk1; //hash?
  long fileSize;
  short nBlocks; //number of blocks
  short null1; //=0
  long unk2; //hash?
  long null2[2];// 8 zero bytes
};

Code: Select all

struct tBlockDefinition
{
  long null;//zeros
  long blockType;//1792-1797
  long offset;// the position in the file where the block starts
  long size; //size of block data
  long unk1; //maybe some form of hash
  long unk2; //??
};

Code: Select all

struct t1792BlockHeader
{
  short unk;
  short arraycount; //number of floats / 3 (i don't think this is where the vertex data is though.)
  long null;
  float[arraycount*3] unk;
};
Several_ugx_models.zip

Here's a zip file with 9 ugx files, some similar and varied. I just want to be able to find where the vertex data and face indices are at this point.
RoadTrain
advanced
Posts: 54
Joined: Wed Dec 12, 2007 5:57 pm
Location: Russia
Has thanked: 29 times
Been thanked: 4 times

Re: Halo Wars ugx files. Just need an expert's opinion.

Post by RoadTrain »

Sorry for necroposting, but wanted to share an idea.

It's quite possible that vertices are incoded in SHORTs instead of FLOATs.
If you look after GrannyRootBone, you will notice a pattern -- each stride is 16 bytes.

That's perfectly situated for 8 shorts making a vertex -- 3 for position, 3 for normals and 2 for uvmap.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4231
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1139 times
Been thanked: 2222 times

Re: Halo Wars ugx files. Just need an expert's opinion.

Post by shakotay2 »

for barracks_damaged_01 the vertex stride is 28
but there are too many submeshes here - you'll need a script to build the whole mesh:
barracks_damaged_01.JPG
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
RoadTrain
advanced
Posts: 54
Joined: Wed Dec 12, 2007 5:57 pm
Location: Russia
Has thanked: 29 times
Been thanked: 4 times

Re: Halo Wars ugx files. Just need an expert's opinion.

Post by RoadTrain »

1794 - vertices
1793 - indices
RoadTrain
advanced
Posts: 54
Joined: Wed Dec 12, 2007 5:57 pm
Location: Russia
Has thanked: 29 times
Been thanked: 4 times

Re: Halo Wars ugx files. Just need an expert's opinion.

Post by RoadTrain »

it's more interesting with assault_rifle_01

According to indices, there must be 480 vertices, but I only get 96...

Must have missed something..
You do not have the required permissions to view the files attached to this post.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4231
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1139 times
Been thanked: 2222 times

Re: Halo Wars ugx files. Just need an expert's opinion.

Post by shakotay2 »

RoadTrain wrote:Must have missed something..
nope - it's low poly models:
battle_rifle.JPG
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
RoadTrain
advanced
Posts: 54
Joined: Wed Dec 12, 2007 5:57 pm
Location: Russia
Has thanked: 29 times
Been thanked: 4 times

Re: Halo Wars ugx files. Just need an expert's opinion.

Post by RoadTrain »

shakotay2 wrote:
RoadTrain wrote:Must have missed something..
nope - it's low poly models:
battle_rifle.JPG
Fine, but where are the rest of vertices? I have found only those located at 2440h, and there are only 96 of them with a 16 byte stride.

But according to indices, there must be 480 vertices. What's the point? [roll]
User avatar
ptowery
n00b
Posts: 12
Joined: Thu Aug 18, 2011 11:56 pm
Has thanked: 6 times
Contact:

Re: Halo Wars ugx files. Just need an expert's opinion.

Post by ptowery »

Oh wow fantastic, With that I should be able to write a maxscript importer, I am curious how the vertex count works though, maybe it has something to do with LOD models??
http://www.datishop.com.br/media/catalo ... ars-46.jpg
The image in that link shows some of the UNSC vehicles and infantry, hard to find a good pic
There's some pretty good closeups in this video.
https://www.youtube.com/watch?v=HxciOQjWEtc
Looks to be about right though, hmm.
User avatar
ptowery
n00b
Posts: 12
Joined: Thu Aug 18, 2011 11:56 pm
Has thanked: 6 times
Contact:

Re: Halo Wars ugx files. Just need an expert's opinion.

Post by ptowery »

RoadTrain wrote:it's more interesting with assault_rifle_01

According to indices, there must be 480 vertices, but I only get 96...

Must have missed something..
So after some further investigation on my own of the formats, I'm getting some models that are doing what you say, They are low poly models but why would the model be saying there's more faces than there are verts?

Also I'm wondering how the stride is different for the models with shorts instead of half floats, and what tells the program if it's half floats or shorts?
Post Reply