
Code:
mob/proc/Render(map/map)
set background = TRUE
var fov = round(FOV / 2)
var tick = world.tick_lag * 1.5
var grid = map.layout
var height = map.height
var width = map.width
var vis = client.screen[1].vis_contents
var rx,ry,rxp,ryp,tile,steps,obj/slice/slice,shade,ray_angle,obj/slice/over = new
var list/tile_density = list("1","r","e","w","b","z","f","c"), t, v
var list/slices = GenerateSlices(), tv
var ts
over.appearance_flags = RESET_COLOR | RESET_TRANSFORM
for()
sleep(tick);. = 0; world.name = "CPU: [round(world.cpu)]% --- ([xpos],[ypos]) , TS: [ts]"; ts = 0
if(!update){continue}
update = FALSE
for(ray_angle = (angle-fov) to (angle+fov) step 0.25)
.++
rx = sin(ray_angle) / 16; rxp = xpos
ry = cos(ray_angle) / 16; ryp = ypos
//
steps = 0; slice = vis[.]
slice.overlays = new
tv = cos(angle-ray_angle)
for()
rxp += rx; ryp += ry; steps ++
t = height * round(ryp) + rxp - width
tile = grid[t]
if(tile in tile_density)
shade = 255 - (steps * 0.085) * ICON_SIZE
if(42 > shade) shade = 42
v = round(((rxp + ryp) * ICON_SIZE) % ICON_SIZE)
slice.color = rgb(shade,shade,shade)
animate(slice,transform=transform.Scale(1,(512/(steps*tv))),icon=slices[tile][++v])
break
Problem description:
So right now all the rays are taking 90,000 steps each time the screen updates and I can't get DDA or whatever it's called to work. I've tried for months and can't comprehend on how to incorporate it so I have come to ask for help.
I understanding finding the size of x and y of the step and compare and step off those values and take the x and y side into consideration, just ZERO clue how to turn that into code that fits with what I have (no clue if that's even possible :D)