u/Itismrwonderful

Image 1 — Another SR1 PC Recomp update (3d models finally showing up)
Image 2 — Another SR1 PC Recomp update (3d models finally showing up)

Another SR1 PC Recomp update (3d models finally showing up)

While I just updated the community recently about the menu but now we are getting into the meat and potatoes of the project, actual 3d rendering.

The game kinda already knows where the button icons go (gray boxes), the player model is in dx12 by hooking into the PM4 Draw_index2 (yes 2) command. While I believed i hooked into it properly earlier, turns out some of the hooks need adjustments to show properly.

The city rendering shouldnt be too difficult, its finding the PM4 command/DX9 command that renders it and fixing it to show correctly.

So we got 2d rendering working (menu) and now 3d. Some of these issues can be attributed to shader issues or hooked incorrectly. Once I fix the skinning and the animations, the textures for the 3d model should appear and animations will work and not in tpose.

Nothing is recreated, its all pcc menus, reading from the game exe and game files to properly place the buttons where they should etc.

Once both the 3d city appears and things are properly textured, then I can press begin game and go to the first level lol.

The player creation screen has many of the game systems, unlike the menu that are being used for the first time and seeing the results. Once its fixed here, everything else should fall into place easier (because the 3d models arent suddenly going to be more difficult to render once the game progresses lol it uses all the same systems, might use different shaders which may prevent some things from working correctly until i fix the shader issue)

u/Itismrwonderful — 2 days ago
▲ 206 r/SaintsRow

SR PC Recomp Update! 1 month in!

What you are seeing the PPC menu, not a recreated menu.

Fun fact: When you take a game in PPC and convert it to CPP, you end up breaking a few things lol.

This menu is one of the toughest parts of the project, just reaching it was difficult because everything that needed to be fixed to reach that point.

Just to reach the menu requires many PPC functions to work flawlessly because the game is there, it is complete, so no need to recreate anything. Let me explain
The game already has a BINK SDK (thats how the game shows bink videos duh), same with all the states the game is, like the game detects when a bink video done, etc and after all of that it loads the menu builder etc.

So there is no way for me to, lets say create my own bink video and texture decoder and go straight to sr_night because, first off, the game doesnt know what the hell you are doing so it wedges (Stops) at bootup.

You have to respect the original code, you have to listen to the code but at the same time, we all know how optimized Saint's row is and surely there are better ways to do stuff from twenty years ago (yes its been 20 years)

So the gameplan the last couple weeks have been as follows:
* If there are any broken or damaged or slow PPC functions, replace it with CPP equivalents that is faster. Easy way to do this is look at the assembly code and see what the function is supposed to do and just recreate it in cpp (the function).

*The bink SDK, obviously relies on things like the Xbox files API etc, so a easy way to have the bink sdk work naturally is by hooking into the Bink SDK and running FFMPEG as the main player, so once the video is done it will tell bink sdk its done and flag it etc.

*After all that, we got the sr_night video loaded but where is the menu? Well, this is where the broken PPC functions and we replace it with faster cpp and also doing deep RE by comparing the retail ppc trace to the RE and seeing what functions are not being fired correctly

Meaning that, SR has pumps, something the engine “pumps” once per tick so subsystems advance such as audio, loading screen, fade in of logos etc. Its critical that my recomp matches the retail pumps so the game progresses natually.

After that was done, after the pumps were working correctly, the bigger job was fixing the menu builder and finding the ppc code that places all the emblems (the white thingy at the middle of the black box at the top and bottom), the deco art at the bottom and top of the black box, the text, the gold bar, the sr logo properly cropped and trimmed.

You would think it would be easy in CPP to create a menu with new game etc, first off the game already has it completed and finished so why recreate it and also there is a REASON why the menu isnt showing so you skipping ahead and recreating it yourself doesnt change the fact that the game aint progressing. Using the PPC code for everything maintains all the internal wiring (with a few fixes of course) like the exact measurements of the menu placements, if I press new game, it automatically follows the retail flow of the loading screen and the player creation screen.

