clementgallet / libTAS

GNU/Linux software to (hopefully) give TAS tools to games
GNU General Public License v3.0
496 stars 56 forks source link

Slime Rancher Desync while loading #427

Closed feuerball11 closed 9 months ago

feuerball11 commented 3 years ago

Hello,

I wanted to start using libtas, and experiment with Slime Rancher. I noticed however that it will desync while loading.

Everything is synced until frame 340 (where I get a massive CPU spike) and in the next 40 frames, I will end up 1-4 frames different in the main menu, each time.

I noticed that I cannot enable software rendering. I'm not experienced enough with Linux to know how I should get that working. So I continued with my nvidia 1060 driver (version 460) I'm using Ubuntu btw.

I did try to slow down the loading part after frame 340, even single-stepped it. but always got different results.

I also used "-force-gfx-direct" as this is a unity game, but It didn't look like it changed anything to me.

I'll welcome any tips on how to get this synced. And will experiment a bit more on my own.

Kind Regards, feuerball11

marcelopio commented 3 years ago

Maybe the same problem I am having with #402

feuerball11 commented 3 years ago

I actually got SlimeRancher to sync up now.

The issue was that the game was using LoadSceneAsync to load its content. This however is an async operation, which can work out different each time.

I was able to edit the Games .dll with dnSpy, and switched the references for LoadScene, which does so synchron.

Now my movies keep in sync. Maybe the same thing would work on Dandara. It needs to be compiled using mono though, and the games logic must be compatible with loading in one frame. Depending on how the developers wrote their loading code, it might not work.

feuerball11 commented 3 years ago

Sadly the modding did not completely fix it. Slime Range still goes to desync. Looks like the physics does its own thing, which causes the game to desync.

Any further ideas?

marcelopio commented 3 years ago

Dandara mod also fixed untederministic loading problems (well 99% at least). But I still have untederministic RNG at boss fight, which uses UnityEngine.Random to change the spawn position of the boss hands.

The frames are synced arriving in the boss fight, as I have a frame perfect talk with him, and that is working fine. So, somehow the seed of the boss is not deterministic.

clementgallet commented 9 months ago

Unity syncability is still being worked on, but it's hard.