Track backgrounds
Track backgrounds
This seemed like the best place to post this.
I was playing with the PODpaint tool. I see that many of the original 16 tracks, such as Cocoon, Burrow, HQ, etc. that do not have backgrounds in the game actually do have background textures in the BL4. But for some reason these are never displayed in the game. Cocoon even has its own unique sky!
I wonder if enabling the background or sky in the game could be accomplished by just changing a few bytes in the BL4? Or would it require a total recompile of the track?
I was playing with the PODpaint tool. I see that many of the original 16 tracks, such as Cocoon, Burrow, HQ, etc. that do not have backgrounds in the game actually do have background textures in the BL4. But for some reason these are never displayed in the game. Cocoon even has its own unique sky!
I wonder if enabling the background or sky in the game could be accomplished by just changing a few bytes in the BL4? Or would it require a total recompile of the track?
- Skubidou
- Administrateur
- Messages : 2367
- Inscription : 19 juil. 2003 17:39
- Localisation : Lonzée (B)
- Contact :
I have look back to the documentation... Not tested but this should be correct...
Search the 'sky.tga' string (i think it is in each track)
Before this string, you will find 3 DWord (01 00 00 00)
Before this, a crypt string (1 byte for the length followed by the string)
Before this a DWord (Background color?)
Before this a Dword (in red on the picture). This Dword activate the background (0=no background. Other walue=background)
But i don't know if it will be 'beautifull'. Some background were disable simply because on theses tracks you can see below the background bottom limit, so you will have a background in the middle of the dark ...
Skubidou:~
Search the 'sky.tga' string (i think it is in each track)
Before this string, you will find 3 DWord (01 00 00 00)
Before this, a crypt string (1 byte for the length followed by the string)
Before this a DWord (Background color?)
Before this a Dword (in red on the picture). This Dword activate the background (0=no background. Other walue=background)
But i don't know if it will be 'beautifull'. Some background were disable simply because on theses tracks you can see below the background bottom limit, so you will have a background in the middle of the dark ...
Skubidou:~
Thank you Skubi...
But is there any tool for re-encrypting tracks? PODpaint can decrypt them but I see no way to transform back into BL4, unless I'm missing something.
I just spent a lot of time comparing the encrypted file with the decrypted dump, and working out where the checksums are located in the file, and editing the encrypted BL4 by hand.
I succeeded! I now have a working background on HQ.
Still, is there any tool to make the job easier?
But is there any tool for re-encrypting tracks? PODpaint can decrypt them but I see no way to transform back into BL4, unless I'm missing something.
I just spent a lot of time comparing the encrypted file with the decrypted dump, and working out where the checksums are located in the file, and editing the encrypted BL4 by hand.
I succeeded! I now have a working background on HQ.
Still, is there any tool to make the job easier?
Some stuff for sky, if anyone is interested:
As with Skubi's example,
"sky.tga" string (dark blue) There are multiple instances of this string; this is the last one.
Before that, 3 DWORDs (green), all set to 01 (little-endian)
Before that, some encrypted stuff(?) (black)
Before that, 1 DWORD (orange), always 2D
Before that, 1 DWORD (yellow), no idea, varies by track
Before that, 1 DWORD (light blue) - IMPORTANT, see below
before that, 1 DWORD (violet), always 0D
Before that, 1 DWORD (brown), no idea, varies by track
Before that, 1 DWORD (red).
This last one is what enables sky. Change the low-order byte to 01 for rolling sky, 11 for static sky, 00 to disable sky.
The DOWRD marked in light blue is important. The high-order bytes (00 00 in this case) determine the "fade colour" of the sky. The sky will slowly change to this colour at the edges (e.g. Pompeii fades to white at the edges). Seems to only work with rolling sky. 00 00 for white, FF FF for black. Other values not tested. The low-order bytes of this DWORD vary by track; no idea what their purpose is.
As with Skubi's example,
"sky.tga" string (dark blue) There are multiple instances of this string; this is the last one.
Before that, 3 DWORDs (green), all set to 01 (little-endian)
Before that, some encrypted stuff(?) (black)
Before that, 1 DWORD (orange), always 2D
Before that, 1 DWORD (yellow), no idea, varies by track
Before that, 1 DWORD (light blue) - IMPORTANT, see below
before that, 1 DWORD (violet), always 0D
Before that, 1 DWORD (brown), no idea, varies by track
Before that, 1 DWORD (red).
This last one is what enables sky. Change the low-order byte to 01 for rolling sky, 11 for static sky, 00 to disable sky.
The DOWRD marked in light blue is important. The high-order bytes (00 00 in this case) determine the "fade colour" of the sky. The sky will slowly change to this colour at the edges (e.g. Pompeii fades to white at the edges). Seems to only work with rolling sky. 00 00 for white, FF FF for black. Other values not tested. The low-order bytes of this DWORD vary by track; no idea what their purpose is.
So, now, backgrounds can look good:
..or terrible:
So, how to fix this? The problem in Burrow (and also HQ) is that the background in too high, or not stretched enough vertically. You can then see the bottom of the background and a black void beneath.
Is there a setting that controls this (vertical position/size)? See Veitland for comparison; in that track the bottom of the background is very, very low. I haven't been able to find the bytes controlling this kind of setting.
Can you help, Skubi?
..or terrible:
So, how to fix this? The problem in Burrow (and also HQ) is that the background in too high, or not stretched enough vertically. You can then see the bottom of the background and a black void beneath.
Is there a setting that controls this (vertical position/size)? See Veitland for comparison; in that track the bottom of the background is very, very low. I haven't been able to find the bytes controlling this kind of setting.
Can you help, Skubi?
- Skubidou
- Administrateur
- Messages : 2367
- Inscription : 19 juil. 2003 17:39
- Localisation : Lonzée (B)
- Contact :
Just what i said.Skubidou a écrit :But i don't know if it will be 'beautifull'. Some background were disable simply because on theses tracks you can see below the background bottom limit, so you will have a background in the middle of the dark ...
No way to move background for what i know. Only "solution" would be to move all polygons from the tracks higher....hoping this will not create another bug (polygons hit the sky )
Skubidou:~
I always thought the background does not depend on the coordinates in the map, i.e. it is always drawn with the centre point where the racer is.Skubidou a écrit :No way to move background for what i know. Only "solution" would be to move all polygons from the tracks higher....hoping this will not create another bug (polygons hit the sky )
So it would not matter how high polygons are because no matter where you are on the track - higher or lower - you always see the same background.
Is this thinking wrong?
And thanks Skubi, I appreciate your help very much!
- Skubidou
- Administrateur
- Messages : 2367
- Inscription : 19 juil. 2003 17:39
- Localisation : Lonzée (B)
- Contact :
Not sure, but i think the background is always at the same place in the 'space' (it is sure it is not moving depending on the place of the player).
After, if the track is large enough and high enough, with the 'view angle' from each point where the driver can be, you can not see lower than the background limit. If the track is small, or lower and small external 'wall' or no external wall, your view angle allow you to see beneath the background limit.
But not sure, we don't have find 100% of the bytes signification (we focus more on the track part than on the other parts)
Skubidou:~
After, if the track is large enough and high enough, with the 'view angle' from each point where the driver can be, you can not see lower than the background limit. If the track is small, or lower and small external 'wall' or no external wall, your view angle allow you to see beneath the background limit.
But not sure, we don't have find 100% of the bytes signification (we focus more on the track part than on the other parts)
Skubidou:~
The source code is included. If you do not have Delphi, I can add the "missing" button - just send me an email to nicode@gmx.net with [pod] in the subject.Mercury a écrit :Still, is there any tool to make the job easier?