See How to Set Up Garden Generator in Unreal Engine 5

Matthias Pressler explained how Unreal Engine's PCG framework helped him create the procedural garden generator and showed us the role packed level instances had in the project.

Introduction

Hello, I'm Matthias Pressler, an artist with a six-year track record in the interactive real-time industry. My path began thirteen years ago with a film apprenticeship, where I learned storytelling, lighting, and composition. A growing passion for 3D animation guided me to master tools such as Cinema 4D and After Effects on my own. Post-apprenticeship, I had the chance to shape visual stories as a Motion Designer for a TV channel, contributing to numerous campaigns and branding initiatives. This expertise led me to an award-winning agency where I joined a team dedicated to creating immersive experiences for events, shows, and product showcases, engaging audiences globally. Leveraging real-time engines like Ventuz and Unity, we blended 3D art with technical implementation to craft these experiences.

Unreal Engine 5

As Covid disrupted the industry, the 2020 unveiling of Unreal Engine 5 marked a pivotal moment, prompting me to explore new avenues. Drawn by the immense technical leap with Lumen and Nanite and inspired by a teenage dream of creating games, I began prototyping and diving into system design with Unreal Blueprints, crafting diverse prototypes. 

As my 3rd person prototype took shape, I delved into procedural world-building with Houdini and realized I missed working in a team. Game development is not a solo journey; collaboration is essential. Combined with my desire to delve deeper into the multifaceted world of game design, this led me to Breda University, renowned for its specializations in Tech Art and Game Design.

In my studies, I'm focusing on technical art, game design, VFX, and dynamics, further enhancing these core areas through leadership roles in collaborative projects. As the Lead in Technical and Art Direction, I was responsible for setting the artistic vision, managing set dressing and lighting, and developing pipelines and tools, while also becoming proficient with team management tools like Jira and Scrum methodologies.

Parallel to my academic journey, I collaborate with one of Europe's leading Virtual Production companies near my hometown, tackling diverse challenges head-on. I often describe myself as a fire extinguisher, always primed to address new challenges, particularly when there's a gap in team capacity. I thrive in diverse problem-solving scenarios, from Technical Art, creating tools and pipelines for faster-set dressing and world-building, to Technical Design for gameplay prototyping and system design, as well as crafting screen-shaking VFX.

I am passionate about crafting cinematic gameplay that enhances the game design and player experiences. Intent on applying my expertise, I am seeking an Internship beginning summer of 2024 at a gaming company known for immersive gameplay, setpieces, and dynamic environments.

Procedural Garden Generator

At the beginning of the academic year, I had to come up with technical challenges in the procedural world-building, VFX, and scripting categories, all within a time frame of two weeks each.

I was particularly excited to delve into Unreal's new PCG framework for the world-building challenge, aiming to leverage my Houdini expertise. The concept for the garden generator sprang from my personal game prototype, which featured diverse garden areas for players to traverse and employ stealth strategies. 

First I familiarized myself with the PCG framework by experimenting with the available documentation and skimming through various tutorials. In particular, I found valuable insights on YouTube channels such as Adrian Logut, Michael Royalty, FreetimeCoder, and UnrealityBites

Since the PCG is still in development, some tutorials contain outdated information. However, this was beneficial in some ways, as it presented me with challenges that further deepened my understanding of the framework.

Once I got familiar with the concepts of the framework, I started with the project.

In the beginning, it helps to do a rough sketch board of the logic components required for the project. I use Obsidian for all the project R&D, a note-taking app for my projects, and leverage its features of mermaid to visualize flowcharts. As the project progresses, I can return to the board to align it with my developments or new ideas.

The Sketchboard

Border Walls and Packed Level Instances

Starting with the wall and corner system, I drew inspiration from the Electric Dreams sample, leveraging packed level instances. For those unfamiliar, packed level instances function like prefabs, allowing you to create a container that holds geometry, which can then be instanced throughout the level. What's special about using this in the PCG context is the ability to tag, filter, and post-instance manipulation of different tagged meshes. This is a key advantage, as you can filter and transform meshes based on their tags.

