Netplay support in RetroArch is “up in the air” as of early 2023. It is possible it's broken at some point for certain cores, if not all of them.
This doesn't apply retroactively to older versions of Batocera (such as v34), which also have older versions of RetroArch, so if you and your buddies use the same old version you should still be able to play together.
For a guide to set up a VPN client for multiplayer games on standalone emulators separate from Retroarch, visit the VPN client section.
Netplay is a feature enabled by RetroArch and some libretro cores to play games with multiple players over the network. If you want to play Double Dragon on NES with your buddy who sits several miles away from you… using netplay you can play both as Player 1 and Player 2 over the internet, like if you were both playing on the same console, sitting next to each other.
How does this black magic work?
Netplay relies on a client/server architecture. One of the players starts by setting up a Netplay game room, with a Netplay server, where the other players connect to, as clients.
Also, all isn't “magic” here. There are several limitations to be aware of:
The word “netplay” can mean many things to many kinds of games, in this context this specifically refers to RetroArch's version of Netplay, which is the act of sharing the emulated console's screen across multiple clients.
It does NOT refer to the emulation of the emulated console's actual network playing capabilities. It can only play “couch” multiplayer games such as shared or splitscreen ones. For example, you won't be able to do the Game Boy Advance's cable link play over the network with your buddy.
However, if a core allows for the emulation of multiple machines on a single client (such as TGBDual emulating two Game Boy originals on a single screen with an emulated cable link connection), then it would be possible to netplay that core with your buddy (albeit with the screen output for both the consoles being shown to both players at all times).
First of all, make sure you have Batocera 5.25 or later. Netplay is not available for earlier Batocera releases.
To enable Netplay for libretro cores, navigate to GAME SETTINGS → NETPLAY SETTINGS and turn on the toggle switch.
For older versions of Batocera (which?), enable netplay by adding
global.netplay=1 in /userdata/system/batocera.conf.
Once this is done, you can check that Netplay is enabled as when you see the help line at the bottom of the screen that tells you that button X in EmulationStation is now used for Netplay options (and not “Random selection” any more).
One of the players needs to host a Netplay server, to which the others players will connect to. When you are on the “systems” list of EmulationStation (the menu where you can select all the consoles, not the games), pressing the X button will give you a list of all available Netplay servers and games in progress.
Some games are greyed out and marked as “unavailable”: there are some technical reasons why you can't join these games (different core version, game you don't own, or a different version of the game, and so on).
Select one of the “available” games that you can join, and launch it: pay close attention to the messages that are popping up when RetroArch launches. Sometimes, there are limitations that could not be detected before and that will prevent you from playing (for example some cores don't support cross-platform Netplay, meaning that you can't have some players with a PC and others with a Raspberry Pi on the same game).
If you want to host your own Netplay game and let your buddies join it, you can do so by entering the “games” selection menu, and pressing X to launch a NetPlay server. Tell your buddies to join your Netplay room, when your game is launched it should appear in the menu described above.
When you host a Netplay server, you have to make sure that your network is either compatible with UPNP to automatically open the right port, or you can define your own port in the settings, and configure your router and network to keep this port open from the outside.
If you can't do it, or don't know how to do it, you can use the MITM option in the settings, that acts like a relay and simplify the Netplay server configuration.
Configuration with Games Settings → Netplay Settings
55435.This is the list for Batocera 5.25:
Arcade
Arcade Lightgun
Arcade Atomiswave & Naomi
Nintendo SNES
Nintendo NES
Nintendo GameBoy 2 Players
Nintendo NDS
Nintendo Famicom Disk system
Nintendo Virtualboy
Sega Dreamcast
Sega Megadrive/Genesis
Sega 32X
Sega Master System
Sega Gamegear
NEC PC Engine and PC Engine CD
NEC SuperGrafx
Neogeo and Neogeo CD
Neogeo Pocket and Pocket Color
Atari 2600
Atari Lynx
Wonderswan and Wonderswan Color
Amstrad CPC
Amstrad GX4000
Sinclair ZX81
Sega Saturn
3DO
SatellaView and Sufami
Thomson
PC98