Post news RSS Innkeep Dev Feature - Barrels of fun

Hi everybody! It’s time for another article on Innkeep development. Today I thought I'd write about a really neat feature: barrels you can grab, carry around, peer inside, and store away under the floor.

Posted by on

Hang on, first tell me what Innkeep is again please!


Innkeep is an immersive job sim with an RPG core and a dark twist. Run your own fantasy world inn. Serve ale. Share rumors. Tell jokes. Rob your guests…?? Well, maybe just a little.

Sound's pretty cool, right? Like to know more? We'll you're in luck! Did you know that Innkeep now has a Steam page? It's true! Go check it out, watch the trailer, and hit that Wishlist button. More wishlists helps a lot with getting steam to recommend the game to people, or for when I try pitching to publishers for financing to finish the project.

Do it! Do it now!


Ahem. Moving on.


The Idea

As I’ve written elsewhere, Innkeep is fundamentally not a management simulation, even though it has some elements from that genre. It’s not so much about the technical challenge of running an inn, as it is about the experience of being an Innkeeper, about inhabiting a fantasy world from that perspective.

To help generate that experience, I want the player to get hands-on with things in the world. So, for example, when you want to serve somebody a beer, you have to actually grab a tankard from the bar, fill it up from a barrel, and give it to them.


This raises the question of where the barrels actually come from. Ultimately they arrive at the Inn via a visiting merchant (more on that another day).

But how do they get on your bar?

And what if there were more of them in storage? What would that look like?

My initial prototype answer was to create a kind of cellar GUI that could be accessed via a trapdoor in the floor.


(Look at that old Innkeeper sprite my goodness!)

I like this kind of diagetic UI, and have used it elsewhere (watch this space for an upcoming article on the Innkeep journal). This was quite early in the development process, at a stage where the bedrooms of the inn couldn’t be actually entered yet.

I was later really pleased with how the bedrooms turned out. They played into the theme of the game being about “revealing hidden things” (like eavesdropping on a guest to learn their secrets).

Following from that, I realized it would be a lost opportunity not to do something similar with the cellar. Rather than a wall fading away to reveal something behind it, I could have the floor fade away! An actual cellar could hold actual barrels, which the player could then physically grab and carry around. It was time to get to work.

The Cellar

First, I needed to create a cellar space that you could enter.


On top of that space, I turned the old floor into a kind of lid, which was faded out when the player entered it.


The Barrel

And on top of that, I needed to make some nice quality barrels.


Focusing again on that theme of “revealing hidden things”, I decided that the liquid contents of barrels should be visible by the player when they mouse over them with a “look” interaction (i.e. holding down the right mouse button), with the exterior surface of the barrel fading away. As the barrels progressively get emptier as they are used, the contents sprites would need to have lots of variations, to represent how full the barrels were.


Then I needed an animation of the player actually carrying a barrel.


This turned out pretty well!

For the cellar itself I added a rack which could hold a number of barrels, and made three stands on the bar which could each hold a barrel. The player could then simply click on a barrel to grab it, and when mousing over a “slot”, a semi-transparent barrel sprite would be drawn to show where it would go. Nice and intuitive!


The Problem

Here is where things get a little bit tricky. Draw order issues can be quite difficult when you are simulating a 3D space in 2D. By this, I refer to the sequence in which a sprite is drawn, which is used to represent ‘depth’.

So for example, if I draw the player sprite first, then on top of that draw a table partially over the player, visually we think of the player as being “behind” the table. Simple enough, but what if the player needs to be “behind” a floor sprite covering the cellar, while also “in front” of a seated character who is technically above the floor! Uh oh.

Clippingfixed 2

The issue was exacerbated by the size of the player sprite when they were holding a barrel. The image above shows it working fine (after the solution), but imagine the bench instead drawing over the top of the barrel, and you can see the problem.

Then on top of that, there was the barrel itself sticking out past the confines of the floor sprite. Realistically, the trapdoor and stairway were quite narrow for a person to go up and down while hauling a big barrel.

Clippingfixed 3

So what to do?

First, the draw order issue.

The simple solution to this was to draw the player twice. First, I drew the full player sprite behind the stone floor. This sprite would be under the seated guest. Next, I drew a cut-out version of the player sprite, just the top half, in the same location, but at a different depth. So this version would be drawn over the seated guest.


What we end up with is a kind of player sprite “sandwich” that looks like something 3D, even while the draw order required would be impossible to do dynamically in-game without this kind of trickery.

Fun stuff!

Second, the clipping issue.

To solve this, I actually made the barrel visually turn a bit as the player walks up or down the stairs. This required a whole new series of player sprites with progressively narrower versions of the barrel. Each of these versions needed its own unique 8 frame animation. Grind! But, together with a few other adjustments (such as narrowing the path the player could walk on) the result worked perfectly.


And there we have it. Barrels can be squirreled away under the floor, to be taken out when needed. Perhaps the player will buy a couple of special brews that are only for their most discerning customers. And perhaps, down in the cellar, where nobody can see, they might also mix a bit of water into the wine, and help it go further. :-)

Hope you enjoyed this little update! I'll follow up with another soon.

Do remember to drop by the Steam page and give us a wishlist!

Or, if you are feeling even more generous / excited by the game, visit my Patreon page. ;p

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.