SR2 Retexture Help

Hey Volition, I wanna ask, is it just me that when I change a weapon's resolution (For example, from 512x512 to 1024x1024) the game gets a lot more unstable that it might even crash?

Sometimes it won't crash, but it will make glitches like when you fire, you'll crash, or other textures are stranger than before, etc.

Also, when I'm trying to retexture the AK47 (Or Krukov-6), the wooden part makes no change. Is that normal? Something I'm doing wrong or apparently the tool isn't "functioning"?
 
Hey Volition, I wanna ask, is it just me that when I change a weapon's resolution (For example, from 512x512 to 1024x1024) the game gets a lot more unstable that it might even crash?

Sometimes it won't crash, but it will make glitches like when you fire, you'll crash, or other textures are stranger than before, etc.

Also, when I'm trying to retexture the AK47 (Or Krukov-6), the wooden part makes no change. Is that normal? Something I'm doing wrong or apparently the tool isn't "functioning"?

What tool are you using for this? Texture corruption sounds like the peg is not correctly constructed or maybe something incorrect about the container. Textures that do not change are probably preloaded, so we simply don't load the texture from the streaming container. Another option is just the way bitmaps work on the SR engine. We might load 50 textures with the same handle, but we just pick one of them to actually display. We pick the first texture loaded of the highest resolution loaded, so if your texture is 5th to load, it will not display. One way to somewhat hack that would be to increase the resolution of your texture, but then you could run into memory issues.
 
What tool are you using for this? Texture corruption sounds like the peg is not correctly constructed or maybe something incorrect about the container. Textures that do not change are probably preloaded, so we simply don't load the texture from the streaming container. Another option is just the way bitmaps work on the SR engine. We might load 50 textures with the same handle, but we just pick one of them to actually display. We pick the first texture loaded of the highest resolution loaded, so if your texture is 5th to load, it will not display. One way to somewhat hack that would be to increase the resolution of your texture, but then you could run into memory issues.
Knobby: our texture tools for SR2 are very primitive. I'd appreciate any information you could give? ;)
 
Knobby: our texture tools for SR2 are very primitive. I'd appreciate any information you could give? ;)

I thought I had posted this, but maybe not. Here goes the peg info from SR2(probably identical in SR3):
header:
uint32 signature
uint16 version
uint16 platform
uint32 directory block size
uint32 data block size
uint16 number of bitmaps
uint16 flags
uint16 total number of entries(animated bitmaps may make this < number of bitmaps)
uint16 alignment value

after the header immediately follows the peg entries:
uint32 data pointer/offset
uint16 width
uint16 height
uint16 bitmap format
uint16 pal format
uint32 mip filter value
uint16 number of frames
uint16 flags
uint32 filename pointer/offset
uint16 pal size
uint8 fps
uint8 mip levels (base frame + number of mips, always at least 1)
uint32 frame size (bytes in palette + image)
uint32 next pointer (runtime)
uint32 prev pointer (runtime)
uint32 cache (runtime)
uint32 cache (runtime)

A vbm is just a peg with a single entry, nothing special there. Palette data seems to be a PS2 relic. PC bitmap formats are DXT1, DXT3, DXT5, 565, 1555, 4444, 888, 8888, 16_DUDV, 16_DOT3_COMPRESSED and A8 starting at value 400 and going sequentially. The peg entry flags are bitfields with the least significant bit being alpha, then non power of two, alpha test, cube map, interleaved mips, interleaved data. The interleaving information is really only used on Xbox 360 to help make the texture alignment not as horrible.
 
Thanks for the info.
I couldn't work out what some of the data in the peg files was for. So I could only edit an existing peg and not create a new one.

I take it pal format/size refers to palette format and size which as you say is obsolete.

I guess any data with (runtime) is basically junk data that gets overwritten by the engine once the file has been loaded in.

Does number of frames and fps correspond to animated bitmap sheets?

I'll get working on updating my texture utilities.
 
I take it pal format/size refers to palette format and size which as you say is obsolete.
Correct, it looks like the palette size value is just set to 0, I don't see any code referencing the palette stuff at all, it might be a garbage value.
I guess any data with (runtime) is basically junk data that gets overwritten by the engine once the file has been loaded in.
Should be zero'd out in the file
Does number of frames and fps correspond to animated bitmap sheets?
Exactly. With animated textures(we don't use many, possibly any), you specify the number of frames the texture has and the fps tells you how fast to switch between them.
 
What tool are you using for this?

PegTools, which sadly, as Minimaul says, it's "very primitive". For example, the DXT formats don't work, which kind of sucks since DXT is a nice lossless compressor.

Textures that do not change are probably preloaded, so we simply don't load the texture from the streaming container.

Does that mean that I can pretty much re-edit the "preload.tbl" and remove the Krukov's preload? Or add it?

We might load 50 textures with the same handle, but we just pick one of them to actually display. We pick the first texture loaded of the highest resolution loaded, so if your texture is 5th to load, it will not display.

One way to somewhat hack that would be to increase the resolution of your texture, but then you could run into memory issues.

I wonder, and not too sure if you can answer it or try to; can that actually be fixed/changed? ("Modders way" of course) It would be nice to stabilize SR2's "texture system", so to say.
 
Does that mean that I can pretty much re-edit the "preload.tbl" and remove the Krukov's preload? Or add it?
There is more to it than that on SR3, I *think* it is the same on SR2, but I'm not sure. The preload data is precomputed and written into packfiles. I would just alter the texture in that preload peg if I were you.

I wonder, and not too sure if you can answer it or try to; can that actually be fixed/changed? ("Modders way" of course) It would be nice to stabilize SR2's "texture system", so to say.
We won't be able to make any drastic changes to the texture system in SR2. This system has worked well for us for many games and I don't see that changing anytime soon. If we have a texture named blue.tga, we obviously would like to display the highest res version available and any of the blue.tga's that are loaded is as good as the next one. I can see your point of wanting to change the texture for a weapon mod, but if that texture is shared across many weapons, you could get some undesired results and I would just try to find a way to "fix" the issue by modifying all or the preload version or change the texture name if I were you. Changing the texture name is probably the best, but hardest route, because you'd need to find where the item defines the texture it uses and alter that. Maybe one of the other guys at V knows more about that system.
 
I thought I had posted this, but maybe not. Here goes the peg info from SR2(probably identical in SR3):

It looks like the peg format in SR3 has a few extra bits of data in it. :(

I think I've got most of the data to line up. Do you know what the differences are between the 2 formats?
 
It looks like the peg format in SR3 has a few extra bits of data in it. :(

I think I've got most of the data to line up. Do you know what the differences are between the 2 formats?

Looks like we added 4 floats right after the flags in the peg entry for average color data. They are average red, green, blue, and alpha respectively.
 
Back
Top