Fix: 'PF_precache_model: Model overflow'

September 24, 2025 Daemon666 8 min read 12 преглеждания

PF_precache_model: Model overflow is the engine telling you it ran out of model precache slots. The Half-Life engine reserves a fixed-size table for models that must be registered before the map starts sending entities; when the number of distinct models a map plus its plugins try to precache exceeds that table, the server aborts at map load. It is a hard ceiling, not a leak, so the fix is always "precache fewer models" — the skill is finding which plugin is greedy.

1. Understand the limit you hit

The engine's model precache table holds a fixed number of entries (the classic limit is 512, and the sound table has its own separate limit that throws PF_precache_sound: Sound overflow). Every player model, weapon model, sprite used as a model, and every custom model a plugin registers with precache_model consumes one slot. When the total crosses the ceiling the engine cannot continue and prints the overflow before dropping the map.

2. Read where it crashed

The line right before the overflow in the console or addons/amxmodx/logs/ usually names the model being precached when the table filled. That is not always the culprit — it is just the straw — but it tells you which subsystem was precaching at the time (a skins plugin, a bots pack, a shop with dozens of model rewards, a zombie mod with many class models).

3. Blame the map or the plugins, and split them

Load the same map with plugins disabled to see whether the map alone is over budget:

amxx pause GamePlugins
changelevel de_dust2

If a bare map loads and only overflows once plugins are active, it is a plugin. If a specific custom map overflows even with plugins off, that map ships too many models and no amount of plugin trimming will save it on that map. Use the plugin-isolation method to bisect which plugin pushes it over.

4. The usual heavy precachers

  • Player-model / skins plugins that precache a model per team per class — dozens of slots.
  • Zombie/biohazard modes with many zombie and human class models plus knife/claw models.
  • Shops and VIP systems that precache every possible reward model at map start instead of on demand.
  • Bot packs (podbot/ZBot custom models) that add their own model set.

The cheapest win is trimming a model list you control: fewer skins, fewer shop models, or making a plugin precache only the models actually enabled by its cvars.

5. Cut the count

Once you know the plugin, reduce what it registers. For a config-driven skins or shop plugin that usually means editing its model list and removing entries you do not need:

// example: a models config that lists one line per precached model
// trim it to the models you actually use
models/player/leet/leet.mdl
models/player/gign/gign.mdl

If two plugins each precache the same shared model, deduplicating helps — but only if they truly reference the identical path, because the engine counts distinct paths. There is no cvar that raises the 512 limit on stock HLDS; running ReHLDS gives you a more robust engine but does not hand you unlimited model slots, so the discipline is the same.

Common errors

  • Overflow only on one custom map — that map ships too many models; the fix is on the map, not the server. Try it with all plugins off to confirm.
  • PF_precache_sound: Sound overflow — same story, different table. A sounds/ambience or roundsound-heavy plugin is registering too many sounds.
  • Crash appears only after you added a plugin — that plugin's model list tipped you over an already-near-full table. Trim it or an existing one.
  • Precaching a model that does not exist — this throws a different error (missing file), not overflow, but people confuse the two. Overflow is about count, not a bad path.

Verification

After trimming, load your heaviest map (the one with the most custom content) with the full plugin set enabled:

changelevel your_heaviest_map

If the map loads cleanly and players spawn with correct models, you are back under the ceiling. Give yourself headroom — get comfortably below the limit, not one model under it, because the next map or the next plugin will otherwise put you right back into the overflow. If the server still aborts at map start for a different reason, isolate it with the crashing-plugin guide.

Сътрудници: Daemon666 ✦
Сподели: