😈 Enemy: Create a basic Enemy AI

To create an enemy AI, you first need to envision or write down what actions this enemy will perform. Now, I will show you how to make a basic behavior:
  • The enemy will continuously chase the player when the player is within its sight range.
  • When the enemy gets close to the player, it will jump to the player's position and deal 10-15 damage.
  • After that, the enemy will take two steps back and wait for a moment.
  • Repeat the cycle.

First, I set the name and HP notetag for the enemy. On the first page, it will be in a scouting state. I'll make it move randomly along with a conditional branch checkRange. When the player comes within 7 tiles of this event, it will show an exclamation bubble and switch to page 2 (using self switch A), which means it has entered the "player detected" state.



Page 2 will contain all the attacking behavior of the enemy.

Explanation: We will loop the condition such that if this event is within 4 tiles of the player, it will jump to the player's position and create a dynamic self-destruct event that lasts for 3 frames with the notetags <dmg: 10 - 15> and <enemyHitbox>. Naturally, we would need a comment event to check for collisions between the player and events with the notetag <enemyHitbox> running in parallel. This is similar to what you've read in the previous tutorials. Then, we will break the loop. If the condition isn't met, we'll have the enemy move towards the player until it is.

The event then moves back two steps and waits for 80 frames before repeating the entire action.



Remember, that's just the bare minimum. If you look at the Action Combat demo, you'll notice that each enemy I've created has at least two attack patterns. The more attack patterns an enemy has, the more varied and challenging the experience becomes for the player.
5 RPG Maker Action Combat Manual: 😈 Enemy: Create a basic Enemy AI To create an enemy AI, you first need to envision or write down what actions this enemy will perform. Now, I will show you how to make a bas...