⏱️ Quickstart

This guide will walk you through creating and deploying a multiplayer game with Godot 4.2.

If you are using Godot 4.1/4.0/3.x, please be aware that some details may be different.


Step 0: Create a new Godot project

For this tutorial, start a new Godot project.


Step 1: Set up the Rivet Godot plugin

The Rivet Godot plugin is can be installed from the Godot Asset Library, via gd-plug, or manually from the GitHub repo.

Go to the Godot Asset Library, search for "Rivet", and install the plugin. Currently, you can only install the plugin from the Asset Library if you are using Godot 4.2.

Once the plugin is open, sign in to link your game to Rivet.

Logging in via the Rivet Plugin

Next, follow the steps 1-3 in the "Setup" tab to setup a basic multiplayer game.

A view of the setup tab of the Rivet Plugin

Step 2: Testing Locally

A view of the Godot window

Now that we've done the 3 required setup steps, we can move on to testing locally. First, note that there are tabs that the Godot plugin added to the bottom of the Godot editor, where logs normally are. One is the "Backend" tab, which shows logs from the OpenGB backend.

A view of the backend logs

Going back to the setup panel, the next tab will bring you to the "Develop" tab. From here, first change the "Environment" to "Local" and then start a local Godot game server by clicking "Start" under the "Local Game Server" section.

A view of the develop tab of the Rivet Plugin

Now that the Godot server is running, we can look at the "Game Server" tab to see the logs from the game server. We can see if any issues came up from the Godot project, or connecting to the backend.

A view of the game server logs

To recap this section, we've:

  • Started the OpenGB backend on our local machine
  • Set our environment to "Local" so that we can connect to the backend
  • Started a local Godot server
  • Seen the logs from the backend and game server to ensure everything is working

The last step after all of that is to see the game connect! In Godot, click "Debug > Run Multiple Instances" and select "Run 2 Instances". Now, after you start the game, you should have two instances of the game running that can connect to your local lobby when you click "Find Lobby".

Two instances of the game running

Step 3: Deploying to Rivet

From the "Deploy" tab, select "Staging" and click "Build & Deploy".

A view of the deploy tab of the Rivet Plugin

Step 4: Test your multiplayer game

After deploying, go back to the "Develop" tab and see that the environment is set to the same environment you just deployed to (should be "Staging"). Press "Run Project" in the top right of the Godot editor. You are now connected over the internet through Rivet to your game!


Next steps

Now that you've seen how to get a multiplayer game up and running, there are a few other things you might want to check out.

Editing the backend config

For this quickstart, we used a default backend config that came with the plugin. You can learn more about what was added here. To read more about how this file can be configured, check out the OpenGB backend documentation.

Configuring lobbies

Lobbies are configured as part of the backend config. We can see the defualt lobby configuration below:

{
  "lobbies": {
    "config": {
      "lobbies": {
        "regions": ["local"],
        "backend": {
          "localDevelopment": {
            "tags": { "test": "5" },
            "ports": {
              "game": { "protocol": "udp", "port": 7777 }
            }
          }
        }
      }
    }
  }
}

We can look at the OpenGB lobbies documentation to find out how to configure it futher:

Check out more backend modules

Take a look at the other backend modules that are available. On top of connecting to lobbies, OpenGB has many pre-built modules across many catagories, here are some:

Was this page helpful?

Edit Page

Rivet

Open-source multiplayer infrastructure. Easy, flexible, and affordable.

This website is not sponsored by or affiliated with Unity Technologies or its affiliates. Unity Trademark(s) are trademark(s) or registered trademark(s) of Unity Technologies or its affiliates in the U.S. and elsewhere. | This website is not sponsored by, affiliated with, or endorsed by Epic Games, Inc. or its affiliates. 'Unreal Engine' is a trademark or registered trademark of Epic Games, Inc. in the U.S. and elsewhere. | The HTML5 Logo by the World Wide Web Consortium (W3C), used under a Creative Commons Attribution 3.0 License. Source | The Godot Engine Logo by the Andrea Calabró, used under a Creative Commons Attribution 4.0 International License. Source | Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries. Docker, Inc. and other parties may also have trademark rights in other terms used herein.

© 2024 Rivet Gaming, Inc. All rights reserved.