Performance report¶
GASPALS 1.2 includes an optimization pass on CPU, memory and network cost, driven by reports of slow frame rates and jittery multiplayer. This page lists what changed, how much each change saves, the settings that control it, and how the numbers were measured. The release notes summarize it under Performance and networking.
Numbers are from one machine
All measurements come from the same laptop (see How it was measured). Your numbers will differ. The before / after ratios are what to look at.
Summary¶
| Area | Before | After |
|---|---|---|
| Frame time, Mover player, default level (8 characters) | 17.7 ms (56 fps) | 11.6 ms (86 fps) |
| Frame time, CMC player, default level | 17.0 ms (59 fps) | 11.3 ms (88 fps) |
| Animation CPU, default level | 31.5 ms | 16.1 ms |
| Server → client bandwidth, Mover players (9 characters, 1 client, 30 fps) | 54.0 KB/s | 25.3 KB/s |
| Client upload, Mover player (30 fps) | 16.7 KB/s | 4.0 KB/s |
| Assets loaded by one pawn (editor sizes) | 2.13 GB | 1.63 GB (Mover) / 1.70 GB (CMC) |
CPU¶
Results¶
One game process, default level unless noted. Animation CPU is the total time animation evaluation takes on all worker threads per frame.
| Scenario | Frame time before | Frame time after | Animation CPU before → after |
|---|---|---|---|
| Mover player, default level | 17.7 ms (56 fps) | 11.6 ms (86 fps), −34% | 31.5 → 16.1 ms, −49% |
| CMC player, default level | 17.0 ms (59 fps) | 11.3 ms (88 fps), −33% | 24.2 → 14.3 ms, −41% |
| Mover player, NPC level (characters walking to benches) | 12.5 ms (80 fps) | 8.7 ms (115 fps), −31% | 15.4 → 9.5 ms, −39% |
| Kellan (MetaHuman) on every character | 22.0 ms (45 fps) | 14.8 ms (67 fps), −33% | 36.3 → 20.3 ms, −44% |
GPU time is unchanged: none of these changes touch rendering.
What changed¶
Mover trajectory prediction. - What it did: motion matching needs the character's predicted path for the next 1.5 s. For a Mover character, the predictor runs the current movement mode again for every step of that prediction. At 60 steps a second that was about 90 runs of the Blueprint walking mode per character, every frame: the largest CPU cost in the project. - New setting: Trajectory Sampling Rate on SandboxCharacter_Mover_ABP (GASPALS > Animation > Trajectory), 20 by default (was 60), never below 10. - Measured: prediction cost 19.5 → 6.7 ms of worker time per frame for the default level. The predicted position barely changes: average error half a second ahead 41 → 44 cm, one second ahead 154 → 157 cm, dominated by input the prediction can't know about.
AI characters skip player-only work. - Cover detection: wall traces, soft cover, corner turns, aiming from cover. - Before, it ran every frame for every character, AI included. - New setting: Evaluate Cover for AI on the cover component (Cover > General), off by default. - Measured: 1.4 ms of game thread per frame saved with the 7 AI characters of the default level. - Takedown and shove candidate search: an overlap and clear-path sweeps every frame. - New setting: Search Interactions for AI on the interaction component (Interaction > Search), off by default. - AI characters can still be the target of a takedown or shove.
- Cover input remapping (cover runs, wall following, aiming from cover) is skipped for AI with the same setting: 0.21 → 0.06 ms per frame.
Turn either setting on if your AI drives cover or interactions through the same inputs as a player.
Physics Control between ragdolls. - In the default Kinematic physics profile the Physics Control component has no active controls; it only keeps the limb bodies on the animation, which the skeletal mesh already does. - New setting: Physics Control Kinematic Tick Interval on the ragdoll component (Ragdoll > Physics), 0.25 s by default. The component ticks every frame in the other profiles (ragdoll, physical animation). - Measured: 0.67 → 0.06 ms of game thread per frame for 8 characters. Ragdoll entry, hit detection on limbs and takedowns behave as before.
First-person meshes only for the local player. - Before: every character built its first-person meshes when it spawned, AI and other players included, although only the character's owner can see them. With a retargeted character such as Kellan, each character also kept its hidden first-person source mesh animating every frame. - Now the first-person component builds them only on the character of a player on this machine, when that player takes control of it. - New setting: Build First Person for Non Local Pawns on the first-person component (FirstPerson > General), off by default. - Measured: - Kellan on every character: 18.0 → 16.1 ms per frame (−11%), animation CPU 24.1 → 22.5 ms; - default characters: no change per frame, about 8 ms less work for each character that spawns.
Tried and removed: returning a per-frame copy of the character's animation properties to the five or so callers per character (0.4 ms of game thread for 8 characters). Callers that run before the movement update froze stale values for the frame, which showed as a wrong pose for a moment after switching characters.
Tried, no gain in the sample levels: - Ticking animation only for montages when a character isn't on screen. Shadows count as rendered, so every character in view of the light still evaluates. - Update Rate Optimizations (the mesh's Enable Update Rate Optimizations): the engine lowers the animation rate of characters that are small on screen. The sample characters are close, so it changed nothing measurable. - Loading the other sample character in advance to remove the short pause on the first character switch (N). It would keep both characters' assets in memory for the whole session, so it isn't done: the switch already loads in the background, and the remaining pause is the cost of spawning a character.
Many characters at a distance
For crowds, tick Enable Update Rate Optimizations on the pawn's mesh (SkeletalMesh on the Mover pawn, CharacterMesh0 on the CMC pawn). Don't use it on characters with a visual override: the pawn's own mesh is hidden and drives the override, and the engine updates hidden meshes of AI characters only every fourth frame, so the override would animate at a quarter rate.
Memory and loading¶
| Pawn | Assets it loads before | after |
|---|---|---|
SandboxCharacter_Mover | 2,394 assets, 2.13 GB | 1,956 assets, 1.63 GB (−23%) |
SandboxCharacter_CMC | 2,412 assets, 2.13 GB | 2,104 assets, 1.70 GB (−20%) |
Each pawn used to load the other pawn and its animation Blueprint: - The visual override manager read the override list by casting to GM_Sandbox, whose default pawn class is the Mover pawn. It now asks the game mode through the new interface BPI_VisualOverrideProvider, which GM_Sandbox implements. Your own game mode can implement it with its own list (Characters and visual overrides). - An animation notify state (BP_NotifyState_EarlyTransition) had an unused local variable typed to the CMC animation Blueprint.
Sizes are editor asset sizes (they include raw animation data); a cooked build is smaller.
Both locomotion setups stay loaded. Each sample character can switch between its locomotion setups at runtime (DDCvar.LocomotionSetupMover, DDCvar.LocomotionSetupCMC), so both are loaded even when one is unused: - Mover character (hybrid by default): the full motion matching setup adds 228 MB. - CMC character (motion matching by default): the state machine setup adds 20 MB, since it reuses the motion matching animations.
The unused setup costs no CPU, only memory and loading time. If your project uses a single setup, remove the other branch from the character's animation Blueprint to drop its assets.
Network¶
Bandwidth¶
Listen server and one client as separate game processes, default level (9 characters), players idle. Both versions are held at 30 fps, so they replicate under the same conditions.
| Players | Server → client before | after | Client upload before | after |
|---|---|---|---|---|
| Mover | 54.0 KB/s | 25.3 KB/s (−53%) | 16.7 KB/s | 4.0 KB/s (−76%) |
| CMC | 38.2 KB/s | 18.3 KB/s (−52%) | 3.1 KB/s | 2.0 KB/s (−37%) |
- The CMC row includes the default level's four Mover NPCs.
- At higher frame rates the gap grows. Before, characters replicated up to 100 times a second, so the server's output grew with its frame rate. Now they stop at 30. In an earlier run with both servers at about 33 fps, the Mover row was 75.4 → 28.6 KB/s.
- Client upload grows with the client's frame rate: Mover clients send one input message per frame.
- The engine's default per-client limit is 100 KB/s. Before, a handful of Mover characters filled it, which is what made remote characters move in steps.
What changed¶
Update rate: both pawns replicate at most 30 times a second (Net Update Frequency, was the engine default 100). Mover's prediction data follows the actor's rate. Remote characters are interpolated over 100 ms, about three updates, so movement stays smooth.
Mover cover input only in cover: - Before: the cover state (wall point and normal, flags) was added to every Mover input, every frame, in cover or not. Blueprint structs travel at full precision, and remote copies receive the inputs twice (in the input and in the synchronized state). - Now it's added only while entering cover or in the cover movement mode. - Measured on its own (with the input change below): server → client 37.8 → 28.5 KB/s at a 20 fps cap.
Mover custom inputs at lower precision: - S_MoverCustomInputs carries the gait, rotation mode and two angles, RotationOffset and ControlRotationRate. - The two angles were 8-byte floats, sent at full precision in every input and again in the remote copies' synchronized state. - They are now integers in hundredths of a degree (and of a degree per second): the movement modes read them back as value × 0.01. - Measured at a 20 fps cap with the client moving: server → client 21.3 → 16.5 KB/s (−23%), client upload 3.2 → 2.7 KB/s. - If you add fields to this struct, prefer bytes and integers to floats: a Blueprint struct in the Mover input is sent field by field with no compression.
Mover input redundancy: - Each client message carries the last 3 inputs (was 6), so a lost packet is covered by the next ones. - Client upload drops by about 40%. - Measured under emulated packet loss (about 140 ms ping, character moving):
| Inputs per message | Client upload | Corrections at 5% loss | at 20% loss |
|---|---|---|---|
| 6 (before) | 5.1 KB/s | 0 | 0 |
| 3 (now) | 3.2 KB/s | 0 | 4 |
| 2 | 2.5 KB/s | 1 | 12 |
For very lossy connections, raise IndependentTickInputSendCount back to 6 in DefaultNetworkPrediction.ini (Project settings).
CMC cover state: - Before: the owner sent its cover state to the server 20 times a second, in cover or not. - Now it sends 20 times a second in cover or during a cover run, and once a second otherwise. - Entering or leaving cover is sent at once through a reliable call (ServerUpdateCoverReliable), so a lost packet can't leave the server thinking the character is still in cover. - Measured: - client upload 2.8 → 1.3 KB/s; - with 50% packet loss on the client's upload, the server sees the character leave cover within 0.2-0.8 s.
Ticking policy: fixed ticking (30 or 60 Hz) and independent ticking were compared at about 60 fps: same bandwidth, no corrections either way. GASPALS keeps independent ticking.
Settings added¶
| Setting | Where | Default | Effect |
|---|---|---|---|
| Trajectory Sampling Rate | SandboxCharacter_Mover_ABP, GASPALS > Animation > Trajectory | 20 | Mover trajectory prediction steps per second (cost per Mover character). |
| Evaluate Cover for AI | cover component, Cover > General | off | Run cover detection for AI-controlled characters. |
| Search Interactions for AI | interaction component, Interaction > Search | off | AI-controlled characters search for takedown / shove targets. |
| Physics Control Kinematic Tick Interval | ragdoll component, Ragdoll > Physics | 0.25 | Physics Control tick interval in the Kinematic profile (0 = every frame). |
| Build First Person for Non Local Pawns | first-person component, FirstPerson > General | off | Build first-person meshes on AI and other players' characters too. |
| Net Update Frequency | both pawns, Class Defaults > Replication | 30 | Maximum replication rate per character. |
IndependentTickInputSendCount | DefaultNetworkPrediction.ini | 3 | Inputs per client message (loss tolerance against upload). |
How it was measured¶
- Machine: Intel Core i7-9750H laptop (6 cores), NVIDIA GeForce RTX 2080 Max-Q, 32 GB RAM, Windows 11, DirectX 12. Unreal Engine 5.8.3, Development configuration, uncooked content.
- Versions: before = the previous GASPALS 1.2 development state; after = this release, run in turn on the same machine.
- CPU:
- one game process, 1280x720, default scalability;
- Unreal's CSV profiler averaged over 900 frames, after 900 frames of loading;
- per-function costs from Unreal Insights traces.
- Network:
- listen server and client as separate game processes, both versions held at 30 fps, 20 s windows;
- bytes per second from the engine's network metrics;
- packet loss and latency from Unreal's network emulation.
- Memory: the assets each pawn loads, from the package dependency tables.