Skip to content

Match Flow

A match is one deterministic game from tick zero to its end. Every machine builds the same match from the same settings and then runs the same simulation, so the settings, who sits where and which rules apply are decided before the first tick and never change during it.

This page follows a match in order: how it is set up, who is on which side, how it ends, and which Unreal class owns which job.

A match has a list of slots, one per seat. Each slot has:

Field Meaning
Slot Index 1 to Max Players (Project Settings > Plugins > SeinARTS, Match category; up to 16)
State Open, Human, AI or Closed
Faction ID The faction the player plays. 0 means none.
Team ID 0 is a team of one. Players on the same other number are allies.
AI Profile An optional tag naming an AI personality

Only Human and AI slots produce a player. Open and Closed slots produce nothing, and units placed in the level for an empty slot are switched off.

The level places each player’s seat with a Sein Player Start:

Setting Meaning
Player Slot Which slot this start belongs to. 0 leaves it unassigned.
Faction ID, Team ID Defaults for a game started straight from the level
Slot State Human or AI, for a game started straight from the level
Spawn Entity The Blueprint spawned for this player when the match is built, such as a headquarters

Each Human or AI slot needs exactly one start with its Player Slot. The match refuses to build if a slot has none or two.

There are two ways to start, and they supply the slot list differently.

  • From the level. Press Play on the gameplay map. The slots come from the level’s Sein Player Starts, one Human or AI slot per start with a Player Slot. The match builds at BeginPlay while the map’s World Settings have Auto-Start Simulation on, which is the default. (The setting appears when the project’s World Settings Class is Sein World Settings, as Create the Demo Project sets it. Other World Settings classes always auto-start.) A map with no Sein Player Start that names a slot builds no match. Turn the setting off on a menu or lobby map that has such a start, or it runs a match nobody sees. A map that delays tick zero, such as an intro cinematic, turns it off and calls Start Standalone Simulation when ready.
  • From the lobby. Players take slots and pick factions and teams, and the host starts the match. The lobby’s slots replace the starts’ defaults. The map’s starts still supply the positions, so the lobby needs a matching map: set Available Maps, Default Gameplay Map and Main Menu Map in Project Settings under Network > Lobby. Create the Main Menu and Lobby builds one.

Both paths build one set of match settings: the slots, and a list of rule structs. The set is fixed when the match is built. Read it with Get Match Settings.

Add the rules a match uses in Project Settings, under Network > Lobby, in Default Match Extensions. A new match copies them in. Two rule structs ship:

Struct Fields
Sein Basic Match Settings End When One Team Remains (on), Destroy Entities On Defeat (on), Friendly Fire, Resource Sharing, Time Limit (minutes)
Sein Match Bootstrap Rules Starting Resources: a resource tag and an amount, overriding every player’s start

The framework reads only the first two Basic fields. Friendly Fire, Resource Sharing and Time Limit are values for your own abilities to read, for example a damage ability that skips allies when Friendly Fire is off. Your own rule structs go in the same list; each must be simulation data. A match with no Basic Match Settings follows both framework rules.

A match moves through these states, readable with Get Match State:

State Meaning
Lobby Players joining; settings still open
Starting Tick zero is built. The first tick moves on.
Playing Normal play
Paused The simulation runs no ticks. Commands keep arriving.
Ended The tick that ended the match finished. The world runs no more.

There is no countdown. A game that wants one holds tick zero.

Request Pause and Request Resume are commands, and they pause every player. Set Simulation Paused pauses from a scenario or ability.

A faction is a data asset of class Sein Faction. Its useful fields are:

Field Meaning
Faction Name For UI
Faction ID A unique number above 0 that slots refer to
Resource Kit Resources whose starting value or cap this faction changes. A row has Override Starting Value and Override Cap toggles with their values.

Available Unit Classes and Starting Entity Classes exist on the asset but nothing reads them. Give a faction its starting building with Spawn Entity on the Sein Player Start.

Add every faction a match can use to Registered Factions in Project Settings > Plugins > SeinARTS, in the Match category. The list is hand-authored on purpose, so every machine registers the same factions in the same order. A faction missing from it is never registered, so its players start with the catalog defaults instead of the faction’s Resource Kit.

Factions are optional. A slot with Faction ID 0 plays with every catalog resource at its default. The faction’s job is to differ in starts, and in any rule your abilities write against the player’s Faction ID. The lobby offers factions through a faction service, which by default scans for Sein Faction assets.

Teams decide who is an ally and when the match ends. Two players on the same nonzero Team ID are allies. A player on Team 0 is alone.

Teams are seeded as diplomacy. A diplomacy grant is a one-way gift from one player to another, tagged by kind:

Grant tag Effect
SeinARTS.Diplomacy.Grant.PresentAsFriendly The receiver sees the giver’s units as friendly. It changes colors and relations, not gameplay.
SeinARTS.Diplomacy.Grant.ShareVision The receiver sees what the giver sees.

At the start, teammates grant each other Present As Friendly. Vision is not shared by default. Add it with Grant Diplomacy, giving a source kind tag under SeinARTS.Diplomacy.Source and a positive source ID. Revoke Diplomacy removes one reference. Has Diplomacy reads a grant, and Should Present Player As Friendly asks the display question.

A grant holds while any source for it remains, so two systems can grant the same thing and neither’s revoke breaks the other. Because it is one-way, you can share vision from A to B and not back.

Team and diplomacy do not decide who can hurt whom. The default target scorer skips only the shooter’s own units. An alliance-aware game gives its Target Scorer a rule using Should Present Player As Friendly, and the same check belongs in any click context. See Gameplay Tags.

