Experiment freely. A Game Mode Studio mode can't crash the server by spawning too much or flooding players with effects: the plugin it makes checks the game's real breaking points and skips what wouldn't fit. On top of that, a few comfort limits keep a mode smooth on a busy server. They're defaults, not walls, and hosts can change them.
Comfort limits
When you add a node that can pile up (markers, trails, projectiles, trigger volumes…), the Studio adds its limit to the mode as a setting in the Limits group. You set the start value in My mode › Variables; hosts change it in the mode's settings (the Play page, the server page, the in-game admin menu) without editing the mode.
| Setting | Default | Warns above | Most | Used by |
|---|---|---|---|---|
| Effect messages a frame | 48 | 56 | 64 | Effects, HUD and chat sent in one server frame: Effect Burst, Trail, Big HUD Text, Colored Chat, Kill Feed Line, Tracer, Dynamic Light, debug drawing and more |
| Loop steps a frame | 20000 | 200000 | 2000000 | Every loop in the event graphs (For Loop, While Loop, For Each, For Each Player…) |
| Loop steps in a Function | 1000000 | 2000000 | 10000000 | The same loops inside a Function |
| Visible things at once | 128 | 200 | 1000 | What the mode has out that players see: props, creatures, NPCs, interactables, weapons on the ground, projectiles, markers |
| On Tick runs a second at most | 100 | 100 | 1000 | On Tick with Interval 0 |
| Objective markers at once | 32 | 64 | 256 | Objective Marker |
| Trails at once | 32 | 64 | 256 | Trail |
| Loop sounds at once | 16 | 64 | 256 | Loop Sound |
| Projectiles at once | 64 | 128 | 512 | Spawn Projectile |
| Trigger volumes at once | 32 | 64 | 256 | Spawn Trigger Volume |
| Things in one trigger volume | 32 | 48 | 64 | Spawn Trigger Volume |
| Areas bots avoid at once | 16 | 24 | 32 | Bots Avoid Area |
| Attached things at once | 64 | 128 | 256 | Attach To |
| Looping animations at once | 64 | 128 | 256 | Play Animation |
| NPC moves at once | 32 | 48 | 64 | NPC Move To, NPC Follow Path |
| Map entity kinds heard | 96 | 160 | 256 | On Map Entity Fired |
| Entities one search keeps | 64 | 256 | 2048 | Entities In Radius |
| Tries finding a free spot | 64 | 256 | 1024 | Find Free Spot Near |
| Aim Point's longest trace | 8192 | 8192 | 32768 | Aim Point |
| Player Command uses a second | 5 | 20 | 1000 | Player Command |
| Top Players places | 10 | 50 | 100 | Top Players |
Each node's reference card lists its limits too.
The warnings
Raise a limit past its "warns above" value and the Problems tab says so, for example: "Projectiles at once is set to 300 (the default is 64): that may lag servers with many players." It's a warning, never an error: Compile still works. Above "Most", the value is held at the most the plugin can keep.
Other cost warnings in Problems:
- An On Tick faster than 0.05 s with a loop, a search or a line-of-sight check in it.
- A mode that loads many files of its own (see below).
- Log Line allowed many lines a second.
Node help also has a Cost note on nodes that are heavy when run often (Find Entities, For Each Entity, Player Hurt, Top Players).
The game's own breaking points
A few things crash a GoldSrc server or break players' games when they run out. The plugin guards each one, whatever the settings say:
| What runs out | What the game does | What the mode does |
|---|---|---|
| Entity slots (every prop, sprite, projectile, volume is one) | Crashes with "no free edicts" | Keeps 128 slots (or an eighth of them, if more) free for the game. A spawn that would eat into them is skipped, and a spawn node runs Failed (Out of entity slots). |
| Things in sight (older games take 256 entities a packet, players and the map included) | Players' games overflow and stutter | The mode keeps at most Visible things at once (128 to start) of its own out. Trigger volumes and loop sounds aren't sent, so they don't count. |
| Files loaded with the map (512 models and 512 sounds for the map, every plugin and the game together) | The map fails to load | A mode loads at most 160 files of its own. Problems warns past 64 models and sprites or 96 sounds, and shows an error past 160 in all; the plugin stops loading at 160 too. A file that isn't on the server is skipped, and what uses it does without. |
| Messages (effects, HUD text, chat) | The reliable channel overflows and players are kicked, or a datagram overflows and stutters | At most Effect messages a frame (never above 64), and effects only use a quarter of each player's rate. Past that, an effect is skipped. Lasting things (a score, a scoreboard tag, an icon, weather) are never dropped: they wait and go out over the next frames. |
| Time in one frame | A long loop freezes the server | A loop in an event graph that runs past Loop steps a frame stops where it is and goes on next frame from the same place; Completed still runs at the real end. A Function can't wait, so its loops stop at Loop steps in a Function and it returns what it has. |
While Loop also stops at its own Limit (1000 to start), and arrays hold at most 10000 items. A mode has up to 2000 nodes and 64 variables.
What's skipped, and where it's said
When a guard steps in, the one action is skipped and the rest of the mode carries on. Nothing crashes, and you can see what happened:
- The server log names the mode, the node and why: "Spawn Projectile skipped: the server is out of entity slots", "Spawn Prop skipped: the mode has 128 things players see out, as many as Visible things at once allows (Limits)", "missing sound/custom/boom.wav: what uses it does without". A repeat is counted, not logged again ("skipped 40 times in the last second"), and "long loops were spread over frames" says when loops waited.
- The debugger (Playtest) marks the node with the same reason.
- The node's outputs: a spawn node runs Failed with a Failure reason (Out of entity slots, Limit reached, Missing file…); see When the spot is taken.
Tuning a heavy mode
- Run a Test run: it measures the real build. The Playtest build records every node, so it's slower than what players get.
- Slow down fast timers: Repeat every 0.5 s and On Tick at 0.1 s are usually plenty.
- Find once, keep the list: put Find Entities in a variable at Round Started instead of searching every tick.
- Prefer events to checks: Begin Overlap instead of measuring distances, Player Landed instead of watching feet.
- Remove what you're done with: Remove Entity, Remove Projectile, Remove Trigger Volume, Remove Marker.
- Only then raise a comfort limit, and say so in the mode's description so hosts know.
See also
- On Tick and what it costs.
- Spawning and transforms: what happens when a spawn can't happen.
- Check a mode and Playtest and debug a mode in the docs.
- The map editor's Budget: the same engine limits, for maps.