Skip to main content

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.

  1. Navigate to the RedwoodBackend directory (this is located under where you installed Redwood)

  2. 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

  3. Create a _config.json file in that folder (e.g. config/node/template-blank/_config.json) with the contents:

    {
    "parentNames": ["evaluation"]
    }
  4. Create a realm/instances/default.yaml file (i.e. RedwoodBackend/config/node/template-blank/realm/instances/default.yaml)

  5. Generate two UUIDs for realm authentication for the next step. You can do this with an online generator.

    note

    If you've installed NodeJS & Yarn and Redwood dependencies by running yarn in the RedwoodBackend directory, you can run yarn id in the RedwoodBackend directory to generate a UUID.

  6. 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: 15000
    note

    Notice that for Windows paths, you need to use double backslashes (\\) instead of single backslashes (\).

  7. Under RedwoodBackend you should see a config-settings.json file. Open it and change the "env" value to the name of the folder you created in config/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.

note

If you run the dev-initiator.exe program from a terminal, make sure to start it from the RedwoodBackend directory.

Running a Match

  1. In the Unreal project you created earlier, open the /Content/Maps/L_Title map.

  2. Change the Net Mode in the play settings to Play Standalone

  3. 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.

  4. Click the Play button

  5. You should now see the Register, Login, and Quit buttons:

    Title screen connected to the backend

    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.

    Title screen connecting to the backend

    note

    If 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 and 3001. 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: 3000

    You 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 the director.connection.frontend.port config variable you specified above.

  6. 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:

    Character selection screen

  7. 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:

    Character selection screen

  8. After selecting your character, click the Join button to join the matchmaking queue:

    Joining queue

    Match found

    Server allocated

  9. If you're seeing the below error, you didn't correctly configure the backend to point to your project:

    Server allocation error

  10. 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.

    In a match

success

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: