Open SuperSamus opened 1 month ago
Both versions of Swap Force are here!
That's cool! Is this still intended to be a draft pull request, or is it mergeable. I'll trust you to say whatever is better for the users.
It's currently missing the other versions of SuperChargers. @WinnerNombre said they'll look into that when they have time. These games luckily have debug symbols, so that should be quick.
Fixes one of the issues caused by higher framerates in the Skylanders saga: #615.
The reason why the character was respawning during long falls is because of a failsafe meant in case your character is stuck falling between geometry. The game determines whether you are stuck with a simple method: it calculates the squared distance of your character from the position of the previous frame, then checks whether it's lower than 20². If that's true for 3 seconds, then it teleports you. But if the framerate is higher, your distance is going to be lower than normal, and the game will consider you stuck even when falling at top speed. Ironic...
The fix simply consists in overriding the load of 20.0, and load
20×30FPS/targetFPS
instead. (Ideally you would multiply bydeltaTime
instead of dividing bytargetFPS
, but since it's not already loaded in a register in that part, not bothering.)Before:
https://github.com/user-attachments/assets/c6215296-79bd-4a04-810e-b9f35508fbd0
After:
https://github.com/user-attachments/assets/74097add-1df3-4f8a-92f8-3463367f13d8
Credits:
This is currently a draft, as this is only one version of one game, so not worth merging now. More games and versions will be added later. I'm leaving this for documentation and for reference.
Other things for reference:
updateStuckFallingCheck
.