TASEmulators / BizHawk

BizHawk is a multi-system emulator written in C#. BizHawk provides nice features for casual gamers such as full screen, and joypad support in addition to full rerecording and debugging tools for all system cores.
http://tasvideos.org/BizHawk.html
Other
2.19k stars 383 forks source link

[F.Rq.] Netplay (multiplayer over a local network or possibly the Internet) #2450

Open Tippek opened 4 years ago

Tippek commented 4 years ago

There are many ways this could be done. Here are my thoughts on one way:

use Kaillera (but it probably needs improving)

Kaillera server and client were recreated in https://github.com/God-Weapon. But it's still needs in improvements:

1) Reconnecting or connect to active session 2) Send states client->server->clients 3) Only buttons need be send by UDP, other commands and states must be sended by another port or TCP. It allows us to require lost packets from clients.(packets can be contains chat or commands in current state) 4) Possibility to start netplay game on server with only 1 player

How it must works: Player creates game on server(4), then other player will connect to him(1), server requires state from first(host) player and send to client(2),during lag a server just wait and requires lost packets(3), on desync a server requires state from host(2)

So it needs make new server code or upgrage current Kaillera servers, you can replace original client code with own will work with Kaillera(or/and upgraded) servers

see also #4018

YoshiRulz commented 4 years ago

For those waiting for netplay support in BizHawk: Don't hold your breath. Netplay has been requested before (#958) and rejected because it's really hard. (I'm surprised our resident grump didn't close this immediately.) To start with, EmuHawk doesn't have a good infrastructure for anything other than 1 console in 1 instance. Though we have some link play support, it's hacked together and doesn't involve any (host) networking or inter-process comms.

To address your proposal directly, Kaillera has been mentioned before (#98, 5 years ago) and was deemed immature. It might not be suitable even if it has improved since then. First, requiring a dedicated server is a strange choice for 4-player retro games, it only really makes sense for specialised romhacks like SM64O. We're also generally hesitant to add more third-party dependencies to EmuHawk. The client in the linked org is written in C++ (MSVC), does it even have C FFI bindings? Without those we'd need to fork or otherwise patch the source before we could start integrating.

zeromus commented 4 years ago

meh, it could be kludged in with lua to do a bad job, at least. at its simplest it's nothing but scripted input (happens to be coming from the network) and savestates (happens to be coming from the network). it's only really hard because you want it outside lua and bizhawk has a bunch of other higher priorities creating a maze of code for the netplay to nestle into. at some point the kitchen sink is full.

a dedicated server is not a strange choice, it's a perfectly normal choice, since it is waaaayyy simpler than any alternative in the modern multiply-natted environment.

resident grump told OP to search for existing tickets. guess he didn't. IMO, netplay is valuable enough to warrant leaving an open ticket for, even if it's ignored, because a big problem with netplay is deterministic emulation and we have that solved--so we have a lot to offer the world here. of course, this problem has a shelf life. if you believe every stream gaming company that's come and gone, we are only days away from having enough bandwidth to implement netplay by letting someone stream an authoritative low-lag video feed, right? :chuckle:

Tippek commented 4 years ago

Video streaming make sense when you have latency between players below 20 ms, if it higher then you can't play some games comfortably(Battletoads NES for example), because encoding and decoding increases latency. Also it's requires major bandwidth and P2P only

vadosnaprimer commented 4 years ago

Lots of useful info is here: http://tasvideos.org/forum/viewtopic.php?p=452926#452926

YoshiRulz commented 1 year ago

These guys have something figured out. Unfortunately, while all their emu forks and this emscripten-based toolchain are open source, I think they're keeping their networking magic secret.