[FE8] FE Infinity - AI System That Builds Original ROM Hacks (Prototype Demo)

Hey everyone, I built FE Infinity, a proof of concept system that uses AI and buildfiles to create original ROM hacks with any number of chapters in one shot. This is a demo of an early prototype, and this post will discuss its strengths, weaknesses, and use-cases, as well as ask the community how it feels about AI tools in ROM hacking.

Demo Video (If only interested in the game demo, watch from 3:27-14:08)

Open Source Code (Feel free to run it yourself and/or look through the code)

tl;dr: It works! But doesn’t produce great games by itself. However it’s cool tech and something like it could be used as a tool for ROM hackers.

How it Works

For a technical overview, check out the demo video at 14:08. Otherwise, here’s a summary. There’s a complex workflow of AI calls that craft the story, create characters, decide unit placement on maps, and more. This workflow passes its output to another part of the system that writes it to buildfiles, which can be run to create a .gba file containing the new hack.

Strengths

  • It’s quick and cheap. In my example, it created a 3 chapter game in 100 seconds and it cost less than a penny in AI cost.
  • LLMs are good at story ideas, characters, and conversations (although it takes prompting to not get generic ideas)
  • This is an early prototype - there’s a lot of low-hanging fruit that could easily be implemented to up the quality of generated games

Weaknesses

  • The quality is nowhere near dedicated human ROM hackers. In no way am I claiming that it’s even close! This is a proof of concept, remember?
  • LLMs (even multi-modal ones like GPT4o) struggle with making sense of a chapter’s map, resulting in sub-par unit placement. Further prompt refinement could make this better.
  • It is not able to handle complex game mechanics, such as creating game code to check for flags such as character deaths across chapters. This would be somewhat straightforward to add.
  • In its current state, there’s no control over having the AI change things as it makes the game. It just makes the whole game on its own. In the future it could stop and get feedback from the creator and course-correct.

Use-Cases

  • For solo players who want to explore a niche world (think: a FE game set in the world of your favorite anime, book, or other game)
  • For ROM hackers who want to quickly get to a working starting point, and manually tweak from there
    • The .gba is openable in FEBuilder but it’s a little hard to work with. This could be improved though.

Where to Go From Here?

Which would you rather use:

  1. An individual game system that will generate the next chapter after you finish one, based on decisions made in the story and objectives the player is able to achieve in battle
    • Unlike its current state, where it generates the whole game at once
  2. A set of AI-powered tools to assist ROM hackers by taking on work the hackers don’t have fun doing, allowing ROM hackers to more easily bring their vision to life
  3. A hybrid tool that generates most of a game but pauses for user input at key moments (e.g., unit placement, chapter objectives). Even after the game is created, you can go back in and tell the AI to change the story in a specific way, etc.

My Ask of You

  • How do you feel about AI tools in FE ROM hacking? I’m open to hearing all opinions, and I certainly don’t want to build things the community doesn’t want.
  • Your thoughts on the Where to Go From Here section.
  • I’ll have it make a hack for you! Comment with a one-sentence description of the game you want the AI to create and I’ll make a 3 chapter game and send it to you to demo.

Closing Thoughts

FE Infinity is not meant to replace the creativity and effort of human ROM hackers but rather be an idea of how AI can complement and accelerate development. As you can see, it doesn’t do a great job creating a game on its own, but I think some version of this tool could help ROM hackers bring their visions to life.

I appreciate your time and would love to hear your thoughts,
Neon


Credits
The buildfiles part of this system was adapted from Legends of Avenir
Character portrait options for AI to choose from are by Kanna

15 Likes

Really cool stuff! I appreciate transparency in terms of what the use cases of this tech are suppose to be and what its limitations are.

Speaking personally, I think the biggest appeal of something like “AI makes a hackrom” is something adjacent to Novel AI or AI Dungeon, where quality isn’t really the expectation but it reacts to your inputs in interesting ways. I think expanding on those elements would be utilizing the appeal of the tech the best.

As a hacking assisting tool, the reality is that it will difficult to find use among the average hacker unless it can play nice with FeBuilder. Buildfiles aren’t particularly difficult, but it takes a second a learn the basics, and any hacker looking to AI to build their hack will have little interest in learning those basics. The Hybrid tool idea is perhaps more useful in this regard, but unless the GUI basically becomes a second FeBuilder, it won’t really become a foundation that can be directly tweaked.

I will say, while LLMs have gotten quite good at understanding how to formulate sentences and follow common writing templates, a player will be able to tell pretty early that certain ideas and themes aren’t being carried over or expanded upon across scenes or even paragraphs. Not that it isn’t super fun to see what an AI will come up with based on a prompts, but LLMs don’t currently have the ability to make an engaging story. I’d generally recommend any hacker that doesn’t want to write to just have limited to no storytelling, as many popular hacks have already done.

5 Likes

I think a system like this could really work well in a randomizer setting or, if such a system could be implemented in a GBA with its outdated C code language, it would rule in a Rouge-Like. Heck, I think it would work great just plain setting it up like a Mad Libs with friends and see what game you made.

If not for that, I think that if it could make a map if you’re feeling stumped on what to make would be really helpful.

1 Like

Thanks SirSpensir! Great feedback and I appreciate your well thought-out response.

This would be fun to run with, and my personal answer of “Where to Go From Here” is the same as this. I’ve also played AI Dungeon and it was an inspiration for trying out this hack system.

Agreed, trying to build a better FE Builder sounds like a nightmare too…

Valid criticism here - I wonder if there’s some combination of AI agent chains reflecting on a story to go over it in multiple passes to try to make it more unique and engaging. Out of the box they definitely don’t create unique plots.


Thanks again for your thoughts and have a great one.

1 Like

