[FE8] Enemy Group AI

Hey, first post here :smile:

So in the more recent 3DS games, there are enemy ā€œgroupsā€ where the units remain passive until youā€™ve either triggered one of their buddies or entered within a cross-section of their attack ranges (or you attack one of the units in the group).

In FE8, you can get a somewhat similar behaviour by using a set of AREA events to map out the enemy attack ranges. Once a player unit activates the said events, then CHAI from guard (0x3, 0x3) to pursue (0x0, 0x0). This however, has issues due to the mechanics canto and rescue. So any one can easily trigger the CHAI events by stepping in the area and then canto/rescue out of it with no risk.

A slightly different approach can be taken where you once again set the same AREA events, except now they are triggered by certain enemy units instead of non-enemy units. So you set all other enemy units to guard except for the trigger guy, who have the ā€œattack in rangeā€ AI. Ideally when you go inside this guyā€™s range, he attacks, thereby triggering the CHAI events causing the remaining enemies to move.

However, this also has some issuesā€¦

  1. The player can kill the enemy before he gets a chance to move. Though you can make a separate ID for the said enemy and then check to see if heā€™s alive every turn and trigger the AI change if heā€™s not. But this can get tedious with all the new IDs (unless we can check if an enemy is alive at a particular coord).
  2. The player can attack any of the enemies and then rescue/canto out of the trigger zone. Is there some way we can check if an enemy has engaged a player unit?
  3. The rest of the enemy group could have ā€œmovedā€ before the CHAI happens. In this case, they will move the next turn. Although you can somewhat control this by moving the trigger unit to be the first unit in the group. However, from what I have seen, in FE8, all the melee attackers gets priorities to move before any ranged attackers so youā€™ll probably have to give the trigger unit a melee weapon.

Any thoughts/suggestions on this? I guess ideally to get the correct behaviour, weā€™ll probably want to write a new routine or modify some of the existing ones. But I want to see if something very similar can be simulated using whatā€™s already in FE8.

read the AI thread it will tell you everything you need to know including mob AI. Thereā€™s actually an AI setting to specify a ā€œleaderā€ unit and other enemies will follow that unit etc.

Thanks for the reply!

Hmm, Iā€™ve tried it before but I havenā€™t been able to get it to work in FE8. Is it confirmed that byte 1 0x0D is the correct one? Also, does it let you have multiple leaders?

Iā€™m actually not sure to be honest on the first one. With regard to the second question, I recall that leaders are specified by character ID, so as long as you have the correct character IDs set, you can have multiple leaders.

I just tried it out again, seems like 0xD works. I thought that the leader byte was a 0/1 flag, didnā€™t realize it was supposed to be a char ID (duh). Anyways, Iā€™ll need to test out this behaviour some more. Maybe I can combine this with the AREA events to get something more interesting. Thanks :slight_smile: