Creating terrain brushes in Blender

From Oldunreal-Wiki
Jump to navigation Jump to search
The Blender version and settings we are using. Note: Future Blender versions should still work with this tutorial as the features we touch on aren't expected to drastically change anytime soon. If something doesn't work as described it's recommended visit the Blender Documentation.

By now it's pretty well known that Epic made the terrain for Unreal's levels using an external modeling tool. Back in those day modeling software was either really user unfriendly, prohibitively expensive or both. However nowadays Blender is the modeling tool of choice for many. With it being relatively small, light on resources (for simple scenes, highly complex scenes will naturally require more powerful hardware), versatile, highly expandable and most importantly: totally free!

This tutorial uses Blender 3.2 with the default key-mapping settings.


Introduction

As a result of Blender being powerful and versatile is it also rather complex. Its daunting UI is often criticized for being overwhelming and illogical by those that collide with the steep learning curve. This tutorial aims to solve that by giving step-by-step instructions while encouraging the reader to experiment on their own. It won't be constantly telling you exactly what buttons to press and instead links to official documentation about the tools and features used. The goal being that after following this tutorial the reader can not only make the exact kind of terrain shown here but also create different terrain and brushes for their specific mapping needs.

This tutorial assumes the reader has some basic knowledge of using Blender. Specifically being aware of the various object interaction modes and how to switch between these, knowing how to select things using both the mouse clicks and the box/lasso select tools, being familiar with 3D navigation and basic transformations (selecting, moving, rotating and scaling). If you never touched Blender play around with these in the default scene (what Blender opens with) until you think you got the hang of them. While doing so pay attention to the Status Bar for the Keymap information that appears whenever using any tool. Once you have a grasp of these basics move on to the next step.

Setting up Blender

By default Blender is designed for real-world scale modeling. Meaning that is uses real-life measuring systems rather than the artificial Unreal Units (UU) we are all familiar with. This creates problems with scaling as 1 UU is (by default) 1 Meter(!) in Blender. Furthermore Blender is by default setup for high-poly high precision modeling. Creating a very near near-clipping plane (things be be rendered very close to the camera) and a very short far-clipping plane (distant geometry will disappear quickly) to ensure a high amount of precision in the z-buffer. So just modeling at a larger scale will prove difficult by default.

Application Template

Fortunately can this be changed with a few settings to make Blender function perfectly fine in native Unreal Units. For convenience is an Application Template provided below with all these changes applied. In addition it sets the Walk Navigation settings to closely match Unreal's player scale and movement speed (hold down Shift). This allows for some very basic play testing within Blender, mostly useful to get a sense of scale of the terrain before importing. It must noted that the gravity is a set value that can't be changed. Because we are modeling in such a large scale to what Blender is normally used for does this result in the gravity appearing extremely low.

File:Blender Unreal (UE1) Mapping Template.zip

Installation

The default view when starting a new project with the Unreal (UE1) Mapping Application Template. It includes a player character and a 256*256*256 cube to aid with scale.

To install the template, click on the Blender logo in the very top left of the screen → Install Application Template → navigate to the downloaded .zip file → Install Template from File.

To use the template go to File (right of the Blender logo we just clicked) → NewUnreal (UE1) Mapping.

Notes and Usage

While most things will work as expected are the a few tips and quirks that the user might want to be aware of.

Script Warning

After saving a .blend file with this template and opening this later the user might see the following warning message:

BlenderTerrainTutorialTemplateScriptWarning.png

You can safely click on Allow Execution. However, as tempting as it might be to just check the Permanently allow execution of scripts checkbox will this allow any scripts inside any .blend you open to be freely executed without your consent. If you ever use .blend files from external sources is it recommended to leave this unchecked for security reasons.

This warning appear because a script is added to the .blend file to set Walk Navigation settings in the Preferences. This is (at least to my knowledge) the only way to set these properties each time a project using this template is loaded without making the change persist between projects.

Grid Scale

By default the template will open with a 8UU grid size. This can be changed by setting Scale in the Header Region under Viewport Overlays.

The Viewport Overlays options with the Scale field highlighted.
Collections and toggling Scaling Aid
The default Collections

Rather than just deleting the player character and cube you can also easily hide them. Go to the SidebarView → Under Collections click on the eye icon next to Scaling Aid. You will also notice another Collection named Level in here as well. By default newly added objects will be added here. If this is not the case you probably clicked somewhere in the Outliner. You can easily drag stray objects back into Level from the Outliner but this isn't strictly required for anything in this tutorial. It's just to keep things organized.

Planning

Before starting to create you terrain it might be worth to plan the layout before hand. Some like to draw things out on paper or in the painting program of their choice, other just plan it in their heads or as they go while others prefer to block things out within UnrealEd. For each approach is there a way to make your life easier during the modeling process inside Blender.

Drawings

The end result of drag-and-dropping and image. Note the properties on the right and how the image is drawn in front of the geometry with some transparency.

Blender support drag-and-dropping images files right into the 3D viewport. This makes it easy to have blueprint or reference to model on top of. For terrain the most logical approach is to draw a top-down view and place that inside Blender.

To achieve this, first align the camera to the Z-Axis using either Numpad 7 or by clicking on the Z in the Navigation Gizmo. This is because when drag-and-dropping an image inside Blender it aligns it with the current viewing angle. The distance the image will be placed away from the camera is based on the location of the 3D Cursor. Since we just started a new file however the 3D cursor should already be at the center of the world, which is what we want. If it's not however press Shift + S and select Cursor to World Origin.

Now grab the image file from your file explorer and drag it into the viewport. It will be placed wherever you drop it.

If things went right you will now have your image inside Blender albeit at a very small size (5UU on widest part of your image). To fix this, make sure the image is selected then go to Properties and find the Object Data Properties tab (should be the second one from the bottom). In here set the Size property to 1. Why 1? Because the maximum value for this Size property is 1000 which is way too small for most Unreal Levels and setting this to 1 allows us to work in Unreal Units in the next step. Next we set the actual scale in the Sidebar under ItemScale by setting all of these to the desired size of the widest part of the image in Unreal Units.

Once done you might want to move the entire image to the World Origin (using Shift + S once again). From here you can use Walk Navigation to fly around the image (note that images do not have collision so keep gravity disabled) to get a sense of the scale and time it would take to walk across various sections of the level. You might also want to play around with the Depth and Opacity properties in the Properties tab we visited before. This allows you to always draw the image on top or behind geometry with some transparency to still allow you to see what you are doing.

Blocking out in UnrealEd

Passage.unr intersected, converted and then imported into Blender. Intersected brushes have very poor geometry with many polygons not being properly connected to each other (selected polygon is moved slightly to show this). Fixing this for an entire map would take hours of manual work.

This is usually slower than just modeling things in Blender and using Walk Navigation for rough testing of the layout. However in a situation where one needs to rapidly prototype actual gameplay situations this approach might still be preferred. If the layout is two-dimensional enough you can just take a screenshot top-down screenshot of the map and follow the steps laid out above. If this is not an option your best bet would be creating a giant cube inside UnrealEd that envelops the parts of the map you want to recreate in Blender, then intersecting this cube followed by converting it to a Static Mesh which you can then export to an .obj file to then import into Blender.

The imported mesh will need some cleaning up however (mostly removing the outer surfaces of the cube used for intersecting) and creates very bad geometry making it ill-suited to be (partially) used in the final terrain brush. Using it as a 3D blueprint to model on top of however is a perfectly valid approach.

Considering this requires modeling taught further on into this tutorial will we not be touching on the specifics of how to prepare the mesh for reference and blueprint use. As this is more of an advanced way of doing things is it recommended that you use a 2D drawing or doing things from memory/as you go for now.


This tutorial will follow the steps to make a kind of mini Sunspire with terrain in a similar style to Epic's levels while following the blueprint bellow:

Expertly drawn layout of what this tutorial hopes to achieve by the end. The player will start at the bottom left.

Modeling the terrain

