Defining Game Modes and Maps for Redwood
Both Unreal and the Backend need to be configured with different information on what game modes and maps exist and correlated information. Without these being properly configured and synchronized, you may not be able to get the corresponding match to start.
Unreal
Redwood defines two UDataAsset types that are required to be used for your game to work with Redwood:
These serve a few functions:
- Provide synchronized IDs with the
game.profilesbackend configuration for Game Modes and Maps - Link the ID with the respective Unreal asset
- Provide any user-friendly information for display
- Enable a standardized way for the Redwood server game subsystem to know how to change a map when the backend tells it to load a new mode/map
Asset Manager Settings
All of our Gameplay Templates come preconfigured to package the predefined assets, but if you want to define these assets in a different directory or you're integrating Redwood to your existing project, you'll need to change the Asset Manager settings to ensure these assets are tagged and cooked properly.
- In the Unreal Editor, navigate to
Edit > Project Settings... - Find Asset Manager under the Game section in the side panel
- Under Primary Asset Types to Scan, add a new entry:
- Set Primary Asset Type to
RedwoodGameModeAsset - Set Asset Base Class to
RedwoodGameModeAsset - Add an entry to the Directories and set it to where your data assets are located
- Under Rules set the Cook Rule to
Always Cook
- Set Primary Asset Type to
- Under Primary Asset Types to Scan, add a new entry:
- Set Primary Asset Type to
RedwoodMapAsset - Set Asset Base Class to
RedwoodMapAsset - Add an entry to the Directories and set it to where your data assets are located
- Under Rules set the Cook Rule to
Always Cook
- Set Primary Asset Type to

Game Mode Asset
An instance of URedwoodGameModeAsset should exist for each game mode you'd like to use in matchmaking as well as lobbies (regardless if they're started by the user or the backend).
Redwood Idshould be lowercase with no spaces and should be unique to this game mode asset.- The
Front Endvariables do anything automatically, but you can use these in your main menu/frontend widgets for information to display to the user. See the Match template'sW_RW_HostSessionsScreenandW_RW_Matchmakingwidgets in/Content/Redwood/Frontend/for examples. Game Mode Typespecifies which class the corresponding game mode inherits from (GameModeBaseorGameMode).Game Mode [Base] Classis the class of the corresponding game mode

Map Asset
An instance of URedwoodMapAsset should exist for each level/map you'd like to use in matchmaking as well as lobbies (regardless if they're started by the user or the backend).
Redwood Idshould be lowercase with no spaces and should be unique to this map asset.Map Nameis a user friendly name that you can use in your widgets.Map Idis reference to the Unreal Persistent Level for this map.

Backend
Profiles
The Redwood Backend configures the Game Modes and Maps under the game.profiles config variable. This variable is an array of game modes. Each game mode can have 1 or more maps associated with it. You can associate a map with multiple game modes. Below are descriptions for each variable for each item in the array:
idis a unique identifier that Redwood uses to keep track of each profile; it's also used asRedwood Idin the Unreal Game Mode DataAssetzonesis an object, containing a named object for each zonevariableCasing: "Original"prevents unwanted transformation by our config system to ensure thatzone-namestays aszone-name(and not transformed tozoneName). You can still usezoneNamemanually too.<zone-name>mapsis an array of strings where each string associates with the correspondingRedwood Idvariable you defined in the correspondingURedwoodMapAsset. A map will be randomly selected from this array.syncItemsFromAllZonesis optional. If set to true, all items from all zones will be synced to this zone.syncItemsFromZonesis optional. If set, all items from the specified zones will be synced to this zone.
max-players-per-shardis the maximum amount of players for a single game server instance (aka shard). It also serves as the maximum number of players that are allowed for matchmaking to consider a full match.num-players-to-add-shardis the number of players per zone per shard to choose to add another shard for the zone. Not setting/setting to null will disable sharding.num-minutes-to-destroy-empty-shardSet this variable if you want empty shards to be destroyed after so many minutes of remaining empty. If you want to try to incentivize players to move from low-population shards to medium-population shards to be more efficient with server costs, you'll need to implement additional game and/or backend logic.min-players-for-matchmakingis the minimum number of players that are allowed for matchmaking to consider a potential shallow match.matchmaking-zone-nameis an optional field that is required to enable matchmaking for this profile. Matchmaking requires a single-zoneGameServerProxyso this field indicates which of thezonesto use for matchmaking.collection-ends-when-any-shard-endsis a boolean that whentrueRedwood will shutdown allGameServerInstancesin the associatedGameServerCollectionif any of theGameServerInstancesend.datais a key/value pair object where each pair will be passed to the map load URL as a parameter (e.g. &key=value). The value must be a string.
Here are some examples of <config-environment>/game.yaml for the Match and RPG templates:
- Match
- RPG
profiles:
- id: "elimination"
zones:
main:
maps:
- "expanse"
max-players-per-shard: 16
matchmaking-zone-name: "main"
min-players-for-matchmaking: 1
data:
Experience: "B_ShooterGame_Elimination"
- id: "control"
zones:
main:
maps:
- "convolution"
max-players-per-shard: 16
matchmaking-zone-name: "main"
min-players-for-matchmaking: 1
data:
Experience: "B_LyraShooterGame_ControlPoints"
profiles:
- id: "overworld"
zones:
variableCasing: "original"
village:
maps:
- "overworld"
outskirts:
maps:
- "overworld"
mountain-pass:
maps:
- "overworld"
forest:
maps:
- "overworld"
mine:
maps:
- "mine"
max-players-per-shard: 16
num-players-to-add-shard: 50
# num-minutes-to-destroy-empty-shard: 5
collection-ends-when-any-shard-ends: false
data:
- id: "instanced-dungeon"
zones:
variableCasing: "original"
main:
maps:
- "dungeon"
max-players-per-shard: 16
matchmaking-zone-name: "main"
min-players-for-matchmaking: 1
data:
Shard Names / Max Shards Per Zone
The game.shard-names is a list of names to use for shards. When a shard is created, it will pick the first name from this list that is not already in use. If no names are available, it will not be created, so make sure you have enough names for the max number of shards you want to support. Redefining this variable will override the whole list.
The configured maximum shards per zone is equal to the length of this array.
This is the default value of game.shard-names:
shard-names:
- "Alpha"
- "Bravo"
- "Charlie"
- "Delta"
- "Echo"
- "Foxtrot"
- "Golf"
- "Hotel"
- "India"
- "Juliet"
- "Kilo"
- "Lima"
- "Mike"
- "November"
- "Oscar"
- "Papa"
- "Quebec"
- "Romeo"
- "Sierra"
- "Tango"
- "Uniform"
- "Victor"
- "Whiskey"
- "Xray"
- "Yankee"
- "Zulu"