Grenediac's Explanation of Mapfiles on IRC

Discuss general issues about modding HaloPC. Post ideas for mods here.
farklem




Socialist Construct Wave Pyre

Posts: 99
Joined: Sat Dec 06, 2003 5:45 pm

Grenediac's Explanation of Mapfiles on IRC

Post 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?
Last edited by farklem on Thu Feb 26, 2004 2:15 pm, edited 1 time in total.
User avatar
Veegie




Socialist Architect Coroner Golden Age
Mad Hatter Acolyte Translator New Age
ONI

Posts: 3638
Joined: Wed Nov 26, 2003 2:28 pm
Location: Redmond, WA

Post by Veegie »

I saw that :)
Image
Hijikata wrote:The fact you love Jesus doesn't change the fact you're a *** mental patient. It just means you're a mental patient with a great imaginary friend.
jimmsta





Posts: 240
Joined: Mon Oct 20, 2003 4:21 pm

Post by jimmsta »

as did I... THANK YOU, GRENADIAC!!!!
User avatar
HunterXI





Posts: 3927
Joined: Sat Nov 22, 2003 11:21 am
Location: Azeroth
Contact:

Re: Grenediac's Explanation of Mapfiles on IRC

Post 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...
This post printed on 100% recycled electrons.
XeRoWaVe





Posts: 379
Joined: Sat Nov 15, 2003 11:12 am

Post 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
farklem




Socialist Construct Wave Pyre

Posts: 99
Joined: Sat Dec 06, 2003 5:45 pm

OK

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





Posts: 160
Joined: Tue Dec 09, 2003 12:10 am

Post by xecuter »

thx cause i dont know what the hell all that means
Deadly_Shadow




Miner

Posts: 1375
Joined: Fri Oct 24, 2003 1:30 am
Location: Earth
Contact:

Post by Deadly_Shadow »

That is interesting.
User avatar
HunterXI





Posts: 3927
Joined: Sat Nov 22, 2003 11:21 am
Location: Azeroth
Contact:

Re: OK

Post 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...
This post printed on 100% recycled electrons.
__Blaz0__




Articulatist 100

Posts: 177
Joined: Fri Oct 03, 2003 7:29 am

Post 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__
Xhzjang





Posts: 46
Joined: Fri Feb 13, 2004 12:06 pm

Post 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?
User avatar
Iron_Forge




Illusionist Socialist Decryptor System Engineer
ONI Golden Age Magic Era Bloodhound
Coagulator Omega Mad Hatter Eureka
Critic Tsunami Firestorm Literarian 250

Posts: 532
Joined: Sat Sep 20, 2003 9:21 pm

Post 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)...
Image
...Thats right...I invented modding...So give me Wii Points...
Xhzjang





Posts: 46
Joined: Fri Feb 13, 2004 12:06 pm

Post 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?
User avatar
HunterXI





Posts: 3927
Joined: Sat Nov 22, 2003 11:21 am
Location: Azeroth
Contact:

Post 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
This post printed on 100% recycled electrons.
Xhzjang





Posts: 46
Joined: Fri Feb 13, 2004 12:06 pm

Post 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
User avatar
HunterXI





Posts: 3927
Joined: Sat Nov 22, 2003 11:21 am
Location: Azeroth
Contact:

Post 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?
This post printed on 100% recycled electrons.
EqUiNoX





Posts: 1929
Joined: Sat Feb 07, 2004 11:08 am
Location: Bantron, USA

Post by EqUiNoX »

yeh.....someone dosn't know HTML.....*COUGH*
Image
User avatar
HunterXI





Posts: 3927
Joined: Sat Nov 22, 2003 11:21 am
Location: Azeroth
Contact:

Post by HunterXI »

now now Jon, you sucked at HTML once too...
This post printed on 100% recycled electrons.
Xhzjang





Posts: 46
Joined: Fri Feb 13, 2004 12:06 pm

Post 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
User avatar
HunterXI





Posts: 3927
Joined: Sat Nov 22, 2003 11:21 am
Location: Azeroth
Contact:

Post by HunterXI »

Equinox heres just spamming a bit...
This post printed on 100% recycled electrons.
Post Reply