A player’s result is one of None (still playing), Victory, Defeat or Draw. Once decided, it stays.

Three nodes decide results from a graph:

Node Does
Defeat Player Defeats one player, with a Reason tag of your own
End Match Ends the match. The listed Winners win, every other player still playing is defeated, and with no winners everyone still playing draws.
Concede Match The local player defeats themselves, from the pause menu

The framework adds one end rule: End When One Team Remains. At the end of a tick that defeated someone, if every player still playing shares one nonzero team, or only one player is left, they win and the match ends. Players on Team 0 are each a team, so three free-for-all players need two defeats before it ends.

A defeated player:

  • Has SeinARTS.Player.Defeated on their entity.
  • Loses every entity they own, unless Destroy Entities On Defeat is off. Then the entities stay but the player can no longer order them.
  • Can give no orders. They watch: the view follows a teammate still playing, or the whole map when none is left.
  • Leaves every open vote.

When the match ends, every machine stops on the same tick, and each presentation layer hears about it.

Where Event Use it for
Player Controller On Defeated (Reason) A defeat screen, while the match goes on
Player Controller On Match Ended (Result, Reason) The result screen
Game Mode On Match Ended (Winners, Reason) What happens next. By default it waits Post Match Seconds (10), then calls Return To Lobby.
Game Mode On Match Result Verified Submitting an online result once every machine’s final state matches
Game Mode On Match Aborted A match that stopped with no result, such as after a desync

Abort Match is the host’s request to end with no results.

A vote lets players decide something together. Start Vote takes a Vote Type tag of your own, a Resolution, a Required Threshold and Expires In Ticks (300 by default, ten seconds at 30 ticks a second; 0 never expires). Cast Vote sends 1 for yes or 0 for no. Get Active Votes and Check Vote Status read open votes. The For Player versions let an AI or a scenario act for a player.

Resolution Passes when
Majority More than half the eligible players vote yes
Unanimous Every eligible player votes yes
Plurality Yes votes outnumber no votes once everyone has voted. A tie fails.
Threshold Required Threshold players vote yes. It fails as soon as that can no longer happen.
Host Decides The host’s vote, whatever the others say. A match with no host cannot start it.

Eligible players are the ones whose result is not yet decided. A vote that expires without passing fails. A resolved vote disappears from the open list, and Check Vote Status reads Not Started again. Presentation learns the outcome from a visual event: get the Sein Actor Bridge Subsystem and bind its On Visual Event Dispatched. In Break Sein Visual Event, Type is Vote Resolved, Tag is the Vote Type and Value is 1 if the vote passed or 0 if it failed.

The framework acts on no vote. A vote is a shared question, and your game decides what a passed vote does. Pausing is not a vote: Request Pause takes effect directly.

Class Runs on Role
Sein Game Mode The server Seats each controller in a Human slot, spawns the AI Controller Class for AI slots, admits connections, decides what happens to a dropped player’s seat, and owns the end-of-match flow. It never writes simulation state.
Sein Game State Everywhere Its Sein components define the match entity: match-wide data and the passive abilities that run match rules. Get Match Winners and Get Match End Reason read the result.
Sein Player State Everywhere Its Sein components define each player entity: tech, per-player data and the passives that run player rules such as income and elimination. The match supplies the identity, starting resources and effect storage itself. Get Player Entity and Get Match Result read it.
Player Controller The owner’s machine Input and commands, plus the match events above
AI Controller The host A computer player’s brain; see Computer Opponents

Create a Blueprint of Sein Game State and Sein Player State, add Sein components to them in the Components panel, and select them as the Game Mode’s Game State Class and Player State Class.

A rule that belongs to a player goes on the Player State. A rule about the match as a whole goes on the Game State. Each is a passive ability, which starts when the match builds and ticks every simulation tick. Victory Rules writes two.

Two teams of two. Slot 1, the human, and slot 2 are on Team 1. Slots 3 and 4 are on Team 2.

  1. Place four Sein Player Starts. Set Player Slot 1 to 4, Team ID 1, 1, 2, 2, and Slot State Human, AI, AI, AI. Set Spawn Entity on each to the headquarters.
  2. In the Game Mode, set the AI Controller Class. Put SA_Elimination, from Add Victory, Defeat and an AI, on the Player State.
  3. Leave Default Match Extensions empty. The match follows End When One Team Remains.

Play and destroy every unit slot 3 owns. Slot 3 is defeated. Its units are destroyed and the match goes on, because slot 4 is still playing and Team 2 is not gone. Destroy slot 4’s units. Now only Team 1 remains: slots 1 and 2 win, the match ends with the reason SeinARTS.Match.End.OneTeamRemains, and after ten seconds the game returns to the lobby or the Main Menu Map.

Switch End When One Team Remains off with a Sein Basic Match Settings entry, and the same play ends nothing on its own. Your own rule must call End Match.

  • Two starts for one slot, or none. The match will not build. A slot needs exactly one.
  • A start that was not saved with the level. The match reports no usable baked transform. Open the level and save it.
  • Putting rules on the Game Mode. It never writes simulation state. Put rules on the Player State or Game State as passives.
  • Allies with Team ID 0. Each is a team of one. Give allies the same nonzero number.
  • Expecting teammates to share vision. Grant it with Grant Diplomacy.
  • A faction missing from Registered Factions. Its Resource Kit never applies.
  • A menu map that runs a match. It has a Sein Player Start with a Player Slot. Remove the start, or turn off Auto-Start Simulation on the map.
  • Treating a vote as a decision. The framework only counts it.
  • More slots than Max Players. The match fails to validate.