Engine Hunk Overflow: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "== What Does It Mean? == === Engine Error === This is an engine error message that occurs when attempting to load the map in-game. This is typically related to Lightmap...")
 
No edit summary
 
(10 intermediate revisions by 7 users not shown)
Line 3: Line 3:
=== Engine Error ===
=== Engine Error ===


This is an engine error message that occurs when attempting to load the map in-game. This is typically related to [[Lightmap]] values being modified to an odd value.
This is an engine error message that occurs when attempting to load the map in-game. This is due to too much lightmap data being allocated for the level, and it exceeds the budgeted memory for lightmaps (the "hunk").
 
{{note|This error is fixed in {{tf2}} and {{csgo}}, as they removed the hunk allocator and therefore have no limit. {{gmod}} disabled the hunk by default so this error will not happen there either.}}


=== What Is Hunk Allocation ===
=== What Is Hunk Allocation ===


This is described as the memory allocated for light data.
This is described as the memory allocated for lightmap data.
*0 = to normal "program memory" with alloc
*0 = to normal "program memory" with alloc
*1 = to Valve's seemingly limited to certain size "MemoryStack memory" with Hunk_Alloc
*1 = to Valve's seemingly limited to certain size "MemoryStack memory" with Hunk_Alloc


== How To Fix ==
== Methods To Fixing The Error ==
 
*<code>+r_hunkalloclightmaps 0</code>
There are two ways of fixing this error:
**Add this in your [[Command Line Options|launch options]]. This will eliminate the error altogether. While fine for singleplayer games, it is not recommended for multiplayer games, as not only will you have to add this to your launch options, but server operators will also have to add it to their server command line.<br>
*+r_hunkalloclightmaps 0
*Find faces with odd or extreme lightmap values.
**This will eliminate the error altogether. Insert this command into your [[Command Line Options|game's launch options]]. For multiplayer maps, this command also needs to be inserted in the start up command line for [[Source Dedicated Server|game servers]].
**Very large [[displacements]] can cause this error. The lightmap value can automatically change (sometimes, to an undesired value). Split them up and/or make sure your lightmap is an even value of a power of 2, avoiding extreme numbers.  Having stretched displacements in one dimension can also cause it.
*Finding faces with odd lightmap values.
**If you can't find any odd lightmap values, as a last resort, select the entire map, open the [[Hammer Face Edit Dialog|Face Edit Sheet]] and input <code>16</code> for the lightmap scale.
**If you have not changed any lightmap value at any given time, the fastest way to reset the lightmap value back is to select the entire map, open the [[Hammer Face Edit Dialog|face edit sheet]] and input <code>16</code> in the lightmap/luxels value.
**Increasing the [[Lightmap]] value on brushes will fix it.
**Check your [[displacements]]. If they are large, the lightmap value will automatically change (sometimes, to an undesired value).
 
[[Category:Modding]]
[[Category:Modding]]
[[Category:Level Design FAQ]]
[[Category:Level Design FAQ]]

Latest revision as of 09:11, 16 November 2024

What Does It Mean?

Engine Error

This is an engine error message that occurs when attempting to load the map in-game. This is due to too much lightmap data being allocated for the level, and it exceeds the budgeted memory for lightmaps (the "hunk").

Note.pngNote:This error is fixed in Team Fortress 2 and Counter-Strike: Global Offensive, as they removed the hunk allocator and therefore have no limit. Garry's Mod disabled the hunk by default so this error will not happen there either.

What Is Hunk Allocation

This is described as the memory allocated for lightmap data.

  • 0 = to normal "program memory" with alloc
  • 1 = to Valve's seemingly limited to certain size "MemoryStack memory" with Hunk_Alloc

Methods To Fixing The Error

  • +r_hunkalloclightmaps 0
    • Add this in your launch options. This will eliminate the error altogether. While fine for singleplayer games, it is not recommended for multiplayer games, as not only will you have to add this to your launch options, but server operators will also have to add it to their server command line.
  • Find faces with odd or extreme lightmap values.
    • Very large displacements can cause this error. The lightmap value can automatically change (sometimes, to an undesired value). Split them up and/or make sure your lightmap is an even value of a power of 2, avoiding extreme numbers. Having stretched displacements in one dimension can also cause it.
    • If you can't find any odd lightmap values, as a last resort, select the entire map, open the Face Edit Sheet and input 16 for the lightmap scale.
    • Increasing the Lightmap value on brushes will fix it.