by philo23 · 4y ago · 0 comments
My understanding with the suspend/resume stuff they've talked about for the Deck is less about actually suspending/resuming the game by syncing some low-level state like memory or graphics, and more about quickly syncing save games via Steam cloud saves.
I only had a quick look over their docs when the Deck was announced and from what I could tell you basically opt into a new system-level save behavior where at any point the Steamworks library can tell the game "this device is going to suspend now, save your progress" then another computer can start the game and immediately load up the save file, giving the impression of seamless suspend/resume.
So as long as your save game files aren't OS specific in some way there's no reason why this should lock you into any specific platform, Windows or otherwise.
Anything else also would be insanely hard.
Just trying to "store the GPU state" on a system with AMD GPU and resume it on a system with a NVIDIA GPU (or just old GPU and new GPU from same Vendor) is likely around the area of "lets treat it as impossible".
When you are writing a program, there are a lot of states, some of them are visible to code, some of them are not, some of them are about game logic, some of them are tight to machine physical states. And you are almost not going to separate them unless specifically designed it to.
And that is called save system.
But the problem of save system is: that is slow to load, because you need to initialize everything from ground up. All the textures, stage data, enemy entities will need to be reloaded even it is technically fine to reuse all of them.
And that is what xbox do(I think steam is unlikely to copy that?)
The idea of quick resume is to sacrifice storage spaces, just store everything(even things tight to hardware) to skip the initialization process for fast loading, which is completely opposite for what steam want to do.
Until now, only xbox implemented that (on same machine only)
But I just can't see it working across OSes.
Maybe if you limited it to same ARCH (or even vendor, AMD here) and dump everything but use some tricks wrt. GPU state? (And also not dumping OS discardeable caches, no idea if that is used by games though).
checkpoint restore of gpu state is much further along than you credit.
You really just need to dump textures and set up a matching context, which at worst should require an indirection shim to translate handles if they are stored by the application but generated by the driver with no way to force custom values during object creation (like how Linux allows custom PIDs for checkpoint/restore and other replay tech like rr).
But they also provide a hook so the game has a chance to save and sync to the cloud before being suspended, so the user can pick up from the same point on another steam device. Loading the game normally of course.