Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Heroes of Might and Magic 6

Post questions about game models here, or help out others!
User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 348
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 11 times
Been thanked: 89 times

Re: Heroes of Might and Magic 6

Post by TaylorMouse »

So this look sabsolutely amazing, a petty I'm don't have the skills to do all that, on the other hand, I can write a convertor to obj if you like :)

If you pass me the correct code to read the current file format ofcourse :

T.
Demonsangel
mega-veteran
mega-veteran
Posts: 241
Joined: Fri Aug 05, 2011 9:31 pm
Location: Antwerp
Has thanked: 13 times
Been thanked: 41 times

Re: Heroes of Might and Magic 6

Post by Demonsangel »

Karpati wrote:X,Y,Z: HalfFloat
3*2 bytes: Normals (?)
4 bytes: Unknown
U: (2 bytes Word) / 32768
V: 1-(2 bytes Word) / 32768
Awesome! How did you find this /2^15?
Edit: turns out Noesis can take the shorts as they are and doesn't need the /32768
Image
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Heroes of Might and Magic 6

Post by finale00 »

Never thought of trying something like that lol
I wonder what justification the devs might have for it.

Nice, now we just need to get to the materials properly. Did you figure out which ones are the odd chunks?
Though, a shortcut is to just parse the chunks to get the offsets and then go back and parse each chunk separately.

For example in the wolf model, after the size of the entire model,

The first chunk is the mesh.
The second chunk is probably bones or something.
The third chunk is the materials.

You just parse the 0x35, the tag, and then grab the size, and seek that many bytes to get to the start of the next chunk (see an 0x35)

Once you get the offsets, you can then go back and parse each chunk.

I might do this cause it looks cleaner and if any gobj file suddenly throws in extra stuff I can skip chunks I don't want.

The first chunk starts at offset 29, with flag 0x08 and tag 0x2031. This gives you the final matching 0x02 at the end.

On the other hand...I would like to be able to do the whole chunk start and chunk end matching properly as well..
Last edited by finale00 on Wed Mar 28, 2012 11:48 pm, edited 1 time in total.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Heroes of Might and Magic 6

Post by chrrox »

i have seen this in a ton of games. most devs who use half floats on consoles use shorts on pc to store uv's. the shorts are just normalized.
Demonsangel
mega-veteran
mega-veteran
Posts: 241
Joined: Fri Aug 05, 2011 9:31 pm
Location: Antwerp
Has thanked: 13 times
Been thanked: 41 times

Re: Heroes of Might and Magic 6

Post by Demonsangel »

finale00 wrote:Never thought of trying something like that lol
I wonder what justification the devs might have for it.

Nice, now we just need to get to the materials properly. Did you figure out which ones are the odd chunks?
Though, a shortcut is to just parse the chunks to get the offsets and then go back and parse each chunk separately.

For example in the wolf model, after the size of the entire model,

The first chunk is the mesh.
The second chunk is probably bones or something.
The third chunk is the materials.

You just parse the 0x35, the tag, and then grab the size, and seek that many bytes to get to the start of the next chunk (see an 0x35)

Once you get the offsets, you can then go back and parse each chunk.

I might do this cause it looks cleaner and if any gobj file suddenly throws in extra stuff I can skip chunks I don't want.

The first chunk starts at offset 29, with flag 0x08 and tag 0x2031. This gives you the final matching 0x02 at the end.

On the other hand...I would like to be able to do the whole chunk start and chunk end matching properly as well..
I'm still working on figuring out each chunk. It's coming along, but I had to do skip[chunk_size] for each 3102 chunk, they seem to vary too much for now.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Heroes of Might and Magic 6

Post by finale00 »

The 3102's look like

Code: Select all

word 3102
dword size
byte[size] data
Ended with an 0x02.
The 01 04 01 00 00 00 right before the 31 02's is probably a word followed by a integer count.

Of course the vertices are contained in 31 02 chunk...
Last edited by finale00 on Thu Mar 29, 2012 8:52 pm, edited 1 time in total.
Karpati
ultra-veteran
ultra-veteran
Posts: 467
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 9 times
Been thanked: 95 times

Re: Heroes of Might and Magic 6

Post by Karpati »

Demonsangel wrote:Awesome! How did you find this /2^15?
The Short type:
Signed: From −32768 to 32767, from −(2^15) to 2^15 − 1

It is a very old technique to store the float value on the integer data type.
You must divide the value / 32768 to get the original float value.

I can't imagine why uses this format it.
Karpati
ultra-veteran
ultra-veteran
Posts: 467
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 9 times
Been thanked: 95 times

Re: Heroes of Might and Magic 6

Post by Karpati »

