class

FLevelSpawner

Turns a layout into prefab placements and instantiates them. Grid +X is world +X, grid +Y is world -Z (the engine's forward); a module prefab is authored with its origin at the centre of its unrotated footprint and its doorways on the edges the grammar lists.

Module
LevelGen
Header
#include "LevelGen/LevelSpawner.h"
Namespace
Mowo

Public functions

ReturnsNameDescription
std::vector<FLevelSpawnItem>Plan
int32_tSpawnInstantiates every planned prefab and places every level module; returns how many landed.
int32_tDespawnTakes the level modules of a layout back out (a regenerate, or a new seed from the host).
FLevelInstanceDescInstanceForThe Level Instance a module room becomes.

Function details

Plan

C++
static std::vector<FLevelSpawnItem> Plan(const FLevelGrammar& grammar, const FLevelLayout& layout, const Vec3& origin)

Spawn

C++
static int32_t Spawn(Scene& scene, const FLevelGrammar& grammar, const FLevelLayout& layout, const Vec3& origin)

Instantiates every planned prefab and places every level module; returns how many landed.

Despawn

C++
static int32_t Despawn(Scene& scene, const FLevelGrammar& grammar, const FLevelLayout& layout, const Vec3& origin)

Takes the level modules of a layout back out (a regenerate, or a new seed from the host). Returns how many actors left.

InstanceFor

C++
static FLevelInstanceDesc InstanceFor(const FLevelLayout& layout, const FLevelSpawnItem& item)

The Level Instance a module room becomes. Named from the seed and the room index only, so its actors get the same ids on every machine that generates the same seed — what lets the network address them.

Generated from LevelGen/LevelSpawner.h via levelgen.json · Oct 26, 2026Version 1.0.0