Nothing is "host" recreated, its all done by the retail code.

Q. Does anything happen when you press New Game?
A. I haven't trie- just kidding I have but again, when you press new game, there is a flow that it follows and there is couple functions that will likely need cpp replacements so it runs faster or correctly.

Q. The Menu is in PPC?
A. Its the retail menu, nothing is recreated or manually placed, it all works off the retail code, its placed by the coordinates in the ppc code and the sprite id and has all the trim etc done by the ppc code.

The game is like trying to teach a kid how to walk, you have to kinda prod it along, help it when its stumbles.

The gameplan is set, once I figured out to simply just recreate any broken or slow ppc functions instead of sit and fix it (plus its highly inefficient), the game runs alot better and making progress alot better.

The menu was the most difficult, it has multiple layers to it, art wise, and you have to find all the functions relating to those art layers to get everyone to play along nicely.

Making progress, I am still going to do some little bit of investigating on some of the art placements for the menu, but I am working on the wiring for the new game option and the menu options and making sure it pulls the correct screens and follows the right flow.

This is all running in DX12 btw, all rendered natively in DX12, the draw calls from the PPC/PM4/DX9 are being funneled correctly and shown in DX12, which is exciting in its own right.

Once I get to gameplay and make sure everything is at least working, I do plan to create a github etc.

I hear you. But progress is being made really fast.

u/Itismrwonderful — 7 days ago

It's been a productive two weeks..I was going to write a big ol post but it gets confusing after awhile so here is some easy to read bullet points.

  • PM4 to DX12 is mostly implemented, the reason why is because SR doesnt strictly use DX9 to render certain things, some things are done through PM4 commands, such as shader bindings. I'm not going to half a$ it so I implemented it fully that I can reuse for other recomps. PM4 commands are very low level and i am attempting to convert it to a dx12 command, which is a task in itself. It's like trying to convert assembly back to C++, but unlike C++, PM4 is the only thing...its not like it starts off at a higher language and converted to PM4, its just PM4...
  • There is a DX9 > DX12 system in place as well like Sonic Unleashed, but simply hooking into DX9 API is not enough because certain things in SR are done through PM4 commands, which I found out.
  • Sonic Unleashed is not as complicated as Saints Row, the sheer number of functions, the cpu job system, the mixture of both DX9 and PM4 and the undocumented nature of the SR engine makes this a formidable task in itself.
  • No PDB's or .Map (memory) files exist for SR, so every suspect function and possible memory address has to be either traced or logged to make sure that I am hooking into the correct address and watching the data it spits, or tracing something (like following a string) to see what is at the end of it.
  • The issues, such as the non visible menu, have nothing to do with unimplemented kernals, nothing from Rexglue or Xenia would fix these issues because the Renderer is custom built.
  • I have hooked into many of the DX9 calls and have them convert to dx12 on the fly, but it still doesn't magically make the game run, there are thousands of different moving parts, if one function is wedged or doesnt want to do anything, the whole thing comes to a screeching hault.
  • I tried recreating the menu in C++ by having a interactive plane in front of the sr_night video with NEW GAME, LOAD GAME ETC but, it runs into a host of different issues. There is a reason why the menu isnt loading, so me forcing a menu to show does not change the fact that a couple functions in the background are not loading correctly or the game is in the wrong "state" (The game, I believe has over 60 states it can be in).
  • This recomp is methodical and is being worked on for almost 10 hours a day.
  • Even if I used Rexglue, I would still be running into these issues because it uses Xenia as a GPU backend and this project is not using Xenia as a backend, if you want that true recomp feel, it has to be custom, which this is. Yes there are some things that I have learned and used but it doesn't speed up recomps because a dedicated project will be making a custom renderer and not repurposing a Xenia GPU backend, because at that point, might as well run Xenia lol.

I am still working on this project, still deep in development. Everyday its worked on. Once I figure out these quirks, I can finally get to the player creation screen.

reddit.com
u/Itismrwonderful — 17 days ago