As mentioned in the previous step are we aiming for terrain similar to that of Epic's maps included with the vanilla game. These maps are effectively large planes with terrain extruded out of it so we will be following this approach. This approach won't work for every kind of terrain but all tools used in this tutorial will come in handy no matter what you are modeling.

Setting up the scene

Scene with the plane added.

First, while in Object Mode, we will add a plane Primitive and set the Scale in the Adjust Last Operation Panel to whatever size we expect our terrain to take up on the horizontal axis. Since my entire map will be roughly 8192x8192 to fit the playable space and I still want to have space around this to add some hills for decoration will I make it 9216x9216 (which is 8192 + 1024). The size of this plane can easily be adjusted later while modeling the terrain so don't worry too much about the exact size.

Next up align the camera to the Z-Axis using either Numpad 7 or by clicking on the Z in the Navigation Gizmo and switch to edit mode.

Drawing the terrain outline

We only doing the outline for now.

Now we are in edit mode switch to the Knife Tool. From here draw out the outline of your terrain, ignoring any internal parts like the cliff-side passage or the spire in the image above. Make sure to keep your lines fairly long (stock levels rarely have cliff faces smaller than ~512UU in length). Smaller detail rarely looks good in-engine once lit and can only cause more BSP errors. An easy way to check while drawing a line is by pressing S to toggle between distance/angle measurements. Also make sure to hit Return/Enter once done.

If not done while drawing the line, move around the vertices in such a way they line up with the start of addition geometry we will be adding later. It might also be worth to ensure both sides of things like narrow passages have an equal amount of vertices on both sides that are roughly aligned with each other. Vertices can be added and removed from the RMB Context Menu by selecting two adjacent vertices and selecting Subdivide, and by selecting any vertices and selecting Dissolve Vertices respectively.

Before and after fixing the vertex locations. Vertices should align with parts where other geometry connects and narrow passage ways should ideally have an equal amount of vertices on either side.

The knife tool doesn't support grid snapping so make sure that after being done you snap all vertices to the grid. Do this by Selecting everything (A key or SelectAll) then MeshSnapSelection to Grid (or Shift + SSelection to Grid).

Extruding

512 Unreal Units is roughtly the height of the lowest terrain walls in Epic's Unreal maps and strikes an decent balance between ensuring it keeps the player inside without looking too tall.

Before we move on to the next step, we need to make sure you understand Selection Modes. So far we have been doing everything in Vertex selection mode. This is what Blender defaults to when entering Edit mode for the first time and was perfect for the previous step. In this step however we are going to need Face selection mode. Read the documentation on Selection Modes if you don't yet know how to switch between these.

In Face selection mode select the part of the terrain we outlined in the previous step. Rotate the camera so we no longer looking at the mesh from a top-down perspective and Extrude it downwards a bit. Like with most tools that involve transformations can you use Axis Locking to ensure the transformation happens on a single axis. This shouldn't matter for now as we are extruding from a perfectly flat plane, meaning that it defaults to the Z axis, but for extrusions from less flat geometry it's handy to be aware of this feature.

Right after extruding the Adjust Last Operation Panel will open again. From here we can enter an exact distance of the extrusion. Set this to the depth of the highest part of your terrain that's still inside the outline. For the layout this tutorial is following will that be the cliff-side passage that connects to the bridge (We will add the spire later).

Now switch back to the top-down/Z-axis aligned view and use the Knife tool to outline the section(s) we just matched the depth of during extrusion (remember to snap the vertices to the grid and that his requires you to be in Vertex selection mode). Then select the face(s) that don't cover this/these section(s) and extrude these to the depth of the next highest point of your terrain.

Slopes should be treated as straight cliffs for now. Note that I had to add some additional geometry to where the slope and the terrain below it connects. This was easily done by pressing C while using the knife tool to 'cut through' all the geometry below it.

Repeat this step until you covered your entire terrain.

The final result. As you probably already noticed does extruding also work the other way. Which is what I did for the platform the spire will be placed on top of.

Cleaning up 1