Page 1 of 2

Grenediac's Explanation of Mapfiles on IRC

Posted: Thu Feb 26, 2004 2:07 pm
by farklem
ok, there are 3 parts to the model
there is the model index, the model meta, and the raw data
the model index is in the tag index and points to the meta
the meta points to the raw data, which contains the verts and indices for all of the model's submodels and

variations
now, when you rebuild a map...
the raw data portion does not work properly
let me get a link to show you how the mapfile works
http://www.halomods.com/projects/MapFor ... _level.htm
ok, you can see that there is the mapfile header, followed by the bsp
then the model raw data, which is followed by the index
after the index is the metadata
now, what happens during a rebuild
is that all of the meta data gets reorganized
but, the raw data doesn't
or something like that, im not exactly sure
so when mono did his library mod
he moved ALL of the raw data to the end of the map
from both source maps
which fixes the problem, but makes the mapfile really big
so you might ask why model injection "sort of" works
well, what happens is the raw data gets replaced by something that is not the same size
if you notice sometimes, model injection corrupts its own object and other nearby objects
and you get the jagged effect
that is because the raw data overwrote some other models raw data partially
which is also the reason the corruption changes when you get farther away
the raw data contains the verts and indices for different LODs
so one Level Of Detail may be corrupt, while others are fine
you have to update the headers if you change meta sizes
if you use the new SparkEdit to generate the offset lists
it includes the raw offsets for models
start and end
if you want to swap models, replace the raw data of one model that is larger than the one you are importing
"gui swaping"...what does that mean?

Posted: Thu Feb 26, 2004 2:10 pm
by Veegie
I saw that :)

Posted: Thu Feb 26, 2004 2:19 pm
by jimmsta
as did I... THANK YOU, GRENADIAC!!!!

Re: Grenediac's Explanation of Mapfiles on IRC

Posted: Thu Feb 26, 2004 3:02 pm
by HunterXI
farklem wrote:"gui swaping"...what does that mean?
the GUI is the Graphical User Interface, meaning that you are swapping things like the crosshair and whatnot...

Posted: Thu Feb 26, 2004 3:05 pm
by XeRoWaVe
wow i actually got that too WOW!
you cant say please put that in plain english lol i htink thats a nice description not too hard not so primitive

OK

Posted: Thu Feb 26, 2004 4:46 pm
by farklem
I plan on putting that in plain english in the next few days. I have no idea what gui swapping is. Grenediac just told me to post this sine I coppied and pasted it from the chat.

Posted: Thu Feb 26, 2004 5:13 pm
by xecuter
thx cause i dont know what the hell all that means

Posted: Thu Feb 26, 2004 5:30 pm
by Deadly_Shadow
That is interesting.

Re: OK

Posted: Thu Feb 26, 2004 11:04 pm
by HunterXI
farklem wrote:I plan on putting that in plain english in the next few days. I have no idea what gui swapping is. Grenediac just told me to post this sine I coppied and pasted it from the chat.
yeah, and putting it into numbered steps is good too... I just dont like bullets...

Posted: Fri Feb 27, 2004 4:14 am
by __Blaz0__
Was looking at the map dir structure from the link and seen this..

Data Type Name Description
-----------------------------------------------------------------------------
int decomp_len File length (length decompressed for Xbox)

is this a possible way to chnge filelength for the xbox map files?

I know this is in PC section, but I am assuming more people who understand this better could awnser.

__Blaz0__

Posted: Fri Feb 27, 2004 10:57 am
by Xhzjang
Im trying to understand the Halo map format at the moment, particularly how it stores the tags...
The tag index contains tags which in tun have a number which points to the metadata. However this number seems to be made up from the offset of the metadata from the beginning of the file + a value which I don't understand where it comes from. The mystery value is the same for all the tags in a particular map but varies map to map (e.g. for danger canyon it is 3FB028F4)

The number presumably has some meaning and is stored somewhere in the file. HMT seems to be able to extract it from the file as it displays the correct offset and when you change the offset it updates it successfully. Anyone know what this value is?

Posted: Fri Feb 27, 2004 11:56 am
by Iron_Forge
Yes, map files can be increased in size, however decomp_len (as far as I know), is only used by zlib to decompress the map...(Probably pre-allocates buffers based on this, or something ;o)...If memory serves me correctly, decomp_len is always a multiple of 512...In the main map file header, there is also a metadata_size, which needs to be increased aswell to make a map file larger...The metadata_size is the size of all the data starting at the map file index, to the end of file (EOF)...

Posted: Fri Feb 27, 2004 3:45 pm
by Xhzjang
I don't mean changing the size of the file... im looking to be able to find the location of the metadata using the tag index, the data stored there does not seem to correspond with the data HMT displays (meta offset) so how does it work out this data?

Posted: Fri Feb 27, 2004 11:34 pm
by HunterXI
I have to say that the complexity of the map files still boggles me...
*edit* happy 800th post to me :D Im too self centered

Posted: Sat Feb 28, 2004 12:24 am
by Xhzjang
Aha i finally found out how you get the magic number... thanks to this webpage with lots of useful map info: http://huge.dyndns.org/halo/

Basically you take the first int from the tag index (little endian) subtract the tag index offset and then subtract 28 to get the magic number, note that that page says 36, but when i tried it out it was actually 28

Posted: Sat Feb 28, 2004 12:29 am
by HunterXI
Xhzjang wrote:Aha i finally found out how you get the magic number... thanks to this webpage with lots of useful map info: http://huge.dyndns.org/halo/

Basically you take the first int from the tag index (little endian) subtract the tag index offset and then subtract 28 to get the magic number, note that that page says 36, but when i tried it out it was actually 28
hm, maybe it can differ in some way between you and them?

Posted: Sat Feb 28, 2004 12:29 am
by EqUiNoX
yeh.....someone dosn't know HTML.....*COUGH*

Posted: Sat Feb 28, 2004 12:34 am
by HunterXI
now now Jon, you sucked at HTML once too...

Posted: Sat Feb 28, 2004 12:34 am
by Xhzjang
???

Anyway, the only difference i can think of is that it is about xbox maps and im looking at pc maps, so maybe there is an extra 8 bytes in somewhere

Posted: Sat Feb 28, 2004 12:43 am
by HunterXI
Equinox heres just spamming a bit...