chunk_pc

I started to work on g_chunk files. As I suspected, g stands for graphics. There isn't much to them, it's all obvious model data, but the way they're arranged isn't exactly straightforward. I can see all vertices and faces but have no clue which go together with what. In the screenshots I had moved every single vertex in chunk 102 up by 100 units.
 

Attachments

  • 20220708002740_1.jpg
    20220708002740_1.jpg
    223.6 KB · Views: 160
  • 20220708002812_1.jpg
    20220708002812_1.jpg
    274.4 KB · Views: 157
  • 20220708003045_1.jpg
    20220708003045_1.jpg
    251.5 KB · Views: 155
Further progress: g_chunk model export. I moved from blender scripts to just python.
So now there's sr2_chunk_extract_gmodels.py which exports to .obj. No uv's or any other things yet, so the models may not be very usable as is.
 

Attachments

  • Screenshot_20220713_163639.png
    Screenshot_20220713_163639.png
    94.1 KB · Views: 140
  • Screenshot_20220713_163651.png
    Screenshot_20220713_163651.png
    55.8 KB · Views: 135
  • Screenshot_20220713_163656.png
    Screenshot_20220713_163656.png
    123.4 KB · Views: 138
While fighting with the g_chunk models I had to look at many different places and ended up learning a lot about materials, objects, and other stuff. Here are some of the various ways I managed to break the chunkfile.
 

Attachments

  • 20220712181122_1.jpg
    20220712181122_1.jpg
    343.9 KB · Views: 147
  • 20220712155414_1.jpg
    20220712155414_1.jpg
    477.4 KB · Views: 157
  • 20220711175619_1.jpg
    20220711175619_1.jpg
    469.4 KB · Views: 152
  • 20220710153457_1.jpg
    20220710153457_1.jpg
    391.3 KB · Views: 158
  • 20220710151606_1.jpg
    20220710151606_1.jpg
    417 KB · Views: 145
New version of extract_gmodels, with somewhat broken uv's, and a new script, extract_materials.
To get textures, use the chunks texture tool, and then copy and rename the appropriate folder here like this:

1657883544724.png


Materials can contain anything between 0 and 16 textures. The script doesn't know which one is which, so it just picks the first one. I packed the unused textures in comments. So if you don't know this already, obj/mtl are human readable. You can open the mtl in a text editor and find them there.

Many objects are actually tinted in material settings. Like the yellow traffic lights, or the orange ultor fences, or the white walls of the church. Without this, they might look a bit off.

https://www.saintsrowmods.com/forum/threads/saints-row-2-chunks-texture-tool.12877/
 

Attachments

  • 1657882983055.png
    1657882983055.png
    740.5 KB · Views: 137
You mean editing the model and putting it back? Probably will be very possible but let's not get ahead of ourselves.
Yes i really want to added saints angel statues or something in the church or near Wardill airport cribs that would be great if you can
 
New addition: sr2_chunk_replace_gmodels.py
20220717170548_1.jpg

This is very crude and a lot of information is lost in the process, but here's how to try it:

1: Unpack chunkfiles, you need both chunk and g_chunk:
Screenshot_20220717_163112.png

2: Run extract_gmodels and extract_materials
Screenshot_20220717_163249.png


3: Do your changes here (but I recommend checking that it works as is first!)
4: Now run replace_gmodels
Screenshot_20220717_163532.png

5: Put them back in.

In g_chunks, there aren't many things left to figure out, but the last ones always takes the longest.
So please don't expect this to be actually usable in a while.

Some notes:
* Do not change the number of models in the folder (.obj files, anything else is ignored).
* Do not change the number of materials in a model.
* Materials can be changed by renaming them (like mat69 to mat420)
* Material names only work in format matN where N is a number.
* In blender you can easily end up with names like mat0.001. This will break the script. Actually I could filter those out, but for now avoid them.
* You can rename models to something more descriptive, like g_mdl_123.obj to g_mdl_123_house.obj. Just keep the alphanumeric order the same.

Do tell if you come across a chunk that doesn't load or crashes the game.
 
Last edited:
Back
Top