FPS Engine

Importing the Integration Package

(FPS Engine 1.1 or Lower Only) To add support for FPS Engine, users will need to import the FPS Engine Integration package. This can be found under Emerald AI>Integrations>FPS Engine.

FPS Engine Integration Demo

After you have imported, you will have a scene to test with an example FPS Engine player. This is located under Integrations>FPS Engine>Demo Scenes>FPS Engine Integration. This scene will have an Emerald AI demo AI that will attempt to fight an example FPS Engine player. You will be able to target, damage, and kill the demo AI. It will also be able to damage and attack the FPS Engine player. There will be a pistol weapon the player can use to fight the demo AI.

Note: The included FPS Engine example player uses the TransparentFX layer as there's no included Player layer. It is recommended you follow the below "Setting up your own AI with FPS Engine" when setting up your own player and AI. This tutorial will provide info on setting up the project and player with the Player layer.

Setting up your own AI with FPS Engine

Included with the integration packages are two scripts. These scripts are bridge scripts that allow Emerald AI and FPS Engine to send damage to each other.

FPSEngineAIBridge

The FPSEngineAIBridge script should go on your AI, if you want it to receive damage from an FPS Engine player. It will automatically take the health values from your AI's Emerald Health Component. You can do this by searching for the FPSEngineAIBridge script and dragging it onto your AI.

Setting up an AI's Tags and Layers

It is important that you properly setup your AI's Tag and Layer. For this tutorial, and the example FPS Engine integration scene, the Enemy Tag and Enemy Layer was used. These are the tags and layers included with FPS Engine. However, you are free to use the ones for your project, just make sure that you have set these up through your AI's Detection Component.

Since the AI are using the Enemy layer, the Enemy layer needs to be added to every AI's Detection Component to allow them to be properly detected.

FPSEnginePlayerBridge

The FPSEnginePlayerBridge script should go on your Player (within the FPS Controller), if you want it to receive damage from an Emerald AI agent. It will automatically take the health values from your FPS Engine player. You can do this by searching for the FPSEnginePlayerBridge script and dragging it onto the FPS Controller>Player>Player object.

Adding the Player Layer

Until FPS Engine adds the Player layer to its included layers, it is recommended that you add the Player layer to your project's layers. Next, assign the Player layer to your FPS Engine's Player object.

Next, add the Player layer to every AI's Detection Layers within the Detection Component.

This concludes the tutorial. Test your FPS Engine Player and AI to ensure everything works correctly. If something doesn't work, go through the tutorial to ensure no steps were missed. You can also test the included FPS Engine example scene to see how everything was set up. Feel free to reach out on Discord or via email if you need assistance.

Last updated

Was this helpful?