This method is not only efficient but also provides a high degree of flexibility, allowing each packed level instance to have its distinct character when spawned using the PCG framework. For this project, I created two packed level actors: a straight wall and a curved one, both enriched with details like ivy, grass, and other objects. Utilizing curvature as a guiding principle, I placed these packed levels along the spline border.

All packed level instances for the project

Interior Scatter

For the interior scatter within the spline, I instanced different flower categories. I computed the distance to the path splines on the surface, converted it to density, and then used this density to determine flower spawns. 

By aligning the height of the spline, the flower scale and placement varied based on their distance attribute, allowing for more direct variation control.

Stairs Placement

For the stairs, I intersected the path spline with the border spline. After pre-filtering points near the border using a bounding box, I determined the closest points' direction relative to the spline points in a custom Blueprint. A classic dot product calculation ensured the stairs were oriented correctly, pointing outward from the border spline.

Path & Crossings

After setting up the ground, I positioned the path points to match those on the interior surface and removed points where stairs were placed. Using a Mesh Set, I selected various stones and step-rotated them incrementally by 180° on two axes for a diverse appearance. For the path crossings, I employed multiple actor tags on the splines and intersected them. After some cleanup to pinpoint the center, I placed the crossing, again, using a packed level instance. 

Final Overview of All the PCG Graphs

1. The ground, wall, and stairs setup:

2. The path, crossings, and grass between:

Diving into Custom Blueprints

Developing custom Blueprints for PCG was a significant step. The lack of comprehensive documentation on PCG's Blueprint components meant I had to rely heavily on self-experimentation. While some of the mentioned channels provided resources, the Unreal Discord server was a great place for asking questions. Fortunately, I also came across leftover Blueprints in the plugin folder, which helped me understand their setups and functionality. A notable achievement was replicating the Houdini Attribute Transfer functionality within Unreal Blueprints, especially crucial for the stair placement.

For starters, I can recommend this video by UnrealityBites on his approach to Mesh Sets. I used the concept in my tailored version, completed with a refined boilerplate/metadata initialization, and the incremental rotation placement used for the path stone placement.

Unreal Engine 5's PCG Framework

I think the PCG framework is becoming a foundational tool for procedural scattering. At its core, it functions as an advanced voxelizer, filling the world with customizable cubes driven by procedural rules. This approach is especially effective for basic scattering tasks and foundational world generation. Furthermore, its capability for grid-based generation fits perfectly with modular-level methodologies.

A prominent feature of PCG is its performance, underscored by its real-time iteration capability. This rapid feedback mechanism is vital for procedural world-building, establishing PCG as a go-to tool for basic scattering. However, it's important to emphasize that while PCG offers a robust suite of features, it doesn't replace Houdini in the pipeline. Houdini's capabilities, particularly its direct attribute manipulation via wrangles, remain unmatched. In contrast, certain aspects of PCG can feel cumbersome, particularly when interfacing with custom blueprints or managing data streams.   

Considering that PCG is still in its beta phase, I'm optimistic that future updates will refine these areas, further enhancing its compatibility and features, including its synergy with the geometry script framework.

In my view, while UE5's PCG framework has advantages, it complements, rather than replaces, tools like Houdini in the pipeline.

Conclusion

The project took me about two weeks to finish. During the first week, I familiarized myself with the PCG framework and explored its features and capabilities in-depth. The following week was dedicated to the garden generator, where I concentrated on configuring the PCG Graphs and implementing the required adjustments. Then a bit more time to polish it here and there.

A notable challenge was integrating custom blueprints and effectively managing data set flows. My experience with Houdini played a crucial role, ensuring a streamlined workflow and helping me tackle many of the project's challenges. Drawing from this, I'd advise newcomers to the procedural domain to familiarize themselves with Houdini's concepts. It provides a strong foundation in procedural techniques, which is invaluable when diving into PCG advanced features, especially those beyond basic scattering.

Matthias Pressler, 3D Artist

Interview conducted by Theodore McKenzie

Join discussion

Comments 1

  • Reddy Rohan

    Wonderful explanation!

    0

    Reddy Rohan

    ·5 months ago·

You might also like

We need your consent

We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more