Optimized Stilwater[ALPHA] v0.2

This is not labelled in the editor since I found it today, but it seems that next to the bits that toggle shadows, there are bits that toggle lighting itself. This means you could make lights people only or world only.
1683407594201.png

The last value determines the type. Looks like the game has cases only for these two values.
0: "omni"
2: "circular spotlight"
1683407848096.png
 
Hey, sorry I've taken so long. I made an update with a couple changes:

Fixed the kaitai file.
I wrote script that tests it against every single chunkfile in sr2. Using this method I got it working with almost all chunks. It looks like the remaining crashing ones don't even have lights, which is the reason for the crash.

FAIL samples/extracted-chunks1.vpp_pc/sr2_chunk046.chunk_pc FAIL samples/extracted-chunks1.vpp_pc/sr2_chunk056.chunk_pc FAIL samples/extracted-chunks2.vpp_pc/sr2_chunk111yacht.chunk_pc FAIL samples/extracted-chunks2.vpp_pc/sr2_chunk127_ph.chunk_pc FAIL samples/extracted-chunks2.vpp_pc/sr2_chunk162.chunk_pc FAIL samples/extracted-chunks2.vpp_pc/sr2_chunk182_rec.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intaicutjyucar.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intapmisstnghbrthhd_bldg.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intarcutlimo.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intctcutmassage.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intdkmissunkdk.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intdtcutbar.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intdtmiscourt_lbby.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_inthecuttalent.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intmacutshoe.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intmucutshadydr.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intprcuthealthclinic.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intsecutlaura.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intsrcuthospital.chunk_pc FAIL samples/extracted-chunks3.vpp_pc/sr2_intsrmispolice02.chunk_pc Chunk 752 / 752[====================] 100% Done! FAIL 20 / 752 failed.


Import options:
Most chunks now make it through the importer but some crash the editor in a later stage. It has something to do with models, haven't looked into it properly. You can now skip cityobjects and their models to work around the crash.

I haven't tested this properly, but it's probably fine.
https://github.com/sevonj/sr2_chonker/releases/tag/0.0.3
As far i know Barrio distric and Ultor dome when looking back into broken drug labs my game got shuttering... Maybe there's some trouble in those two area.. even in the mountain the game shuttering so bad.. could be some light issues,Or anything and when everything got lagging when you going anywhere thats the sign the game would crash if you visit the shop first.. and buy something from the cloth stores
 
This is not labelled in the editor since I found it today, but it seems that next to the bits that toggle shadows, there are bits that toggle lighting itself. This means you could make lights people only or world only.
View attachment 35649
The last value determines the type. Looks like the game has cases only for these two values.
0: "omni"
2: "circular spotlight"
View attachment 35651
Hmmm I'm curious about the lightcharacter and lightlevel flags, I might do some more comparisons between the PC and Xbox version and see if that is the culprit of poor optimization as well. Also worth noting that (i think all?) of the street light shadows have the same optimization issues as the interior shadows.
 
Alright so I'm going to change trajectory a bit for the next releases. The next release will have all of the shadows in ALL of the interiors disabled. It will make things easier from a development standpoint. Hopefully releasing within the next week or so.
 
Last edited:
I kept combing through the chunks some more. Here's a generated list of which bits of the bitmask are used in chunks. It may have included some garbage data too, but at least it should tell which bits are not relevant.

Note: List edited, now one (and only?) garbage chunk is filtered out.
Code:
bit 00 used 0 times.
bit 01 used 0 times.
bit 02 used 0 times.
bit 03 used 0 times.
bit 04 used 0 times.
bit 05 used 0 times.
bit 06 used 0 times.
bit 07 used 0 times.
bit 08 used 0 times.
bit 09 used 4569 times.
bit 0a used 0 times.
bit 0b used 0 times.
bit 0c used 0 times.
bit 0d used 0 times.
bit 0e used 0 times.
bit 0f used 0 times.
bit 10 used 10892 times. <- light_level
bit 11 used 10321 times. <- light_character
bit 12 used 5695 times.  <- shadow_level
bit 13 used 7318 times.  <- shadow_character
bit 14 used 0 times.
bit 15 used 9 times.
bit 16 used 0 times.
bit 17 used 485 times.
bit 18 used 0 times.
bit 19 used 0 times.
bit 1a used 0 times.
bit 1b used 128 times.
bit 1c used 8997 times.
bit 1d used 7271 times.
bit 1e used 2721 times.
bit 1f used 9466 times.

Edit: I'm going to restructure the lights bit. This is how they will be exposed in the editor once I'm done:

Code:
bit 00 used 9466 times.  <- bitflag0
bit 01 used 2721 times.  <- bitflag1
bit 02 used 7271 times.  <- bitflag2
bit 03 used 8997 times.  <- bitflag3
bit 04 used 128 times.   <- bitflag4
bit 05 used 0 times.
bit 06 used 0 times.
bit 07 used 0 times.
bit 08 used 485 times.   <- bitflag8
bit 09 used 0 times.
bit 0a used 9 times.     <- bitflag10
bit 0b used 0 times.
bit 0c used 7318 times.  <- shadow_character
bit 0d used 5695 times.  <- shadow_level
bit 0e used 10321 times. <- light_character
bit 0f used 10892 times. <- light_level
bit 10 used 0 times.
bit 11 used 0 times.
bit 12 used 0 times.
bit 13 used 0 times.
bit 14 used 0 times.
bit 15 used 0 times.
bit 16 used 4569 times.  <- bitflag22
bit 17 used 0 times.
bit 18 used 0 times.
bit 19 used 0 times.
bit 1a used 0 times.
bit 1b used 0 times.
bit 1c used 0 times.
bit 1d used 0 times.
bit 1e used 0 times.
bit 1f used 0 times.
 
Last edited:
Wonderful Moyh! Also unrelated, I already shared this on discord but did you know that the skybox is it's own map chunk file?
 

Attachments

  • skybox.png
    skybox.png
    342.9 KB · Views: 76
I've been filtering out variables that are never used and trying to find what the remaining ones do. If I recall correctly, it might be more packed bits. There were a couple unknowns that looked so. I can try to make sense of them after the update I'm working on now.

Edit: I remembered wrong. It appears to be just a number.
Code:
result:
found value -891 3 times.
found value -387 2 times.
found value -326 10 times.
found value -321 12 times.
found value -320 1 times.
found value -319 8 times.
found value -308 1 times.
found value -302 5 times.
found value -296 9 times.
found value -294 3 times.
found value -293 1 times.
found value -283 1 times.
found value -277 1 times.
found value -276 6 times.
found value -275 9 times.
found value -270 1 times.
found value -268 5 times.
found value -251 4 times.
found value -249 1 times.
found value -212 4 times.
found value -209 5 times.
found value -208 6 times.
found value -203 1 times.
found value -202 4 times.
found value -201 1 times.
found value -195 12 times.
found value -190 1 times.
found value -188 1 times.
found value -184 1 times.
found value -181 1 times.
found value -176 1 times.
found value -174 2 times.
found value -170 4 times.
found value -164 6 times.
found value -158 3 times.
found value -151 2 times.
found value -141 4 times.
found value -133 1 times.
found value -129 2 times.
found value -128 3 times.
found value -125 8 times.
found value -123 2 times.
found value -117 5 times.
found value -116 2 times.
found value -115 9 times.
found value -112 1 times.
found value -109 2 times.
found value -106 1 times.
found value -99 1 times.
found value -98 16 times.
found value -94 8 times.
found value -89 1 times.
found value -86 5 times.
found value -85 8 times.
found value -84 8 times.
found value -82 7 times.
found value -80 4 times.
found value -78 2 times.
found value -74 1 times.
found value -72 2 times.
found value -69 5 times.
found value -68 3 times.
found value -67 16 times.
found value -66 3 times.
found value -65 1 times.
found value -64 1 times.
found value -63 1 times.
found value -62 2 times.
found value -60 7 times.
found value -58 2 times.
found value -56 1 times.
found value -53 2 times.
found value -52 2 times.
found value -51 7 times.
found value -50 2 times.
found value -49 6 times.
found value -47 2 times.
found value -45 3 times.
found value -43 1 times.
found value -42 4 times.
found value -41 4 times.
found value -40 7 times.
found value -39 4 times.
found value -38 1 times.
found value -35 2 times.
found value -34 1 times.
found value -33 2 times.
found value -32 1 times.
found value -30 12 times.
found value -29 6 times.
found value -28 1 times.
found value -26 4 times.
found value -25 4 times.
found value -24 2 times.
found value -22 4 times.
found value -21 2 times.
found value -20 2 times.
found value -18 1 times.
found value -17 4 times.
found value -15 6 times.
found value -14 20 times.
found value -13 18 times.
found value -12 2 times.
found value -11 1 times.
found value -9 4 times.
found value -8 3 times.
found value -7 5 times.
found value -6 8 times.
found value -5 6 times.
found value -4 9 times.
found value -3 9 times.
found value -2 18 times.
found value -1 73 times.
found value 0 10464 times.
found value 1 94 times.
found value 2 40 times.
found value 3 32 times.
found value 4 7 times.
found value 5 36 times.
found value 6 15 times.
found value 7 3 times.
found value 8 9 times.
found value 9 6 times.
found value 10 12 times.
found value 11 11 times.
found value 12 9 times.
found value 13 4 times.
found value 14 4 times.
found value 15 22 times.
found value 17 2 times.
found value 18 12 times.
found value 19 5 times.
found value 20 2 times.
found value 24 11 times.
found value 25 9 times.
found value 26 16 times.
found value 31 1 times.
found value 33 5 times.
found value 35 1 times.
found value 36 2 times.
found value 37 16 times.
found value 39 6 times.
found value 41 1 times.
found value 50 11 times.
found value 51 1 times.
found value 52 1 times.
found value 60 4 times.
found value 66 2 times.
found value 74 8 times.
found value 75 24 times.
found value 81 12 times.
found value 83 20 times.
found value 85 2 times.
found value 91 4 times.
found value 93 1 times.
found value 100 8 times.
found value 106 16 times.
found value 109 2 times.
found value 120 1 times.
found value 144 1 times.
found value 151 12 times.
found value 179 8 times.
found value 180 12 times.
found value 183 8 times.
found value 197 16 times.
found value 263 1 times.
found value 311 6 times.
found value 314 1 times.
found value 315 2 times.
found value 329 1 times.
found value 337 1 times.
found value 350 1 times.
found value 371 1 times.
found value 408 7 times.
found value 433 1 times.
found value 443 1 times.
found value 496 4 times.
found value 549 1 times.
found value 681 4 times.
found value 707 2 times.
found value 710 1 times.
found value 891 4 times.
 
Last edited:
Back
Top