Help: Enemy AI Pattern

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
Ok, so I'm currently working on my forest dungeon for my Tactical RPG which will have these Goblins as enemies, among other woodland critters. There are 2 types of Goblins: Goblin Grunt & Goblin Mystic.
1627601093683.png
The Goblin Grunts are just standard melee units.
1627601059997.png
The Goblin Mystics, however, are casters. They are given 2 spells: Stone Skin & Fireball.
~Fireball is deals Fire damage, has a chance to Burn, and has a 3-tile radius range.
~Stone Skin increases the target's DEF and makes them immune to physical Critical Hits.
~They can also do a normal/basic attack (i.e. whack a target w/ their staff)

My issue is when the Goblin Mystic eventually runs out of Mana and resorts do using their normal/basic attack. I currently have their AI set as a "ranged" unit. This means they will try to keep their distance as much as they can. This causes a weird behavior when they don't have enough Mana to cast spells. They will get into melee range to whack a target w/ their staff and then run and distance themselves again. I'm trying to decide if this AI behavior is fine, or should they switch to being "melee" units once they run out of Mana? Also, they do have a bit of MP Regen, so they'll eventually be able to cast again. If they are set as "melee" units, they will try their best to stay adjacent to a target.

So assuming the Goblin Mystic is out of Mana and can only use their normal/basic attack and is starting from a position a couple tiles away from the target...

"Ranged" AI behavior will go like this:
approach target -> attack -> retreat

"Melee" AI behavior will go like this:
approach target -> attack -> stay next to target

The "melee" behavior will let them have an easier time hitting the target w/ their normal/basic attack in future turns due to already being closer to the target. The "ranged" behavior will provide better survivability by keeping their distance as much as possible, especially since the Goblin Mystics are squishier than their Goblin Grunt counterparts.

In short, should I add in code for them to switch behaviors depending on their Mana remaining, or just let them run as a "ranged" unit all the time?
 
Last edited:

G-G-Games

Villager
Member
Joined
Jul 26, 2021
Messages
20
Reaction score
11
First Language
English
Primarily Uses
RMMV
Hard to know what would be easy/hard to implement for your tactical system, but my first few thoughts were:
  • Maybe the mystic's spells don't cost Mana at all?
  • Give the mystic a 0 Mana ranged spell option?
  • Give the mystic a skill which allows them to regenerate Mana much faster?
 

lianderson

Veteran
Veteran
Joined
Dec 27, 2012
Messages
531
Reaction score
440
First Language
English
Primarily Uses
N/A
For the mystics, you can create a MP generating skill that they use when their MP is low. (I does this with almost all enemies in the game)
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,965
Reaction score
1,670
First Language
English
Primarily Uses
RMMV
In that case, should I just remove the Mystic's melee attack as well?
 

lianderson

Veteran
Veteran
Joined
Dec 27, 2012
Messages
531
Reaction score
440
First Language
English
Primarily Uses
N/A
These are questions you must ask yourself and not us peoples on the forums! Do not seek our validation. Seek yours! Have confidence in your own ability human, for you have the ability. You haves it!

Praise be to the gam mak.
 

G-G-Games

Villager
Member
Joined
Jul 26, 2021
Messages
20
Reaction score
11
First Language
English
Primarily Uses
RMMV
In that case, should I just remove the Mystic's melee attack as well?
I think it'd depend on how the AI works. If both the mystic's HP and MP are low (and doesn't have a 0 MP spell) a melee attack could be worthwhile so their last turn isn't "wasted" only regenerating MP.

Players probably won't feel strongly about such a minute detail, so as @lianderson suggests you should do whichever seems best to you! You could also see what play-testers think since they'd have a more grounded understanding of how the game plays out.
 

Yuki_P

Villager
Member
Joined
Jul 19, 2014
Messages
11
Reaction score
3
First Language
english
Primarily Uses
Interesting and pretty standard tactical rpg game design.
why not keep the mystic goblin as "ranged" unit?
~ I read it you wanted to make melee and ranged enemies right? Good job, you already determine the road you want to go. Dont waste that determination.
~I will give you this hint: MP Charge
~my suggestions for your future design: tactical rpg is a long game and complex so you need to make a decision how do you process AND make your game special
 

alice_gristle

Veteran
Veteran
Joined
Jul 2, 2019
Messages
255
Reaction score
229
First Language
English
Primarily Uses
RMMV
Give the mystic a sling, so when they're out of mana, they shoot stones at ya dudes?
 

Latest Threads

Latest Profile Posts

Don't you just hate it when you get a high level armor only for it to look like a metal plated bikini on your female character?? Seriously. How can that protect you??? Enemies can hit the squishy parts! :kaosigh:
Bathrooms are not designed for the middle of the night.
so... I decided since a park was an area in my game... here's an enemy that's slide with a hand behind it. cause why not.

Forum statistics

Threads
115,277
Messages
1,088,560
Members
149,890
Latest member
mekiboss
Top