Role(s): Tool Designer

Team Size: 1 person

Game Engine: Unreal Engine 5

Dates: July 2024 - August 2024

Building Interior Generation Tool

A tool that allows designers to create custom buildings

What I Did Right

What I Did Wrong

What I Could Do Better

As a fun introduction to Unreal Engine 5 programming, I wanted to make an apartment generation tool that I could use the framework for in other projects. I was inspired by Rockstar’s patent on their System and Method for Game Object and Environment Generation, something that I imagine they will be using for Grand Theft Auto VI. I read the patent front to back, taking notes the entire time, and the main takeaways I got from it is that objects are broken down into smaller objects, and that the system itself is incredibly open-ended. Another major inspiration was Epic’s Procedural Content Generation tool, specifically how intuitive it is to generate objects, despite the amount of different variables that can be tweaked. My main goal for this project was to create a tool that paid homage to these companies’ tools, while being significantly less complex.

To start, I decided to divide the apartment building into hallways and apartments. From there, I divided each apartment into different rooms, and then generated each of those rooms’ dimensions. In order to lay out these rooms in a believable order, I looked online and found a room layout that looked small, square, and realistic, with a variety of different rooms that I could put in. Altogether, the apartments generate a combined living room and kitchen, and a bedroom, hallway, bathroom, and utility/laundry room. I also programmed some debug features so designers could see how these rooms were laid out in action.

I decided to differ from Rockstar’s tag system of organization, and created a unique numbering system instead. I find the way that Unreal Engine spawns actors in to be incredibly unintuitive, with the actors all being named the same thing, with no real inheritance or organization. In order to solve this, I programmed some basic custom C++ functions that I could incorporate into my visual scripting. I decided to format each object spawned as [ClassName]_[Suffix] (UAID_[PointerAdress]). The reason why I needed to include the UAID into the name was because Unreal would crash when spawning actors of the exact same name. My guess is it has something to do with the way the actors are stored in memory, but I couldn’t figure out exactly why. For the suffix, I decided to number each object, which helped from a programming standpoint, as I had a function that could extract those numbers and let me do things with them. As an example, if I needed to make sure that only the first floor had doors, while the other floors had windows, so my numbering system came in handy.

Create Actor Script

For the meshes that make up the apartment building, I used Unreal’s Geometry Scripting. I made custom functions to try and make creating walls, floors, and ceilings as simple as possible, with lots of variables related to doors, window amount, window size, direction of the wall, material, and whether or not the wall is double-sided, along with many others. The linked visual scripting shows how I generated the living room, and each room in the apartment has different parameters in order to properly generate.

One of my main goals was to make this tool designer-friendly while not skimping out on advanced options if a designer wants to be very specific. With that in mind, I tried to keep technical information to a minimum, with a single button for generating the building, and some floats and vectors to determine appropriate dimensions. For materials, I created an array for each possible material, and the program randomly picks one when generating.

Overall, after 2 months, I created a pretty decent apartment building generation tool! A designer could use this tool for way more time-efficient city generation, because each version of the building blueprint works independently. This project helped expand my programming and visual scripting abilities, in addition to giving me a great crash course on the unique quirks of Unreal Engine. I definitely feel a lot more comfortable messing around with the engine now, and am excited to see what I can create in the future!

Sources: