AFK Romhack AI v2.1 - seize, villages, and more

Hello, denizens of FEU! These .ips patches can be applied on top of most modified fe8u roms. It makes the hacks play themselves. Maybe you enjoy the appeal of afkable games and want to stare at the screen most of the time, or maybe you’re just curious as to how well the AI can actually do. If you have your own romhack, maybe you’ll want to use this for some automated playtesting.

Main features:

  • Ending your turn causes all remaining units to act
  • Player units are given free vulneraries
  • Items do not deplete (as the AI does not go shopping)
  • Optional 100% growths version (compatible with SkillSys and non-SkillSys hacks)

So how good is the AI?

VQ Ch 1 - Pass

Although Vision Quest’s Ch 1 is an escape map (which the AI doesn’t understand), it defeats the enemies (although sometimes it just dies) and is near enough to the escape point by the end that I could manually finish the chapter.
mGBA_RRUP3N7Dj2

LoA Ch 1 - Pass

Legends of Avenir’s initial chapter isn’t too bad, though the AI did get a game over the first try.
mGBA_dAgiN7uXQe

BoB Ch 1 - Fail

The AI had no way of understanding what to do during this chapter, so it quickly failed.
mGBA_ORQhG2GD4H

This project is for entertainment purposes and is not meant to reflect in any way on the above hacks. An earlygame chapter being doable by ingame AI may be a positive trait in that it eases the player into the game.

The AI is good, but it does not work miracles. It does not visit villages, and it does not understand objectives: it basically just kills stuff and tries not to die.

Incompatible Hacks List

Sacred Echoes
Pokemblem

Please let me know if you find other hacks that are incompatible so I can add them to this list.

It’s actually pretty fun to play hacks this way imo. I like watching numbers go up :smile:

Enjoy lol

17 Likes

Ooh, ‘zero player games’ and AI have always been a fascination of mine, I sorta want to try this out. Hmmm.

2 Likes

Looks like you know what to do next :sunglasses:

2 Likes

For Justice & Pride, Prologue and Ch 1 are possible (tho Melinda does die by waltzing into an archer’s range)

Ch 2 is possible on paper, but Aderyn has a tendency to suicide, making chapter 2 heavily dependent on dodges

I’d imagine it’s theoretically possible to win with zero player input until Ch 4x, or Chapter 6 if you don’t get 4x, as these both require Aderyn to seize a point

1 Like

Interesting…

Wouldn’t use (the default) AI for playtesting personally as they have no idea of what to prioritize and it doesn’t look ahead many turns afaik.

I think if a chapter is being beaten by the AI then it is too easy. But if a chapter is not beatable by the AI, it is not necessarily too hard.

Well, tried it in my ‘Celestaris’ romhack and it seems it does not go well at all.
Has a chapter select and you’re presented with the first three chapters.
Chapter 1 fails (Lord dies to zombie dragons), chapter 2 will usually be completable, and chapter 3 fails turn 2 (Lord dies to the first group of enemies).
…Hm. Who knew I actually played better than AI.

1 Like

I set the player units to use a vanilla AI but with different weights on things like safety. The default one most enemies use is really terrible - it charges in and dies constantly.

Of course, lol. The AI can hold its own, but it’s not going to outperform most real players.

This was a fun little thing to try.
Tested it on my hack, Blades of Fate, and the AI did surprisingly well.

Prologue 1 was a breeze, Prologue 2 was pretty simple, but I had to help it open a door, and it killed Naomi, the archer.
Chapter 1 and 2 were easy for it, though it nearly killed Asha, the mage, on chapter 2.
Chapter 3 went a lot better than I expected, though it did kill half the party and Adrienne, a recruitable shaman. I did also have to stop the remaining party members from nuking themselves on Zakarias once they cleared all the reinforcements.
Chapter 4 was rough. It disliked the fog heavily, and because Silvia, the lord, was the only character who started in range of an enemy, she rushed off and ended up getting killed by two wyvern riders.

Overall though, very interesting and neat thing to mess with, great job on this :slight_smile:

2 Likes

Is that a challenge? Ha I’ll prove that I can play worse than ai!

3 Likes

Looks like your AI is already being used by content creators:

Only watched the prologue. Wonder why Seth wasn’t used by the AI in the prologue. Not for safety I assume. Does it know to level up lower-leveled units and keep higher-leveled units out of combat?

Seth starts at low hp, so he immediately goes into recovery mode. It doesn’t care about how dangerous the enemies are - it’s just “if x% hp or less, run away and heal”.

Ah gotcha.

Ended up watching the video a bit more. There’s some odd moments, like Vanessa suiciding on an archer (attacking at 2-range with a Javelin) at 10:09 and Natasha being able to somehow heal full HP units at 1:04:15.

Overall, pretty impressive it somehow got all the way to Chapter 8 (although there were moments it could have easily been gameover much earlier with a little worse rng).

Tried this with FE0 - the AI proceeded to throw Mona into like 5 enemies and immediately die, no matter what I did

I’m surprised it didn’t game over sooner! I think if your goal is no resets, then you’d want to give different units different ai (eg. Eirika the run away ai and Seth the charge forward ai).

The ai does not stand in the range of an enemy to bait them one at a time when already in range to attack. Basically, it does this:

  • if in range of enemies, attack in safest square
  • if not in range of enemies, move towards them but wait in range of 0-2 enemies.
  • if below 2/3rds hp, run away and heal up to 80%+

To change this, someone would have to actually write new ai. I only tried optimizing the vanilla ai - not writing a new one.

I think thieves have some hardcoding not to move towards enemies. It might have something to do with whether the ai is allowed to use door keys or lockpicks or whatever which is set per chapter.

I tried this with my hack, Flames of Redemption. It’s very simple in design and somewhat juggernaut-friendly so I figured the AI had a decent shot.

Hard Mode Run

The early part of this hack has very limited healing by design, which means infinite vulneraries made the first two maps a joke, lol. However, Ch2 is somewhat open with a lot of strong enemies so the AI didn’t stand a chance:

roman2

Normal Mode Run

I decided HM was too difficult, but maybe the AI could beat NM. I made a rule where I was able to recruit characters if they were in range, although it barely mattered because I ended up losing nearly everyone.

lily
ugh

My team by Ch6:
jacob

Jacob is an absolute beast of a muscle mage, though, and a capped one can actually solo the chapter. The only problem is that there is no way for the AI to understand that Roman isn’t as strong and must be kept out of harm’s way. Since my hack doesn’t have a way to reposition your lord, this is a dead end.

But if we add this feature, trap Roman, and let Jacob cook, we can continue.
jacob2

jacob0

This boss is bullshit and Jacob only has about 37% hit with Thunder. However, she will not counter, which means she’ll eventually get Gazzak’d. In the end, it seems like the AI can actually beat the first six chapters (or at least a better version of it with lord repositioning).

Observations about the AI
  • I don’t know if it was tweaked this way on purpose, but I noticed your units tend to stick together more often instead of charging alone like most enemies. This is optimal in a lot of scenarios, but the AI will get destroyed on chapters with unforgiving anti-turtling measures.

  • Sometimes, the AI refuses to move and is essentially softlocked without the player’s input. I’m assuming it happens when the enemies are too far away.

  • They ignore everything that isn’t an enemy, such as snags, breakable walls and probably doors too.

  • Any gimmicky chapters are pretty much a dead end, lol.

Unfortunately, I don’t think I made any groundbreaking discoveries, but it was a fun experiment. This is honestly really good.

1 Like

I wrote my own ai now.

ezgif.com-optimize_1

Writing ai is pretty tough, but I’ve definitely made some improvements.

Special cases:

  • If unit is lord and there are no enemies, move towards throne and seize it
  • for the first few chapters if a unit is promoted and expects to take nearly no dmg and there’s only 2 or fewer enemies that could attack you, don’t attack unless your target is a boss (so the jeigan doesn’t steal all exp)

Added support for the following when not attacking

  • talk to someone in range
  • visit village in range
  • loot chest in range
  • open door in range
    It will not seek these things out, however.

I also did stuff to make it more defensive and less likely to die. But units will still die, of course.

Edit: improvements and fixes

Example - now with kiting!
mGBA_nt7ekwDF1T

  • Eirika knows it is too dangerous both to attack or to approach, as if both fighters hit, she will die. But it is not to dangerous to stay within range of one enemy, so she does that instead.

They now also equip the optimal weapon for weapon triangle advantage based on nearby enemies.
mGBA_2C7mqvOWyR
Franz has a lance equipped and moves towards an enemy and equips a sword. This sort of thing is a lot more difficult than it sounds to make the AI do :sweat_smile:

13 Likes

Hey there! Great patch, been having lots of fun with it. One thing I want to try is to see how the AI does without being given infinite vulneraries. Tried to discard the vulneraries at the start of each chapter, but for most characters it comes back at the start of every turn if their inventory isn’t full, which makes this very tedious. I was wondering if it is possible to work around this so that the AI cannot infinitely use vulns, or if this is impossible currrently, uploading a version that doesn’t make item/weapon usage infinite? In this case the player can still just shop for the AI when items break or want to upgrade their weapons. A no extra vulns + breakable items version would be perfect, since the AI could still use all these items like vulns and elixrs, they would just be limited like normal (and wouldn’t constantly get vulns refreshed in their inventory).

Thank you :slight_smile: this is an impeccable feat. Crazy you can beat the game with no real player input.

2 Likes

Here you go.

2 Likes

Wow, I appreciate the quick reply. I’m new to FE8 modding so this is all so cool to me, thank you :slight_smile:

No worries, just took me a few mins to comment out the infinite weps/vulns part to make the patch, so it wasn’t any trouble.

The AI can’t trade or buy things, so I felt it was only fair to give it infinite uses personally.

Tbh I was a little tempted to cheat in some way (such as making it so 90% of the time lethal attacks would be dodged) since this would be very easy to do without anyone knowing, but I didn’t! Lol

1 Like