Valve Developer Union

Properly Avoiding the "Pollen Sprites" in Half-Life

(November 12, 2017)


In Half-Life, NPCs have very peculiar placement rules. If you put them too close to any brushes or level geometry, even if there's a noticeable gap between the two, more than likely, you'll see sprites akin to yellow pollen surrounding your NPC. Other times, the NPC might not even be in the same spot as it was in the editor.

A scientist giving off yellow error sprites
A scientist giving off yellow error sprites

You don't need to reconfigure your entire level if something like this occurs. A simple workaround involves the use of a scripted_sequence entity to move the NPC into position when the level is run.

Fixing the pollen sprites

1. Place the NPC where you'd like it to be in the final map.

In our example map, a monster_scientist (named Walter and herein referred to as such) is up against a wall. In this state, Walter would give off the unwanted "pollen" sprites.

Walter against a wall
Walter against a wall

2. Copy your NPC to an empty space, preferrably off the ground.

You'll want to give it space (at least 32 units or so on all sides) so as to avoid the pollen sprites. Raise the NPC off the ground a few units just to make sure (this is good practice even if you're not scripting an NPC). It really doesn't matter where it is, because it won't be there when the map is run. We now have two Walters, and the one we're keeping will be in the middle of the floor.

Tip

Shift-dragging your way to victory

Both Hammer and J.A.C.K. have the ability to duplicate brushes and entities through shift-dragging. Use the Select tool to select the items you'd like to copy, hold down the Shift key, and drag the items around in one of the 2D viewports. The items will be copied to the location where you dragged, leaving the original in place. Anything you can select can be duplicated in this manner."

3. Turn the original NPC into a scripted_sequence.

In our example, the original Walter against the wall will now be the scripted_sequence block. Walter himself is a short distance away. Rename or delete the name from the scripted_sequence and set the m_iszEntity ("Target Monster") keyvalue to Walter. If you want an idle animation, you can set one with the m_iszIdle ("Idle Animation") keyvalue. Walter now has sitidle as his idle animation.

A scripted_sequence has taken Walter's place
A scripted_sequence has taken Walter's place

4. Set the Move to Position keyvalue of the scripted_sequence to "Instantaneous".

This means that, when the map is run, the scripted_sequence will move the NPC to its location immediately. If you have SmartEdit off, set m_fMoveTo to 4.

Move to Position should be set to Instantaneous
Move to Position should be set to Instantaneous

Walter will now sit against the wall without any pollen sprites whatsoever.

Walter sitting against the wall without any sprites
Walter sitting against the wall without any sprites

How does it work?

With developer 1 set, a "pollenated" NPC will make something like this appear in the console:

A level design error printed to the console
A level design error printed to the console

With this method, the NPC is moved into position at runtime. This prevents any errors because the NPC was technically in a safe position at the start of the map. One minor drawback is that the NPC will teleport into location when the map is run, so be careful not to spawn the player where they might be able to see it.

This also works for monster_generic entities, as seen with pipebubbles.mdl in the Blast Pit chapter of Half-Life. GoldSrc modeller The303 gives another example of its usage, with an escalator model being placed into a sloped surface with no errors at all.

An escalator monster being placed around complex geometry
An escalator monster being placed around complex geometry