nmdist-log

Flickering lights

It’s been awhile! Last time I was working on the networking code. The unfortunate news is that I’ve decided to put that on hold for now. A lot of great refactoring work was born out of that effort, but I got to the point where I needed more knowledge on what my requirements would be in the future. Given that I’ve never finished a game, I decided to put that off. Multiplayer works on the local network, but won’t sync quite right under poor network conditions. If multiplayer doesn’t get finished, it’ll for sure be a v2 feature for the engine along with a refactored renderer I worked on.

But that’s not all, these past few days I’ve been working on lighting. While the main lights have been working for some time, none of the togglable or flickering lights worked. For example, the office in c1a0 where two scientists are working together, they are working in darkness. Now the room is lit as intended, and it means you can harrass them by turning off the lights!

You’ll also notice that the NPCs are now properly lit. Before they were always perfectly lit up, which made it look like they were glowing when in dark rooms. Now whenever an NPC moves, it’s position is converted to the texture coordinates on the light map for the face they’re on.

I’ve also implemented flashing lights, like this one on c1a1f:

You may notice that this is the same light pattern that made the rounds in the summer of 2021. All the default Half-Life/Quake light patterns are supported, as well as any custom patterns.

During development, I added some debug models that I can toggle on to make it easier to find where light entities are. These models were whipped up in Blender:

A lightbulb and a lamp.

Here it is in the wild:

Debug lamp models seen in the level c1a1f.

As a last bonus image, here’s a screenshot when I messed up the code that updates the light map. I forgot to invert the y coordinates since I’m not using a projection in that shader.

The level c1a1f with black splotches all over the place.

That’s all for this update. Happy New Year!