Light Speed

by FIREking
The fastest lighting system for BYOND
ID:1259376
 
light/effect() can be re-written to use a technique known as "recursive shadow casting" to make this library virtually limitless. Unfortunately, this is beyond me so I use line of sight to calculate light effect.

Fortunately, Light Speed is VERY fast and very efficient anyway.
Thanks for the links, I know of these already. I have read that article and looked at that code many times and for some reason, it still does not click for me.

Another thing I realized with my engine is that each tile is basically either on or off. Light doesn't "falloff" as it gets further from its source (it just appears that way at the edge). Because of that, I've sort of only looked at this library as an "aesthetically pleasing" visual effect more than anything. It doesn't really provide you with anything cool such as "is my creature in a half-lit area" type functions...

That said, it does make Legends Online look much cooler at run time, so I figured I'd share how I did it!
I tried the lib and it looks great! For most game purposes, simply lit or not is sufficient and the appearance is certainly a step up from built in lighting.
I implemented an iterative shadowcasting algorithm from my own lighting library into Light Speed, and have seen a significant boost to performance.
Light Speed with this algorithm is still a little slower than my library, but not by much. However, Light Speed is significantly easier to implement than my library is.

This algorithm was developed by Yota, actually, and while it is faster than what was once being used by this library, it is still a little slower than the recursive shadowcasting algorithm on Roguebasin.

Expect an update to Light Speed soon, with the aforementioned improvements in performance.