ID:593776
 
(See the best response by Deathguard.)
Code:
/*
//////////////////////////
Phase Atom
//////////////////////////
*/

var/list/PhasedIcons=list(/**/)
proc/PhaseWorld()
set background=1
for(var/turf/T in world)
T.PhaseAtom(/**/)
mob/see_invisible=1
atom/var/Phase=0
atom/var/DontPhase=0

obj/Phase
layer=5
density=0
invisibility=1
mouse_opacity=0

atom/proc/PhaseAtom(/**/)
if(src.Phase || (src.layer>=5 && !src.density))
if(src.layer>=6 || src.contents.len || src.overlays.len || src.DontPhase) return
src.layer=2.2
var/srcLoc=locate(src.x,src.y,src.z)
for(var/obj/Phase/P in srcLoc) return
var/icon/I
if("[src.icon]" in PhasedIcons) I=PhasedIcons["[src.icon]"]
else {I=src.icon-rgb(0,0,0,150);PhasedIcons["[src.icon]"]=I}
var/obj/Phase/O=new(srcLoc)
O.icon=I;O.icon_state=src.icon_state
O.pixel_x=src.pixel_x;O.pixel_y=src.pixel_y

World
New()
spawn() PhaseWorld()


Problem description:
I am just wondering if this can make game lagging ?
Best response
Yes, because you loop over every turf in the world, so if your world is large this will take up processor time to accomplish very little.

You only appear to perform PhaseWorld() at world startup, so I'd recommend setting all turfs that will be phased to turf/Phased/ rather than just /turf/, and only loop over those.
Well since its at world startup its gonna lag only at the beggining untill its not loaded. And im using 301x301 4z level map so I hope lags aint gonna be big
Try running it and see if it lags, that's probably your best test.
I did it and my cpu is the same as with out it. Even with 6 players on it
If you are getting lag, is it on startup or all the time? I don't really understand why you asked about lag.