Institute of Computer Science
  1. Courses
  2. 2023/24 fall
  3. Computer Graphics (MTAT.03.015)
ET
Log in

Computer Graphics 2023/24 fall

  • Main
  • Lectures
  • Practices
  • Projects
  • Exam
  • Results
  • Links

A Simple Procedural Scifi Landscape

Kertu Toompea, Anna Prudchenko, Elias Fiedler

A simple procedurally generated sci-fi landscape in runtime. For example for a game where you fly above the landscape that seems to be infinitely generated as you move into further distances. The goal of this project was to learn the basics and a good practice how it is done. The project is made with Unreal Engine 5 and uses the PCG framework. The landscape itself is a procedural mesh (not the UE Landscape) and spawning additional meshes on the landscape is done using the PCG Graph. All final meshes in this project are created within our team and are part of the work.

The initial idea was creating a small peace of actual UE Landscape component that looks unique, and then procedurally generate a similar looking landscape from it. This turned out to be too large work for the course project. Instead, a new landscape was created from scratch.

  • Video
  • The current final build (21.01.2024): download link
  • Cgvrgit repository

Tools and roles:

  • Anna Prudchenko (Windows) - All custom meshes and materials creations, Blender.
  • Elias Fiedler (MacOS) - All git struggles, procedural spawning, final video and presentation.
  • Kertu Toompea (Linux) - Landscape, PCG mesh landscape in runtime, project lead and idea.
  • Unreal Engine 5.3.2 (for all members)
  • External plugin used: Fast Noise Generator

Progress shortly:

  • Landscape created (the Landscape component)
  • Meshes added for the ground and in the air
  • Sculpting in Blender to create own custom meshes
  • Learned basic object manipulation and blueprints in UE5
  • Learned about procedural content in UE5
  • Learned about creating landscape from other meshes
  • Switched from the Landscape component to PCG component
  • Created PCG landscape for "infinite" generation in runtime
  • Added PCG Graph to spawn custom meshes on PCG landscape
  • Added spawning meshes on PCG landscape in runtime as the player moves

Progress in more detail (click to expand)

First, one initial peace of landscape was crafted in UE Landscape mode and a few floating rocks were added. For a scifi look, one purple color theme was used and some unnatural looking landscape features were intentionally included. At this point several materials were experimentally created - one for the main color and a mat ground surface, one for glowing rock, one for translucent rock, one for mossy rock. A custom tree shape was sculpted in Blender and different textures were tried. A suitable texture for a scifi looking tree was a bit of a challenge to find and preferably creating a new custom one was considered. Here it appeared that some interesting textures do not play out well on such a detailed shape tree and tend to "hide" the crafted details that were meant to be preserved.

Initial landscape in UE5 with few floating rocks. No procedural generation yet.
Initial element on ground - a tree made in blender.
Floating rock with rocky tree.

The next step was creating the custom art content and the PCG content. All meshes for spawning on the landscape and all their materials were created in Blender and after experimenting in UE, also adapted as the performance issues came out. It is important to note that all the team members used a different operating systems and had very different hardware to run the UE, therefore facing different issues with plugins, performance, speed etc. In this stage, also experiments with different PCG spawning were done, including discoveries about some methods being only for the UE Landscape component and not for the PCG mesh component. Here, also the switch from the UE Landscape component to the PCG component was done as it became clear it will not fit into the course project time to figure out how to sample the existing Landscape in such detail and then use this info to create the same looking landscape infinitely in runtime, using the UE5 PCG approach.

Landscape

The "landscape" is generated from chunks. Chunks are created vertex by vertex, triangle by triangle, using Procedural Mesh Component. And some noise is added to make it look more interesting (instead of just varying the height randomly with the z variable). Finally a deliberately simple basic unicolor material is applied. The landscape is created in two different BP-s.

The landscape chunk creation happens here
The landscape creation in runtime happens here
PCG landscape generated in runtime - small size path as the player moved

Tree

The initial custom tree mesh has been modified to achieve reasonable performance. I reduced the number of vertices and triangles on it so that the mesh would not load the computer too much. The lava material was also created, which makes our tree more fantastic.

Tree

Tree animation

A small animation was created for one tree that can move and move its branches.

Tree animation
Video of the tree animation

Stone

When creating this mesh, a lot of work was done with the material. The mesh itself was made in Blender and it was not complicated. The material was supposed to convey transparency creating a crystal effect, but I played with the settings and made the stone more sci-fi. I thought it would look better this way.

Stone

Portal

The portal mesh is a regular flat sphere. The very effect of this mesh creates the material. Also, to make it more realistic, I created the Niagara system, which is needed to visually improve our mesh.

Portal

Spawning on landscape:

The PCG Graph to spawn stuff on landscape
Spawned stuff on landscape - Grass closeup - looks cool :)
Spawned stuff on landscape - Overview from distance

The last step was to finalize the project, make the video and the build. The last moment problems with runtime, settings for acceptable performance and capturing the wished content in the video, made it an intense finish run. Decisions were made to not go into implementing "the better solutions" and wrap it up as is. No optimizations (just a bit of changing some parameter values). It is a working prototype.



How to open the project if you don't want the build:

  • Use Unreal Engine v5.3.2
  • Open the .uproject file
  • If prompted to build the noise plugin for UE5, press Yes
  • Runtime landscape: Run play and fly above land with WASD keyboard controls

Problems:

  • Setup issues
  • Performance issues (incl complexity of custom meshes but not only)
  • UE5 beta components lack of documentation issues
  • Assigning materials to meshes (sometimes materials were applied with defects)
  • Making the infinite landscape for runtime from an existing peace of landscape
  • PCG mesh type of landscape and runtime spawning - lack of documentation
  • Finding the right approach to spawn meshes (started with painting grass on landscape and using Procedural Foliage Spawning, changed to PCG)
  • Flickering of spawned PCG components in runtime

Successes:

  • We achieved what we set out to do:
  1. Use as little predefined meshes & materials as possible (none at all)
  2. Procedurally generate landscape and foliage
  3. Create alien-like landscape
  • It was creative and interesting:
  1. Creating interesting materials for meshes
  2. Creating sci-fi meshes for alien terrain

Suggestions noted:

  • Procedrual Mesh Component approach in PCG is a bit old by now (UE 5.3.2).
  • Consider the new Geometry Script tools as an alternative approach.
  • Split landscape generator and PCG actor to two different actors. Make a landscape generator spawn PCG actors on top of landscape chunks. Make one pcg actor for each landscape chunk. Don't move them, just spawn and generate.
  • You really don't want to be trying to generate a pcg every tick.

Sources (that were most useful for final result):

  • https://docs.unrealengine.com/5.3/en-US/procedural-content-generation-overview
  • Unreal Engine 5.2 PCG Tutorial - Using a Height Filter to Place Trees on a Mountain
  • UE5.2 PCG - Short Ep 1 - Sampling on any static meshes
  • Terrain generation for Beginners - Unreal Engine tutorial (and all the videos for this topic in this channel)
  • Videos by Aziel Arts
  • Unreal Source Discord
  • And the help from our project coach Ats Kurvet.
  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment