Lighting Update, and More Build Menu Tasks

Hey Folks! I'm still sort of midway through the latest work on build menu tasks, so I decided to show some of Chris's progress in today's screenshot.

Chris has been rewriting the visibility/lighting code to support arbitrary shadow shapes. Previously, all walls and items had to have shadows made up of axis-aligned blocks, which looked bad when paired with diagonal walls and other non-orthogonal shapes. His work makes those shadows line-up with the visuals of non-square items.

In the process, he ran across a few different ways to calculate shadow bounds, and our most recent discussion resulted in today's screenshot. It still supports non-square shadow blockers, but the interesting thing is the way it illuminates objects at the outer edge.

My old code would completely illuminate any item touched by a light (and similarly, reveal any item touched by line-of-sight bounds). His new code illuminates the first half of the touched item, leaving the far face dark. You can see a good example on the upper left, where the shadow cuts off the upper part of the door.

The nice thing about this is that we can have different lighting on either side of a wall, and the wall will reflect that difference. Plus, if we're in a pitch black room that has one wall lit from the other side, we won't see that light anymore.

Still quite a few glitches to sort out, but this could be a promising upgrade!

On my end, I'm still working on integrating the installation of equipment with the build menu and task system. I can use the menu to place a placeholder down, but that's the end of it. The AI doesn't care, and the ghost placeholder remains there forever.

And the way placeholder installation works, it needs to know who's installing the thing, the thing it will turn into, and the thing we are starting with. But my interaction system only knows about two things at a time.

We did some trickery in the past to do this, but it breaks if I don't directly assign an AI to immediately carry out the installation. My task system puts the job up on a list for AI to grab from later.

So, I've started adding some code to my interactions to support a depot of input items required before the interaction can proceed. Think building materials that must be collected on-site before construction, like in RimWorld or Oxygen Not Included.

My current thinking is that the placeholder will generate a task for each item it needs to start installation, and won't agree to the installation until it holds those items in its depot.

Plus, it's getting to be about time that interactions requested items by their properties instead of their names. Just like in NEO Scavenger, we should be able to use any similar object to fill an ingredient, not just a specific named item.

Quite a few moving pieces here in mid-transition. So we shall see how it goes!

Tags: Ostranauts