Welcome!

Final Burn Neo => FBN Development => Topic started by: furiadeoso on January 12, 2017, 04:12:57 PM

Title: Save and load savestates during netplay
Post by: furiadeoso on January 12, 2017, 04:12:57 PM
Hi!

Would be possible to save savestates in netplay game and load them after?

Some mame kaillera versions allow it. It's very useful if you wish to include a new online player.

It would be really amazing if it could be included in our favourite emulator, fba of course :)
Title: Re: Save and load savestates during netplay
Post by: dink on January 12, 2017, 06:10:08 PM
Currently you can save a state from a netplay game but you can't load states while netplaying.  I havn't found a way to do that yet :(
Title: Re: Save and load savestates during netplay
Post by: shine on March 19, 2017, 04:34:06 PM
Isn't this what GGPO does all the time? generates a savestate for each frame, and does a rollback when both machines are not synced, which happens really fast. Probably worth taking a look at source code
Title: Re: Save and load savestates during netplay
Post by: dink on March 19, 2017, 08:44:17 PM
Is there a public/recent source code for GGPO avaiable somewhere?
Title: Re: Save and load savestates during netplay
Post by: shine on March 22, 2017, 06:50:03 AM
https://github.com/wuziq/ggpofba/blob/master/src/burner/win32/fba_ggpo.cpp

Take a look at functions ggpo_save_game_state_callback and ggpo_load_game_state_callback, which basically call BurnAreaScan for reading/writing

And also when a game is started, both clients load the same savestate (via BurnStateLoad), so they start at same point, usually in the VS select screen. If somehow you could send your savestate to the other client (creating a socket, or a service somewhere) then it would be simple to start in that state
Title: Re: Save and load savestates during netplay
Post by: ggaclassics on October 31, 2017, 12:59:23 AM
If somehow you could send your savestate to the other client (creating a socket, or a service somewhere) then it would be simple to start in that state

That's exactly what ggpo does when someone tries to spectate a match. Every time that happens, there's a light pause in the game to do just that, otherwise, how would you receive the streamable input replay and watch at pseudo-live time without ggpo sending you a savestate?