Lighting Update, and Admin
Hey Folks! Sorry for the missed post yesterday. Late phone call, then had to run and help with dinner. And unfortunately, both yesterday and today involved a lot of admin type tasks. So I didn't get much development done.
Fortunately, someone else did!
Chris has been working away on a revamped lighting model, and was able to get it checked-in today. And lucky you, you get to see it in action!
Chris's task was to take the existing lighting system, and make a few changes to it:
- Enable non-square shadow-casters. The old version only supported square-ish block shapes for shadow-casters on objects. Which meant round or diagonal objects had either blocky shadows, or none at all. Chris was going to try and make this more versatile.
- Fix corner flickering. The old version would illuminate any wall a light touched completely, but this caused corners to flicker on and off.
- Half-wall shading. If a wall in the old version was illuminated from both sides, it got double-illuminated. Also, it could be seen in a pitch black room if the other side had a light touching it. Chris was tasked with addressing this.
And as you can see, all three are working now! Our walls now get illuminated only on the side facing a light, which is easy to see on the right side of the screenshot. The orange and blue lights don't mix on shared walls, and shadowed sides of walls remain dark.
The corners are also really nice looking now. No more patchwork or flickering darkness where two walls meet.
And finally, shadow casters can be any arbitrary shape. This means we can start having diagonal walls and other arbitrary shapes! There's one caveat, however. The nice half-wall shading we see above will only work on certain shapes which we setup in advance. Right now, we're thinking that will be 1x1, 1x2, and 1x3 tile triangle walls, which allows some creativity in ship layouts. Full-shadowed items, which are 100% visible when touched by a light, but cast shadows behind them, can be any polygon shape. So we still have some creative options there.
Overall, this is a nice boost to the game's aesthetics, and makes things more consistent looking. It also makes things a bit easier to read, since the lighting is more well-behaved. Nice work, Chris!
For my part, I'm mostly emailing folks, writing documentation, or (very) briefly looking into my hauling problem. I'm starting to get some groundwork laid there, and some ideas how to proceed. I even have the hauling UI button done.
I think the one remaining piece is to figure out how the AI will find where to drop an item into a haul zone, and how it remembers that choice later. I can use placeholders for this, just like I did with install jobs. But the one case this fails with is stacked items. But I'm sure there's a solution in here somewhere.
More on that tomorrow, hopefully!