multiplayer

Introduction

This page contains information about the network multiplayer feature.

Quick guide

  1. To Join a game: Go to the Single Race - Multiplayer tab and press the Refresh list button.
    • This will connect to the master server for available games (see chapter below)
  2. Select a game you wish to join and press the Join game button
  1. Alternatively you can host your own game by pressing the Create game button (the game will show up in the list for others to join).
    • You can also connect directly to an IP:port by pressing Direct connect
  2. Press Ready button in the game lobby tab and wait for others to become ready too
  3. The game shall start when the host presses the button
  1. It is possible (since 2.2) for host to continue game on other track (or restart on current)
    • When host presses new game (same button as start) curent game will end, peers will have shown menu
    • Host can now change track (and game settings) and after all peers have pressed ready, game can start again


Master server, Players

On Multiplayer tab you can see an error message “Couldn't reach the master server”. This is because it's not working since years and won't be.

It means networked multiplayer only works with Direct connect (all players need to specify IP).

So to play multiplayer you should enlist your friends to play with you. All players need to have ports forwarded, and use Direct connect.

Local network multiplayer works well.

The list of available games will never be filled.

But even years ago (when it worked) it was rarely not empty. There was also a webpage with status of available games back then. And you could come to #stuntrally on Freenode to challenge one of the hang-arounds.


Troubleshooting

Q: I get a “Network error” message box when I try to join or create a game.

A: Maybe some other program is currently using the local port. Try a different one by changing it in the Settings tab. Also make sure your firewall isn't blocking Stunt Rally - it needs permissions to both access the internet as well as listen for connections (i.e. permission to be a server).


Q: Other players can't connect to me

A: Most likely your router is blocking access. Configure it to forward the traffic coming to the Stunt Rally local port (check it from Multiplayer's Settings tab) to your computer. You might find http://portforward.com/ helpful.


Q: I cannot connect to some players

A: This is the previous problem reversed - their firewall is misconfigured. If you have your router properly configured, the others should be able to connect to you and as such you don't need to connect to them anymore. Obviously this doesn't apply if you are the host.


Q: I get errors about protocol versions

A: This means that your version of Stunt Rally is incompatible with the master-server and/or other players (depending on with whom you are trying to communicate). Your best bet is to make sure you are running the latest release of SR. Otherwise, tell your fellow players or master-server administrator (that's us most likely) to upgrade.


Q: How can I change my nickname?

A: Go to the Settings tab under the Multiplayer main tab.


Technical details

Stunt Rally uses a lightweight master server for tracking available games. All other networking is based on the peer-to-peer architecture, meaning all players are connected to each others and there is no separate game server.

The underlying protocol used is UDP, though ENet, the networking library, builds it's own layer on top of that, so using generic UDP sockets for communicating with SR or master server is not possible.

Master server

Master server is a simple command-line server (can be daemonized on Linux) that accepts game announcements and passes a list of them to anyone who asks. Clients must update the games periodically or they will timeout in the master server.

Anyone can build and host a master server, but players need to set the correct address and port in the Multiplayer - Settings tab in order to connect to it.

multiplayer.txt · Last modified: 2019/03/29 07:43 by cryham