-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Finish multiplayer support #248
base: dev
Are you sure you want to change the base?
Finish multiplayer support #248
Conversation
MAC addresses can be derived from the libretro username, read from a file or read from firmware.
Thank you so much! This week I'll do a code review and test it personally, then I'll get back to you with any notes I have. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! There are some changes I'd like you to make. Once you do, I'll test the changes and get back to you with any additional feedback I have.
LanMultiplayer.md
Outdated
|
||
Now, the Nintendo DS local Wi-Fi isn't the normal Wi-Fi in your house, it is a [mesh network that uses specialized hardware](https://melonds.kuribo64.net/comments.php?id=25). This means that games expect extremely low latency, which is achievable between two consoles directly connected with special hardware, but harder to achieve with two computers with a router in-between, and simply **impossible** to achieve through the Internet. **LAN multiplayer does not work through the Internet and neither with VPNs or tunnels such as Hamachi**. This is not something that can be fixed easily. **The only way to use emulated LAN Multiplayer is on an actual, low latency LAN connection**. | ||
|
||
The latency requirements are so extreme that even in LAN, you might still have issues. If your sibling is watching Netflix and using the same router, it won't work. If the router is too far away, it won't work. If the router does not have a powerful enough CPU, it won't work. The recommended way to use the emulated Wi-Fi LAN connection is with a wired LAN connection between the computers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests you've conducted so far...have they been in this kind of environment? When I tested your last PR, I did so with two Ethernet-connected devices on the same switch. Same network, but I don't think the packets have to go all the way to the router and back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial tests were in localhost, with two instances of RetroArch on the same computer. When I confirmed that the basics were working, I tested extensively in a connection between my desktop computer (wired) and my phone (wireless, very close to router).
It worked but disconnects sometimes happened. Should I update this to say that the only way it works is with a wired connection?
Specify netplay can be started during a game and improve wording
Ended up about the same size as the hand-rolled parser.
Looks good to me (minus some minor notes I just left), but before I merge this I'd like to build and test it myself. I should have a chance to do that tomorrow. I'd also like to fix an unrelated bug in the build pipeline itself -- it turns out that PRs are being built against the wrong commit, and I didn't notice until I gave some poor bastard (what I thought was) a build of this PR to test! Thanks for your hard work and your patience. |
I've tested this with Mario Kart DS on three simultaneous devices -- my desktop (Ethernet), my Steam Deck (Ethernet), and my brother's desktop (Wi-fi). Didn't manage to start a session. I'm gonna dig into this and figure out why. Even once I do, I'll still need to think about the most sensible default behavior for picking a MAC address. There are two settings here that are important:
The problem here is twofold:
This puts us in a bind:
I'm not going to ask you to change the default MAC selection behavior. For the purpose of this PR, it's fine. But we'll have to solve this problem (of reducing LAN netplay friction without breaking save data) before releasing 1.2.0. The time for generalization has passed; I will need to investigate which exact games use the MAC address to restrict save data and wireless features (local and WFC) and how they do so. But before that, I need to get this working with three players on my own network. |
Allow multiplayer for more than 2 players by adding options to change MAC addresses and relevant documentation. Also add warning to not use VPNs or tunnels as well as copyright notices.
Changing MAC addresses can be done either through libretro usernames or dropping a text file on the "system" folder. Deriving MAC addresses from usernames is done with compiler-independent algorithms to guarantee portability.
Note that trying to run 3 instances of melonDS DS was too much for my CPU (on software renderer) and the game lagged too much that disconnects were frequent. I'd recommend using at least a second device to test 3 players so the CPU doesn't get overwhelmed trying to deal with both multiplayer and rendering.
With direct mode, things are a bit confusing as the DS thinks it's sending frames with a certain MAC address, but it's actually using your computer's MAC address instead. However, since direct mode is about Internet connection, it all works fine.
Should fix issues #246 #247 and #225