[Feature] Netplay signaling for external emulators (UDP candidates & hole punching)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python, redis
- Domain
- backend, game-dev, networking
Research direction
Start by reading the existing netplay socket handlers and _is_room_peer guard, then inspect the netplay socket test suites named in the issue. The change spans room metadata, API listing, peer signaling, and coordinated punch timing; completion means those paths are covered by metadata round-trip, peer-only relay, punch broadcast, and non-peer rejection tests. The issue says this work depends on #5486 landing.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
RomM's netplay rooms currently only serve EmulatorJS in the browser: peers exchange WebRTC offers/answers over the /netplay socket. External emulators (RetroArch and friends) do their netplay over plain UDP, so they can't use these rooms at all. Multiplayer between users of the same RomM server, each playing in their own emulator on desktop or mobile, currently has no home.
Describe the solution you'd like
Enable UDP + hole-punch multiplayer for external emulators between users of the same RomM server, with three small, backwards-compatible additions to the existing netplay socket:
- Optional room metadata on
NetplayRoom(Redis JSON, no migration):transport("webrtc"default,"udp"for external clients),client,core_id,rom_hash_prefix,protocol_version. Exposed inGET /api/netplay/listso guests can verify core/ROM compatibility before joining. - A room-scoped
udp-signalrelay event carrying{kind, target, payload}(e.g.kind: "candidates"with LAN/STUN/UPnP address sets). Relayed only between verified members of the same room via the existing_is_room_peerguard, exactly likewebrtc-signaltoday. The server never interprets payloads and never touches game traffic. - Server-coordinated punch timing: on request, the server broadcasts
udp-punch-startto both peers with a sharedstart_at_unix_mstimestamp so they can synchronize NAT hole punching. Game traffic flows peer-to-peer afterwards; no TURN, no relay bandwidth.
sequenceDiagram
participant H as Host (launcher)
participant S as RomM /netplay
participant G as Guest (launcher)
H->>S: open-room (rom_id, transport=udp, core_id, rom_hash_prefix)
G->>S: join-room (preflight: core + ROM match)
H->>S: udp-signal (candidates)
S->>G: udp-signal (candidates)
G->>S: udp-signal (candidates)
S->>H: udp-signal (candidates)
H->>S: request punch
S->>H: udp-punch-start (shared timestamp)
S->>G: udp-punch-start (shared timestamp)
H->>G: direct UDP (NAT hole punch)
G->>H: direct UDP (netplay session)
This is the signaling layer on top of #5486 (client-token auth on these namespaces): just enough for two external-emulator clients to find each other and establish a direct UDP connection.
Describe alternatives you've considered
- Explicit per-purpose events (
candidates,punch,handshake-result) instead of one genericudp-signalrelay: more self-documenting, but more server code for the same relay role. Happy either way. - A separate namespace for external netplay instead of a
transportfield on the existing room: cleaner separation, but duplicates the room lifecycle that already exists and works. - An external matchmaking service (as some launchers host themselves): adds accounts and third-party infrastructure, and splits multiplayer away from the RomM server that already holds the users, the ROM permissions, and the room lifecycle. RomM-native signaling keeps everything in one place.
- TURN relay fallback for peers behind symmetric NAT: useful, but out of scope here. Direct P2P covers most pairs; relay support can follow if needed.
- Handshake telemetry (RTT/jitter reporting) and a server-wide "joinable sessions" endpoint (like streaming's): both nice to have, both better as follow-ups than as part of this change.
Additional context
- EmulatorJS rooms and the
webrtc-signalpath are untouched; new fields are optional and default to current behavior. - Token-authenticated clients act within their token scopes (#5486); anonymous password-guest behavior is unchanged.
- No DB migrations, no new dependencies, no TURN/relay infrastructure, no frontend changes required.
- Tests would extend the existing netplay socket suites: metadata round-trip, peer-only relay, punch broadcast, and rejection of signaling to non-peers.
Happy to implement this against current master once #5486 lands, with the same test coverage style.
- Dominant language
- Python
- Stars
- 13.3k
- Forks
- 747
- Avg merge
- 20h 58m
- Merged PRs (30d)
- 207
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rommapp/romm
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rommapp/romm#5857 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
rommapp/romm#4178 · 1 reaction ·
Maintainers usually reply within 1 day
-
[UI/UX] Misaligned number in searchPossibly taken @NevesHenry claimed this today. Openui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
Maintainers usually reply within 1 day
-
[Bug] Games do not show up in search if more than 2 letters are used.Possibly taken @andest01 claimed this today. Open
Difficulty 3/5 1-2 days Newbie friendliness 58/100
rommapp/romm#5853 · 7 comments ·
Maintainers usually reply within 1 day
Similar issues
-
area:print-dispatch
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area/geometry good first issue help wanted kind/doc-mismatch severity/4-minor
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Apich-Organization/rssn#295 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
chore claimed
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
schuyler/corvidae#1424 · 2 comments ·
Maintainers usually reply within 1 day