Very cool idea - although it’d probably be easier to build my own game engine to do that instead of trying to edit the GBA code! I just might try it…

1 Like

I think the fact that one needs to pay for an API key to even use it is a good barrier to entry. Makes it so idea guys can’t just spam out low-quality slop.

5 Likes

Cool stuff. Do you think you could share some screenshots of the maps & unit placements it makes?

Ai generated games are adjacent to games with randomized dungeons / maps, so I think it’s an interesting frontier. I haven’t used ai for this, but fe map creator generates random maps, and I recently made advance wars maps generated ingame.
https://feuniverse.us/t/aw2-self-randomizing-rom-complete/24788/6

Advance wars was easier to do this with than fe8, but ingame generated chapters for fe8 is something I’ve had in mind for a few years now, so it’s cool to see something similar.

2 Likes

Thats neat to mess around with and use it as a jumping off point like you say.

Hows it do with sprites and color palettes?

2 Likes

shame it doesnt work with LT but this is a pretty amazing already

1 Like

It would actually be easier to implement this in LT - if there’s a lot of interest I could do that

1 Like

I took a bit of a short cut with the character portraits - for now the AI chooses from a set list of 80 existing portraits (from the FE Repo) for each character.

In the future it could use Stable Diffusion or Flux to create unique portraits for each character, but that’s not the current state

1 Like

Unfortunately that is the system’s weakest area.

I tried having an LLM make a map from scratch but I couldn’t get it to be anywhere near playable. LLMs have a really hard time with large grids and spatial data.

As far as the unit placement, I was able to rig the AI to do that by splitting it up into multiple steps: The AI views the image of the map and the tile data and comes up with areas of the map. One area might be “Southern Forest” or “Throne Room” with data about the terrain within that area. This data object is much more useful for the next AI that decides the unit placement than a raw grid of text.

Since I couldn’t get the AI to create decent maps, I had it choose from a list of 60 existing maps from the FE repo for each chapter.

Additionally, the unit placement is iffy at best - this would be something a human using this system would need to tweak heavily.

This is super cool! I think an AI would need help from some programmatic map creator like this instead of trying to do it from scratch.

1 Like

As someone who does a lot of randomization in LT, having something like this would be… scary, but in a cool way. I have mixed feelings about AI as one of the people in fear of losing there jobs from the AI uprising.
But seriously, if this would be easier to implement in LT, I for one would love to see it. Feel free to drop into the server if you haven’t already and connect with the other devs who know code to see how they feel about it. Would love to hear Rainlash’s thoughts.

2 Likes

Ironically my first iteration of this was in LT, but for some reason I thought the community would be more interested in it if it was making real .gba files… I guess I was wrong!

I’ll hop in the LT discord and see what they think.

3 Likes

Aleatoric Fire Emblem real

1 Like

Been having a bunch of troubles running it. Seems like i keep getting a bunch of different errors i dont know how to fix

Hmm, what’s the part that it’s stuck on? And what OS are you using?

I’ve seen some romhacks made based on ChatGPT’s input, and it did have some interesting ideas for gimmicks but the enemies turned out somewhat overtuned. It’s promising to see that there’s progress in AI actually implementing things.

If the intention is to make it usable by a larger crowd in the present, making it compatible with FEBuilder would be ideal. This doesn’t mean much, since FEBuilder can read buildfile romhacks just fine. It might struggle if you obfuscated pointers or did some complex changes to the engine, but this is the kind of thing you wouldn’t do in FEBuilder anyway and would be supposedly skilled enough to handle yourself by that point. I’m not sure exactly what makes it hard to work with, but if the pointers are where FEBuilder expects them to be, I think it’d be fine for the usual things like chapters, units, classes, etc.
Now, as much as I’d prefer to see it be a romhack, if you’re looking at the future then compatibility with Lex Talionis is probably better in the long run, since that is also getting updated. Another important fact is not being limited by the GBA restrictions. You could make map generation be outsourced to some image generation AI, since maps in LT are images not constrained by tilesets, or some music generation AI for BGM, since we wouldn’t be limited by the GBA soundfont (or whatever’s the best term for it, I’m not a musician), for example.
I understand that you already went the LT route, just thought to point those factors out anyway.

As for how it works, if it could be made modular, that would be a ideal. I guess that’d be a mix of 2 and 3.
Specifically in my case, I usually had a clear gimmick I want to implement. But I also need a map and units to make that gimmick playable, and it helps to have some cutscenes as well. So I would use it for those 3 things, and then make events myself. If I’m impressed enough by the events the tool makes, perhaps I’d consider leaving those to it as well, but the bar would be higher since events are what I enjoy the most. Since my chapters tend to be event-heavy, I’d probably do one chapter at a time until I’ve tested it enough.
But, on occasion, I also think “it would be cool if there was a romhack based on this setting, but I don’t have any other ideas for it”, and that’s where I’d give it a description of the setting and let it do everything else for multiple chapters. Maybe then I’d get inspired to add in some events to it.

As for some generation suggestions, the topic What historical events would be well-suited for a Fire Emblem game? has some good ideas that you could put as a prompt. If I may suggest one: “A romhack centered on Oda Nobunaga’s unification of the Oda clan after the death of his father and the succession disputes that followed.” It’s a simple prompt, but since there’s historical background you could specify which conflicts or add more details if needed.

1 Like

gets stuck in different places, sometimes after everything is generated, sometimes before. I can send you screenshots of the errors if you’d like. I’m running it using GIT bash on windows 11.

Thanks for the thoughtful response!

Agreed - I think LT is the best path forward. Messing with the build files had a massive learning curve and introduced unnecessary GBA restrictions.

And I appreciate the feedback on what you’d want next :pray:

3 Likes