Preface
This game is a multiplayer 2v2v2v2 arena, similar in structure to the Arena game mode in League of Legends. It includes a fully developed bot system that dynamically replaces missing players with AI. This map alone has attracted over 3,000 unique players on Fortnite Discovery and had a peak of over 250 players active at the same time. You can check it out yourself here! Before we dive into the details, here's a short trailer I made for the map's release.
Gameplay Trailer
Details
System Design
There are two main underlying systems in this game: the economy (earning gold, buying weapons and upgrades) and the matchmaking.
Code Snippets
GetBestPlayer() : void =
# Retrieve all players currently in the playspace
AllPlayers := GetPlayspace().GetPlayers()
# Loop through each player to populate the Scores array with their current scores
for(IDX := 0..Scores.Length-1):
if (Player := AllPlayers[IDX]):
# Set the score for each player in the Scores array
if (set Scores[IDX] = ScoreManager.GetCurrentScore(Player)){}
# Initialize a flag to track whether any scores were swapped during sorting
var Swapped : logic = false
# Main loop to repeatedly sort scores and update the leaderboard display
loop:
Sleep(5.0) # Runs every 5 seconds to keep it up to date
set Swapped = false # Reset Swapped to detect any new swaps in this iteration
# Bubble sort loop to order scores in descending order
for(IDX := 0..Scores.Length-1):
# Compare each score with the next; swap if current score is higher
if(Scores[IDX] > Scores[IDX + 1]):
if (NextScore := Scores[IDX + 1], CurrentScore := Scores[IDX]):
# Perform the swap of scores in the array
if(set Scores[IDX] = NextScore, set Scores[IDX + 1] = CurrentScore):
set Swapped = true # Mark that a swap happened
# Once sorting is complete (no swaps), determine the highest scorer
if (Swapped = false):
# Check each player to see who matches the top score (Scores[0])
for (Player : AllPlayers):
if (HighScore := Scores[0], HighScore > 0):
# If player's score matches the top score, display them on the DanceMannequin
if (ScoreManager.GetCurrentScore(Player) = HighScore):
DanceMannequin.ActivateSkinAndEmoteCapture(Player)
else:
# If no high score is found, set the mannequin to its default appearance
DanceMannequin.ActivateDefaultPreset()
break # Exit loop after displaying the best player
TeleportAllToArenas() : void =
# Get the collection of all teams within the playspace
TeamCollection := GetPlayspace().GetTeamCollection()
# Loop through two indices representing the two winning and two losing teams
for (Index := 0..1):
# Retrieve the team from the WinnerTeams array at the current index
if (WinnerTeam := WinnerTeams[Index]):
# Get the agents (members) of the winning team and the designated teleporter
if (TeamMembers := TeamCollection.GetAgents[WinnerTeam]):
if (WinnerTeleporter := Teleporters[Index + WinnerPlacer + ArenaCycler]):
# Teleport each team member to their assigned winner teleporter
for (Member : TeamMembers):
WinnerTeleporter.Teleport(Member)
# Retrieve the team from the LoserTeams array at the current index
if (LoserTeam := LoserTeams[Index]):
# Get the agents (members) of the losing team and the designated teleporter
if (TeamMembers := TeamCollection.GetAgents[LoserTeam]):
if (LoserTeleporter := Teleporters[Index + LoserPlacer + ArenaCycler]):
# Teleport each team member to their assigned loser teleporter
for (Member : TeamMembers):
LoserTeleporter.Teleport(Member)
# Increment ArenaCycler by 2 to change the arenas the players are going to play in
set ArenaCycler += 2
# Reset ArenaCycler and swap positions for winner and loser placers when the limit is reached
if (ArenaCycler > 6, LoserPlace := LoserPlacer, WinnerPlace := WinnerPlacer):
set ArenaCycler = 0
set WinnerPlacer = LoserPlace
set LoserPlacer = WinnerPlace
Print("Swapped")
Map Design
I designed five arenas for this game, each with a unique layout to encourage different play styles. Most follow a 3-lane style (except for the white map), making them easy to understand and play while still offering various approaches and angles.