TF2 New trick: how to clear 2/3 edicts used by each point_spotlight

sunstep

The Biggest Star
★ VIP ★
Joined
May 2020
Messages
79
Points
33
Note: This thread is for mappers, if you don't understand any of this, please move on.



In this video I show how the sv_dump_edicts is linked to the status command, by subtracting num edicts - free edicts, which results in the used edicts. The map I was on was full of point_spotlights which use 3 edicts each, so obviously this map will cause trouble with edicts. But subtracting num edicts - free edicts confirms that the status command is accurate after all. (I made a video earlier about this but then people thought that the status command was wrong, and that I had to use sv_dump_edicts).

Every mapper can save 2/3 edicts of each point_spotlight by creating a logic_relay with the following outputs, I created a logic_relay with a stripper so I don't have to recompile the map. Note that the filter instruction on a stripper will entirely clear the entity, rather than 2/3 edicts. I recommend doing this with a logic_relay and avoid logic_auto's. (logic_relays do not use edicts, while logic_auto's do)

Anyways, here are the outputs required on the logic_relay to free edicts on a point_spotlight while (barely?) noticing any difference:

x = the delay it takes before the edict gets removed, I recommend setting this to 0.

Note that they spawn back when the round is over, which makes this more a mid round optimization rather than an optimization for the beginning of the round.

"OnSpawn/OnTrigger" "point_spotlight,Kill,,X,-1"
"OnSpawn/OnTrigger" "spotlight_end,Kill,,X,-1"

I've shown in the video the edicts before and after triggering the logic_relay

The point_spotlight entity uses the following edicts:
  • point_spotlight
  • beam
  • spotlight_end

The beam edict is what causes the shining. You can kill the other 2 edicts with the logic_relay while barely noticing a difference. On the map I was on it reduced the amount of edicts from 155X to 122X. That's a significant amount of edicts reduces for no effort / any noticeable visual difference. But this of course depends on how many a map uses. How more point_spotlights are used, how more edicts this trick will save. I recommend this mostly on maps that overuse point_spotlights.
Post automatically merged:

In short: If you use point_spotlights in your map, just create a logic_relay and add the outputs in the thread above and you'll be freeing edicts without affecting the light.
 
Last edited:
Top