Testing a Match
Configuring the Backend
For Redwood to know how to launch the server when a match is found in the matchmaking service, you need to add some minimal configuration to point to your Unreal project.
-
Navigate to the
RedwoodBackend
directory (this is located under where you installed Redwood) -
Create a folder in
config/node
with the name of your project (e.g.template-blank
); it's recommended to use hyphens or underscores instead of spaces -
Create a
_config.json
file in that folder (e.g.config/node/template-blank/_config.json
) with the contents:- Evaluation Version
- Full Version
{
"parentNames": ["evaluation"]
}{
"parentNames": ["default"]
} -
Create a
realm/instances/default.yaml
file (i.e.RedwoodBackend/config/node/template-blank/realm/instances/default.yaml
) -
Generate two UUIDs for realm authentication for the next step. You can do this with an online generator.
noteIf you've installed NodeJS & Yarn and Redwood dependencies by running
yarn
in theRedwoodBackend
directory, you can runyarn id
in theRedwoodBackend
directory to generate a UUID. -
Set the contents of your
realm/instances/default.yaml
to the below. In this config we're:- Specifying new realm auth parameters. The secret shouldn't be shared externally to the studio, and doesn't support the secrets system yet, so you're safe to commit this value in the meantime but otherwise treat it like a secret.
- Ensuring we use the
local
game server provider and specifying the path to the UE project file - Changing
max-wait-until-make-shallow-match-ms
to a smaller value for faster testing
auth:
id: "your-first-generated-uuid-here"
secret: "your-second-generated-uuid-here"
game-servers:
provider: "local" # this is redundant here since it's the default, but we like to keep it here to prevent later confusion
local:
project: "C:\\path\\to\\YourProject\\YourProject.uproject"
ticketing:
matchmaking:
max-wait-until-make-shallow-match-ms: 15000noteNotice that for Windows paths, you need to use double backslashes (
\\
) instead of single backslashes (\
). -
Under
RedwoodBackend
you should see aconfig-settings.json
file. Open it and change the"env"
value to the name of the folder you created inconfig/node
. For example:{
"defaults": {
"dir": "config/node",
"env": "template-blank"
}
}
Launching the Backend
You can run the dev-initiator.exe
file in the RedwoodBackend
directory via the terminal or double click on the Run Dev.bat
script from File Explorer. Several logs will print to the console as the backend initializes; wait until you see All services ready
.
If you run the dev-initiator.exe
program from a terminal, make sure to start it from the RedwoodBackend
directory.
Running a Match
-
In the Unreal project you created earlier, open the
/Content/Maps/L_Title
map. -
Change the Net Mode in the play settings to Play Standalone
-
Optionally change the number of players to whatever you'd like. Below we'll just show the steps for a single player, but you can repeat them to get multiple players in the same match.
-
Click the Play button
-
You should now see the Register, Login, and Quit buttons:
If you're stuck seeing the Connecting to the director... screen, make sure you've launched the
dev-initiator.exe
program, there are no errors, and double check any firewall/security prompts that may be preventing it from connecting.noteIf you're still having trouble connecting, make sure you don't have other applications using conflicting ports. The Redwood backend by default runs on ports
3000
and3001
. These config variables can be changed by adding them to the_index.yaml
file you created earlier. Below is what you can add to the end of the file; change the ports respectively:director:
connection:
backend:
port: 3000
frontend:
port: 3001
realm:
connection:
backend:
game-server-access:
port: 3000You would also need to change the port in the Director Address variable in the Class Defaults section of the B_TitlePlayerController blueprint in
/Content/GameFramework
using thedirector.connection.frontend.port
config variable you specified above. -
Click the Register button and enter a username and password. If that's successful, you'll be automatically logged in and see the character selection screen. Press the
+
button to create a new character: -
Enter a character name and click Create. You'll be taken back to the character selection screen. You should see your new character in the drop down menu:
-
After selecting your character, click the Join button to join the matchmaking queue:
-
If you're seeing the below error, you didn't correctly configure the backend to point to your project:
-
If everything was configured properly, any clients that signed up before should be put into a match. The Blank template has a simple match where players can move around as a floating cube with WASD and the mouse.
That's it! You're using Redwood to run a match! Generally speaking, you can continue to build your game as you normally would.
When you're ready to continue learning more about Redwood, here are some follow up topics: