# Optimization/Tips/Errors

## Enable DirectX12

You can enable DirectX12 for increasing your performance from Project Settings-> Platforms -> Windows -> Default RHI:

<div align="left"><figure><img src="https://2314585985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB9CZin4WWsXZRIgGnqEV%2Fuploads%2F6yPaTlKlsQLQq2eNkJWr%2Fimage.png?alt=media&#x26;token=2fcc1555-1581-490d-9883-b92fe20db91f" alt=""><figcaption></figcaption></figure></div>

## Engine Scalability Settings for optimization

If you need, you can increase the performance in various ways:

* You can decrease the engine scalability. "Epic" is the default setting, you can set it to High setting, which will increase the performance with a low impact on visuals.

<div align="left"><figure><img src="https://2314585985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB9CZin4WWsXZRIgGnqEV%2Fuploads%2Fjan6GUDAnFEeKGDOtSZX%2Fimage.png?alt=media&#x26;token=e62e716c-cb19-4e71-860d-22d18ddebb71" alt="" width="563"><figcaption></figcaption></figure></div>

* Disable "Use Hardware Ray Tracing when available" or at least set "Software Ray Tracing Mode" to "Global Tracing". This will increase the performance with a low impact on visuals.&#x20;

<div align="left"><figure><img src="https://2314585985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB9CZin4WWsXZRIgGnqEV%2Fuploads%2Fk4JzwNRTpfjCgp31OFlE%2Fimage.png?alt=media&#x26;token=a96b0254-c366-4b35-8081-cf42d11c2e15" alt=""><figcaption><p><em>Edit - Project Settings - Engine - Rendering - Lumen</em></p></figcaption></figure></div>

<div align="left"><figure><img src="https://2314585985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB9CZin4WWsXZRIgGnqEV%2Fuploads%2F21wQDYukfZJ3zz7rpw8R%2Fimage.png?alt=media&#x26;token=d5f9e8d3-c3e5-4a16-b012-0fa735114b7b" alt=""><figcaption><p><em>Edit - Project Settings - Engine - Rendering - Lumen</em></p></figcaption></figure></div>

* Or disable Support Hardware Ray Tracing:

<div align="left"><figure><img src="https://2314585985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB9CZin4WWsXZRIgGnqEV%2Fuploads%2FP7kH1NBXRe7LhQqtAmSh%2Fimage.png?alt=media&#x26;token=f84578a7-f80c-4edb-b9bf-d62bd01bc16f" alt=""><figcaption><p><em>Edit - Project Settings - Engine - Rendering - Hardware Ray Tracing</em></p></figcaption></figure></div>

* Change Shadow Map Method to "Shadow Maps" (Default is Virtual Shadow Maps (Beta)

<div align="left"><figure><img src="https://2314585985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB9CZin4WWsXZRIgGnqEV%2Fuploads%2FgkEvLEsa74vUyhcjXSlc%2Fimage.png?alt=media&#x26;token=efa46ffc-dc5e-4963-8351-1ebf460cb403" alt=""><figcaption></figcaption></figure></div>

* You can gain a huge performance by disabling the lumen but it will impact the visuals drastically.

You can disable it from Project Settings or from Post Processing Volume:

<div align="left"><figure><img src="https://2314585985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB9CZin4WWsXZRIgGnqEV%2Fuploads%2Fj1sQiT7MIz6rhRQ0jSbO%2Fimage.png?alt=media&#x26;token=11599833-7313-46c9-b916-818a819385ff" alt=""><figcaption><p><em>Edit - Project Settings - Engine - Rendering - Global Illumination</em></p></figcaption></figure></div>

<div align="left"><figure><img src="https://2314585985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB9CZin4WWsXZRIgGnqEV%2Fuploads%2FMOqJpdzAtGUN7GVxE10i%2Fimage.png?alt=media&#x26;token=5da7b95e-d991-4d8a-a099-a04c057984cb" alt=""><figcaption><p>Post-Processing Volume</p></figcaption></figure></div>

## Packed Level Actor

You can increase the performance a lot by editing the level itself:

* You can create Packed Level Actor for each building from the scene or multiple buildings in a row. This will increase the performance by decreasing the draw calls, the engine will use more mesh instances than regular static meshes.

You can create your own building Packed Level Actor by selecting all the static meshes/blueprints from a modular building, then pressing on Actor -> Level -> Creating Packed Level Actor:

## Bake The procedural Background Buildings in static meshes

1\. Select the building that you want to bake into a static mesh. Select the “Building” Component from the “Details” tab and press on the "Create StaticMesh" Button from the "Procedural Mesh" category:

<figure><img src="https://lh6.googleusercontent.com/S3pdMBgFDa4jcZSzyA0Y9MwmudLoDglGihY6eEnchXyyNmqnVGsqB-X3YEFHxpYHm1vP4cO74Xyo--74RqUq-_IRrcsxUqnZG9q65REEFhQRyhxCDKW4b9pQm2a9a6eORadP522hvgce3-Ws7vEzvdjzUhYDbRv79CgW6ZuLPtpNoFKp2D5mZj6GOa1F" alt=""><figcaption></figcaption></figure>

2.Choose the location and the name of the new static mesh:&#x20;

<figure><img src="https://lh3.googleusercontent.com/Zp8fbtouQVFGla4V59ivlvfNG8zA18tGORULQ0yEjhuXQzGexR24BmqOw3ABonAV0hsCxdTIt9ATPlyAATaEFOjzotTctNlynH1ZVxK4-oKNZ4JSuqkkBC88bWljBQwO70K92G2Qoyhx4nPah_TkIA_JCEzVCZnjVwyfha0w9XSTyyi3pqxvZrHo58n9" alt=""><figcaption></figcaption></figure>

3\. Delete the building blueprint from the scene and put the new static mesh building in the same location.

<figure><img src="https://lh5.googleusercontent.com/wNrNf_j2nWTtbQi0ZdoAxEyWon3TlpJfXHHFM-eWt-en0gn6QYuPCC2z4uIkUDwn8igtg5Ms0tp75ZR61pqDoiBv8jL7CcZviXXk1i4aLr1Ksx5XZFfP_lmJgABR5j9w75WpcUTcCemSj8YC_LyukgKXaMEYM0OfQMrXmWrGyussVPi4pP9FcDhMDmHq" alt=""><figcaption></figcaption></figure>

## Merge multiple actors

This could help to increase performance in some cases.

1\. Select the actors

<figure><img src="https://lh4.googleusercontent.com/csBLsWqhuG_Dg0zIxKBojhZTft8THjGfS8otdInTouLu4B5dlGoidIORIETYs9vN3tPYz8NZFz-cVtlsSAYhB9AlcReFjVo0uvdeKinBa8i1NNkq7btoTkWgzg3CXdLXrvRwsXcRleUWAIBgiyNwHVj6j9YDmOZGJJtgF-9gS-CdB2-5v0FqqcwRPEwb" alt=""><figcaption></figcaption></figure>

2\. Open “Merge Actors” tool (Windows/Developer Tools/MergeActors)

3\* Optional - Check “ReplaceSource Actors”

<div align="left"><figure><img src="https://2314585985-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB9CZin4WWsXZRIgGnqEV%2Fuploads%2F1LxMxhbHmOwaEuIfquGa%2F2023-05-15_20h34_41.png?alt=media&#x26;token=a1b93637-9909-4b34-bb7f-c9ebb00c8247" alt=""><figcaption></figcaption></figure></div>

4\. Press “Merge Actors” and save the new mesh.

<div align="left"><figure><img src="https://lh6.googleusercontent.com/XohbzMihXzG1ekXIK9lA60rU9o651eueARbsy9i-xA6bmu1mhLVwv9cL2-tj6RlxgI7uENqQd-CLo_KV1xMlPQIyC8UXI1LJBsp5meyASIktwDYwCYyZleUMCVqJgbdpXOwRoj1fuYKIdsosId-uhmjqZn3BcBbrXGDaisWfCq9TL_rbDgF_NmqxUpX2" alt=""><figcaption></figcaption></figure></div>

<br>
