This page is a companion to the Talisman: Environment template, which showcases the best practices for creating highly detailed, realistic environments. The Talisman is created using modular construction and optimization best practices in Unreal Editor for Fortnite (UEFN).
You can find the template in the Feature Examples section of the Project Browser.
You can play the Talisman experience shown during the 2024 Game Developers Conference by opening Fortnite and entering island code 7100-3544-3074.
Location of the Talisman: Environment template in the Project Browser.
This overview walks you through the optimization challenges faced during the creation of the Talisman project and how each challenge was overcome:
Because the template is designed to run on all available platforms, the assets and style of the Talisman has to conform to UEFN’s memory and project size limit requirements. This creates several challenges for projects designed with a more detailed art style:
Project size: High-detail assets in games can be large and UEFN has a 400 MB project size limitation.
Runtime memory limits: UEFN has a 100,000 memory unit streaming memory restriction that limits the amount of assets, custom landscapes, and devices that can be on the screen at one time.
Quality on all supported platforms: These limits ensure that your UEFN experience is available to all players on all Fortnite-supported platforms.
UEFN supports a variety of techniques to meet these requirements, including Levels of Detail(LODs), Hierarchical Levels of Detail (HLODs), World Partition, Level Instancing, and Data Layers.
Applying Best Practices
The Talisman: Environment template is designed to showcase a variety of best practices and processes to bring AAA realism to Unreal Editor for Fortnite. This template uses the following best practices to manage project and streaming memory to optimize performance:
Create custom content that is modular and lightweight.
Improve the look of hard surface geometry using face weighted normals.
Add detail to meshes using Mesh Decals.
Build your experience for the lowest end target platform and add features from there.
Minimize draw calls on non-Nanite meshes.
Create Custom Content that is Modular and Lightweight
The Talisman environment was built using kitbashing, a modular modeling technique that uses preexisting meshes from a modular environment and repurposing them to create new assets. By reusing assets, the artists were able to decrease the project size by minimizing the number of single use meshes.
This asset is made of six different static meshes.
Traditionally, artists create this type of environment by mapping a high detail, high polygon mesh onto a low polygon mesh using unique baked normal maps to preserve the detail between the two. This method requires additional texture maps that can increase the size of your project, are expensive at runtime, and do not scale well during the kitbashing process.
Mid-poly meshes with face weighted normals were used to save memory, and Mesh Decals were used to add small details.
For more information, see Mesh Design and Construction.
Build Your Experience for All Target Platform
Fortnite is designed to run on a variety of platforms. To make sure that your content gives players the best experience on each of these devices, it is important to design with every platform in mind, and then add additional features for high end platforms during development.
For example, Nanite virtualized geometry helps platforms render highly detailed meshes and improve performance, but is only available to certain high end devices such as PCs running DirectX 12. Because of this, it is still important to optimize your content so that it will perform well on all platforms.
The following images show Mesh LODs at Epic, High, Medium, and Low settings.
For more information on creating your own custom assets for UEFN, see Mesh Design and Construction.
Minimize Draw Calls When Using Non-Nanite Meshes
Draw calls are the process of telling the graphics API what to draw and how to draw it during each frame. Nanite bypasses standard draw calls by streaming geometry into the scene as needed. For non-Nanite meshes, each of the following initiates a draw call in a scene:
Every individual mesh.
Each material on a mesh.
Every light.
Every shadow cast.
The Talisman: Environment template uses both Nanite and non-Nanite meshes. To optimize the performance while using non-Nanite meshes, the number of draw calls in the scene was minimized by:
Removing non-critical meshes.
Removing non-critical mesh decals.
Removing shadow-casting lights and supplementing them using light functions.
Managing Project and Runtime Memory Limits
Runtime memory management and managing project size are key components of any project made in UEFN. The Talisman: Environment tackles these challenges by:
Narrowing the project scope.
Reusing custom assets.
Managing runtime memory.
Narrow project scope
To meet the 400 MB project size limit, the MetaHuman character has been moved to the Talisman: MetaHuman template. You can find this template in the Feature Examples section of the Project Browser. To learn about MetaHumans in UEFN, see Talisman: MetaHuman template.
Levels of detail
Each mesh used to build the Talisman uses three Levels of Detail (LODs) to keep the project within the 100,000 streaming memory unit budget.
The automatic LOD settings are located in the Static Mesh browser.
The LOD meshes are auto-generated using UEFN’s automatic LOD tools and are assigned to specific quality levels. For more information on using Levels of Detail in UEFN, see Setting the Level of Detail.
Management of Runtime Memory
The Talisman: Environment template uses a custom streaming solution created using Data Layers and Sequencer to keep the level within the 100,000 memory unit streaming budget. The vertical size of areas like the Cargo area and the length of the hallways meant that the ship did not fit within the World Partition streaming grid.
Each data layer corresponds to a different room on the Talisman.
To overcome this limitation, Data Layers were combined with Sequencer to load and unload areas of the ship based on the location of the player.
Mutator Zones trigger loading events in the Level Sequence.
Each room has its own corresponding data layer and Mutator Zones spread throughout the ship that trigger events in the Level Sequence. These events load and unload sections of the ship as the player moves through the level. The Mutator Zones are strategically placed in areas of the ship to hide this from the player.
This solution is not compatible with multiplayer experiences. The Data Layers and Level Sequence have been included, but the Mutator Zones have been removed to make the template multiplayer ready.
Using Custom UI Elements
This template uses Verse to display a custom quest icon widget and play audio when the player interacts with the console in the starting room.
The custom quest banner is triggered by Verse script.
When the player uses the Crew Quarters VO Button device, the starting_sequence_device.verse script file will:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Temporary/UI }
using { /UnrealEngine.com/Temporary/Diagnostics }
Cancel the welcome audio if the audio message is still playing.
Enable a minimap of the ship to help players explore the Talisman.
Display the custom quest_icon_widget UI widget blueprint.
Play a sound clip.
For more information on using Verse to customize your UEFN projects, see the Verse Programming Onboarding Guide.
Lighting Large Spaces
The Talisman uses Lumen global illumination to help light the environment, providing the player with shadows and accurate indirect lighting throughout the ship.
This corridor demonstrates all of the techniques described here.
Lumen provides ambient occlusion and global illumination to objects that are not lit by direct lighting. While Lumen is a powerful tool for creating lighting solutions, it is still important to optimize your environment to maximize performance. Lumen is used with the Talisman: Environment template with several optimizations.
Shadow casting is toggled off on all static meshes that are indirectly lit throughout the level. Lumen provides excellent shadows for these meshes, so turning off the Cast Shadows property increased performance without sacrificing visual quality.
Most of the lights in the template have Cast Shadows toggled off.
Shadow casting is also supplemented through the use of light functions and a striped texture with some overhead lights.
Lumen noise and light flickering from emissive light panels is reduced by pairing each one with a non shadow-casting spotlight.
This spotlight enhances the light from this light panel
The emissive value for each panel is reduced and supplemented with a non shadow-casting spotlight. Each spotlight is given a small radius of effect and provides additional light while making it seem as if the light is still coming from the light panel.
The environment lighting was optimized further by having each light have the smallest max draw distance possible. This setting culls each light from view when it does not need to be rendered.
The Lighting Complexity visualizer was also used throughout the lighting of the Talisman.
The Lighting Complexity visualizer can be toggled using Alt+7
This viewport viewmode shows the number of non-static lights affecting your geometry in your level as color shading and helps to track the performance cost of lighting. This visualizer is helpful in minimizing the overlap of lights in the level to keep performance costs low.
Mesh Design and Construction
Kitbashing and mid-poly custom meshes were used to create the detailed interior of the Talisman. Kitbashing is a powerful technique that helps minimize the number of assets your project needs while still giving you the ability to reuse and combine the meshes to create new geometry.
Each mesh in the project uses a variety of different techniques to improve the look of the asset without adding additional geometry.
Face weighted normals is a technique that aligns the vertex normals of the model with the larger, flat faces to improve shading without lowering performance.
The vertex normals (green lines) align with the larger, flat faces to improve shading.
Details such as bolts, branding, and damage were added using Mesh Decals. These decals use custom UVs to project complex geometry onto surfaces and have the ability to wrap around corners or stretch along splines while still maintaining their look.
Designing Materials Using Dynamic Material Control
Textures and materials are often the largest part of any UEFN project. To further reduce the project size, the template uses a dynamic approach to textures and materials that avoids the use of unique texture maps. For this final result, a procedural workflow that stores ambient occlusion, curvature, and mask data on the mesh using Vertex Colors was used. The stored data was then used to apply and blend the materials.
Vertex Color Data
It is best to avoid using unique texture maps for each asset by packing ambient occlusion, curvature, and texture mask data into each mesh using Vertex Colors. Meshes for the Talisman are designed with supporting geometry and mesh density (polygons per square inch) to provide smooth gradation between vertex colors. This helps create clean transitions between materials.
The data is stored using the following method:
| Map | Color Channel |
|---|---|
Ambient Occlusion | Red |
Curvature | Green |
Material ID Mask | Blue |
For more information on Vertex Color painting, see Vertex Color Materials.
Material slots on each mesh are then used to define what part of the mesh receives a specific material. For more information on material slots, see FBX Material Pipeline.
This chair has material slots for metal and rubber.
Dynamic Material Control
Meshes for the Talisman use a combination five main material types:
Metal
Painted metal
Plastics
Rubbers
Textiles
Each material relies on a single master material that uses world-aligned tiling textures and user-defined parameters to generate the result. This keeps the overall memory cost of materials low by reusing letting our artists use the same materials across the ship.
One part of the Talisman: Environment master material
Dust, scratches and other wear marks are also included in the master material and are applied to meshes using parameter-driven masks. These parameters are stored on the mesh using custom primitive data.
Using the Orbit Camera Device
The Orbit Camera device provides a view that follows the player character, but that the player can rotate to freely look around. The template uses this device to give the player the ability to switch between a third person view and a simulated first person view.
Players can shift between three different views using the Orbit Camera device
This is done using camera_switch_mode_device Verse script.
# This file handles swapping between different cameras when an input is pressed.
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Characters }
using { /UnrealEngine.com/Temporary/Diagnostics }
The Verse code listens for the player to trigger the Target Creative Input action, which by default is mapped to mouse right-click or the left trigger on a controller. It then does the following:
Removes the current camera from the camera stack.
Gets the next camera in the Cameras array.
Adds the new camera to the agent.
Hides the player character, if needed.
Unhide the player character, if needed.