Procedural Building in Unreal Engine 5
A procedural building is a set of rules that generates the shape of a virtual structure. This method is used in a number of applications, including the creation of buildings, landscapes, and more.
Many development efforts aimed at ruins’ virtual reconstructions in full VR environments have relied on this methodology. However, addressed approaches tend to be time consuming and oriented towards squared/rectangular shapes.
How it works
Basically, the building system works on a volume of a mesh, and it uses a set of rules to decorate the mesh. The rules work by extracting rectangular regions of the face of the building, and then using a library of feature meshes (such as doors and windows) to fill those regions.
Procedural buildings also allow you to use complex shapes. For example, you can take a character mesh like Suzanne and drag-and-drop a Preset on it. This will make PBG 2 create a building out of the mesh. PBG 2 is also a lot faster than its predecessor, and offers more functionality, such as simulations.
It is recommended to group building volumes together for performance reasons. You can do this by assigning the same Base property to several volumes or using the context menu ‘Group Buildings’. StaticMeshActors that are attached to ProcBuildings automatically have their Base property set to the ProcBuilding’s default value. This can be disabled with the bDisableAutoBaseOnProcBuilding property on the StaticMeshActor.
Creating a ruleset
A ruleset is a collection of rules that help you organize business logic into a set of related functions. This allows you to distribute the same rules to multiple applications at once and avoid duplicate rule processing. A ruleset can also be used to manage parameters that are exposed in building mesh Materials. This can be useful for tinting walls on a per-building basis, for example.
A ruleset can be saved to a file, exported for use in another project, or deployed to a deployment. However, the ruleset must pass validation before it can be used in a deployment.
To create a new ruleset, select the New Ruleset option in the Workspace view toolbar. Then enter a name for the ruleset. The ruleset name must start with a letter and can include letters (a to z and A to Z), numbers (0 to 9), the following characters: “,”, “-“, “_”,””, “:”, and “/”. The rule must have a valid description and a definition.
Using a ruleset
Procedural Buildings work on the level of meshes, and so can be modeled using standard geometry nodes. This gives it more flexibility than traditional procedural modeling, and can be used to build a range of different buildings in the same package. This new method also allows designers to easily change the color of a building’s walls, or add a variety of windows and trim to the same structure.
Rulesets provide a unit of sharing for rule sets; rules are grouped into a set and executed based on the conditions in a given rule set. These conditions include the rule preconditions and exit conditions, and may be manipulated through a ruleset stack.
Some rules can even be re-run after the current building generation, which is useful in cases where the exit conditions for the previous run are not met. This is referred to as restarting the ruleset, and it can be enabled by setting the “Restart Ruleset” option.
Creating a building
Procedural building is a new feature in Unreal Engine 5 that lets you create buildings using a simple set of rules. It works on a mesh, and updates in real time. This can save a lot of time over modeling a building by hand. It also allows you to change your style at any time.
It uses a combination of simple shapes to define the building layout, and a library of feature meshes (doors, windows, columns etc.) to decorate it. It can even generate LOD textures for each of these. It is an exciting new technique that could be used for a wide range of applications, including maps.
The system can easily handle large buildings. Its main advantage is that it combines the benefits of procedural design with an object-oriented approach. It is a great tool for game developers who want to add buildings to their environments without having to manually model them by hand.