This package allows you to create multiple maps/arenas within your game and cycle through them each round. It includes options to change the world settings, music, and results camera for each map, as well as configuration options for cycling randomly or through a set order. It’s been tested with most of the gun-based starter templates (FFA, CTF, TDM, etc) but it should work with any game that uses the default spawn points.
Demo gif: Multi Map Game Demo - Album on Imgur
NOTE: When I started this package I was using the term “arena” to describe each “map” so I’ll use those terms interchangeably below. And all of the code refers to “maps” as “arenas”.
HOW IT WORKS:
This package consists of 3 core components: the “Arena Controller”, “Arena Spawn Points”, and “Arena Settings Modifiers”. The Arena Controller handles all of the logic for choosing the next map and moving the default spawn points to their correct locations. The Arena Spawn Points define the positions and rotations where the default spawn points will be. The Arena Settings Modifiers define the world settings, music, and results camera for each map.
- Install the “Multi Map Game” package from the Community tab
- For each of the default spawn points in your game, swap out the spawnScript for the spawnScript that came with this package. The new spawnScript includes one additional property: “spawnPointNumber”. Set each of the spawnPointNumber properties to 1, 2, 3, 4… Each should be different and you should increment them by 1 each time.
- Create an Arena Spawn Point for each of the original spawn points and set their spawnPointNumber to match those of the original spawn points. Leave the “arenaNumber” property set to 1. (Pro-tip: I rename the spawn points (and other components) using the formula “Arena##SpawnPoint##” to help keep things organized. See screenshot below.)
- For the any subsequent map, you’ll create another set of these Arena Spawn Points and increment the arenaNumber up by 1.
- Create an Arena Controller somewhere in your game. The only required property on the Arena Controller is numberOfArenas – this should be the total number of maps you want to cycle through in you game. (And there should be a set of Arena Spawn Points for each map.)
- On your gameController entity, add an event to the onRoundStart event. The Entity should be your Arena Controller, the script should be the arenaControllerScript, and the event should be UpdateCurrentArena.
At this point, regardless of where your default spawn points are located, when the game starts they should be moved to match the positions of their corresponding Arena Spawn Points. If you create a second set of Arena Spawn Points (with their “arenaNumber” property set to 2), and adjust the “numberOfArenas” property on the Arena Controller to be 2, you should cycle through the 2 maps.
ARENA SETTINGS MODIFIER:
- If you want to change the world settings, music, or results camera for your maps, create an Arena Settings Modifier for each of your maps and set their “arenaNumber” to match the corresponding Arena Spawn Points arenaNumber. When this map is selected, any enabled options in the Arena Settings Modifier will be applied. To change the results camera, create a new camera entity and select it in the resultsCamera property on the Arena Settings Modifier. NOTE: Each option is hidden behind a “changeOptionName” checkbox.
- IMPORTANT: The Arena Settings Modifier overwrites the world settings, music, and results camera for the remainder of the game. If you change any of these things, they will retain their settings for all subsequent maps unless you modify them again. So if you want unique music for only one map, you’ll need to change the music for that map and then change it back on the next map – none of the settings will revert back automatically.
ARENA CONTROLLER OPTIONS:
- By default, the Arena Controller will cycle through your maps incrementally (eg: map 1, map 2, map 3, etc). If you select “randomCycle” in the properties, a new map will be selected each round excluding the current map (eg: map 2, map 1, map 2, map 3, etc). If you also select “canRepeatPreviousMap” in the properties, a new map will be selected each round including the current map (eg: map 3, map 1, map 1, map 2, etc).
- Also by default, the Arena Controller will play each map once before moving on to the next one. By ticking the “repeatArena” property and setting the “repeatArenaCount” to a number greater than zero, you can play the same map XX times before moving to the next one. Note, this number is how many times the map will repeat so setting it to 1 will play the map twice, setting it to 2 will play the map 3 times, etc.
UPDATE 04/18/21: EVENTS
- The Arena Settings Modifier now contains 2 events: OnArenaStart and OnArenaEnd. These events (and any functions you add to them) will be triggered when the arena changes. These can be useful for showing/hiding a map when it’s not in use or for any other number of purposes.
UPDATE 03/15/22: LOBBIES AND NEW WORLD SETTINGS
- I’ve (finally) added support for having a Lobby in your game between rounds. Previously the package could only do the lobby schedule once at the start of the game, now you can choose to have it between each round in a designated “lobby area”. This works the same as the other arenaSpawnPoints in the game (ie: it physically moves the default spawns to the positions of the lobby spawns before spawning the players).
- For each of your default spawn points create a new spawn point and check the “isLobby” property. Make sure there is a corresponding lobby locator for each spawnPointNumber.
- On your gameController entity, set the properties “alwaysDoLobby” and “alwaysRespawnForPlay” to true. (Note to self: double check the names of those properties.)
- On your gameController entity, add an event to the onLobbyStart event. The Entity should be your Arena Controller, the script should be the arenaControllerScript, and the event should be ResetLobbySpawns. It should look like the image below
This update also includes the new World settings on the arenaModifierScript. Old properties were removed, updated properties were updated, and new properties were added. I’ve also tried to organize them into groups to match the World tab (for clarity and ease of use).
Example naming convention:
As always, if you need help or have questions about this package, please find me on the official Crayta discord (my name is ekelrock over there as well).