> For the complete documentation index, see [llms.txt](https://soulslike-framework.isik.vip/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://soulslike-framework.isik.vip/workflow/creating-an-enemy.md).

# Creating an Enemy

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2Foew3ClYFiNXDLjZrTTPl%2Fimage%20(1).png?alt=media&amp;token=3e847980-069e-48ae-8937-0b7e438ebb59" alt=""><figcaption></figcaption></figure>

### Creating the Character & Setting up the Components

1. Create a new blueprint derived from **Soulslike Enemy (B\_Soulslike\_Enemy).**

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FtXWgcoFASzqhSJvuPRgg%2Fimage.png?alt=media&amp;token=b3a1fc95-6b6b-4999-a6a5-70ec87581bb8" alt=""><figcaption></figcaption></figure>

2. Assign your character mesh & the relevant Animation Blueprint you'd like to use:

{% hint style="info" %}
If your character is Epic skeleton compatible, you can use the Animation Blueprint & the Animation Blendspace provided by Soulslike Framework.
{% endhint %}

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FPiSbzi67svot5OQ3F7JU%2Fimage.png?alt=media&amp;token=4923e63f-a1fc-4afd-814b-c2eb1f510444" alt=""><figcaption></figcaption></figure>

3. **(Optional)** If your character will be using weapon(s), add a **Child Actor Component** to your Mesh. Select the world actor **(derived from B\_Item\_Weapon\_AI)** for the weapon you'd like your enemy to use:

{% hint style="success" %}
For more information about creating **AI Weapons**, check out our guide on [Creating & Editing Weapons for AI](/workflow/creating-and-editing-items/creating-and-editing-weapons.md#creating-editing-weapons-for-ai).
{% endhint %}

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FPcTaQxPhfnMB8GrtGxPb%2Fimage.png?alt=media&amp;token=3b89420e-ea1f-40b6-b85b-6fc19163e94a" alt=""><figcaption></figcaption></figure>

4. **(Optional)** Setup your loot table for the enemy under the **AC\_LootDropManager** component. For more information, [read about the Loot Drop Manager component here](/components-managers/shared-components/loot-drop-manager.md).

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FJhQnNHa3ycuOPxtEOjlJ%2Fimage.png?alt=media&amp;token=ce668a09-e47f-426f-b03f-fd2f84fa23f4" alt=""><figcaption></figcaption></figure>

5. Setup movement speed & stats/attributes for your enemy under the **AC\_StatManager** component. Additionally, you can override any stat/attribute you want and adjust their values from this component. For more information, [read about the Stat Manager component here](/components-managers/shared-components/stat-attribute-manager.md).

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FJgFXvM6Tw6Mx32HSgKlJ%2Fimage.png?alt=media&amp;token=c7ddfdd3-819a-4a3b-8245-463a03ad6efb" alt=""><figcaption></figcaption></figure>

6. Setup AI behavior for your enemy under the **AC\_AI\_BehaviorManager** component. For more information, [read about the AI Behavior Manager component here](/components-managers/ai-only-components/ai-behavior-manager.md).

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FHVe5feIzJ83Xe2jClvwP%2Fimage.png?alt=media&amp;token=265c9bf4-7609-4ccc-9519-535be9a96842" alt=""><figcaption></figcaption></figure>

7. Finally, setup combat related data for your enemy under the **AC\_AI\_CombatManager** component. For more information, [read about the AI Combat Manager component here](/components-managers/ai-only-components/ai-combat-manager.md).

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FQXzHOgTgZIbDKT6TG8Ao%2Fimage.png?alt=media&amp;token=71e23d14-9eea-493c-8302-58f1af40f7c4" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
If your Enemy character will not be using a weapon, ensure that you fill in the **Unarmed** category correctly under **AC\_AI\_CombatManager.**
{% endhint %}

### Creating AI Abilities

Soulslike Framework uses a data-asset based, scored ability system for every enemy's abilities. To create new abilities, click on the Soulslike Framework dropdown and select the **AI Ability Creator**:

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FgMXyybxhEi6h6Z9ypox1%2Fimage.png?alt=media&amp;token=71e9cc29-f635-46e8-8c32-9a79449d5680" alt=""><figcaption></figcaption></figure>

For each ability, you can define the corresponding **montage**, its **score** (weight based), its **cooldown** and custom **rules**. For more information on creating montages & utilizing notifies, [check out our Setup Custom Montages](/getting-started/quickstart/setup-custom-montages.md) page.

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FvEEWfYmQmfEXLVWyJzlJ%2Fimage.png?alt=media&amp;token=7d4d671b-d97c-4ec6-926a-2631ab5a3ff0" alt=""><figcaption></figcaption></figure>

After creating the ability, do not forget to assign it to your enemy's **AC\_AI\_CombatManager!**

### Advanced: New/Custom Ability Rules

The framework provides two rules - **Distance (FAiRuleDistance) & Stat (FAiRuleStat)**. These rules are structures that contain relevant data. They are located in **/SoulslikeFramework/Structures/AI/Rules.**

With the use of **Instanced Structures,** you can create your own rules by creating a new structure with the relevant data and adjusting the **EvaluateAbilityRule()** function inside **AC\_AI\_CombatManager.**

#### Example #1 - Target (player) Stat Rule

For this example, we'll create a rule which is **capable of checking any Stat of the player**. Start by duplicating the **FAiRuleStat** rule and rename it appropriately (or just create a new struct):

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2Fa2KAbfNtIeTYVtRyTBBS%2Fimage.png?alt=media&amp;token=82d3fc7b-0b9e-43c3-9b1a-54b1f4345baf" alt=""><figcaption></figcaption></figure>

Next, adjust the EvaluateAbilityRule() function to take into consideration this new rule we created:

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2F4zj5Xqtb7YAV0ZYK6eyl%2Fimage.png?alt=media&amp;token=f4f07e2a-be3b-41cb-b524-f4865de9aad5" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FTZs24lQLjU7DTfTKqkhN%2Fimage.png?alt=media&amp;token=5530309c-1a3d-4178-9481-f47b67119ac0" alt=""><figcaption></figcaption></figure>

Finally, utilize the rule in any AI Ability you have:

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FvGY4Df9JT8WJZk38V9JJ%2Fimage.png?alt=media&amp;token=a9a74ea6-f025-47af-9914-63506ea954ea" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FQxOWseUDKkXo5ugPajMr%2F2025-02-06%2001-10-11.gif?alt=media&amp;token=e21b449d-2fce-484c-bbad-a9209ab9554c" alt=""><figcaption><p>After the player's health drops below 95%, enemy can no longer execute the ability - thus strafing randomly.</p></figcaption></figure>

#### Example #2 - Input Reading Rule

For this example, we'll create a rule that is **capable of reading player input**. Start by creating a new structure and name it appropriately - lets say **FAiRulePlayerInput**:

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2F02gxNxFGh7BRbITALKVb%2Fimage.png?alt=media&amp;token=812a2f28-6a3e-4ab1-a5fa-999a08b8dafd" alt=""><figcaption></figcaption></figure>

For this rule, we want to keep track of the actions the player is executing. We can retrieve this from the [AC\_InputBuffer ](/components-managers/player-specific-components/input-buffer.md)component of the player. We will bind to the **OnInputBufferConsumed** delegate in the Input Buffer Component to detect when an action has been performed. You can do this anywhere you like, but for this example, we'll do it inside [AC\_AI\_BehaviorManager](/components-managers/ai-only-components/ai-behavior-manager.md)'s **SetTarget()** method:

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FxfsNPxAViWGRwtFN2etU%2Fimage.png?alt=media&amp;token=023486db-0f55-4f4e-9e2a-f7dbe4cad256" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FRZTobnZgczQPfpS31Qq5%2Fimage.png?alt=media&amp;token=4a158e80-89a0-4f30-8af0-43fdfb82c470" alt=""><figcaption></figcaption></figure>

Now that we're keeping track of the recently triggered actions of the player, we can utilize this new property we created (**MostRecentPlayerActionInput**) on the [AC\_AI\_CombatManager](/components-managers/ai-only-components/ai-combat-manager.md)'s **EvaluateAbilityRule()** method:

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2Fw4dHSwJVaDTEASL8ssMu%2Fimage.png?alt=media&amp;token=ce96a7b3-a1f7-4016-9717-65f63e30165f" alt=""><figcaption></figcaption></figure>

Add the new rule to the AI ability you want to use:

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2F9w57vqJZNtbd0R5yXLUd%2Fimage.png?alt=media&amp;token=d093e5b6-d704-4edc-b294-0a80d0544c2f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3303637552-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOAGs3il6rJbkejwPOlEP%2Fuploads%2FFPvF53FnSlX4Y0qXK0w3%2F2025-02-06%2023-10-46%20(1).gif?alt=media&amp;token=4f91e676-1ce6-4ba1-bf23-563042af2112" alt=""><figcaption><p>Enemy will now dodge when player attacks!</p></figcaption></figure>
