Jump to content

A Grim Reunion: Strange Enemy AI Behavior


ruadath
 Share

Recommended Posts

I'm playing through Chapter 9 of Lyn Hard Mode and have noticed the following curious phenomenon in the enemy AI behavior. Depending on certain conditions that I have yet to determine, it appears that sometimes the bandit(s) who spawn in the SW corner of the map do not move off of their spawn point, which prevents certain enemies from spawning.

I am currently doing a run where getting all of the EXP is extremely important, so if anyone has a viable workaround to this problem or even understands what causes it, I would be really glad to hear it.

Link to comment
Share on other sites

OK, after doing more experimenting, it seems that for this chapter only (or maybe for FoW chapters), the game doesn't have stick enemy reinforcements into the empty unit slots after the starting enemy units, but instead replaces enemy units' slots as they are defeated. This doesn't fully explain the reason for this phenomenon, but I do know that the enemy AI goes down the unit list as it makes it moves; perhaps this has something to do with it?

Link to comment
Share on other sites

After performing some more testing, I've now confirmed the above. A surefire way to make the enemy bandits move is to not kill any of the units before turn 4. If you kill one on turn 4, it's fine; the last enemy bandit won't move, but that won't block any reinforcements (there are none left), and it will eventually move out of the mountains once you clear out the other enemies.

Again, it would be cool if someone could look at the AI script and figure out why this happens.

Link to comment
Share on other sites

I'm on mobile and don't have access to a hex editor or anything, but I just played C23 on HHM and the AI is acting normally for me, i.e. leaving the fort when reinforcements are supposed to spawn, so it seems to be exclusive to this chapter (mine glitched to check). Not sure if this helps your situation at all, though.

Link to comment
Share on other sites

New reinforcements will fill in the slots of defeated units. This is creating a scenario where the newly birthed brigand gets its turn before the brigand 1 space above it. (Turn order is actually a bit more complex than just deployment order, but it's the main factor in this case)

The fort brigand has AI1 0x00 and AI2 0x00.
AI1 0x00 fails since it can't attack, staff, or steal. Because AI1 fails, we move on to AI2.
AI2 0x00 moves the enemy towards your units. I haven't line-by-line examined AI2 0x00, but I think the brigand isn't moving because it can't move to any spaces that actually places it closer to your units (factoring in terrain movement costs). The north space is already occupied by the brigand spawned last turn. Moving east/west isn't good because it means having to travel over more high-cost peaks to reach the plains. So it seems the best option is to not move at all.

Link to comment
Share on other sites

A slight correction to what I said earlier: you don't need to avoid killing enemies before turn 4, just before the enemy phase of turn 3. In other words, you can still position your units at the end of turn 4 to kill enemy units and have the third reinforcement spawn move as desired.

Link to comment
Share on other sites

New reinforcements will fill in the slots of defeated units. This is creating a scenario where the newly birthed brigand gets its turn before the brigand 1 space above it. (Turn order is actually a bit more complex than just deployment order, but it's the main factor in this case)

The fort brigand has AI1 0x00 and AI2 0x00.

AI1 0x00 fails since it can't attack, staff, or steal. Because AI1 fails, we move on to AI2.

AI2 0x00 moves the enemy towards your units. I haven't line-by-line examined AI2 0x00, but I think the brigand isn't moving because it can't move to any spaces that actually places it closer to your units (factoring in terrain movement costs). The north space is already occupied by the brigand spawned last turn. Moving east/west isn't good because it means having to travel over more high-cost peaks to reach the plains. So it seems the best option is to not move at all.

Thanks! I agree, and think that this is the problem.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...