Netplay

From Libretro Wiki
Jump to: navigation, search

RetroArch has Netplay support which uses rewind and re-emulation to account for lag between server and client. With correct configuration and assuming no bugs in the emulation, RetroArch's Netplay cannot lose sync.

Please note that this page is on the current netplay in RetroArch (after 1.3.6). For information on Netplay in RetroArch 1.3.6 and earlier, see Old Netplay.

Where To Find Other Players

Join #retroarch-netplay on Freenode IRC

WebChat_Applet ^^ It's a ghost town right now, but hang around for awhile and maybe more people will turn up :)

Basic Setup

The default configuration should be sufficient for most circumstances. If you want to change it or are simply curious about the settings, they can be found under Settings > Network:

   Server address: =server IP address or hostname= (The client should enter the server's address here)
   Netplay TCP Port: 55435 (This will show as "0" if using the default value, which is of course fine)
   Server Password: (With no password, anyone may connect to your netplay session)
   Server Spectate-Only Password: (Set this as well as the server password to allow some clients only the privilege of spectating, not playing)
   Netplay Stateless Mode: false (Setting this to true will use no states and no rewinds, so does not jitter, but requires a very fast network)
   Netplay Check Frames: 30 (This is how often sync will be explicitly checked. The default value is almost certainly fine)

Setting stateless mode to true on both sides requires a very fast connection; if the connection is not fast enough, both the server and the client will frequently stall as they wait for data. However, with stateless mode set to true, there will be no visible jitter while the clients keep in sync. Stateless mode is automatically used for cores that do not support savestates, but otherwise the only recommended use case is if one netplay peer is recording the screen and the other isn't, in which case the recording peer can set stateless mode to true to get a jitter-free experience at the expense of the other peer.

Note that check frames are not necessary for netplay to work, they are merely a fallback for buggy cores. Nonetheless it is recommended to keep them at their default value.

To serve, simply go to the Netplay menu and choose "Start hosting". To connect, use "Connect to Netplay host". Remember that the core and content must be loaded first. In some cases, if the host and client are on the same local network, the client can use "Search local network" to find their peer rather than entering an IP address manually.

The client and server must have the same version of RetroArch, the same version of the core in use, and the same content. They do not need to use the same operating system.

If you prefer, these settings can be configured in retroarch.cfg or on the command line. In retroarch.cfg, relevant fields are :

   netplay_ip_address = ""
   netplay_ip_port = "55435"
   netplay_password = ""
   netplay_spectate_password = ""
   netplay_stateless_mode = "false"
   netplay_check_frames = "30"

On the command line, suggested server and client commands (respectively) would be

   $ retroarch -L <core> -H <content>
   $ retroarch -L <core> -C <server IP> <content>

If using a core which does not support save states, you must launch RetroArch using these command line options to use Netplay. Cores with savestates have no such restriction.

Three-Player Mode

Netplay supports as many players are RetroArch supports (currently 16). To make it work, the host must configure the input devices correctly before hosting. For instance, for Super Nintendo cores, the host must set input 2 to "Multitap" before hosting. Clients do not need to set up the input devices, they will use the host's settings. If there are insufficient input devices configured for a third (or fourth, fifth, etc) client, they will receive an error message indicating that no controllers are available, but they may still spectate.

Which Cores Work With Netplay?

Most cores which support rewind should support Netplay. The author of the current Netplay implementation has maintained information on his own testing here.