Multiplayer Information

Multiplayer in Wayward is enabled for up to 32 players. Multiplayer works in a simulated turn-based mode where each turn happens on a fixed interval as long as players are performing actions or in a real-time mode where each turn happens on a fixed interval regardless of player action. When playing in hardcore mode (or with permadeath enabled), after dying, you will continue to play in ghost form, allowing you to spectate but not interact normally. Multiplayer also allows for a special PVP flag to be set to allow players to hurt and kill other players. Multiplayer options can be set in the "Multiplayer" menu via the pause menu accessed with escape by default. Additionally, modes and tick time (turn intervals) can be changed via the "Modes" menu.

Creature spawn rates, creature difficulty, and reputation are all based on how many connected players there are and will scale and average based on each individual player.

Commands

You can use several special commands while playing multiplayer. To see a list of all possible commands, type "/commands" in the chat bar and hit enter. The following commands are also available for use:

  • /players – Shows a list of all connected players.
  • /ping – Shows your latency to the host player.
  • /kick – Allows the host to kick a player.
  • /banned – Shows a list of all banned players.
  • /ban – Allows the host to ban a player.
  • /unban – Allows the host to unban a player.

Networking & Forwarding Ports

By default, when running Wayward through Steam, Wayward will attempt to use the Steam Matchmaking API for networking. There should be no additional setup needed in this mode.

If you are running Wayward outside of Steam or in the event the Steam networking services are down, Wayward will attempt to run multiplayer games over WebRTC, which chooses a randomized port. If the client is unable to connect to the WebRTC port, their game will fallback to using a WebSocket connection, which will connect on port 38740. If that fails, then players will be unable to join the game without port forwarding or firewall configuration. You can find more information about forwarding ports and firewalls here. Every router and network is different and what you need to do will vary drastically. You can attempt to disable firewalls or reduce their security level and ensure that port 38740 is opened under the TCP protocol for the WebSocket fallback to function.

Local Multiplayer

Wayward supports local multiplayer over the same network using IP addresses. Simply start the multiplayer game as per normal and share your local IP address for others on the same network to be able to join. You can join a multiplayer game by IP address by clicking on "Multiplayer" from the main menu and clicking "Join by Game Code or IP".

Note: This method is required if you are trying to connect to your own dedicated server if it is on the same network.

Private Multiplayer

You are able to set your multiplayer game (including dedicated servers) to private. This will only allow others to join your game if you share the game code with them or invite them from in-game through the "Copy Game Code" or "Invite Steam Friends" buttons inside the multiplayer menu available after you start the game.

Note: Copying the game code from a dedicated server will copy the IP address of the server. If you are on the same network, you will not be able to join with this IP address. You will need to use your local IP address.

Dedicated Server Info

To run Wayward in a dedicated server mode, run the wayward executable from the command prompt/terminal/console with the following parameters:

On Windows:

wayward.exe +server

On macOS:

Wayward.app/Contents/MacOS/Electron +server

On Linux:

wayward +server

Full arguments list:

  • +allowHardcoreRespawns | Switch | Allows players to respawn in hardcore mode as a new character. Defaults to disabled.
  • +backup | Switch | Add this argument to enable automated backups to the servers /backups folder. Defaults to no automated backups.
  • +backupInterval 10 | Number | Defaults to 10 (minutes).
  • +console | Switch | Starts dedicated server in console only mode (no GUI) - When using this, you must specify a world to load using the +load switch. Certain headless Linux distributions may require a display driver or virtual display/framebuffer. Defaults to disabled.
  • +customMilestoneModifiersAllowed | Switch | Allows players to set their own milestone modifiers when joining. Defaults to disabled
  • +dev | Switch | Opens Developer Tools on launch.
  • +difficulty hardcore | String | Sets the difficulty (or game mode). Valid options: hardcore, casual, challenge, dailychallenge. Defaults to "hardcore".
  • +hardwareAcceleration 1 | Number | Defaults to 1 (enabled).
  • +load "Game Name" | String | Specify the game name to have it load the save on startup - If the world you specified in +load does not exist, it will be generated. Defaults to nothing.
  • +maxBackups 24 | Number | Defaults to 24 maximum backups to keep.
  • +maxPlayers 16 | Number | Sets the max players. Defaults to 32.
  • +milestones | String | A comma-separated string of milestones to load as the server. You can get the milestone enum names here.
  • +name "Default" | String | Defaults to "Default".
  • +new | Switch | Creates a new game every launch.
  • +port 38740 | Number | Defaults to 38740.
  • +private | Switch | Prevents the server from showing up in the server browser. Defaults to disabled.
  • +pvp | Switch | Enables PVP. Defaults to disabled.
  • +realTimeTickSpeed 50 | Number | Real time tick speed. Defaults to 50 (833ms). Normal range is between 10 and 80.
  • +savePath | String | A path string enclosed in quotes to specify the path that saves are stored in. By default, this is set to the root Wayward folder where server saves can be found in the "/servers/<+name>/" directory.
  • +seed 123456 | Number | World generation seed. Defaults to a randomized number.
  • +server | Switch | Starts Wayward in dedicated "server" mode.
  • +ssh | Switch | Enables SSH. Defaults to disabled.
  • +sshPassword | String | The SSH password to use.
  • +sshPort | Number | The SSH port to use.
  • +sshUsername | String | The SSH username to use.
  • +turnMode realtime | String | Sets the turn mode. Valid options: realtime, simulated. Defaults to "simulated".

