The cover generator is a plugin for Unreal Engine 4.
It analyzes the geometry of a level to find possible cover points. Cover points can then be parsed via the native Environment Query System (EQS) to allow AI controlled characters to find spots to hide during a fight or to prepare an ambush.
The system offers different set of information per generated cover such as if it is a crouched or standing cover, if the character can stand or lean on the sides to shoot.
The plugin is a proof of concept only. It is stable but not production ready, a lot could be optimized and a good cleaning is needed.
-
Add the plugin to your project
-
The cover generator is using the native nav mesh bounds volume of a level to generate the covers, so if you do not already have one in the scene, add a nav mesh bounds volume to your level.
- You can see the generated navigation mesh by pressing 'P' on your keyboard.
- Create a CoverGenerator blueprint and drop it in your level
- By default, the cover generator will generate the cover points on begin play. To visualize the generated points, click on the cover generator actor in your scene and tick the option "Debug Draw All Points"
- Press the "simulate" button. You can see the result on the image below. Blue spheres represent cover points, the lowest ones for crouched covers, the highest ones for standing covers. Arrows are representing from where the character can see or shoot.
-
To be able to use the generated covers in your AI logic, first enable the Environment Query System: UE4 quick start guide
-
Create a new EQS query
- Select "Cover FMemory" as a source of points
- You can use an EQS Testing pawn to visualize the result