Multiplayer development.

Avatar

By pastaq 1 Nov 2015 00:13

New member · 1 comments

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)

Avatar

By ShadowApex 3 Nov 2015 07:58

Lead Developer · 374 comments

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:

  • Players can host games on the local network.
    ZYVsOfp.gif
  • Users can autodiscover games on the network and join them.
    Xp0tgw0.gif
  • Players can walk around on the world map together.
    QCMiNqo.gif
  • Players can open an interaction menu with other players to challenge them to battles or trade (not fully implemented yet).
    w0thy2U.gif

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.


Avatar

By ShadowApex 28 Nov 2015 06:43

Lead Developer · 374 comments

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:

  • netifaces
  • neteria

You can install both of these dependencies easily with pip:

pip install netifaces
pip install --pre neteria


Avatar

By dulsi 15 Oct 2016 00:52

Member · 27 comments

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.

Avatar

By ShadowApex 15 Oct 2016 01:58

Lead Developer · 374 comments
dulsi wrote

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.


Avatar

By MirceaKitsune 22 Jan 2017 15:00

Member · 38 comments

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.

Avatar

By ShadowApex 23 Jan 2017 19:27

Lead Developer · 374 comments
MirceaKitsune wrote

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.


Avatar

By MirceaKitsune 24 Jan 2017 14:30

Member · 38 comments

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).