Change a texture without affecting other maps
Posted: Sun Mar 13, 2005 12:38 pm
Well, I'll use the warthog as the example since thats the one most people seem to be interested in...Open up coagulation in your favourite hex editor...Jump to offset 0x10. This is the offset to the index...You will want to write this number (0x023AE200) down...
Now get the offset to the warthog_standard.bitm with whatever means you find easiest...For my map, it's 0x024C9544...0x68 bytes into this meta, you should see the 6 LOD offsets, followed by their sizes...Should look something like:
Now, you'll want to wipe out all the LOD's but the first, so change that to look like:
We could copy the LOD's too, but it doesn't effect MP games that I've noticed...If you want to copy them too rather than eliminating them, just repeat this for them...
Now, the first offset (0x88FF3600) is a shared offset, we can tell cause the high nibble is 8...So we will subtract 0x80000000, leaving us with 0x08FF3600...Because that was an 8, we know this offset is in shared.map...If it were a 4, it would be in mainmenu.map, and a C the single_player_shared.map...
Now, we note the size of this bitmap is 0x00055580...All textures in Halo 2 are rounded up to 512, so we round this up to the nearest 512 (0x00055580 + (512 - (0x00055580 % 512)))...This gives us the new size of 0x00055600...
Before moving on, we'll replace the offset while we're here...Change the offset (0x88FF3600) with the point we will be injecting too, which is the current index offset (0x023AE200)...
So we go to offset 0x08FF3600 in shared.map, and select 0x00055600 bytes...Copying them, we return to coagulation, and jump to 0x023AE200...Paste the data here, inserting it...Now that the map has changed sizes, we'll need to fix a couple of values in the header...0x08 is the size of the map, and 0x10 is the offset to the index...Both need to be increased by the size of the injected data, since the map size has increased by this, and the index has been moved by the same value...
Now save your work, and run whatever tool you use to correct the encryptomatic signature (I use the TF6 tool, since it's quick, and I won't be making other changes to the map)...
Now the coagulation map has its own warthog_standard.bitm, and you can use your favourite editor to do to it as you please...
For those of you who are interested, this works due to the design of Halo 2 maps...Bitmaps happen to be just before the index..This is the purpose of the magic value(s), which are calculated based on some constants and the offset to the index (among some other values)...So if the index is moved, all reflexives are fixed, because magic will change corresponding to this change...This allows meta of a map to be built, without requiring knowledge of the size of the raw data...Thanks of course to TheSwampFox for verifying that this still works with Halo 2...
It should be noted that PPF's don't work correctly when maps change size (especially in this fashion)...So don't expect to be distributing this with many of your mods... ;oP
Now get the offset to the warthog_standard.bitm with whatever means you find easiest...For my map, it's 0x024C9544...0x68 bytes into this meta, you should see the 6 LOD offsets, followed by their sizes...Should look something like:
Code: Select all
0036FF88 00E0FD88 008AFD88 FFFFFFFF FFFFFFFF FFFFFFFF 80550500 80550100 80550000 00000000 00000000 00000000
Code: Select all
0036FF88 FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF 80550500 00000000 00000000 00000000 00000000 00000000
Now, the first offset (0x88FF3600) is a shared offset, we can tell cause the high nibble is 8...So we will subtract 0x80000000, leaving us with 0x08FF3600...Because that was an 8, we know this offset is in shared.map...If it were a 4, it would be in mainmenu.map, and a C the single_player_shared.map...
Now, we note the size of this bitmap is 0x00055580...All textures in Halo 2 are rounded up to 512, so we round this up to the nearest 512 (0x00055580 + (512 - (0x00055580 % 512)))...This gives us the new size of 0x00055600...
Before moving on, we'll replace the offset while we're here...Change the offset (0x88FF3600) with the point we will be injecting too, which is the current index offset (0x023AE200)...
So we go to offset 0x08FF3600 in shared.map, and select 0x00055600 bytes...Copying them, we return to coagulation, and jump to 0x023AE200...Paste the data here, inserting it...Now that the map has changed sizes, we'll need to fix a couple of values in the header...0x08 is the size of the map, and 0x10 is the offset to the index...Both need to be increased by the size of the injected data, since the map size has increased by this, and the index has been moved by the same value...
Now save your work, and run whatever tool you use to correct the encryptomatic signature (I use the TF6 tool, since it's quick, and I won't be making other changes to the map)...
Now the coagulation map has its own warthog_standard.bitm, and you can use your favourite editor to do to it as you please...
For those of you who are interested, this works due to the design of Halo 2 maps...Bitmaps happen to be just before the index..This is the purpose of the magic value(s), which are calculated based on some constants and the offset to the index (among some other values)...So if the index is moved, all reflexives are fixed, because magic will change corresponding to this change...This allows meta of a map to be built, without requiring knowledge of the size of the raw data...Thanks of course to TheSwampFox for verifying that this still works with Halo 2...
It should be noted that PPF's don't work correctly when maps change size (especially in this fashion)...So don't expect to be distributing this with many of your mods... ;oP