The Light System
I'm making this post because I have a funny feeling that I need to re-evaluate the design of the system, and possibly rewrite it from scratch. Here's how it works:
- All lighting is handled via /lighting obj's placed on every tile*
- The distance light is cast is done via a variable called
incandescence - Lighting objects are updated every time a client moves, an incandescent object moves within view of a client.mob, an object in view of a client.mob changes incandescence, or a door/window is open/closed
- atom/light() - all of the logic for acquiring lighting objects within the range of the light source and
src's affect on their overall intensity - lighting/update() - all of the logic for adjusting the intensity of the lighting object, and assigning it's
icon_stateaccordingly
* I know this is far from the most efficient way to handle it, which I think is where I can improve the performance here drastically.
Screenshots
Shadowcasting
//-----------------------------------------// |
I'd like to hear what I can do differently here. Any relevant snippets can be posted, but (for obvious reasons) I'm against putting too much code up on the site for all eyes. That being said, let me know what you need to look at in order to help out, and I'll gladly share it.
Looking forward to your help
- F0lak
