SR2 Retexture Help

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.
Great :) I will get started on updating PegTool when I get home tonight :)
 
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.

Thanks for the solution "theories", but what I don't really get is "the preload version", are you saying there are textures that are not exactly the texture itself but the preload's?

Sounds interesting, as well as "texture name change", I'd like to try that.

Great :) I will get started on updating PegTool when I get home tonight :)

Sounds great, but what will be "changed" or "added" exactly? Perhaps you will be able to make DXT be able to be used now?
 
Thanks for the solution "theories", but what I don't really get is "the preload version", are you saying there are textures that are not exactly the texture itself but the preload's?

We preload some textures/models at game boot. The commonly used things end up there. We have a preloaded effect peg and a preloaded item peg. If the texture was on a preloaded item, it will be in that peg and that will probably be the first one that is loaded. So if you wanted to change wood.tga, that would be a good place to try to find it if you wanted to not alter dimensions of the texture but wanted anything using wood.tga to pick up your version.
 
Well, let's see here as an example. I'm using PegTools, I get "p_ak47.peg_pc" and "p_ak47.g_pec_pc", I put the one that is peg_pc onto "PegTool.exe", which pretty much "extracts" the texture. I get "ak1_s.tga_0.png", "ak2_me.tga_0.png" and "ak1_me.tga_0.png". The first one can be retextured, but the second one (ak2_me.tga_0.png) makes no difference.

So, if I want that texture part to be changed, I should change the "wood.tga" in "preloaded item peg"?
 
So, if I want that texture part to be changed, I should change the "wood.tga" in "preloaded item peg"?
It wouldn't be a different texture name. If changes to the texture don't reflect on the screen, there is another peg with a texture that has the same name loaded before that one. This could be another weapon or a preload peg. Another option is a higher resolution texture with that name loaded later.
 
Btw, the second texture name is probably the texture that was assigned to the object to tell the audio system which sound to play.

On the content side, we make use of suffixes partially for sanity (_s for spec) and partially for the engine (_me, which gets interpreted by the system that determines what sound file to play when that object gets hit).
 
I decided to do some hunting, and the ak is authored the same way characters are -- With everything on one tile and unwrapped. The wood texture you want to modify exists inside ak2_me.tga

Hopefully that's enough for Knobby to point you in the right direction
 
Exists "inside"? I don't get what you mean exactly, I use PegTools for it, and what I get is "ak2_me.tga_0.png", that is pretty much a picture of the wooden parts of the AK as well as the clip (Not sure why the clip is there)

Problem is, no matter how much I try to modify it, it doesn't work. That's what I'm pretty much worried about.

EDIT: Oh yeah, I extracted the peg and g_peg of "p_ak47", isn't that what I'm looking for and want to modify, or is it actually another file? (At least for the wooden parts of it)
 
I mean it's part of the texture, much like the wood is part of the handle in this bitmap.

If you're seeing what I think you're seeing, the reason that the clip is in the same map as the wood is because it's a memory saving trick.

How're you trying to modify the bitmap you've found?

(Also, I believe the g_peg is what you want to be extracting from, but Knobby could confirm for sure.)
 
Back
Top