Quickstart
Goal: By the end of this crash course, you'll have a working multiplayer game running on Rivet servers using Godot 4.2 or newer.
Estimated time: 10-20 minutes
Quick Start
- Install the Rivet Godot plugin
- Set up a local multiplayer game
- Deploy your game to Rivet servers
Overview
The Rivet plugin allows you to get a multiplayer game running out of the box in a few clicks, all within the plugin, without needing to sign in to start. Writing code is unnecessary to get a working multiplayer example game running on scalable servers across multiple regions.
Detailed Steps
1. Set up the Rivet Godot plugin
- Install the Rivet Godot plugin from the Asset Library or within the engine under AssetLib (search for "Rivet").
- Enable the plugin in the project settings under plugins. This can also be reached under the AssetLib tab with the "Plugins..." button. Check the On box to enable the plugin for the project.
2. Get a Multiplayer Game Running Locally
Open the Rivet plugin on the bottom left next to FileSystem:
- Setup Rivet Modules: Click Setup to generate the Rivet SDK and configs.
- Setup Multiplayer & Game Server: Click Setup to generate the fully functional multiplayer scene with working server and client code that can be customized.
- Test Locally:
- Click Open Run, which will open the Develop tab.
- The Environment tab will be set to locally, and the Run Locally dropdown will be set to "Run Client & Server (Local)".
- Click Start in the Run Locally section to start the multiplayer game locally.
3. Deploy Game to Live Rivet Servers
-
Sign In:
- Click Sign In at the top right of the plugin.
- Follow the steps to create an account or sign in to an existing one.
-
Link Project:
- Click the select game dropdown on the link project screen to create a new game and team.
- If this isn't your first time using Rivet, you can use an existing team.
- Click continue to connect the Godot project with the game project in Rivet.
-
Deploy:
- Under the Develop Tab, in the Environment section, change the environment from local to Production.
- In the Deploy section, select "Deploy Game Server & Modules" from the drop-down.
- Click Deploy to Production.
-
Run the Game:
- Under Run Locally, set the drop-down to "Run Client (Production)".
- Click Start to play the game on a server.
- You can change the region in the dropdown within the game menu.
Testing Your Game
- To test multiple clients, use the Client Config in the Develop tab.
- Try connecting from different devices or browsers to simulate a real multiplayer scenario.
Troubleshooting
- If you encounter issues during deployment, check your internet connection and Rivet account status.
- For plugin-related issues, try disabling and re-enabling the plugin in Godot project settings.
- If you're having trouble connecting to servers, ensure your firewall isn't blocking the connection.
- Try redeploying the server and client to the Rivet live servers.
- Use the logs for more detailed troubleshooting.
Next Steps
- Customize your game by modifying the generated scene and scripts.
- Explore additional Rivet modules in the Modules Tab to add features like authentication or currency.
- Join the Rivet Discord for community support and updates.
Additional Information
Rivet Plugin Layout
- Setup Tab: Initial setup process for getting a multiplayer game working.
- Develop Tab: Main development area with Environment, Run Locally, and Deploy sections.
- Modules Tab: List of game features (modules) to add functionality to your game.
Technical Details
- Godot supports ENet, WebSocket, and WebRTC transports. This tutorial uses ENet, but it's easy to swap out.
- Rivet offers a scalable Postgres database built for gaming to add features to your game.
- Most modules are open-source, allowing you to edit the code directly.
For more detailed information, click the documentation button within the Rivet plugin or visit the Rivet GitHub repository.