I wonder, how much impact several entities with applied trigger_range have on the frame rate. Does it make sense to do a periodic distance check tu turn off trigger_range for entities further away? Is doing a simple periodic (e.g. 1s recurrence) distance check using vec_dist() faster?
Re: speed of trigger_range
[Re: FBL]
#88024 08/29/0610:2508/29/0610:25
c_move is remarkably slower with triggering (->collision section of the manual). So yes, it would make sense to turn off the trigger_range when triggering is not needed.
Re: speed of trigger_range
[Re: jcl]
#88025 08/30/0601:4308/30/0601:43
Another idea (which I haven't tried) is to only do a trigger_range move every few frames (e.g. 4 'normal moves' for every one trigger_range move).
If you do try this, make sure to do it enough times that you don't skip over anything. Also make sure that each entity takes turns (if all the entities check at once you'll get jerks).
He means that I shouldn't use sqrt and instead check the with the square result (Meaning when checking for a distance of 5, I check with 25 (5²) instead in the script). This is doable, but I'm planning ot use vec_dist anyway, because it has less problems with exceeding variable ranges for great distances. Not sure how much slower vec_dist is, though.