Loner-StrikeReference

Reference

Limits

The comfort limits on effects and searches, and when the game itself runs out.

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.

SettingDefaultWarns aboveMostUsed by
Effect messages a frame485664Effects, 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 frame200002000002000000Every loop in the event graphs (For Loop, While Loop, For Each, For Each Player…)
Loop steps in a Function1000000200000010000000The same loops inside a Function
Visible things at once1282001000What the mode has out that players see: props, creatures, NPCs, interactables, weapons on the ground, projectiles, markers
On Tick runs a second at most1001001000On Tick with Interval 0
Objective markers at once3264256Objective Marker
Trails at once3264256Trail
Loop sounds at once1664256Loop Sound
Projectiles at once64128512Spawn Projectile
Trigger volumes at once3264256Spawn Trigger Volume
Things in one trigger volume324864Spawn Trigger Volume
Areas bots avoid at once162432Bots Avoid Area
Attached things at once64128256Attach To
Looping animations at once64128256Play Animation
NPC moves at once324864NPC Move To, NPC Follow Path
Map entity kinds heard96160256On Map Entity Fired
Entities one search keeps642562048Entities In Radius
Tries finding a free spot642561024Find Free Spot Near
Aim Point's longest trace8192819232768Aim Point
Player Command uses a second5201000Player Command
Top Players places1050100Top 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 outWhat the game doesWhat 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 stutterThe 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 loadA 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 stuttersAt 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 frameA long loop freezes the serverA 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

  1. Run a Test run: it measures the real build. The Playtest build records every node, so it's slower than what players get.
  2. Slow down fast timers: Repeat every 0.5 s and On Tick at 0.1 s are usually plenty.
  3. Find once, keep the list: put Find Entities in a variable at Round Started instead of searching every tick.
  4. Prefer events to checks: Begin Overlap instead of measuring distances, Player Landed instead of watching feet.
  5. Remove what you're done with: Remove Entity, Remove Projectile, Remove Trigger Volume, Remove Marker.
  6. Only then raise a comfort limit, and say so in the mode's description so hosts know.

See also

A hand-written guide. Every node it names links to the node reference, which is made from the app's own catalog.