Example on Windows with some of the arguments:

wayward.exe +server +name "My Server" +port 38740 +backup +backupInterval 10 +maxBackups 24 +load "Game Name" +difficulty Casual +hardwareAcceleration 0

When the server is running, you will be able to see player messages as well as chat as the server.

Note: Port forwarding may be required when running a dedicated server. By default, you will need to forward port 38740.

Dedicated Server Mods

To run modifications using a dedicated server, navigate to the Steam Wayward folder. Create a folder called "mods" in that directory if one doesn't exist. Here, you can upload any mod folder you wish, including modifications from the Workshop. Simply navigate to the /workshop/mods/ folder and copy over any workshop mod folders that you wish to use on your dedicated server.

Console Setup

Certain headless Linux distributions may require a display driver or virtual display/framebuffer when using the +console parameter. Running without a display driver or virtual display/framebuffer may result in the following warning to appear: "Gtk-WARNING: cannot open display", stopping execution. We recommend using something like Xvfb for this purpose.

SSH Setup

To run a dedicated server with SSH support, you need to enable it with the +ssh argument in conjunction with other SSH-specific arguments. For example:

+ssh +sshPort 38742 +sshUsername wayward +sshPassword test

In addition you need to generate a SSH server key. Via Shell, you can run:

ssh-keygen -t rsa -b 4096

Copy the private key file to:

Wayward\servers\<Your Server Name>\ssh.key

Optionally copy the public key file to:

Wayward\servers\<Your Server Name>\ssh.pub

With the above configuration, your server will have an SSH server running at port 38742. It will accept a login for username "wayward" with the password "test". You can ssh into your server by running:

ssh wayward@localhost -p 38742

If you copied the public key to the server, you can connect using it with:

ssh -i ssh.key wayward@localhost -p 38742

Multiplayer Design

Packets the server sends to clients: IWorldPacket, ITickPacket, IActionPacket

Packets the client sends the server: IActionPacket, IKeyBindStatePacket, IUpdateDirectionPacket, IConfirmDialogSelectionPacket, IChatMessagePacket, IUpdateOptionPacket

The client doesn't do anything unless the server tells it.

For ticking, it's controlled from the server. A client will never tick unless the servers tells them to (along with most other things).

The server will:

  • Log the current seed (before seed)
  • Execute the tick method
  • Log the current seed (after seed)
  • Send an ITickPacket to all the clients (containing the before and after seeds)

Each client will see the ITickPacket and:

  • Confirm the current game seed is the same as the before seed
  • Execute the tick method
  • Confirm the current game seed is the same as the after seed
For player movement, the client will send the server an IKeyBindStatePacket (if WASD), or IUpdateDirectionPacket (if mouse click).

The server will then:

  • Update the players key bind state or direction state
  • Process the players input
    • If a movement is going to happen, the server will send every client an IActionPacket with the MoveTo action type
When a client wants to execute an action, it sends the server an IActionPacket with the details (action type, item, etc.).

The server will see this and:

  • Log the current seed (before seed)
  • Execute the action
  • Log the current seed (after seed)
  • Send an IActionPacket to all the clients (containing the before and after seeds)

Each client will see the IActionPacket and:

  • Confirm the current game seed is the same as the before seed
  • Execute the action
  • Confirm the current game seed is the same as the after seed

Community & Links