Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

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

sunstep

Truly Feared
Joined
Jun 15, 2020
Messages
164

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.

Every mapper can save 2/3 edicts of each point_spotlight by creating a logic_relay with the following outputs, I created this 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.
"OnSpawn/OnTrigger" "point_spotlight,Kill,,X,-1"
"OnSpawn/OnTrigger" "spotlight_end,Kill,,X,-1"

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 freed by no effort / any noticeable visual difference.
 

sunstep

Truly Feared
Joined
Jun 15, 2020
Messages
164
Apparently one edict is for the cone, another for the halo and the third one for the light. If you kill all except the light you won't notice much difference in the spotlight, while freeing a lot of edicts. I honestly see no reason to keep the 2 other edicts. I mostly recommend this in maps that overuse spotlights
 

Benedevil

Blackwonder's Own
Staff Member
Owner
Developer
Joined
Sep 28, 2015
Messages
3,325
This is a great observation. I see 0 difference actually. This will be very useful in preventing edict overflow. If I kill the entities as soon as they spawn, I don’t get to see any of the light, but if I wait 1 second and then delete them it seems to work just like in the video.
 

sunstep

Truly Feared
Joined
Jun 15, 2020
Messages
164
For some reason using the filter feature in the stripper config will entirely wipe out the spotlight. Probably because the the edict has the same name as the entity it self, which is unfortunate because the edicts that are killed spawn back at the beginning of the next round which may still make it cause a server crash. This makes the trick better for mid round optimization nonetheless.
 

Who Read This Thread (Total Members: 1)

User Who Replied This Thread (Total Members: 2)

Top Bottom