Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] netplay #2450

Open
Tippek opened this issue Oct 13, 2020 · 5 comments
Open

[Feature Request] netplay #2450

Tippek opened this issue Oct 13, 2020 · 5 comments
Labels
App: EmuHawk Relating to EmuHawk frontend Enhancement For feature requests or possible improvements Open to design proposals only We're not ready to add this yet, but technical discussion of how it could be added is welcome.

Comments

@Tippek
Copy link

Tippek commented Oct 13, 2020

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

@YoshiRulz YoshiRulz added App: EmuHawk Relating to EmuHawk frontend Enhancement For feature requests or possible improvements labels Oct 13, 2020
@zeromus zeromus changed the title [Feature Request] Add netplay with Kaillera, but improve it. [Feature Request] netplay Oct 13, 2020
@YoshiRulz
Copy link
Member

YoshiRulz commented Oct 13, 2020

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
Copy link
Contributor

zeromus commented Oct 13, 2020

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:

@YoshiRulz YoshiRulz added the Open to design proposals only We're not ready to add this yet, but technical discussion of how it could be added is welcome. label Oct 13, 2020
@Tippek
Copy link
Author

Tippek commented Oct 13, 2020

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
Copy link
Contributor

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

@YoshiRulz
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App: EmuHawk Relating to EmuHawk frontend Enhancement For feature requests or possible improvements Open to design proposals only We're not ready to add this yet, but technical discussion of how it could be added is welcome.
Projects
None yet
Development

No branches or pull requests

4 participants