ID:95749
 
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
http://www.byond.com/members/Koil/files/Lighting.zip

The built-in lighting system would look much better if it were to do what my demo here does, which shouldn't required much. The FOV calculation is also pretty bad sometimes. I can't imagine these modifications being that hard to implement, and they'd make a huge difference.

My demo uses the built-in opacity features and supplements them so they're less blocky.
I am not suggesting the whole radial blur thing on the outside edge, let me add. I'm only talking about atom.opacity and how it blocks light.
http://i48.tinypic.com/169rrio.jpg Here is a picture example.
If this were added there should be some sort of option for hiding things in half shaded tiles until they're fully revealed.
I would like to suggest the possibility of built-in, hardware accelerated lighting.

Sure, there have been great attempts to simulate such an effect already in BYOND, but they reach their limits rather fast both with limitations on the colours/flexibility and performance.

With today's graphic hardware, implementing coloured light effects and an improved FOV calculation should be an option for the ambitious BYOND developer. The lack of visual appeal is one of the main points when BYOND games are concerned and light certainly plays an important point in this scenario.

I'd like to inquire how feasible you would consider such a feature addition to the language and thank you in advance for consideration.
In response to Schnitzelnagler
I support this, if it can be implemented and actually used without murdering performance. Considering how poorly basic alpha transparency performs, though, I don't know what the chances of that are.
In response to Schnitzelnagler
This seems technically feasible because most of the changes would be on the client and would be purely visual. As nice as this would be, I doubt it will be added. This feature is useful and non-trivial, which is the kind of feature they seem to avoid.
In response to Schnitzelnagler
I would really like this myself and it's something I've thought about from time to time. Questions that naturally come up are how we would reconcile the lighting with 2D sprites, for instance how they would cast shadows and how the lighting would play off their surface, and this is an even bigger question for isometric modes. I'm very open however to any ideas that would suggest a way to handle these issues, because having built-in lighting would be incredibly awesome and add a lot of wow factor to BYOND. I'm putting this under "Needs Discussion" for now because I'd really like to encourage some brainstorming on how to handle all the technical details.
In response to Schnitzelnagler
Shadows are not necessary. When we get a working dynamic lighting system then we can have the discussion about how to handle shadows.
In response to Schnitzelnagler
I'm not sure there can be a meaningful discussion of lighting without considering shadows, though. For instance if you're shining a light and it hits an opaque tile, if it's a standard wall you probably want the whole thing to cast a solid shadow but otherwise you might only want the opaque parts of one icon to cast a shadow. So that's somewhat relevant; it's also not that hard, overall, except that there'd have to be some way to tell one icon's opacity from another so an underlay tile didn't cast any shadows. A very simple 2D lighting scheme could handle all this, and simply attenuate the brightness or color of objects in the lit area, but this would only apply to topdown mode. (Other questions arise like how to handle soft shadows, ambient illumination of an area, etc.) Handling lighting in that manner via isometric would be more difficult, since every icon has the illusion of depth.
In response to Schnitzelnagler
There will always be problems with shadows in a top-down 2D environment.

 M

#####
#
# L
#

# = wall
M = mob
L = light source


What does the wall look like? Does the light illuminate the wall tiles? Does is pass through the wall? Either way it won't look correct from the mob's vantage point because you're on the dark side of the wall.

Having no shadows might be a somewhat flawed implementation but it's a heck of a lot better than what we have now. Realtime soft shadows is a problem for modern PC games. We don't need BYOND's graphical capabilities to be in sync with modern PC games. Dynamic colored lighting would at least bring BYOND's graphical capabilities out of the stone age and that's better than nothing.
In response to Schnitzelnagler
The example you brought up is a perfect illustration of the problem though. The walls effectively cast shadows to keep lighting from showing up behind them.

In a case like this, say the edges of the ### are doorways into a room. Most of the # tiles you wouldn't want to light up because the light source is invisible to the mob; there'd be no point. Floor tiles in front of the doorway however you would want to light up. This distinction is fairly easy to make. But as you got near the doorway you'd also want wall tiles near it to be at least partially lit by that source.
In response to Schnitzelnagler
Why wouldn't it work just like every other "lighting"/vision based thing with opaque tiles?
In response to Schnitzelnagler
Given this map: http://files.byondhome.com/Forumaccount/no-light.png

And a light source positioned similar to my text example: http://files.byondhome.com/Forumaccount/light.png

With shadows it would look something like this: http://files.byondhome.com/Forumaccount/shadow-1.png

The problem is that we have a top-down view. We're not seeing the sides of the wall, we're seeing the top. No matter what we do it won't look nice. Our options are:

this: http://files.byondhome.com/Forumaccount/opacity-1.png

or this: http://files.byondhome.com/Forumaccount/shadow-opacity.png

Whether or not the light passes through the wall is actually the least of our worries.
In response to Schnitzelnagler
Meh, do we even need offcast shadows? Just have it work like opacity does; either shiny light, or no light at all. The no light at all would more or less = shadows anyway.
In response to Schnitzelnagler
Falacy wrote:
Just have it work like opacity does;

The problem with opacity is that the current line-of-sight model is not entirely realistic and works on an all-or-nothing basis. Having either all pixels or no pixels within a tile be affected by a light source would look afwul.
In response to Schnitzelnagler
In response to Schnitzelnagler
When you position the light source such that the edge of its visibility is a 45 degree angle it'll look bad.

Edit: It'll also look bad when wall tiles don't occupy the full 32x32 space.
In response to Schnitzelnagler
I think none of those options look particularly good, nor are they correct for a 2D environment. Off the top of my head I can think of some options to do better, but as this interplay has aptly demonstrated, there are no simple solutions.
In response to Schnitzelnagler
The simple solution is to not worry about shadows. There are plenty of ways this is useful even if it doesn't support shadows.

An overly complex pixel-based solution still has its problems. This isn't the type of shadow you'd expect from a fence: http://www.byond.com/members/Forumaccount/files/fence.png The problem is that the pixels occupied by the image aren't necessarily representative of the volume of space occupied by the object.
Page: 1 2 3 4 5