v0.7.0 Night on the Town

Published by

on

Hey everyone,

It’s been a bit! Generally I don’t dive into personal life stuff on here, but its been an eventful couple months for me. But I’m back into Flask & Barrel now, and here to show off a new update.

Highlights

Locations!

This is exciting. If you kept up with the last post, you’ll know that I’ve been planning a reveal of some real in-game locations. Well here we are!

First up is the town. I’ve drawn up most of the town, but for this update I decided to really focus on adding depth and detail to one “slice”. This gives me a better idea of the final workflow, and allows me to make changes easier as I go.

You can see the player here standing in front of the Flask & Barrel potion shop, roughly in the center of town. This will eventually be a small shop where the player will handle customers and sell their potions. Right now the front door just takes you to the meat and potatoes of the operation, the brewery!

This is the Flask & Barrel Brewery, where the player will spend most of their time. Here you will find your copper brewing cauldron, and eventually some options to decorate and expand. In the future, this brewery will be accessible via a special door in the shop, and it will only be available to the player.

Outside the brewery you’ll find what I am calling the “Hidden Grotto”.

The Hidden Grotto will only be accessible via the brewery, and it will serve as a small outdoor playground for the player to decorate, grow ingredients and much more.

As development continues, I expect these locations to start filling up with various details and activities, and each upcoming update will expand the relevant areas.

Lumen

This is definitely the biggest portion of this update. If you’ve been following some of my social media, you’ll have gotten a sneak peek at this already. I’ve developed a new lighting subsystem for Flask & Barrel that I am calling “Lumen”.

This system is a deferred lighting system that simulates 3D lighting effects within a 2D isometric pixel art environment.

To accomplish this, I’ve made some changes to the rendering pipeline to send additional data to the GPU. This data is sent as an extra texture, and I use the color channels of that texture to provide new some per pixel data.

The most notable thing this allows me to do is manually enter my own depth maps for all my sprites. Lumen’s lighting calculation uses this height data to simulate a third dimension in this 2D space, allowing lights to extend up walls as if they were a 3D object. That was some fun math to figure out. This is what that height data looks like when drawn directly to the screen:

Since that depth information can be communicated using just one color channel, I have 2 others to work with. I use those to add in normal mapping. For those unfamiliar, normal maps let you tell the GPU what direction each pixel is “facing”, which allows each pixel to “bounce” the light in a more realistic way. Here’s a good close up of them in action:

This effect is most notable on the window trim of the green building. As the light moves, these details get shaded differently as if they were truly facing away from the light even though this is a flat texture. This really makes everything pop out a lot more.

All in all, I am really happy with the way Lumen came out. It’s incredibly performant, and the memory overhead is minimal. There is still some work to do, I’d eventually love to get real shadow casting working, but that’s a project for another day.

Ambiance

You’ll notice in the above images that the lights tend to bob and pulse a little bit. This is is a pretty minor feature, but I feel it really helps make the world feel alive.

The other ambiance feature I’m really happy with is the fog. You’ve seen fog before, but it was a very hacky system and it never ran well. This system uses the scene depth data to more accurately fog-ify everything, and there is almost no impact on performance.

This effect even interacts really nicely with the day/night gradient system:

What’s Brewing?

So that’s all I’ve got! A smaller update than usual (in a longer time than usual), but I expect things to pick back up again. Lumen was a huge challenge to get working right. There was a lot of math, and a lot of workflow changes. These challenges are really difficult to show off in a blog post, but it should really pay off going forward.

The next update, v0.8.0, is going to focus on combat and adding some monsters into the game. Progress is already underway, so here’s a little teaser!

The first priorities are the skeletons and the slimes, as they should be the simplest.

After that, I’d like to share a bit of what else I have planned. This isn’t necessarily the release order, nor is it comprehensive, but its a rough outline:

  • Brewing System Rework
  • NPC Integration (shops, townsfolk, customers)
  • Potion Shop Mechanic
  • Questing
  • Content expansion
  • Play Testing

So stay tuned for more to come! As always, you can find some more frequent updates on my twitter, bluesky, or reddit. Thanks!

– Nick