🗺️Mappers cheat sheet

Introduction

In NACT you can place a few utilities in the Unreal Editor in order to make your map compatible with it. First you have to download NACT_Utilities here https://github.com/DKFN/NACT_Utilities

Once you have downloaded the repository, drop it in your Unreal Project alongisde your orther asset packs

What your content folder should look like

Content of the Unreal Tools

Inside the tools you will see two folders:

  • Placeholders: This is what you want to plmace inside your level for cover points and patrol routes

  • Utilities: Contains the script that generates the Lua code that should be placed in your Map package

Placing cover points

For human-like NPCs, taking cover is an essential part during combat. By default, this datas are used by NACT_Combat default behavior.

Manual placing

First, start placing a mesh. I will use the simple guard house for this tutorial but you can use anything

Our mesh

Go inside the placeholder folder of the tools, select BP_Placeholder_Cover and drop it inside the level.

As you can see, two sphere have appeared. Before placing our cover point let's explain:

  • Red sphere: It is the point the NPC will go to if he chooses this cover.

  • Green sphere: It is the point where the ViabillityCheck will be performed.

Most of the times, you do not need to change the cover viability check position, however, you are able to if you select this point specifically (for example tricky corners or uphill positions, etc). We will go into more details about their implications later.

Move it into place inside the guard house. For example, left to the door.

This position should provide a great shelter for an NPC

Finally, you can see there is warning NOT SET in the cover point. This is because we need to specify the desirred Stance our NPC should take while going into cover.

This is configurable as a property on the Actor:

Since this cover seems great for Standing we will put "1" as a value

This concludes our first way of manually placing cover points. Of course, the actors you place are invisible in game!

Using level instances

Of course, manually placing all cover points for all guard houses will quickly make you mad. Manually placing them should be very exceptionnal. As a general good practice, you should use Level Instances . Once you have placed all your cover points inside your guard house:

Select all the actors involved and create a level instance. Once you have it created, you can drop every guard house from there instead. And they will be populated with their respective cover points.

Two guard house level instance with their respective cover points

That's it, this is how you can create complex levels without specifying each cover points one by one.

Datacenter missing on Unreal Editor with all cover points from level instances

Code generation

Finally, to let NACT know about your cover points go to the Utilities folder of the Tools, and then launch the Code Generator editor blueprint.

Run the editor widget and click generate code.

Finally, place the generated code in your map package script. That's it! Since the generated code calls SetMapCoverPoints it will let known NACT of all the cover points of the current level.

Patrol routes

Alongside covers, placing patrol routes in an integral part of the human-like behaviors. Unlike Covers, Patrol Routes uses two placeholder blueprints:

  • BP_PatrolRoute: Holds all the patrol point and represents a route

  • BP_Placeholder_PatrolPoint: Represents a point on a patrol route

Creating routes

First, start by adding a BP_PatrolRoute inside the level

You can place it anywhere on the level, but I recommend you place it close to the route starting point. Then, give a name to your patrol route

Then, add a Patrol Point but make sure to slide it within the patrol route tree.

Next move the patrol point to the start of the route, make sure to select the patrol point inside the tree.

Repeat the process until you have your desired route

Nice you have completed your crazy route!

Code generation

Like before, launch the code generation utility widget

The generated patrol route can be accessed in your gamemode with the global

NACT_GENERATED.patrolRoutes.CrazyRoute

Then in the NPC config when using RegisterTerritory you can pass this route as an argument for the NPC. For example in the Test Gamemode:

Before assigning this route to one or more NPCs in RegisterNPC

I hope this guide helped you, please let me know ortherwise and have fun !

Last updated