oranges_ear
Oranges Ear -
turns out view() spends a significant portion of its processing time generating lists of contents of viewable turfs which includes EVERYTHING on it visible
-
and the turf itself. there is an optimization to view() which makes it only generate lists of a certain atom type - this system takes advantage of that.
-
a fuckton of these are generated as part of its SS's init and stored in a list, when requested for a list of movables returned by the spatial grid or by some
-
superset of the final output that must be narrowed down by view() one of these gets put on every turf that contains the movables that need filtering
-
and each is given references to the movables they represent. that way you can do for(var/mob/oranges_ear/ear in view(...)) and check what they reference
-
as opposed to for(var/atom/movable/target in view(...)) and checking if they have the properties you want which leads to much larger lists generated by view()
-
and also leads to iterating through more movables to filter them.
-
TLDR: iterating through just mobs is much faster than all movables when iterating through view(), this system leverages that to boost speed
-
enough to offset the cost of allocating the mobs
-
named because the idea was first made by oranges and i didnt know what else to call it (note that this system was originally made for get_hearers_in_view())
Vars | |
references | references to everything "on" the turf we are assigned to, that we care about. populated in assign() and cleared in unassign(). movables iside of other movables count as being "on" if they have get_turf(them) == our turf. intentionally not a lazylist |
---|---|
Procs | |
unassign | clean this oranges_ear up for future use |
Var Details
references
references to everything "on" the turf we are assigned to, that we care about. populated in assign() and cleared in unassign(). movables iside of other movables count as being "on" if they have get_turf(them) == our turf. intentionally not a lazylist
Proc Details
unassign
clean this oranges_ear up for future use