Houdini Lego Tool: Breakdown

Making Of / 14 December 2019

Few weeks ago I made a simple LEGO tool in Houdini. I decided to do a little breakdown about it.

The very core of this tool is only 4 nodes. Pretty simple right?

The first node creates a VDB volume from your input mesh. Next, we convert the 3D grid of the voxels into geometry. When we have the geometry we can extract the centre point of each little cube out of it. So now we have 3D point cloud. The last step is to literally put any kind of mesh you want and use the copy to points SOP.

If we leave it like that the object can only be build with 1 type of Lego brick. That's why I decided to push it a little bit further (Since the first step was so difficult).

Brick Variations

This was the part i had the most trouble with. I wanted it to support any kind of the basic Lego bricks, so doing calculations by hand seemed not like the correct approach. The solution I came up with allows for any kind of convex shape on the X, Z axis. Which is pretty good I think.

We start with slicing up our point cloud for every row of points.

Then we go in to a nested for each loop. One will loop over the different rows and one will iterate over every point in said row.

What I do in the second loop is moving a template shape around and see where it matches the points. The matched areas get marked and will be merged together into one point. So in the example below I'm basically looking for an area within the point cloud were a 2x4 brick would fit in.

The downside is that for every shape we want to look for we have to loop through the points. Granted only the first time will be the most intensive loop. In my examples I searched for 2 shapes. The 4x2 and the 2x2 Lego brick. The remaining points in the end got the 1x1 brick.

I get that this might come across as a rather brute forced solution, if anyone has a better approach please let me know!

Brick Tool

I also made a basic brick tool that would let me generate some of the basic shaped bricks. This tool allows for 1x1, 2x3, 2x4 and 2x2 bricks. It could easily be expanded to support other types but it wasn't really the focus of my experiment here. Albeit, it was still fun to make.


After all that is finished we can achieve the following result!

Btw, to get the colours you can use the SOP Attribute From Map.

Then the only thing left to do is...


(I'd love to render out a video where I trash the cathedral Lego model, but it takes ages!)

Shinrin: Tactical Turn Based Combat

Work In Progress / 13 December 2019

I decided to do a little write up on this project because even though it has been dormant for the last few years, it's still an interesting showcase of my experience with UE4 Blueprints and C++.

Everyone has these passion projects, Project Shinrin is mine. It's supposed to be a tactical turn based rpg with an Total war-like world map and XCOM-like combat. But we're not here to talk about game design.

If you want the tl;dr version, this video below was the last one I uploaded. It showcased how my system was relatively well implemented since I could make two AI teams battle each other without much alteration in the code.

Here is the playlist with all the videos I uploaded:

When I started out I researched different pathfinding techniques like A* or Dijkstra. Which was very interesting and I remember having a lot of fun with these. I made everything in blueprints at this point.

 I just added and changed stuff as I liked without really focusing on getting a prototype completed. Like for example a map editor. Which was totally not needed at this point. But the idea intrigued me.(See playlist)

After I began to run into performance issues I started to rewrite almost everything from scratch and the interesting part is that I moved all my base classes and the more heavier functions (like pathfinding) to C++. Which was a huge performance help.

Ultimately the obstacle that made me stop working on it was a good Ability framework. While most things worked okay-ish, the one part that was still very ugly coded was the combat/action phase. I was trying to find a way to create a solid framework for it, so I didn't have to rewrite everything 5 times. In the end I never got this to work and I think I also managed to break some stuff after trying to implement Unreal own Abilities system in my project.

  I hope I can work on this or something similar again in the future.