Landscape Collision Guide
The Unreal Engine 4 (UE4) Landscape system enables you to specify the detail level of the geometry used for both simple and complex collisions for the entire Landscape as a whole or on a per-Component basis. In the following sections, we will go over how to use the system as well as any relevant information you must know before using this in your UE4 projects.
For this example, we are using the Landscape Mountains project that can be found in the Learn tab of the UE4 Launcher.
Collision Mip Level
If you select any Landscape Actor that has been placed in a level and go to the Details panel, under the Collision section you will find two settings called Collision Mip Level and Simple Collision Mip Level.
|Collision Mip Level||
The Collision Mip Level sets the complexity of the Complex collision that is used for the Landscape. Setting Collision Mip Level to 0, the default, will give you a very accurate Landscape collision at the expense of memory. Setting this value to 5, the maximum setting, will make the Landscape collision cheaper, but the accuracy of the collision will suffer.
|Simple Collision Mip Level||
The Simple Collision Mip Level sets the complexity of the Simple collision that is used for the Landscape. Setting Simple Collision Mip Level to 0, the default, will give you a very accurate Landscape collision at the expense of memory. Setting this value to 5, the maximum setting, will make the Landscape collision cheaper, but the accuracy of the collision will suffer.
Viewing Collision Mip Level
You can visualize the Landscape collision geometry using the Collision Viewmodes. To enable the collision view mode, go to the View Mode menu in the Editor viewport toolbar, under the Collision section, select either Player Collision or Visibility Collision.
|Player Collision||The Player Collision view mode displays the Simple Collision Mip Level.|
|Visibility Collision||The Visibility Collision view mode displays the Collision Mip Level.|
Adjusting the Landscape Collision Mip Level
To set the complexity for both simple and complex Landscape collision you will need to do the following:
Select your Landscape Terrain in the Editor viewport. In the Details panel, expand the Collision section.
Under the Collision section, find the Collision Mip Level option. Set the value from 0 to 5 and then press the Enter key to apply the change. The gray collision mesh in the level updates automatically to reflect the changes.
Mixing Collision Mip Level Options
You can set the complexity of both the simple and complex Landscape collision meshes to provide a better balance between performance and accuracy. To set the simple and complex collision levels independently in your project you will need to do the following:
Select your Landscape and in the Details panel and expand the Collision section.
Set the Collision Mip Level to a value of 0 and Simple Collision Mip Level to a value of 2.
In the following image comparison, you can see what happens to the Landscape collision when the Collision Mip Level and Simple Collision Mip Level are set to different values.
For most cases, you will want to leave the Collision Mip Level at 0 and then use 1 or 2 for the Simple Collision Mip Level. Using any higher numbers will start to show inaccuracies between the player and collision.
Setting Collision Mip Level Per Landscape Components
You can set the Collision Mip Level collision for individual Landscape Components which enables you to reduce the Landscape collision complexity even further in non-playable areas of the level.
To set the Collision Mip Level for an individual component in your project, you will need to do the following:
From the Modes panel, click on the Landscape option and select Manage mode.
Select a few Landscape components by clicking on them with the Left Mouse Button. The selected Landscape Components are highlighted in red.
In the Details panel, expand the Landscape Component section and change both the Collision Mip Level and Simple Collision Mip Level to 5.
In the Landscape Manage section under Tool Settings, press the Clear Component Selection button to deselect any currently selected Landscape components.
Select a few more Landscape components and this time set both Collision Mip levels to a value of 2.
In the following image, the Collision Mip level for each of the four outlined Landscape Component has been set to a different level.
|Number||Collision Mip Level|