Looking for comprehensive guide on Netplay; willing to make one myself if none exist

Basically what the topic title says.

I’d like to know if there’s an easy-to-follow but detailed single-page or at least concise guide for netplay on Retroarch, which details how to do it, what ports to forward, and what cores are and are not compatible. If there’s not, I’m willing to write one myself, and hopefully have it posted somewhere visible and easy to find. Maybe on Libretro itself or at least its Wiki.

Retroarch supposedly has really good netplay but there seems to be a dearth of accessible information on it and I feel we should fix that. Hopefully I’m not stepping on any toes here by saying so.

1 Like

I don’t know of any guide and one would be welcome. Our wiki is kinda b0rk3d at the moment, so we couldn’t put it there but we can sticky it here and maybe find some places to reproduce it. The gametech emugen wiki is another good place you could post it.

Alright, I’ll try to get the ball rolling on this and report back with what I have.

That would be amazing as I was only vaguely aware the feature existed.

According to the Wiki, the following cores are compatible with Netplay:

[ul] [li]4DO[/li][li]Mednafen PCE FAST[/li][li]Mednafen PCFX[/li][li]Mednafen SGX[/li][li]Bnes[/li][li]Bsnes[/li][li]Bsnes-Mercury[/li][li]FCEUmm[/li][li]Final Burn Alpha[/li][li]Genesis Plus GX[/li][li]Mupen64Plus[/li][li]Nestopia[/li][li]PicoDrive[/li][li]PocketSNES[/li][li]QuickNES[/li][li]Snes9x[/li][li]Snes9x Next[/li][li]TGB Dual[/li][/ul] I’m assuming all of the forks of Bsnes that are available in the online updater are compatible too.

However, from searching around, some people also report the following cores are compatible as well. [ul] [li]MAME works, but sends incorrect input[/li][li]Mednafen PSX[/li][li]PCSX ReARMed (?? This core doesn’t appear in the online updater.)[/li][li]Yabause[/li][/ul]

I’m unable to test any of this myself at the moment, so any corroboration would be appreciated.

I would also like to know if save states and save data (such as SNES games’ .sram) are compatible, as well as how things like Memory Cards (for PS1 games) and controller paks (for N64 games) work–I’m assuming that these have to be exactly the same like everything else, if they even work at all.

Alright, here’s what I’ve got so far. It’s formatted like a Wiki page in case you guys get that working. Note that this isn’t tested, I’m simply consolidating information from other guides into one and written so it’s as easy and newbie friendly as possible.

Contents

  1. Prerequisite Information
    1.1 ROM and Core versions 1.2 Compatible Cores
  2. Netplay 2.1 Prerequisites 2.1 Server side 2.2 Client side and spectating

1. Prerequisite Information 1.1 ROM, Core, and BIOS versions All involved players must have the exact same ROM file you intend to play, and must be played on the exact same version of the core you intend to play it on. Additionally, if the core you are using requires a BIOS/system file, these must be the exact same BIOS/system file. If you are uncertain if you have the same file, use a CRC32 calculator or simply send the appropriate file to the other player(s) or make sure you download them from the same place.

You will, for example, not be able to play Super Bomberman (E) [t1].smc and Super Bomberman (USA).sfc on the bsnes-accuracy core and SNES 9x Next core over netplay.

1.2. Compatible Cores The following cores are compatible with Netplay as of this writing:

[ul] [li]4DO[/li][li]Mednafen PCE FAST[/li][li]Mednafen PCFX[/li][li]Mednafen PSX[/li][li]Mednafen SGX[/li][li]Bnes[/li][li]Bsnes and related cores[/li][li]FCEUmm[/li][li]Final Burn Alpha[/li][li]Genesis Plus GX[/li][li]MAME[/li][li]Mupen64Plus[/li][li]Nestopia[/li][li]PCSX ReARMed[/li][li]PicoDrive[/li][li]PocketSNES[/li][li]QuickNES[/li][li]Snes9x[/li][li]Snes9x Next[/li][li]TGB Dual[/li][li]Yabause[/li][/ul]

2. Netplay 2.1 Prerequisites

[ul] [li] If you are not playing over LAN, You will need to forward port 55435 as both TCP and UDP, or change the Netplay TCP/UDP port in Retroarch to a port that is already open. If you are unable to open ports, you will need to use LAN emulation software such as Hamachi. [/li][li] If you are the server, you will need to give your client(s) your public IP Address, the port you will be using, and the number of delay frames you’ve chosen. Also, as mentioned before, you will need to use the exact same ROM, core, and if applicable, BIOS/system file. [/li][/ul]

2.2 Server side If you are going to be the player hosting the game:

[ol] [li] Set “Netplay Enable” to on. [/li][li] Set “Swap Netplay Input” to off. [/li][li] Make sure the IP Address field is blank. [/li][li] Set “Netplay Client Enable” to off. [/li][li] Set “Netplay Spectator Enable” to off. [/li][li] Set the number of “Delay Frames” you want. The number of delay frames you will need will vary based on yours and the clients’ connection speed, specifically the ping. If you are playing over LAN, this can be typically left at zero, otherwise you will want to raise the number of delay frames, as there will be frame drops. Be aware that all players must have the same setting. [/li][li] Set the Netplay TCP/UDP Port to 55435 or a port that is already open. [/li][li] Network Commands, Netork Command Port, Network Gamepad, and Network Remote Base Port do not need to be changed, as well as “User # Remote Enable” and stdin Commands. [/li][li] Back out of this menu and load your ROM and Core. The emulator will appear to be “stuck” or “frozen”, but is simply waiting for the client(s) to join. [/li][/ol]

2.3 Client side and spectating If you are not hosting the game:

[ol] [li] Set “Netplay Enable” to on. [/li][li] If the game you are playing requires two controllers (typically, this is true), set “Swap Netplay Input” to on. [/li][li] Enter the public IP address of the server into the IP address field. [/li][li] Set “Netplay Client Enable” to on. [/li][li] If you are simply spectating, set “Netplay Spectator Enable” to on. Otherwise, leave this off. [/li][li] Set the number of “Delay Frames”. This needs to be the same as the server. [/li][li] Set the “Netplay TCP/UDP Port” to the same value that the server did. [/li][li] Network Commands, Netork Command Port, Network Gamepad, and Network Remote Base Port do not need to be changed, as well as “User # Remote Enable” and stdin Commands. [/li][li] Back out of this menu and load your ROM and Core. The game should soon start for you and the server. [/li][/ol]

1 Like

[QUOTE=softchassis;37424]Alright, here’s what I’ve got so far. It’s formatted like a Wiki page in case you guys get that working. Note that this isn’t tested, I’m simply consolidating information from other guides into one and written so it’s as easy and newbie friendly as possible.

Contents

  1. Prerequisite Information
    1.1 ROM and Core versions 1.2 Compatible Cores
  2. Netplay 2.1 Prerequisites 2.1 Server side 2.2 Client side and spectating

1. Prerequisite Information 1.1 ROM, Core, and BIOS versions All involved players must have the exact same ROM file you intend to play, and must be played on the exact same version of the core you intend to play it on. Additionally, if the core you are using requires a BIOS/system file, these must be the exact same BIOS/system file. If you are uncertain if you have the same file, use a CRC32 calculator or simply send the appropriate file to the other player(s) or make sure you download them from the same place.

You will, for example, not be able to play Super Bomberman (E) [t1].smc and Super Bomberman (USA).sfc on the bsnes-accuracy core and SNES 9x Next core over netplay.

1.2. Compatible Cores The following cores are compatible with Netplay as of this writing:

[ul] [li]4DO [/li][li]Mednafen PCE FAST [/li][li]Mednafen PCFX [/li][li]Mednafen PSX [/li][li]Mednafen SGX [/li][li]Bnes [/li][li]Bsnes and related cores [/li][li]FCEUmm [/li][li]Final Burn Alpha [/li][li]Genesis Plus GX [/li][li]MAME [/li][li]Mupen64Plus [/li][li]Nestopia [/li][li]PCSX ReARMed [/li][li]PicoDrive [/li][li]PocketSNES [/li][li]QuickNES [/li][li]Snes9x [/li][li]Snes9x Next [/li][li]TGB Dual [/li][li]Yabause [/li][/ul]

2. Netplay 2.1 Prerequisites

[ul] [li] If you are not playing over LAN, You will need to forward port 55435 as both TCP and UDP, or change the Netplay TCP/UDP port in Retroarch to a port that is already open. If you are unable to open ports, you will need to use LAN emulation software such as Hamachi. [/li][li] If you are the server, you will need to give your client(s) your public IP Address, the port you will be using, and the number of delay frames you’ve chosen. Also, as mentioned before, you will need to use the exact same ROM, core, and if applicable, BIOS/system file. [/li][/ul]

2.2 Server side If you are going to be the player hosting the game:

[ol] [li] Set “Netplay Enable” to on. [/li][li] Set “Swap Netplay Input” to off. [/li][li] Make sure the IP Address field is blank. [/li][li] Set “Netplay Client Enable” to off. [/li][li] Set “Netplay Spectator Enable” to off. [/li][li] Set the number of “Delay Frames” you want. The number of delay frames you will need will vary based on yours and the clients’ connection speed, specifically the ping. If you are playing over LAN, this can be typically left at zero, otherwise you will want to raise the number of delay frames, as there will be frame drops. Be aware that all players must have the same setting. [/li][li] Set the Netplay TCP/UDP Port to 55435 or a port that is already open. [/li][li] Network Commands, Netork Command Port, Network Gamepad, and Network Remote Base Port do not need to be changed, as well as “User # Remote Enable” and stdin Commands. [/li][li] Back out of this menu and load your ROM and Core. The emulator will appear to be “stuck” or “frozen”, but is simply waiting for the client(s) to join. [/li][/ol]

2.3 Client side and spectating If you are not hosting the game:

[ol] [li] Set “Netplay Enable” to on. [/li][li] If the game you are playing requires two controllers (typically, this is true), set “Swap Netplay Input” to on. [/li][li] Enter the public IP address of the server into the IP address field. [/li][li] Set “Netplay Client Enable” to on. [/li][li] If you are simply spectating, set “Netplay Spectator Enable” to on. Otherwise, leave this off. [/li][li] Set the number of “Delay Frames”. This needs to be the same as the server. [/li][li] Set the “Netplay TCP/UDP Port” to the same value that the server did. [/li][li] Network Commands, Netork Command Port, Network Gamepad, and Network Remote Base Port do not need to be changed, as well as “User # Remote Enable” and stdin Commands. [/li][li] Back out of this menu and load your ROM and Core. The game should soon start for you and the server. [/li][/ol] [/QUOTE]

im doing full tutorial once i figure out work around of mame convention naming in otherwards i dont wanna rename every system that goes through mame because it matches hyperspins xml

2 Likes

hey,

appreciate the good work!

are there any updates?

1 Like

How can I set which network adapter I am using, for example I have one connected to internet (DHCP) and one connected to LAN with static IP. I want to play over the LAN.

It should bind the socket to INADDR_ANY/ IN6ADDR_ANY_INIT, meaning it will be valid on any network interface you’ve.

https://linux.die.net/man/3/getaddrinfo

If the AI_PASSIVE flag is specified in hints.ai_flags , and node is NULL, then the returned socket addresses will be suitable for bind (2)ing a socket that will accept (2) connections. The returned socket address will contain the “wildcard address” ( INADDR_ANY for IPv4 addresses, IN6ADDR_ANY_INIT for IPv6 address). The wildcard address is used by applications (typically servers) that intend to accept connections on any of the hosts’s network addresses. If node is not NULL, then the AI_PASSIVE flag is ignored.

Make sure to disable relay servers. Currently, it doesn’t work at all and will effectively disable the LAN-only netplay.

Thanks, I don’t know how to interpret all that, but I hope it means that it is broadcasting to all my networks.

I think maybe windows firewall was blocking it, I have to wait for my friend to try again later. I added retroarch.exe to my private network on exceptions.

You can try it yourself by using a program to establish a TCP connection to your server via LAN; even a simple telnet client works.

>telnet 192.168.0.10 55435
RANP♦♦☺Θ



Connection to host lost.

As long as the first 4 bytes received after connection are ‘RANP’, the socket is listening to your LAN interface.

Ok telnet was working (I had unplugged ethernet cable). But still retroarch “fails to initialize netplay”.

Unable to connect to hos, no route to host.

He can ping me just fine and connect to other servers like quake 2.

I’ve added more comprehensive error logging for netplay as of 1.9.13; could you update the client trying to connect to 1.9.13, enable Logging -> Logging Verbosity and Logging -> Log to File, and post the log here after failing to connect?

Ok, I’ll try it when my friend gets online.

Ok, we ran into trouble since my friend is on Linux and seems to think that the only way to use retroarch is to compile it. So he spent all day compiling it and the cores. I feel like that was unnecessary step? I don’t know I’m a dummy who uses windows.

Anyways, we were able to connect and got these two error messages:

“A netplay peer is running a different version…” “Client doesn’t have a nickname” “Client disconnected”

At least we know it’s trying to connect now. He went in and set up a nickname, but it still gives the same error. We both have the same version 1.9.13 but he probably has a fresh build from the code compile?

Could you attach the log file?

We got it to work. We apparently had downloaded it around the same time and still managed to get different versions of retroarch, so they couldn’t connect.

I saw his issue on GitHub; this is what caused the problem:

Version 1.9.13 is running netplay protocol 5 and I’ve been making several changes that will break backwards compatibility for 1.10, thus bumping the protocol to 6. However, a hotfix was released yesterday (1.9.13.1) which shouldn’t have included my changes; the protocol version is supposed to remain at 5 for non 1.10+ versions.

I’ve since changed the protocol back to 5 until 1.10 is ready to be deployed. The plus side is that we can test netplay chat before 1.10.

1 Like