Author Topic: Save and load savestates during netplay  (Read 785 times)

Offline furiadeoso

  • Newbies
  • *
  • Posts: 41
  • Karma: +0/-0
    • EMUpartidas online
Save and load savestates during netplay
« 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 :)

Offline dink

  • Administrator
  • *****
  • Posts: 2504
  • Karma: +213/-0
  • I <3 fried chicken
Re: Save and load savestates during netplay
« Reply #1 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 :(

Offline shine

  • Newbies
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Save and load savestates during netplay
« Reply #2 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

Offline dink

  • Administrator
  • *****
  • Posts: 2504
  • Karma: +213/-0
  • I <3 fried chicken
Re: Save and load savestates during netplay
« Reply #3 on: March 19, 2017, 08:44:17 pm »
Is there a public/recent source code for GGPO avaiable somewhere?

Offline shine

  • Newbies
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Save and load savestates during netplay
« Reply #4 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
« Last Edit: March 22, 2017, 06:56:45 am by shine »

Offline ggaclassics

  • Newbies
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Save and load savestates during netplay
« Reply #5 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?
twitter.com/ggaclassics