Floors and Walls

Floors and Walls

Welcome back! The last time we checked in on this game we started building out Rob’s house, marking our first entry into the actual Godot file. We created some basic movement code for our main character, as well as made a bunch of furniture to outfit the house with.

For this update we’ll be focusing on improvements to the house, the primary one being that we have some starter walls and floors now in place. Here’s a zoom out of what Rob’s house looks like so far.

The Floors

Rob’s house now has two different floors in it. His bedroom and the living room share a wooden floor look, while the kitchen has a tiled look. Both floors (as well as the new wall, but more on that later) are viewable here:

 
 

Both of these floor plans are really just a 32x32 pixel square that repeats over and over again. The repeating sections are isolated here:

 
 

I experimented with a few different strategies for the floor plan. One issue new to the floor plan that makes it different from an individual sprite is that since it is being created to be repeated over and over again to make up unlimited floor, the shading of the individual piece of floor is self-contained to a 32x32 area.

For contrast, look how this much larger rug is shaded. There is an overarching shadow system across the rug as a whole. It is lightest in the top right, and darkest in the bottom left. As an aside - I believe this rug is the only new piece of furniture featured in this post - I like it!

 
 

In order for the floor of Rob’s house to have a holistic shading mechanism like the rug does, we’d have to draw that shading by hand. Essentially, the floor would become one big piece of art in the same way the rug is a big piece of art (though the floor would be a lot bigger).

Instead, the floor is one repeating 32x32 square, and so the shading of the floor focuses on making the individual wooden planks stand out.

The benefit of this approach is that we can change the shape of Rob’s house at will. Look again at the zoomed out house:

In the above picture, imagine the sun is shining into the house from the top right. Looking at the house zoomed out, I think it’s a little easier to see what the contrasting approaches to doing this would be. If we shade the floor, then the shape of this house needs to be set. Once it’s set, I could draw in whatever shading I wanted directly onto the floor, but once that shading were in place, changing the shape of the house would destroy the shading logic.

Instead, we have worse shading on the floor, but the ability to paint in more floor really easily (since really, our floor is one repeating 32x32 square).

This flow of decisions is also why I decided to create a rug - since the floor itself has unrealistic shading, the house as a whole looks more realistic the more stuff is on the floor. E.g., instead of an unshaded floor, I put a shaded rug on top of it to add life back into the monotonous floor plan.

With that said, I definitely did take a ‘okay, let’s get ANY floor down just for starters’ approach to this. Maybe this floor will end up shaded eventually, but for now it is what it is and I’m happy enough with how it’s improved so far.

The Walls: Getting into tilesets

Similar to the floor, the walls consist of a series of 32x32 tiles. The set of tiles you can choose from are shown below, and are what make up the ‘tileset.’ Godot calls the actual node a tilemap, and the texture that it uses a tileset, but outside of godot you’ll see these called tilesets too. Regardless, the point is that we paint the walls in 32x32 chunks, and each of those chunks can be seen below. Our floors were technically tilesets too, but they only consisted of one tile.

 
 

Below you can see an example of the wall painted in. It looks a little busy on its own, but as you add furniture in the little scuffs become less numerous.

 
 
 
 

Zooming out one last time to take a look at the walls, note how in the image below you can only really see the back wall. I’m not sure how this will evolve over time, but the perspective of the game is something I’m evaluating as I go. This look feels acceptable to me right now.

And finally here’s the kitchen and living room so far. I still need to add a front door.

 
 
 
 

And that’s where we’re at! The thing I’m working on right now is making a kitchen mat so I’m still focused on improving the look of this house. I imagine there will be some new furniture in the next update. See you then.

Getting into dream world

Getting into dream world

Starting the Godot file

Starting the Godot file