Arena Shooter
A multiplayer team deathmatch you can open, host and read, the Arena Shooter variant of the First Person template, built on the ArenaKit Kit, the Combat weapons and the session layer.
The Arena Shooter variant of the First Person template is a small multiplayer game: two teams, a warmup, a timed live round, a results screen, bots that fill empty seats and a scoreboard. The rules live in the ArenaKit Feature or Kit so another project can reuse them; the variant is the project around it. It is a template to read, not a framework to extend.
Open and play
Create a project from the First Person template and choose the Arena Shooter variant in the Project Launcher. The variant enables the Combat and ArenaKit Features and Kits and opens Assets/ArenaShooter/Scenes/Arena.mmap. The bots build their navigation when the map loads, so there is nothing to bake by hand. Press Play: the warmup runs while you are in the match, then the round starts. Fire with the left mouse button and reload with R.
The match is local: to play with others, host a session or join one by address:port with the session commands in Sessions and hosting. The template ships no front-end menu; the Feature or Kit registers the menu, practice and find-match actions in the MiriGraphics action registry (Arena.Menu:<page>, Arena.Practice, Arena.EnterArena, Arena.BackToMenu, Arena.FindMatch, Arena.CancelMatch) for a screen of your own to fire. See Game screens.
Match rules
| Phase | What happens |
|---|---|
| Warmup | Weapons are off. The timer runs only while a human is in the match. |
| Live | A kill on the other team adds one to the killer's team. A friendly kill takes one point off. A killed player respawns after arena.RespawnTime at the team start farthest from the enemy. |
| Results | The winning team is shown for arena.ResultsTime, then a fresh warmup starts with scores cleared. |
The first team to arena.ScoreLimit, or the higher score at arena.TimeLimit, wins; equal scores are a draw. Humans take the seats of bots on their team (arena.TeamSize seats per team). The rules are console variables, so a dedicated server sets them in Config/DefaultGame.ini.
| Variable | Default | Meaning |
|---|---|---|
arena.ScoreLimit | 15 | Team kills that end the match |
arena.TimeLimit | 300 | Seconds a live match lasts |
arena.WarmupTime | 10 | Seconds of warmup |
arena.ResultsTime | 15 | Seconds of results |
arena.RespawnTime | 3 | Seconds dead |
arena.TeamSize | 3 | Seats per team, bots included |
arena.Bots | true | Fill empty seats with bots |
arena.Replay | true | Record live matches when the Replay Feature is loaded |
How it is built
- Authority. The host, a dedicated server or an offline game runs
FArenaMatchSystem, which owns the match. Clients never run the rules; they receive a snapshot event (phase, clock, team scores, every seat) twice a second and on every change, plus one event per kill for the kill feed. Both ride the session's gameplay event channel. - Teams. A joining human is put on the team with fewer humans and the choice is written to the replicated player record, so the scoreboard and team colours read it like any other player state. See Player state.
- Weapons.
BP_ArenaPlayerequips the Weapons pack'scarbine.weaponthrough the Combat weapon system. Clients fire locally and send the request to the server, which validates and applies damage. Weapons are disabled outside the live phase. - Kills. Damage goes through the engine's damage pipeline; the match system listens for deaths and credits the instigator.
- Bots. A bot is a pawn with a navigation agent. A pure decision function picks the nearest visible enemy, strafes inside engage range, fires when aimed and roams between the spawns otherwise; the system turns its decision into an agent destination, a facing and the trigger. Bots use the same weapon and damage code as players.
- HUD and scoreboard.
ArenaHUD.uiandArenaScoreboard.uibind to thearena.*sources (arena.timer,arena.score.team1,arena.row.N.name,arena.feed.N,arena.health) and to the Combatweapon.*sources. The scoreboard shows during warmup and results. - Remote players. On a client, other players and bots arrive as replicated ghosts; the system gives each a capsule coloured by team. The local pawn is first person and hidden from its own camera.
Optional hooks
ArenaKit works alone. When another Feature or Kit is present it uses it, and does nothing when it is not.
| Feature or Kit | What the variant does with it |
|---|---|
| Replay | Records each live match with replay.record and stops at the results. |
| Anti-cheat | Exposes "Anti-cheat: protected" as the arena.anticheat text source when a service is registered, for your HUD or menu to show. |
| Matchmaking | Arena.FindMatch and Arena.CancelMatch start and cancel the queue, and the status is a text source. Join the match it found with Direct Connect. |
Run a dedicated server
MowoServer --project <YourProject>.mproject --map Assets/ArenaShooter/Scenes/Arena.mmapClients join with address:port. See Dedicated server and Sessions and hosting.
Related
- Replication and RPCs and events for the transport this sits on.
- Templates for the project templates.
Engine sources
This page describes behavior implemented in these files of the engine repository, checked against commit 23111c146.
- Engine/Kits/ArenaKit/ArenaKit.mkit
- Engine/Kits/ArenaKit/Api/ArenaKit/ArenaMatch.h
- Engine/Kits/ArenaKit/Api/ArenaKit/ArenaMatchSystem.h
- Engine/Kits/ArenaKit/Api/ArenaKit/ArenaBotBrain.h
- Engine/Kits/ArenaKit/Api/ArenaKit/AArenaGameMode.h
- Engine/Kits/ArenaKit/Api/ArenaKit/AArenaCharacter.h
- Engine/Kits/ArenaKit/Api/ArenaKit/AArenaBot.h
- Engine/Kits/ArenaKit/Api/ArenaKit/ArenaServices.h
- Templates/TP_FirstPerson/Config/TemplateDefs.ini
- Templates/TP_FirstPerson/Config/DefaultGame.ini
- Templates/TP_FirstPerson/Assets/ArenaShooter/Scenes/Arena.mmap
- Templates/TP_FirstPerson/Assets/ArenaShooter/Blueprints/BP_ArenaGameMode.vscript
- Templates/TP_FirstPerson/Assets/ArenaShooter/UI/ArenaHUD.ui
- Templates/TP_FirstPerson/Assets/ArenaShooter/UI/ArenaScoreboard.ui