libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.05k stars 1.81k forks source link

libretro netplay API #6376

Open GregorR opened 6 years ago

GregorR commented 6 years ago

There's some push from both sides to make an API in libretro to allow cores to have some feedback from netplay. This is further complicated by the fact that netplay can be enabled or disabled at any time, and so any such API has to be "live"; we need an actual callback into the core.

In particular, the following features are wanted:

In addition, there is some mumbling about piggybacking on some features of RA's netplay while actually implementing the core's own netplay, in cores where that makes sense. e.g. it would be nice for cores that implement netplay to be able to use RA's lobby. This one would be more invasive and is not currently on my "actually important" list.

Obviously we can't modify retro_serialize or retro_run, so the normal execution path would have to go something like this:

netplay_callback(NETPLAY_IS_ABOUT_TO_SAVE, ...);
retro_serialize(...);
netplay_callback(NETPLAY_IS_DONE_SAVING, ...);
...
netplay_callback(NETPLAY_IS_ABOUT_TO_RUN_HIDDEN_FRAMES, ...);
retro_run();
retro_run();
retro_run();
netplay_callback(NETPLAY_IS_DONE_RUNNING_HIDDEN_FRAMES, ...);

If any other use cases, perhaps demanding different feedback, are known, please post them here. It would be nice to cover all known use cases.

furiadeoso commented 5 years ago

Hi, @GregorR ! Maybe this actual working line can help to start all those improvements:

https://github.com/libretro/RetroArch/issues/7299 https://github.com/libretro/RetroArch/pull/7379

Glad to help if it's needed! Best Regards!

LibretroAdmin commented 2 years ago

@Cthulhu-throwaway Some old issue with some ideas regarding netplay. Not sure if any of it is worthwile.