I have been implementing multiplayer actions into tuxemon over the last couple of months. Here is my progress so far. Currently there is no limit on the number of players that can join a game. It is limited to LAN connections at the moment so if you want to play with your friends at this time you need a VPN of some sort. You can click here to browse the code in my fork or contribute. I am currently starting to work on implementing multiplayer battles into the battle system and then trading. As always, feedback is appreciated.
Link to the examples gallery
Last edited by pastaq (1 Nov 2015 00:14)
This is a fantastic start! I've been testing this implementation out on my local network and it's been working beautifully. This implementation does add some additional dependencies, which I'll need reflect in the installation instructions and README. Right now it looks like the following has been implemented:
Eventually we'll be looking to add network play over the internet and hosting an official Tuxemon Alpha server for those who want to test out the multiplayer aspects of the game.
I have finished reviewing this pull request and have successfully merged it with the existing development branch. You can now host and join multiplayer games on your local network. Going forward we will be working on multiplayer combat and the ability to join an officially hosted Tuxemon Alpha server.
In order for multiplayer to work, you'll need to install the following dependencies:
You can install both of these dependencies easily with pip:
pip install netifacespip install --pre neteria
pip install netifaces
pip install --pre neteria
So did this really work? I tried adding the multi player menu and couldn't get it to work. Also I don't see how it would have worked since there is only one player object. I'm guessing it was just implemented as a quick hack and needs reworking to be usable in the current code.
Yeah, it did work in previous releases, but it's been broken since a large refactoring that was done. In that implementation, any mutliplayer user would appear as an NPC object, with their movements defined by network events. Right now efforts on multiplayer are done on the Tuxemon Server project. In the future, single player will rely on the Tuxemon Server core for all game logic, and the Tuxemon client will mostly just render the game; talking to the Tuxemon Server core for all actual game logic.
For the general proposed architecture, I wrote up a small doc on what's planned: https://github.com/Tuxemon/Tuxemon-Serv … 20Overview
Edit: I've also written up a start of the APIs that the server code will provide here. These APIs will be available for both single player and multiplayer. The main difference in accessing the API is that the transport layer will either be configured to go over the network (via websockets, HTTPS, etc.) or go directly to the Tuxemon Client module.
It's nice to see some progress on this. I assume most of it isn't in the 'development' branch however: For me, Tuxemon freezes or crashes whenever I use the multiplayer options from the bedroom computer.
Yeah, some refactoring that was done after this implementation broke multiplayer. If you wanted to check out the old implementation, you can check out this commit here. Right now future multiplayer implementations are being done in the Tuxemon Server project.
The server project aims to implement all the game logic and server logic in a standalone library separate from Pygame. Eventually the Tuxemon project will use this library as the basis for single player games too, with the Tuxemon project just being in charge of drawing the screen, playing music/sound, and accepting keyboard/joystick input.
That sounds like a good idea. As long as starting local games remains seamless, and you don't have to separately run a local server in order to play normally. At that point, the client and server should probably be in the same repository as well, and part of the same code tree. The difference between the two should probably be in how you launch Tuxemon (client or dedicated server).