I’m still playing Fire Emblem Heroes, in a low-key way. It’s a fun diversion, and it’s fun to see your heroes grow and thereby open up new possibilities. But there is an element of chance in there: when you summon a new hero, there is a randomiser that determines who you get, and at what star rating (from 3 to 5 — 1 and 2 star heroes can be earned by completing special maps). And you can get the same hero multiple times.
So you end up with a whole roster of heroes, and some are duplicates, and they can have different star ratings. You can send heroes home (remove them from your roster), and gain items that you can use to upgrade other heroes, so that’s something you want to do with duplicate heroes that you’re not going to actively use. But you also want to get balanced parties: a party with only sword fighters won’t go far.
So I thought it would be cool to have a spreadsheet with all my heroes, so I can do some analysis and make informed decisions, because the game itself doesn’t really offer any analysis options. Yes, you can sort the heroes according to up to four criteria, but you can’t answer questions like “How many mounted lance fighters do I have and what are their star ratings?” easily.
As always, I set to work to see what I could come up with. I started out by using Apowermirror to mirror my phone screen on a PC. Then I wrote a macro for AutoHotKey (which can do amazing things) to click on certain spots in that window (which would be sent as taps to the phone) to go through the heroes. It also made screenshots with the printscreen button, which I then saved to file with irfanview from a commandline. So I ended up with shots of all my heroes.
Then, using ImageMagick to cut out the part of the image that contains the star rating, masking that and then comparing it with prepared images of all the different star ratings. That allowed me to determine the star rating of each hero!
All that was missing was to determine the name of the hero, so that I could cross-reference that with one of the many wikis. I tried using Tesseract, an open source OCR engine. The idea was that I would cut out the part of the image that contained the character name, and pass that through the OCR to find the name. However, the recognition quality was just too bad, because of the fuzzy, anti-aliased images.
An alternative would be to manually type in the name of the character for each hero, and maybe correlate the image of that name with all the other names, but that’s costly in terms of processing power, and is just too much manual processing to make it worth my while.
So I shelved that little project. Too bad, but it was fun to see how far I could take it with a few evenings of tinkering.