Multiplayer

From SRB2 Wiki
Jump to: navigation, search
ToDoIcon.png To do
Since many 2.1 patches ago, CONSFAILPROTECT became RESYNCHATTEMPTS and consistency/synchronisation in netgames works differently as such. This article should be updated to reflect this.

Multiplayer is category of game modes in SRB2 where multiple players are allowed to play the game at the same time individually, in contrast to Single Player. Depending on the gametype being played, players either play together as a team or against each other. Multiplayer games can be played through either two-player mode, which is played on a single computer, or through netgames, where one player hosts a game on a network using several computers, such as the Internet.

Two-player mode

A screenshot of Two-player mode gameplay.

Two-player mode, also called splitscreen mode, is played by two people on the same computer. The screen is split horizontally to provide a separate display for each player – the top display is for Player 1, and the bottom display for Player 2.

Each of the two players have their own set of controls in this game mode, with exception to using the talk keys, opening the console and pausing the game. A single keyboard can be used for controlling both players; alternatively, a second joystick or mouse can be plugged in exclusively for Player 2 to use.

Many of the console commands and variables in SRB2 have variants for Player 2, allowing some settings to be toggled on/off or modified exclusively for Player 2. Examples of commands/variables with Player 2 variants include the following:

Netgames

A screenshot of a multiplayer CTF netgame.

Networked games, often shortened netgames, are games that are played over the Internet. One player hosts a server on their computer and other people join the game by connecting to the server from their own computers. The server can either be advertised publicly on the SRB2 Master Server (see section below) or, if the netgame is intended to be private, the other players can join by specifying the IP address of the host. Up to 32 players maximum can be in a netgame, though it is incredibly rare for a netgame to have this many players present.

Joining

There are several different methods of joining a netgame in SRB2:

Go to the Multiplayer menu, and click on the "Join Game (Search)" option. To select a room to search for servers in, highlight the "Room..." option, and press Enter to go to a separate screen displaying the full list of rooms on the Master Server (as well as their descriptions). Select one of these rooms to display the available servers hosted through the selected room, or "All" to display all servers for all rooms on the Master Server. Select the server you want to join and press Enter, and the game will attempt to join. By default, the game will always check for local servers.
  • Method 2) Joining via IP address:
Option a) Go to the Multiplayer menu, and click on the "Join Game (IP Address)" option. Type in the IP address of the person hosting the game you want to join. This is commonly used for joining private netgames that should not be displayed on the Master Server, though can be used to join servers regardless of whether they are hosted or not.
Option b) The console command CONNECT: can be used in a similar way to the "Join Game (IP Address)" option above – to join a netgame, CONNECT <ip address> should be typed into the console. However, this command also allows to apply other options such as the port to join to (if the server differs in port from the default) – see Console/Commands > CONNECT for more information.
Option c) The -connect command line parameter: If an IP address is specified after this, and SRB2 will automatically connect to a netgame with the given IP address. If an IP address isn't given, SRB2 does a broadcast check for a network game. (Due to a bug, connecting to a netgame with this parameter will change your character and color to the same as the host's.)

Hosting

The Host Game menu.

To host a netgame, there are several necessary procedures you must follow:

First and foremost, you must have port 5029 UDP open. This website will explain how this works. Once this is done, hosting your game is simple: just go to the "Multiplayer" option in SRB2, select the "Host Game" option, and choose your settings. If you want to advertise your game on the Master Server, choose the "Room" option and then, select the room you want your server to be advertised in (or all of them if you select "All"). This will allow people to search for your game and join it. If you want the game private, leave the "Room" option set to "<Offline Mode>" – this will only allow people who know your IP address to join your server if they know you are hosting. If you need to inform someone of your IP address and you don't know it, this site can help you.

Dedicated servers

Main article: Dedicated server

This is a special type of netgame server in which the host doesn't need to join their own game. See the main article for more details on setting up a dedicated server.

Administrative privileges

By default, only the host player (or "server") for a netgame has administrative powers: these include kicking or banning unwanted players from the netgame, toggling permissions or multiplayer "cheats" on/off, or configuring other general netgame settings. However, the server can use the VERIFY console command to promote other players in a netgame to server admins, who have almost all of the same powers as the server – exceptions include allowing other players to become admins, or toggling on/off the ability for players to join the netgame. Alternatively, a password can be set and passed around to trusted players, who can then log in as admins for the netgame. This allows other players to manage the netgame when the server is absent at all during the netgame.

Many console commands and variables are available to the server and admins in SRB2, such as the following:

  • KICK - used to kick a player from the netgame. A reason can be typed in after the command.
  • BAN - used to kick and ban a player from the netgame, adding to the server's ban.txt log file. A reason can be typed in after the command. Due to a bug, bans by server admins apparently ban the player but do not register the player on the ban list, thus degrading it to a kick.
  • MOTD - sets a "message of the day" that is displayed in a player's chat text when they join the netgame.
  • ALLOWJOIN - toggles on/off whether other players are allowed to join the netgame. (Server only)
  • DOWNLOADING - toggles on/off WAD downloading in the netgame.
  • PAUSEPERMISSION - toggles on/off whether other players besides the server are allowed to pause the game. (Server only)

Many more commands and variables exclusive to servers/admins can be found in places such as the following article sections (this is not a complete list):

Master Server

