Brawlback Progress Report #2
Added 2023-04-29 20:58:27 +0000 UTCThe first quarter of 2023 has been both a frustrating and insightful development period for Brawlback, and as we hit a major milestone I will discuss later in this post, we wanted to hone in on the progress made in terms of finishing up the rollback netcode.
Challenges and Roadblocks
The biggest challenge with picking up where PiNE left off with savestates specifically is that the functionality that Brawl has that prints off what portions of memory are currently in use actually caused crashing when loading a savestate on rollbacks. For months we were convinced this was due to some issue with the memory where certain portions of memory couldn't handle being rolled back for whatever reason, so the effort being placed was on analyzing which portions of the savestate we needed to scrape out of the reporting Brawl was giving us on the side of the emulator. However, after awhile it became apparent this was not the issue as the game began to crash randomly as well. As a result, WhiteTPoison began a period of analyzing the code to figure out the points where it would crash. This analysis brought up a very unfortunate fatal error in the Python compiler we were using to inject code into the game: it simply did not create the assembly code at the locations it said it was. As a result, we had 2 options, either figure out a different way of injecting code into the game, or fix the existing one. Fortunately, almost exactly at this time a new development in injecting C++ code into the game was released: Syriinge.
Syriinge
Syriinge is a tool developed by Sammi Husky, a very well respected Brawl modder from the very beginning of the scene, that allows for runtime hooking, a method by which you essentially insert foreign code at boot time, via C++. The way it works is pretty complex, but the loose difference between Syriinge and the framework developed by Fracture17 is that Syriinge is more stable due to its injections being packaged as a *.rel module file and inserted into the game via methods already intended by the game (there are other *.rel files within the game, therefore functionality to load them already exists,) whereas Fracture's system required some magic we don't really understand and may never fully understand due to Fracture's continued absence from the modding scene.
While the translation from our original codeset to the new one was very difficult and required a lot of bug fixing due to the difference between GCC C++17 and MWCC C++99, it has proven to be quite fruitful as the game no longer randomly crashes as far as we can currently tell, and we have a greater level of control over the memory management and injections (yes, that means we can fix any issues presented by Sheilda now).
Future Roadmap
For the forseeable future, the work will be concentrated on getting rollback and embedded matchmaking out the door. That being said, we still cannot give a discrete release period as we aren't sure how long it will take to fix the remaining issues (desyncs and any remaining crashes.) Replays will have to take a backseat until then, as the existing codebase will need to be translated to Syriinge, which will take around the same time as it did for the existing netcode.
Credits
I want to give huge shoutouts to Sammi Husky for Syriinge, as without it we would have to figure out by ourselves a new system for runtime hooking. Additionally, continued support from Kapedani, Fudgepop01, Rapito, Bird, DukeItOut, Brawl Central, and the P+ development team and community as we continue to wrap up the netcode has been immensely appreciated.
Thanks for reading and have a great weekend,
WhiteTPoison and the rest of the Brawlback team
Comments
Thanks for the update and keep up the incredible work
Vapedragon
2023-10-18 01:04:30 +0000 UTCJust wanted to say thank you for all the hard work!
Danny Pepin
2023-05-20 22:45:32 +0000 UTC