Game Design Game Development Geek / Technical

Freshly Squeezed Progress Report: Lighting the Way

Last time, I reported that the player can now obtain items from furniture and that I was planning out how the flashlight will work in The Dungeon Under My House, my non-violent, first-person role-playing game and my second Freshly Squeezed Entertainment project.

I implemented a working flashlight and proceeded to work on the next in-game obstacle for the player.

Sprint 2024-10: Intro sequence game play

Planned and complete:

  • Flashlight automatically lights up dark dungeon

Unplanned and incomplete:

  • Door with beam requires minimum number of party members (or strength) to open

Now that the party can acquire a flashlight from under the bed, they can return to the dungeon to light their way through the darkness.

As I said in the previous report:

I think requiring the player to manually turn the flashlight on and off would be tedious.

Instead, I’d like the flashlight to turn on and off based on the current light conditions. So if the player is entering an area that is getting darker, then the portable light source turns on automatically, and once the player enters an area with getting brighter, the portable light source turns off automatically.

I figured a decent way to make it obvious that the flashlight’s status was changing was by popping up a piece of scripted dialogue.
The Dungeon Under My House - turning on the flashlight automatically

The Dungeon Under My House - turning off the flashlight automatically

I created two light thresholds, one for when it was getting too dark and you needed to use your portable light source, and one for when it is getting bright enough that the light wasn’t needed anymore. I figured that with two separate thresholds instead of a single boundary, the scripts wouldn’t pop up too frequently if the player decided to move back and forth between two grid cells.

The somewhat tricky part was the actual dynamic lighting of the dungeon. I was worried that the raycasted dungeon rendering code would be slowed down, but with only a handful of light levels being modified, it turned out that it wasn’t a big hit to performance.

Otherwise, it turned out to be straightforward to project out from the party’s current position and modify light levels on the fly, and as the party turns to the side, you can see that part of the dungeon gets lit up as they turn.

The Dungeon Under My House - dynamic lighting

I’m not entirely happy with it, as it seems to lighting up more intuitively when turning one way but not as much the other, but on the other hand, it’s a quick turn and the player might not see much anyway.

Another issue is that I think the way the lighting works is functional enough, but I wish it looked more like a flashlight, with a rounded illumination. But maybe I’ll come back to it in the future.

But one thing I want to address sooner than later is that it feels weird. The light projects out in a straight line, so you can see the cells directly in front of you, but the cells to either side are left at their default light levels, which can be pitch black. But instead of looking like you are walking in a dark hallway with a flashlight, it looks like the walls on each side are just super dark.

The Dungeon Under My House - dynamic lighting

Strangely and counterintuitively, to make it feel more correct, I might need to light up the cells to the sides a little.

But in the meantime, one more step in the intro’s game play is completed: the player can navigate a space that was originally too dark to proceed through.

I next started working on what the player would find at the end of the dark hallway. My plan was for it to be a door with a heavy beam across it. In order to open the door, the party would first need to remove the drop bar, and it would require a full party of three members working together to do so.

Currently, the only doors in the game can open and close, so adding a barrier and/or a lock was a future task, and the future is now.

It made me think about the need to persist the state of doors and how I might rearrange the data structures in a way that make it easier to save and load those states.

I’ve also been watching videos about level design, which got me thinking about this intro hallway. My original plan was to have one main way forward and one non-obvious and secret way into a different part of the dungeon. Now I am considering adding a third or even a fourth path, allowing a player who decided not to get the flashlight or not get a full party to proceed anyway. I’m considering how much freedom I want to allow the player to have this early and wondering if I should keep the intro sequence more direct and allow that freedom later.

But first, I need to work on the door, and that work should happen this coming week.

Thanks for reading!

Want to learn when I release The Dungeon Under My House, or about future Freshly Squeezed games I am creating? Sign up for the GBGames Curiosities newsletter, and download the full color Player’s Guides to my existing and future games for free!

One reply on “Freshly Squeezed Progress Report: Lighting the Way”

Leave a Reply

Your email address will not be published. Required fields are marked *