Devlog #4 - Window System

Posted by Ponzel on 2025-06-26

Hello everyone!

Let’s talk about the window system for HavenCraft. Last time we talked about the construction system and windows are a huge factor in how your buildings look.

Besides, I think our system is pretty cool!

Standalone Windows or Windows + Walls?

This is the first question to answer when it comes to window building. For a while we had a simple, Minecraft-like solution where you place the window like any other wall piece.

In Minecraft, windows are just blocks. Simple!

The beauty of this solution is that it’s simple and requires no programming. A window is just a wall, so there is no new feature needed. The drawback is of course that windows are restricted to square shapes, like the walls.

This is not enough for us, so our solution has to be that you place the walls first and then place the windows into the walls. This is a bunch more complicated to do since you have to cut an arbitrary window shape out of the wall 3D model, but the result is well worth it.

This is basically a more advanced system of what we did in Founders’ Fortune. And boy, is it more advanced 😉

Left: In Founders’ Fortune, doors and windows were cutting a simple hole into the wall.
Right: In HavenCraft, we support hole cutting, too, but with arbitrary window shapes.

Bigger windows

We realized pretty quickly that rounded windows can look nice, but if they’re only restricted to cutting holes into a single 1x1 meter wall, houses will be pretty dark and boring. 1x1 is just not a big enough space to let enough light in or to make any kind of interesting window shape.

So instead, we had to add support for bigger windows, like 1x2 or 2x3 or even larger windows. This involves a lot of math and programming, particularly in 2 areas:

  • When placing a window, make sure that there are valid walls in the whole window area
  • When cutting the holes for the window, cut the right holes in the right walls.

The first is just a lot of boring code, but I want to show you how we solved the latter issue: In order to cut the holes into the windows, we created a “hole-texture” that defines all the different kinds of holes which can be cut into the walls:

The “Window Hole Mask Atlas” defines the shapes of holes to cut into walls to make space for the windows.

When you place a window, the program checks the window config file, reads which holes need to be cut, calculates which hole to cut into which wall, and then applies the cut.

And here you can see the result!

Large windows can now stretch over multiple wall tiles.

Window Rotation

Once we’ve designed the system for cutting arbitrary holes into the walls, we realized it could be used in much more ways than first intended. The hole shape is given by the hole texture. There is nothing stopping us from just rotating that texture!

There was some math and code required, but once it was figured out, you could rotate any window any direction you like. I hope we’ll see players make some creative builds with this system.

You can rotate windows on the wall however you like.

Window Flipping and Modular System

Ok, ok, so rotation is nice, but can we use this system to make a full-blown sandbox window building system? Where is the limit?

We figured there was at least one more feature we should definitely implement. When you press ‘F’ you can flip the windows.

Why is this cool? Because it enables you to build all kinds of interesting shapes from a couple of basic windows. Take for example this circle segment:

With a little bit of rotating and flipping, you can create all kinds of unique window shapes. You can make your own cirlce, a rounded top, a narrow window slit, etc.

With rotation and flipping, you can make all kinds of windows out of a couple basic shapes.

The only thing that’s not quite ideal about this solution is the window frame placement, it won’t look as good as with the pre-made windows that are not as modular. We could spend a lot of time developing a perfect solution for this, but probably the best course of action is just releasing the system we have for playtesting and seeing how much it gets used.

Drag building: Also for Windows!

And lastly, you might remember the last post about being able to drag-build anything: Of course you can also drag windows!

At this point, I’m so used to drag-building that it would just feel weird and cumbersome to not have it for the windows, so we went the extra mile and implemented that, too.

Bonus: Triangle Wall Building

Last week someone in the community sent me a file called “add_this_asap.jpg”:

If you’ve checked the main homepage you too may have noticed a lack of proper triangle wall shapes under the roof. I’m happy to report that as of this week, proper triangles for the roofs are supported. And the building system is pretty nice, in my opinion:

We’ll update the homepage with new images in some time. First, we’ll develop some more things and then we can update all the pictures at once.

What are your thoughts? Let us know if you have more cool ideas about window building!

Subscribe by Email Discuss on the Forum
Imprint Privacy EULA

Copyright © 2025 Dionic Software.

All Rights Reserved.

Copyright © 2025 Dionic Software. All Rights Reserved.