Multiplayer

AI thinks on the authority only: perception, awareness, the StateTree and the subsystem run on the server (or the listen host). Clients see the pawn move through normal character replication.

UPulseAIAgentComponent replicates (push model) what UI and effects need: the profile, and one net state FPulseAIAgentNetState (GetNetState()) with these fields:

Field Use
Awareness, AwarenessValue (0..255) ”?” / “!” markers, body colors, music
Target Who the agent is after
LOD Lower effects far away
GroupRole Icons

The team comes from the Pulse Team component (replicated by Pulse Foundation): names, colors, client-side attitude.

The net state is one property, so a change of several fields arrives together and its events fire in one fixed order on server and clients: OnAwarenessChanged, then OnTargetChanged, then OnLODChanged (a change of the value or the role alone fires none). On the server the agent announces its changes in the order they were written, also when a listener changes the agent again while the events of an earlier change are still being sent.

Target is an actor reference on purpose: the replicated reference is the network identity of the target. Everywhere else the AI names targets by id with the actor as a cache (see Awareness); when targets become entities, the net state gets their net id.

Bandwidth: classic replication sends only the changed members of the struct. Iris gives a struct property one change bit and sends the whole struct (about 6-8 bytes) when anything in it changed, so every change of the quantized awareness value costs that instead of 1 byte, at most once per awareness update and only while the value moves.

Telegraphs (Telegraph) and montages (PlayMontage, task Play Montage (Pulse)) are unreliable multicasts, so every machine plays the announcement and the animation. OnAwarenessChanged, OnTargetChanged, OnLODChanged and OnTelegraph fire on server and clients.

UPulseAIAgentComponent::OnAgentAdded / OnAgentRemoved (native, static) fire on every machine when an agent begins or ends play; UI uses them to find agents on clients.

Bosses (PulseAICombatBridge)

UPulseAICombatAgentComponent replicates the boss as one push-model property, FPulseAIBossState (boss data, phase, enraged, fighting; the fight start time stays on the server). Events fire in the order fighting (boss bar), phase, enraged on the server and on clients. Under Iris the boss name goes along with each phase, enrage and fight change (a few changes per fight). Encounters do not replicate (server only); their agents replicate as usual.


This site uses Just the Docs, a documentation theme for Jekyll.