Nabil Kechiche talked about the production of a street scene in UE4 made for his new Game Environment Design Masterclass: work with Unreal Blueprint spline component, modular approach, use of Megascans, storytelling, and more.
In case you missed it
You might find these articles interesting
Hi, my name is Nabil Kechiche and I'm a freelance Technical Artist from Sousse, Tunisia.
I completed a multimedia degree at the University of Sousse last year. Right after my graduation, I joined Hadean Supercomputing Ltd as a remote technical artist where I was able to contribute to the art side of their tech demos showcasing complex multiplayer worlds that sit outside the confines of player counts. Given that their tech demos used server-side simulation to massively increase the number of player, AI, and physics entities, the demand for traditional renderers to keep up was quite extreme. This meant that creating a high fidelity environment was challenging and required a lot of tricks to pull off something that both looked good and remained performant for several hundred thousand entities (some very good news coming from Hadean and Minecraft recently).
I mainly do programming but when I was very young, I used to enjoy playing games that support modding and world-building – especially RTS. So instead of just winning games, I would spend plenty of hours building huge cities. When I got introduced to Unreal Engine around 4-5 years ago, I had been building small scenes. I then joined an RTS project called Edge of Chaos as a co-founder. Edge of Chaos is an ambitious next gen-RTS drawing thematic inspiration from Age of Empires 2, Battle For Middle Earth, and the Warcraft series and technological inspiration from Company of Heroes. We’re currently working on a kickstarter and will announce the date for it soon.
In order to work full time on my game project, I had to find a solution that would allow me to get some passive income during the next months of crunch while getting Edge of Chaos ready. The idea of an online course looked like the best way to go. So before building the actual course I made a quick scene in 3-4 days.
I posted the results on social media to get feedback and measure receptivity. It was overwhelmingly positive, so this motivated me to create a more polished, detailed version of the environment and a course walking through the full 45 hours of every step.
For the references, I only used a few photos so I could have a starting point for this small scene. Then I unleashed my imagination to guide me through the rest of the level. The end result looks very different, but if you look very closely you will be able to notice that many ideas were taken from the references.
Planning for this level was very straightforward:
- Choose some references
- Pick the best elements, e.g: the road with the cobblestone and the drying autumn leaves, the street lamp, the tunnel entrance and the mysterious light at the end of the tunnel, the pipes on the building's wall, the wall texture and how it blends with other textures).
- Connect these different elements while trying to deliver a visual narrative. It’s a bit like putting a puzzle together.
Blocking Out the Road
Since the road occupies almost half of the screen (along the curb and the roadside), I wanted to start with that first.
For the road, I wanted to have full control over how it's placed and the best, standard way to achieve this inside Unreal was to use the Unreal Blueprint spline component as the video below shows:
For the curbs, I wanted to re-use the spline component with the only difference being, instead of creating a new procedurally generated long mesh, I made sure to create new blueprints that instance and scatter the curbs along a curve like the following:
Another thing you can notice is, the curb splines instance two different curb models to create variation. I made sure the logic uses a score variable to decide whether to spawn the first instance or the second. When an instance is spawned twice in a row, its score becomes so high that the code has a high probability of spawning the other instance next. All of this is controlled through some exposed parameters to give the level artist (in this case, me) more control.
In addition, I made sure that the curb splines allow manual placement of different curb variations as the video below shows:
Finally, the roadside is actually very similar to the main road. The only difference is the spline, instead of sweeping one single modular mesh, spawns at each step one of two variations.
This is because the roadside planes had small rock details and if the same piece is placed many times in a row it will make repetition very obvious.
And for the rest of the scene, I tried to use some quick modular pieces and Unreal built-in geometry editing tools to blockout the general shape of the scene (we will talk in a bit about the modular pieces).
After analyzing the references I knew I’d need pieces like the colored ones, e.g.: a simple wall, a wall that supports a window, a bottom part piece for the wall, a tunnel entrance, some bricks, a modular roof piece, rock pillars, and a corner version for some pieces like the bottom part. Some pieces were made when I needed them or when I felt like some areas of the scene needed more details: e.g. the roof pieces.
The total number of modular pieces is 21, made using 3ds Max.
As you can see, modular pieces for the buildings have two varieties: stone and bricks. Even though later in the engine I planned to make them share the same material instance, the reason behind that was to follow Megascans tiled textures, transform some of the details to actual geometry and break the flat volume to create good shadows later.
Like in the video below:
If you want to recreate similar details inside 3ds Max you should follow the steps below:
- Use the cut tool and follow the texture pattern.
- Select all cut pieces and use shell modifier; make sure the inner amount is slightly higher than 0 (so the small pieces intersect a little bit with the parent geometry) and enable select inner faces (so when you move to editable poly mode you should have them selected by default).
- Add edit poly modifier and delete the inner faces.
- Make the cut pieces smoother by using chamfer on the edges and then weld points.
- Finally, use the pro-optimizer with keep textures and UV boundaries options enabled and reduce the polycount percentage a little bit; usually, 90% will be fine.
Finally, these modular pieces were used later in the engine to replace temporary geometries or to help finish the structure of the buildings.
I tried to use Megascans assets whenever worthy or needed but I always end up tweaking the textures, especially the base color and roughness, and also contrast, brightness, etc.
Filling your scene with many unique assets doesn't necessarily make it look much better. Rule number one when it comes to level building: BE CREATIVE WITH WHAT YOU HAVE. Try to reuse every resource you have as many times as possible unless you feel like importing or creating a new asset will contribute a lot to the overall scene.
Below are some examples of some Megascans assets I used:
Mostly assets that can be used in a street environment where everything looks abandoned and a bit destroyed. The cactus plant is fairly self-sustaining so it's one of the few plants that make sense if placed in this environment, especially near the windows.
In this scene, I only needed two types of vegetation: a basic street tree and some ivy. For the tree, I used the default SpeedTree example.
For the leaves, I couldn't spend additional time recreating them from scratch, so I decided to pick the closest asset from Megascans:
But I couldn't use this asset in its default state because green vegetations wouldn't fit in such an environment, so I ended up tweaking the base color inside the material instance in a way to achieve a more yellow/orange color:
I tried to place the ivy in a smart way, either to 1) create some contrast:
2) Hide seams and intersections:
3) Connect the orange leaves texture on the ground with the wall ivy and give more volume to the 2D texture:
4) Give windows more variation, by scaling and transforming the ivy in different ways:
5) Make the pipes network look more interesting:
6) Link assets attached to the wall in a more realistic way:
7) And finally to create interesting shadows (and show how these powerful plants can climb anywhere!):
I divided my master materials to the following:
I will start talking about the master ground first (used for both the road and the roadside).
So, if we look very closely at our reference road, we will be able to notice 3 different textures: Asphalt, Cobblestone, and the orange/yellow leaves.
To replicate a similar look inside Unreal Engine we can use vertex colors to store some masks and then use it to blend the different textures:
The blending uses the mask stored in the vertex colors as a transition phase for a height lerp with two heightmaps (so we will get a realistic blending that takes into consideration the height of each texture), like in the video below:
In addition to the textures blending, in order to make intersections less sharp, I used the last available channel (alpha channel) as a mask to drive the Pixel Depth Offset (mixed the alpha channel values with a noise to break the smooth gradient look).
And this is how it looks with the pixel depth offset blending:
The curbs material is a simple material with two features:
The first one is that it blends in the same leaves texture on the road based on a vertex color mask that stores where the leaves can appear and based on a world space noise (so each curb will have a unique leaves pattern to it).
For the second one, since those curbs are instanced it gave me the possibility to use the per instance random to give each curb a unique color brightness (a very small variation).
Check the video below:
And for the wall master material, its core features are very similar to the road when it comes to textures blending (painting vertex colors and 2 textures height lerp).
The only special feature is the bump offset (aka Parallax Mapping) which allows displacing the textures coordinates based on the view angle and the height map in a way to give some “fake” depth to the rendered polygon.
Check the video below:
Placing Details Logically
Whenever the player looks at any corner of the scene it doesn't need to look only cool, but it needs to make sense. Let's discuss the following examples:
If you look at this image, you’ll be able to instantly notice that the destroyed wall makes sense since we can see some debris (contains rocks and some pipes) below it:
The pipes network needs to start from somewhere, right? And it needs to make sense (I used a decal to help with the blending):
The Cobblestone Gutter needs to end somewhere and the tunnel is the perfect spot in this scene. Even though it’s destroyed (added a decal too, for more logical detail):
If the road is damaged it would make sense to place some road maintenance signs:
And everything in general needed to look damaged, including the painted stop sign:
I tried to use destruction and light to tell a story and guide the player's vision. For example, the debris in the tunnel will make the player feel like something very strong made its way through this tunnel.
In addition to that, the strong blue light, the god rays and those mysterious particles at the very end of the tunnel will make the player even more curious to go and check what's there.
The wood planks covering the windows don't only make window repetition less obvious but they make the player feel like whoever lived there left a very long time ago and whatever the reason was, it must have been a good reason (given everything around is destroyed).
The ivy covering the traffic control cabinet suggests that the local authority abandoned this area a long time ago.
For lighting, the first task was to find an interesting angle for the sun direction, and since I already have some street lamps that I can turn on/off, I didn't want the sun to face that area. So I kept rotating the sun direction until I got a similar result (the contrast between the two sides of the building was interesting + I wanted to have the tunnel half-bright to keep the mysterious mood).
Next, I added a skylight (with ray tracing features enabled):
Then I added volumetric height fog:
Once I was happy with the general result, I added some post-process where I enabled ray tracing features like GI, AO, etc. and I adjusted the saturation and contrast.
And finally, I added some point light to help fake and “propagate” the sunlight giving a unique mood to the scene. I added some god rays and dust particles.
An example that shows how point lights were placed:
How Long It Took
The previous version of the scene took me around 3-4 days. On the other hand, the polished version made for the online course took me from 40 to 45 hours.
Creating all the modular pieces and shaders took around 15 hours. Level Design took 20-25 hours and lightning and other special effects a further 5-6 hours.
I spent a lot of time placing leaves and pipes, probably a blueprint tool would have helped to place them faster.
Sharing knowledge is one of the best ways to enhance your skills. I made a couple of mistakes here and there but I'm proud of the final result.
If you're interested in the full course, you can check it here and use the code 448651033B59F6C3D7EB for a 75% discount.