A master server is a website or IP publicized on the Internet and primarily functions as a list of servers for players to join. The SRB2 community's Official SRB2 Master Server (commonly known as the SRB2MS or simply MS) is hosted at ms.srb2.org. It serves as the main gateway for netplay, as it is the only public method of obtaining a list of running netgames. Through several information packages sent between the SRB2MS and running servers, in-depth information about all hosted netgames can be obtained from the SRB2MS's website. Historically, unofficial master servers have been hosted in the past, though these have since been dropped in favour of using the official master server (the SRB2MS) exclusively.

The IP address/host name and port of the master server the game connects to can be configured through the Game Options menu (Options > Game Options), or through the console variable MASTERSERVER. To use the SRB2MS, this should be set to ms.srb2.org:28900 – here, ms.srb2.org is the host name, and 28900 is the Standard port.

The SRB2MS is divided into separate "rooms", which can serve different purposes and have differing rules to each other. The two main rooms featured on the SRB2MS are Standard and Casual, although more rooms can be opened there depending on current events in the SRB2 community such as the OLDC. These rooms, along with their room ID numbers, are listed below:

Room name Room ID Description
Standard 33 Servers using the official gametypes implemented into SRB2 are to be hosted in this room.
Casual 28 Servers that play the game in a different way than intended through the game, such as role-playing or hangout, are to be hosted in this room.
OLDC 31 This is a special room made to go along with the bi-monthly contest on the SRB2MB.

A common misconception about the SRB2MS is that it is required to play SRB2 netgames. In reality, the SRB2MS is simply a list of advertised netgames – if the SRB2MS is currently down, one can still join a netgame by connecting to the host's IP address (see section above).

Some servers listed on the SRB2MS, whether in-game or online, may be marked as having particular tags, which showing important notes about the netgame:

Tag Description
Mod The game has been modified – additional WAD files, SOCs or Lua scripts have been loaded for the netgame, which may be required for you to join; however, SRB2 will automatically download all files that you don't have, unless downloading is disabled or if any of the files are too big to download. Note that files containing only music, sounds or palettes will not mark the game as modified, but will not be downloaded by SRB2 when joining the netgame.
Cheats Cheats have been enabled in the game – this refers to any of the Multiplayer "cheats" variables that can be modified by the server or admins. Cheat variables can all be reset to their default values by typing CHEATS OFF into the console, disabling this tag.

On the SRB2MS page online, these tags show up as small colored circles with the colors of the tags that apply to each server listed.

Lag

Lag is a common term for any kind of delay in gameplay. Specific kinds of lag occur for different reasons.

  • Latency causes the player's controls to be delayed between pressing the button and having it actually happen in-game. Latency is caused by the time it takes for your internet connection to send your input to the host server and then for the server to send the information back to you about what happened because of your input. This wait time is called ping, and is generally written in milliseconds. The lower the ping, the less latency, and the more responsive your controls will be in-game. Because the host is running the server on their own computer, they will not experience any latency, but all other players will experience at least some latency, depending on how good both the host's internet connection and their own internet connections are.
  • Framerate drop is when the game drops frames of animation when playing. This is caused when the player's computer is not fast enough to display the graphics on-screen in time, and never has to do with one's internet connection. The most common cause of this is an overly detailed map, but it will also happen when the player's computer is too slow for the resolution they're trying to play at. If you're experiencing framerate drop, try lowering your resolution in the video options or selecting a less detailed map.
  • Lag spikes are when gameplay freezes up for a moment. Normally, this is caused by a bad connection on one user's end. Lag spikes will also occur momentarily when a user joins the netgame. Contrary to popular belief, pausing does not directly stop lag spikes.
  • Consistency failure protection can generate a weird kind of laggy behavior characterized by the character teleporting back to where they were after moving, creating a stuttering effect of players moving two steps forward, one step back. This happens when CONSFAILPROTECT is set to enabled and someone gets desynched and has a consistency failure. This can make a game impossible to play, but prevents player from being automatically kicked. Frequently this can be fixed by simply ending the round and reloading the map, but if not, you'll need to find who is breaking the game's consistency and kick them.

Prevention techniques

  • Getting a better internet connection speed (mostly the upload speed) can allow your server to keep more players connected with less latency for the other players. This can also help prevent you from causing lag spikes when you join other servers, and reduce your latency when you're playing on other servers.
  • Use the PING command to determine which players have an excessively high latency, and either ask them to leave or kick them.
  • Reload the map. This can occasionally solve problems caused by people with high latency joining mid-round.

Consistency failure

Test.png This article or section is outdated and has not been updated to reflect the release of 2.1.

Please help the Wiki by correcting or removing any misinformation, as well as adding any new information to the page.

A consistency failure, also called "c-fail", is an automatic action performed by the server if the other players' connections are sending improper data. The player sending the improper data will have it refreshed by the server, this can cause lag. People still get kicked for consistency failures, however. Usually when the client sends an illegal netvar command. The host can see who is being inconsistent by typing blamecfail 1. If these jam up your game without stopping, you can turn off consistency protection with consfailprotect 0. Don't forget to turn it back up afterwards.

External links

  Game modes [view]
Game modes CampaignUltimate modeRecord Attack/NiGHTS ModeMultiplayer
Game types Single Player/Co-opCompetitionRaceMatch/Team MatchTag/Hide & SeekCapture the Flag
Level types Supplementary: 2D modeMario modeNiGHTS
Other: Special StageEmerald Hunt