Skip to content

Sein Game Mode

Class · ASeinGameMode : AGameModeBase

#include "GameMode/SeinGameMode.h"

can be subclassed in Blueprint

The default RTS Game Mode, on the server. It seats each player controller in a Human slot of the match roster (the lobby’s, or one made from the level’s Sein Player Starts), gives it a relay, admits connections through an optional admission authority, decides dropped players’ seats (Get Vacant Seat Policy), and spawns the AI Controller Class for AI slots and for seats handed to AI. It never writes simulation state: USeinMatchStartupSubsystem builds the match on every process.

GameMode

The slot count of this world’s match settings, or the project maximum when it has none.

int32 GetEffectiveMaxPlayers() const;

Spawn the AI Controller Class to play a slot (server only). Null without an AI Controller Class.

ASeinAIController* SpawnAIControllerForSlot(FSeinPlayerID Slot);

Find the one Sein Player Start authored for a slot (1 or higher).

ASeinPlayerStart* FindPlayerStartForSlot(int32 SlotIndex) const;

Match

Send everyone back to the lobby map the match started from. A standalone game without one opens the Main Menu Map. False when there is nowhere to return to.

bool ReturnToLobby();

GameMode

Overridable in Blueprint, with a native default

Runs on the host when a player drops mid-match: return what happens to their seat (AI takeover, opening it to new players, whether they may come back, and the delays). Override it to decide per match, per mode or per seat, for example from a lobby option. By default it returns the project’s Vacant Seat Policy (Project Settings > SeinARTS > Network).

FSeinVacantSeatPolicy GetVacantSeatPolicy(FSeinPlayerID Slot) const;

Match

Overridable in Blueprint, with a native default

The match ended and every machine’s world stopped at the same tick. Winners and Reason are the Game State’s. By default this waits Post Match Seconds, then calls Return To Lobby; override it for a score screen or a different flow.

void OnMatchEnded(const TArray<FSeinPlayerID>& Winners, FGameplayTag Reason);

Overridable in Blueprint, with a native default

After On Match Ended: whether every player’s final state matched the host’s. A network match reports once each player has; a standalone match reports Verified at once. Submit an online match result here.

void OnMatchResultVerified(bool bVerified);

Overridable in Blueprint, with a native default

The match stopped without a result: a desync under the Abort Match policy, a network match that could not start, or a simulation that fail-stopped. By default this waits Post Match Seconds, then calls Return To Lobby.

void OnMatchAborted(const FString& Reason);

TSubclassOf<ASeinAIController> AIControllerClass · default ASeinAIController::StaticClass()

Editable in defaults and on instances · Blueprint read-only

The AI controller the Game Mode spawns for each AI slot and for a dropped player’s seat its vacant seat policy hands to AI. None leaves those slots idle.

float PostMatchSeconds · default 10.0f · min 0

Editable in defaults and on instances · Blueprint read and write

Seconds the default On Match Ended and On Match Aborted wait before Return To Lobby. The host waits up to five seconds for every player’s final checksum, so a shorter wait can leave before On Match Result Verified.

FSeinMatchSettings ResolvedMatchSettings

Blueprint read-only

The match settings that route controllers to slots. A match started without a lobby replaces the authored defaults with its final roster before launch.

bool bMatchSettingsResolved · default false

Blueprint read-only

True once the Game Mode has settled the match roster it routes controllers by (Resolved Match Settings). False if no roster exists yet, for example on a map with no Sein Player Starts and no lobby.