This increased performance by x10 at least, my idea is that there is a function such as
cast(source,angle,fov,ray_step_size,max_steps)
that could return all the atom's hit.
I created this as an example of what I mean
proc/density_map(atom/object,range=0)
var list/density_map[range+1][range+1]
var middle = round(range / 2)
var list/turfs = block(locate(object.x-range,object.y-range,object.z),locate(object.x+range,object.y+range,object.z))
var x=0,y=1
/*Build Grid*/
for(var/turf/t in turfs)
x++
if(x > range)
x = 1
y++
density_map[x][y] = t.density
density_map[middle][middle] = 0
return density_map
Could have something like it built-in that allows us to return a 1D or 2D array of the map's density in chuncks/blocks and from there we could use that to send rays. Having a single function called cast() would be awesome af tho.
Results --> x10+ Increase in raycasting performance
Having this built-in would be freakin awesome o: