Fix: 'AllocBlock: Full' (Too Many Lightmaps)

May 21, 2025 Daemon666 8 min read 6 vues

You compile a map, it runs fine in the editor, but the moment a client loads it the engine drops to the console with:

AllocBlock: Full

This is not a compile error — hlrad finished happily. It is a runtime failure inside the GoldSrc engine. The renderer allocates lightmap surfaces into a fixed set of blocks, and your map has produced more unique lightmap data than those blocks can hold. The map is over the lightmap budget, and the fix is to reduce how many distinct lightmaps the compile generates — not to add more.

1. Understand what a lightmap costs

Every world face that receives light gets its own lightmap, and the lightmap resolution is driven by the face's texture scale and by -texdata/light detail. A large face at a small texture scale (say 0.25) generates a huge, high-resolution lightmap; the same face at scale 1.0 or higher generates a much smaller one. Thousands of faces each carrying an oversized lightmap is exactly what exhausts AllocBlock. The engine has a hard ceiling on the total; you cannot raise it, so you must lower your usage.

2. Run a compile with -chart to see the budget

Add -chart to your hlrad (and hlbsp) parameters and read the report at the end of the compile:

hlrad -chart mymap.bsp

The chart lists engine limits and how close you are to each. Watch the lightmap / texdata lines and the face count. If they are near the limit, AllocBlock is your next crash. See the compile parameters guide for the full flag list.

3. Raise the texture scale on big, unimportant faces

This is the single most effective fix. Select the large faces that do not need fine lighting detail — ceilings, floors under crates, big outer walls — open the Face/Texture Application tool, and increase their texture scale:

Texture scale X: 1.00  -> 2.00
Texture scale Y: 1.00  -> 2.00

Doubling the scale on a face roughly quarters its lightmap footprint. You lose lighting resolution on that surface (softer shadows), which is invisible on a 512-unit ceiling but very visible on a detailed wall — so only scale up the faces where nobody will notice.

4. Cut unnecessary lights and lit surface area

Fewer light sources touching fewer faces means fewer lightmaps. Delete decorative light entities that overlap, and cap the reach of the rest. Faces textured with tool textures that are not rendered — NULL, SKY, AAATRIGGER, CLIP — do not generate lightmaps at all, so apply NULL to every face the player can never see (backs of walls, tops of skyboxes, hidden brush sides). This is the same discipline that keeps the whole map inside its limits.

5. Convert detail brushwork to func_detail

Small, numerous brushes each add faces and lightmaps. Turning non-structural geometry into func_detail (a ZHLT/VHLT entity) keeps it lit but removes it from BSP tree splitting, which reduces face fragmentation and therefore lightmap count. Rails, trim, pipes, and clutter are ideal candidates.

6. Recompile and re-read the chart

After scaling and culling, run the full chain again — hlcsg → hlbsp → hlvis → hlrad — with -chart and confirm the lightmap figure dropped. If you are using Vluzacn's VHLT v34, the chart is more detailed and easier to read than old ZHLT.

Common errors

  • AllocBlock: Full on load, compile was clean — the classic symptom. Too many/too-detailed lightmaps. Scale up big faces and NULL hidden ones.
  • It only crashes for some players — it will crash for everyone once you are over the limit; those who "work" simply have not reached the offending view yet. Fix the budget, do not ignore it.
  • Scaling textures made the map ugly — you scaled the wrong faces. Only raise scale where the surface is large and lighting detail is unimportant; leave detailed walls at 1.0.
  • Chart shows lightmaps fine but it still crashes — check that you recompiled with all four tools; a stale hlrad pass against an old BSP reports old numbers.
  • Adding more lights to "balance" it — that makes AllocBlock worse, not better. The problem is total lightmap data, and more lights add data.

Verification

Load the recompiled map on a listen server and walk the whole level, especially the open areas you scaled. If it no longer drops to AllocBlock: Full, you are under budget. Confirm with the final -chart output that the lightmap line sits comfortably below the ceiling — leave headroom, because adding one more detailed room later can push you back over. If lighting looks too flat after scaling, reintroduce detail selectively on the faces players actually study, and re-check the chart each time.

Contributeurs: Daemon666 ✦
Partager :