The concept
During my study, I have a few weeks time to work on personal projects. Since I want to learn more about Unreal and it’s environment tools, I decided to make a landscape from scratch.
First, I decided upon a mood. Personally I like magical and mysterious landscapes. Landscapes that tell a story themselves. So I ended up searching the world wide web for beautiful environments.
To make sure my landscape was as close to realism as possible, I searched on holiday trip advisors for the perfect lake. I used the real life data for the generation of my own landscape inside the Unreal game engine. To make sure all the biomes are on the same positions as in real life, I used the google maps data and placed it onto the landscape. I could have used this data later for the placement of the foliage but I decided that I wanted a little more artistic control over it.
Procedural Content Generation (PCG)
For this project I wanted to make everything as procedural as possible. Especially the foliage. For this I used the PCG toolkit provided by Unreal. This toolkit uses node based principles to place and adjust actors.
After a few tests I realized that I could make this proces easily adjustable using the landscape material.
I made a PCG graph that can sample the landscape material for its layers. Depending on these values, it places different types of foliage. For example, in the image above the grass is only being placed on dirt. And the chance of rocks is higher inside the river. And tree’s are never placed inside rocks. And of course, this is a simple example. But this is the basic idea.
In the final version I added different types of tree’s, removed the hard edges between materials and a lot of other quality of life updates. In the end, this toolkit could provide a semi-realistic placement of foliage on my landscape. It even provided a lot of optimization settings to play around with.
AI agents and procedural animation
For the video I wanted so characters to walk around in the world. And to challenge myself, I wanted the characters to be procedural as well. So I decided to create my own AI agents.
AI agents are a big thing in the gaming industry. AI agents are (semi) intelligent actors that can make choices of their own. They can have their own internal needs and routines. In the example below I told them to pick a random spot they could reach and walk towards it, taking into consideration height differences and other agents. This simple test immediately gave some sense of chaos. Something that is difficult to achieve using premade animations.
Another advantage of using AI agents is the scalability. Not only can AI agents make their own decisions, they can also change their appearance and animations.
When a scene is loaded, all agents in the scene pick a random skin. In my example I have 4 skins, but this can easily be added. I also did some experiments with subtle texture differences per agent. For example allowing each agent to have a slightly different color of clothing. Or let them hold different items.
For the animation I used 4 different walk cycles. But I let the AI agent blend between them. For example, I had a idle, a walking and a running animation. Depending on the speed, the agent can bend parts of the animations to make one that fits his speed. I also made it so that each agent had a personality. Some have a confident walk, while others are wounded. All of that was randomized as well.
The downside of using procedural animations is that a sudden change of speed can result into unwanted snapping between animations. This is something that needs further research.
The result
At the end of the day, you’re working towards a result. So after 5 intensive weeks I pressed the render button one last time. No work will ever be finished, but I am quite proud about the end result. This scene runs at a stable 25 frames per second on a mediocre PC. So on a real render node the performance is good enough for virtual production.
It is impossible to explain every technique used to create this video. But I hope I explained something about the proces in general. If you want to know the details, feel free to contact me about it.