the Veldt
technical notes: entity limits
1 INTRO • 2 ENV_BUBBLES • 3 FOLIAGE • 4 LIMITS • 5 MAPS
There is a hard-coded entity limit within the HL engine which mappers need to be careful about. Placing too much foliage will conk HL to the desktop. To check, refer to this relatively-accurate formula:
((TreeQuantity x 5) + 1) + (GrassQuantity) + 11 < 220
Tally together all the grass and trees you are using in the map (manually add their quantities in Worldcraft) and punch it into the above formula. If you are below the 220 mark, the map should run okay. To see how much entities you are using, enter impulse 100 into the console.
A way to increase the foliage limit:
Edit DLLS/EFFECTS.CPP and remove all the leaf code. You will lose all the random-leaf formations, but you will gain a substantial increase in the foliage limit. Currently, one tree takes up five entity slots. If all leaf code were removed, then one tree would only take up one entity slot.
Currently, TREE01.MDL consists of a tree-trunk and empty branches. One can edit TREE01.MDL to include leaves. This can be done by merging TREE01.MDL and LEAF01.MDL together.
The above two solutions were not chosen because they would result in having pre-made trees, which would defeat the purpose of this project. This being a simple code experiment, I like the random leaves in the trees. Games typically use canned tree models/textures, meaning you see the same damn tree repeated over and over and over again. Every tree in The Veldt is a completely unique product. They're like frickin snowflakes. It's a small effect, one that you probably won't consciously notice, but I think it does make a difference.
At the cost of hurting the foliage limit, one can improve tree appearance by increasing the leaf amount (it is currently locked at four leaves per tree). I felt that five was a reasonable compromise between looking decent and the entity limit.