"I thought this was going to be easy" I thought to myself. Oh... what a fool I was.
For the past few days I have been poking around the files of the PC version of Saints Row 2. You see, the xenia(Xbox 360) emulator had a recent update that significantly improved performance. One of those games being none other than Saints Row 2. With it rendering nearly everything perfectly, except for light coronas which seems to clip through geometry. I started taking loads of screenshots of Saints Row 2 both of xenia and the PC port. Shortly afterwards I started playing a game of spot-the-difference between the two. That is when I noticed something that caught my eye. Saints Row 2 on PC has more shadow maps than the console counterpart. Not only that but the areas that had additional shadows was where the frame rate dipped. "Hmmmmm... am I on to something?" I thought to myself. I quickly googled various terms to see if anybody else noticed this and from my results the answer was no.
PC screenshot above, xenia screenshot below:
This is where I developed a theory, that the shadows were what was responsible for the framerate drops for the interiors in the PC version. I figured that if I could disable the shadows from the light source I could improve the performance in these areas. I thought I could release an "Optimized Stilwater" mod. First, I tried out Möyh Mäyh's experimental map editor, just to test things out I replaced the light you see under the pole dancer with a plant. I thought the light object itself was responsible for casting lights. Nope! Just a pole dancer on a plant with a terrible frame rate. So then I messed around with various "lightset" files. Only to find out that those files are for editing light data in cutscenes, not the map itself. A bit frustrated at my first couple attempts I browsed the forums and learned of Möyh Mäyh's SR2 Chunk Kaitai. It is a tool that lets you view the data of the "chunks" files in the game. It is still very much a work-in-progress so I asked him if I could view and edit lighting data with the tool. Surely enough I could! In fact he added that just hours before I asked.
Then things got a little bit funky to say the least. Each light source in the game (seems) to have 36 flags. The thing is we don't know what most of these do, yet. Eager to mess with the lighting I found the light I wanted to edit. "Finally, people could play Saints Row 2 at a consistent(ish) frame rate after all these years!" I was excited. I eagerly booted up the game to see that successfully manged to edit the light to stop casting shadows! Only... um the framerate drop is still there. Welp, there went my theory. Perplexed, I continued fiddling with the other lighting flags. Setting all(except pos) of them to 0, and wouldn't you know it essentially deleted the light and the frame rate improved dramatically! But then another issue occurred, the light in the office was not working. How did that happen? Shortly afterwords I got a crash. Now I was even more perplexed. With no idea what else to do I went through a cycle of setting every "unk" to 0 except 1 which was left at the default setting. I did this in sequential order, until I found the culprit. "Unk10" when messed with seems to be responsible for the the performance issues and the crashes. All of the other "unks" don't seem to have any effect on the performance or stability. As of this date we still don't know exactly what "unk10" does. But I can confirm that Möyh Mäyh will be looking into unk10 soon. The remedy of Saints Row 2's frame drops may soon be within grasp.
I will be sure to post any updates regarding these endeavours.
P.S. A big thanks to Möyh Mäyh for his tools and all his help!
For the past few days I have been poking around the files of the PC version of Saints Row 2. You see, the xenia(Xbox 360) emulator had a recent update that significantly improved performance. One of those games being none other than Saints Row 2. With it rendering nearly everything perfectly, except for light coronas which seems to clip through geometry. I started taking loads of screenshots of Saints Row 2 both of xenia and the PC port. Shortly afterwards I started playing a game of spot-the-difference between the two. That is when I noticed something that caught my eye. Saints Row 2 on PC has more shadow maps than the console counterpart. Not only that but the areas that had additional shadows was where the frame rate dipped. "Hmmmmm... am I on to something?" I thought to myself. I quickly googled various terms to see if anybody else noticed this and from my results the answer was no.
PC screenshot above, xenia screenshot below:
This is where I developed a theory, that the shadows were what was responsible for the framerate drops for the interiors in the PC version. I figured that if I could disable the shadows from the light source I could improve the performance in these areas. I thought I could release an "Optimized Stilwater" mod. First, I tried out Möyh Mäyh's experimental map editor, just to test things out I replaced the light you see under the pole dancer with a plant. I thought the light object itself was responsible for casting lights. Nope! Just a pole dancer on a plant with a terrible frame rate. So then I messed around with various "lightset" files. Only to find out that those files are for editing light data in cutscenes, not the map itself. A bit frustrated at my first couple attempts I browsed the forums and learned of Möyh Mäyh's SR2 Chunk Kaitai. It is a tool that lets you view the data of the "chunks" files in the game. It is still very much a work-in-progress so I asked him if I could view and edit lighting data with the tool. Surely enough I could! In fact he added that just hours before I asked.
Then things got a little bit funky to say the least. Each light source in the game (seems) to have 36 flags. The thing is we don't know what most of these do, yet. Eager to mess with the lighting I found the light I wanted to edit. "Finally, people could play Saints Row 2 at a consistent(ish) frame rate after all these years!" I was excited. I eagerly booted up the game to see that successfully manged to edit the light to stop casting shadows! Only... um the framerate drop is still there. Welp, there went my theory. Perplexed, I continued fiddling with the other lighting flags. Setting all(except pos) of them to 0, and wouldn't you know it essentially deleted the light and the frame rate improved dramatically! But then another issue occurred, the light in the office was not working. How did that happen? Shortly afterwords I got a crash. Now I was even more perplexed. With no idea what else to do I went through a cycle of setting every "unk" to 0 except 1 which was left at the default setting. I did this in sequential order, until I found the culprit. "Unk10" when messed with seems to be responsible for the the performance issues and the crashes. All of the other "unks" don't seem to have any effect on the performance or stability. As of this date we still don't know exactly what "unk10" does. But I can confirm that Möyh Mäyh will be looking into unk10 soon. The remedy of Saints Row 2's frame drops may soon be within grasp.
I will be sure to post any updates regarding these endeavours.
P.S. A big thanks to Möyh Mäyh for his tools and all his help!