TaylorMouse wrote:So this look sabsolutely amazing, a petty I'm don't have the skills to do all that, on the other hand, I can write a convertor to obj if you like.
If you pass me the correct code to read the current file format ofcourse
I made an own Wavefront .obj exporter about 20 years ago. :wink:
I don't have other information about this format than I did find on the finale00's script.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Heroes of Might and Magic 6

Post by finale00 »

Lol this game has been around for 20 years? o.O
Oh wait, it's already 2012...

Time sure flies.

Guess I have another trick in the bag when looking for data.
Karpati
ultra-veteran
ultra-veteran
Posts: 467
Joined: Thu Dec 07, 2006 11:25 pm
Has thanked: 9 times
Been thanked: 95 times

Re: Heroes of Might and Magic 6

Post by Karpati »

finale00 wrote:Lol this game has been around for 20 years? o.O
I did not write that the game is 20 years old.

I wrote my .obj exporter (for the 3D Object Converter) about 20 years ago. :wink:
Demonsangel
mega-veteran
mega-veteran
Posts: 241
Joined: Fri Aug 05, 2011 9:31 pm
Location: Antwerp
Has thanked: 13 times
Been thanked: 41 times

Re: Heroes of Might and Magic 6

Post by Demonsangel »

Sarah model:

Image

Material parsing isn't 100% yet, I have to figure out what

Code: Select all

vector4(1,1,0,time/4000)
do in the material sections.
I'm guessing some particle animation?
junk angel
veteran
Posts: 82
Joined: Thu Jan 14, 2010 4:38 pm
Has thanked: 1 time
Been thanked: 4 times

Re: Heroes of Might and Magic 6

Post by junk angel »

Demonsangel wrote:Sarah model:

Image

Material parsing isn't 100% yet, I have to figure out what

Code: Select all

vector4(1,1,0,time/4000)
do in the material sections.
I'm guessing some particle animation?
Probably the flames. The ingame sarah model does have a lot of fire around her hair. http://www.celestialheavens.com/homm6/w ... M1_007.jpg
Demonsangel
mega-veteran
mega-veteran
Posts: 241
Joined: Fri Aug 05, 2011 9:31 pm
Location: Antwerp
Has thanked: 13 times
Been thanked: 41 times

Re: Heroes of Might and Magic 6

Post by Demonsangel »

How would I go about adding the following 2 textures to the same UV?
ImageImage

I can't seem to find a way in Noesis or even 3ds max for that matter. The way I've been doing it atm is manually making 1 texture out of them.

Junk Angel's post brought this to my attention because my render of the angel doesn't have these "highlights" on her wings but the in his link they're there.

I currently have 4 sorts of "textures": _diff.dds = normal texture
_spec.dds _norm.dss and those _emis.dds highlights.

I'm currently going through bone and animation info and looking for a way to match the drawcall to the correct materials. I there's 2 lists of shorts that seemed to match the Material ID's but they don't match at all for the Sarah "Angel" model.
And some models don't seem to have bone names. (:
junk angel
veteran
Posts: 82
Joined: Thu Jan 14, 2010 4:38 pm
Has thanked: 1 time
Been thanked: 4 times

Re: Heroes of Might and Magic 6

Post by junk angel »

Demonsangel wrote:How would I go about adding the following 2 textures to the same UV?
ImageImage

I can't seem to find a way in Noesis or even 3ds max for that matter. The way I've been doing it atm is manually making 1 texture out of them.

Junk Angel's post brought this to my attention because my render of the angel doesn't have these "highlights" on her wings but the in his link they're there.

I currently have 4 sorts of "textures": _diff.dds = normal texture
_spec.dds _norm.dss and those _emis.dds highlights.

I'm currently going through bone and animation info and looking for a way to match the drawcall to the correct materials. I there's 2 lists of shorts that seemed to match the Material ID's but they don't match at all for the Sarah "Angel" model.
And some models don't seem to have bone names. (:
I'd need to see the textures myself, but they seem to be on the same UV. The emissive texture is just more squashed together. But other than that it looks fine.

If you mean how to bring them together into one single material, it depends on the program or engine.

Emiss textures are also almost definitely not highlight textures but emissive texture - also known as glow maps. Closer to highlights are the specs since those usually mean Specular - or light reflectivity.
Demonsangel
mega-veteran
mega-veteran
Posts: 241
Joined: Fri Aug 05, 2011 9:31 pm
Location: Antwerp
Has thanked: 13 times
Been thanked: 41 times

Re: Heroes of Might and Magic 6

Post by Demonsangel »

Tiny update:
I'm having some trouble with bones:
Bones with Bones = rapi.multiplyBones(Bones)
Image

Without
Image

Do any of you see on sight what could be wrong?
I have 10 floats in my bonedata. 3 for xyz and 3 I guessed were Euler angles, so 4 remain. What else can be stored as float for bones?
Also, if Angles aren't Euler, how do you figure them out?
Fixed Sarah model:
Image
Post Reply