Gameplay programming

How gameplay code is organized in Mowo, from actors and components down to the ECS, and a map of every gameplay system and plugin.

Last updated Oct 27, 2026Edit this pageVersion 1.0.0

Gameplay in Mowo is C++ written against an Unreal-style object layer: you subclass AActor, compose it from components, mark fields with reflection macros, and let a world tick it. Under that layer sits a flat entity-component system (ECS) that the renderer, physics and animation iterate for speed. Visual Scripting builds its node catalog from the same reflection data, so every system on these pages is usable from graphs too. Wolang scripting gives an actor its behaviour in a script, through bindings generated from the same reflection.

This section explains how the two layers fit together, then covers each gameplay system: physics, animation, audio, effects, AI, cameras, narrative, save games and the first-party gameplay plugins. The object model, reflection macros and modules are covered in depth in Programming.

Two layers, one scene

Every actor has a backing ECS entity. Gameplay code talks to the actor. Performance-critical systems read the entity. AActor

  1. Your AActor subclass
  2. Actor components (MActorComponent)
  3. Mirrored ECS components
  4. ECS systems (render, physics, animation)
Gameplay code writes to actors and actor components. Components publish their state onto the actor's backing entity, which the flat systems iterate.

The layers split the work like this:

LayerWhat it isYou use it for
MObjectThe garbage-collected base class with a reflected MClassAnything with identity and lifetime
AActor / MWorldPlaceable objects and the world that ticks themGameplay objects, lifecycle, spawning
MActorComponent / MSceneComponentObject-oriented behaviors attached to an actorMeshes, lights, cameras, your own logic
ECS World, components, SystemPlain-data components in archetype storage, processed by systemsHigh-volume data, engine subsystems

An actor component such as MStaticMeshComponent also writes a plain MeshRenderer component onto the actor's entity, so the renderer's flat iteration sees it while your code keeps using the object interface. MActorComponent

Engine note

AActor, MWorld and the scene live in the Game module. Below it sit SceneTypes (render components), AssetSystem, the ECS module and Components (the base TransformComponent and RelationshipComponent). Larger systems such as AI, narrative, sequencer and PCG are feature modules the engine loads by name. See Programming for the module layout.

Naming conventions

Mowo keeps Unreal's prefixes with one change: managed objects use M where Unreal uses U.

PrefixMeaningExamples
MGarbage-collected objectMObject, MWorld, MActorComponent
AActorAActor, APawn, AGameMode
FPlain struct or value typeFName, FTimerHandle
EEnumETickGroup, ECollisionChannel
TTemplateTObjectPtr, TWeakObjectPtr
IInterfaceIDamageable

ECS components are plain structs named with a Component suffix, for example TransformComponent and RigidBodyComponent.

Where your code lives

Your gameplay code lives in the project's game module, a shared library that depends on the engine and can be hot-reloaded while the editor runs; see Programming for game modules and plugins. MowoSandbox in the engine source is the reference template for a hot-reloadable module. The editor's class wizard, mbt newclass and the hot-reload loop are covered in Working with C++.

A typical game-module class looks like this, taken from the sandbox template:

  1. Derive from an engine class

    Pick AActor for a placeable object, MActorComponent or MSceneComponent for a reusable behavior, or APawn/ACharacter for something a player or AI drives.

  2. Annotate it for reflection

    Put MCLASS() before the class and MGENERATED_BODY() inside it. Mark fields with MPROPERTY() so they are saved with the scene and traced by the garbage collector.

  3. Build components in the constructor

    Create components with CreateDefaultSubobject<T>() and pick a root with SetRootComponent().

  4. Override the lifecycle

    Override BeginPlay, Tick and EndPlay, and call the base implementation so components keep receiving their callbacks.

Note

Every MFUNCTION you declare shows up in Visual Scripting automatically, because the node catalog is built by walking the class registry. You never register nodes by hand.

What happens each frame

When the game is playing, the scene runs actor ticks in groups around the ECS update, and the physics step happens inside the ECS update. AActor

  1. PrePhysics actors
  2. DuringPhysics actors
  3. ECS systems (physics step, transforms)
  4. PostPhysics actors
  5. PostUpdateWork actors
Actor tick groups run around the ECS system update. Put logic that must see settled physics poses in PostPhysics or later.

With p.OverlapDuringPhysics on (the default), the physics steps run on a worker while the DuringPhysics group ticks. ECS systems have their own phase order (PrePhysics, Physics, PostPhysics, PostUpdate) inside that update. System

Pages in this section

Foundations

Physics and animation

Presentation

AI and game systems

Worlds

Gameplay plugins

The engine ships 7 plugins. These four add gameplay; each is off until a project enables it in the Plugins window.

Networking and replication are covered in Multiplayer, and game UI in UI.

API reference

Engine sources

This page describes behavior implemented in these files of the engine repository, checked against commit 5922e6e5e.

  • Engine/Source/Runtime/Game/Public/Game/AActor.h
  • Engine/Source/Runtime/Game/Public/Game/MWorld.h
  • Engine/Source/Runtime/Game/Public/Game/MActorComponent.h
  • Engine/Source/Runtime/ECS/Public/ECS/System.h
  • Engine/Source/Runtime/Core/Public/Core/MObject.h
  • Engine/Source/Runtime/Reflection/Public/Reflection/Reflect.h
  • Engine/Plugins/Combat/Combat.mplugin

Page feedback

Was this page helpful?