menu

Game Analysis AI Assistant for Age of Empires IV

Introduction

Hope everybody is doing great whenever you are reading this! I’d like to share some information about the popular real-time strategy (RTS) game, Age of Empires IV (AoE4), and the tool I’ve developed to help players analyze their matches and improve their gameplay.

AoE4 was released in 2021 but still remains one of the most active RTS games as of October 2025. Excitingly, a new DLC called “The Dynasty of the East” is set to release in early November 2025.

What is AoE4

As mentioned, AoE4 is an RTS game but don’t worry if RTS sounds intimidating or too “click-click-click.” AoE4 is actually slower-paced compared to other strategy games, which is a good thing. It gives players time to think and make decisions based on what’s happening in real time.

Before each match, you pick a civilization (civ). During the match, you build your base, manage your economy, train your army, and battle your opponent. There are different victory conditions, but landmark victory is the most common in ranked 1v1 matches.

Winning requires strategy. You need to consider your civ’s bonuses, your opponent’s civ, and the map layout.

  • Is it an open map where villagers can be harassed easily?
  • Are there gold mines close to your base?
  • How far is your opponent’s starting position?
  • What kind of army composition is your opponent using?

The game is set in the post-classical era, so you’ll command knights, archers, infantry, and more.

There are currently 18 civilizations in AoE4: English, French, Mongols, Delhi Sultanate, Chinese, Rus, Holy Roman Empire, Abbasid Dynasty, Ottomans, Malians, Japanese, Byzantines, Order of the Dragon, Zhu Xi’s Legacy, Ayyubids, Jean d’Arc, House of Lancaster, and Knight Templar. The upcoming DLC will add four more civilizations.

Each civ has its own playstyle and unique units. For example, the English have the Longbowman, a long-range archer with slower movement but better range and higher cost compared to a regular archer.

How the Game Analysis AI Assistant Helps

The Game Analysis AI Assistant is a tool I built to help AoE4 players review their matches, identify mistakes, and learn better strategies over time. It also helps players interpret their opponent’s strategy and plan effective counters. The assistant can even compare your performance with top players to highlight differences in decision-making and execution.

I’ve shared a sample output of the AI assistant’s analysis later in this post so you can see how it works.

Updates to the Game Analysis AI Assistant and Why They Matter

I’ve been working on the Game Analysis AI Assistant for a few months now, continuously looking for ways to make it more accurate and insightful. Recently, I’ve made an important improvement that enhances the quality of the AI-generated reviews.

Before describing the update, here’s a quick overview of how the assistant works. When you provide a match link, it processes your game data through multiple steps such as parsing your match info, augmenting it with expert-level data, and connecting it with relevant game knowledge such as civilization bonuses, economy strategies (1TC or 2TC), military strategies (cavalry-heavy or infantry-heavy compositions), etc.

To connect your match data with the right game knowledge, the AI assistant uses a “vector database” containing thousands of game knowledge entries. Only a portion of these entries are relevant for a given match, so the AI performs a “vector search” to find the most relevant ones.

You don’t need to understand all of this to use the tool, but I’m sharing it just to explain why this update matters.

Previously, the assistant used an embedding model for the vector search that didn’t always distinguish relevant from irrelevant game information accurately. As a result, some analyses could include mismatched or incomplete context.

To improve it, I’ve researched and tested multiple embedding models on a sample dataset and found fascinating results. The following table shows a simplified version of my tests, where 1.0 means two sentences are identical and 0.0 means they’re completely different. A better embedding model should give higher similarity scores for related sentences and lower scores for unrelated ones.

Sentence A Sentence B Model A Model B Model C Model D
Balancing food and gold to sustain Japanese mounted Samurai production Balancing food and gold for Delhi Ghazi Riders Feudal 0.763817 0.780322 0.784596 0.613802
Chinese counters to Abbasid archers and battering rams Castle Age Chinese Castle Age answers to enemy mangonels 0.774029 0.773624 0.882328 0.667558
Counters to French early knights with archer support Counters to spearman and archer mass as French 0.820385 0.797822 0.88552 0.777139
Balancing food and gold for English men at arms and knights Balancing food and gold for archers and men-at-arms 0.813494 0.7815 0.913027 0.841913
Knights Templar Hospitaller Knight unit role training building and counters Hospitaller Knight unit role training building and counters 0.95965 0.894969 0.969956 0.944327

As you see, different models behave differently. After careful testing, I’ve switched to a new model that performs better for this task. I’ve also rebuilt the entire vector database with it.

As a result, the AI assistant can now connect match data to more relevant knowledge, producing analyses that are more accurate, contextual, and useful.

Sample Review Before and After Updates (Same Match)

Below is a real comparison of how the AI Assistant analyzed the same match before and after the latest update. The update improved the way it understands and connects in-game events with strategic knowledge.

Review before updates Review after updates

What went wrong in your game?

  • Early game (0:00–6:00): You faced early_knight_pressure (the french trained lancers immediately on hitting Feudal at ~04:00), but you had only a single barracks and very few donso, with no quick walls/outpost on exposed resources. You lost villagers at 05:00–06:00, which ceded tempo and map control right as the opponent’s first lancers arrived.
  • Time: 06:00–12:00: From ~09:00–11:00 you floated large resources (e.g., >800 gold, >300 wood at 09:00–10:00) without either clicking Castle or adding enough production/counters, and you stayed on archers. Into growing french lancers + arbaletriers, that composition trades poorly; you gave up the initiative and bled more eco.
  • Mid game (12:00–18:00): You hit Castle at ~13:00 with Grand Fulani, but continued prioritizing archers/sofa and delayed key armor upgrades, while the french hit Castle at ~15:00 and powered up lancers (chivalry/bloodlines). The result was heavy villager losses (~11 at 14:00) and losing fights due to composition mismatch (too few sustained donso + javelins) versus knights + arbaletriers.
  • Time: 18:00–24:00: You repeatedly floated big banks (e.g., 21:00 gold 1704; 22:00 food 1023/gold 1098; 23:00–24:00 still >1k) but did not scale production or siege enough, even as the french added a keep at 22:00. Without more production and siege, you couldn’t convert eco into map control, and villager pickoffs continued.
  • Late game (24:00+): You clicked Imperial at 26:00 with large banks but without a stabilized army/production. You then lost huge armies (e.g., at 28:00: 26 archers/47 donso/12 sofa; at 29:00: 8 villagers) while still floating thousands. The core issues were insufficient production scaling (far short of the 20–30 buildings typically needed at this stage) and continued composition mismatch into mass lancers + arbaletriers.

How could you improve?

  • Early game (0:00–6:00): Scout for the first french stable. Add 4–6 early donso, quick palisade walls/gates, and an outpost on your first gold/food; garrison and repair to blunt the first lancer. Keep 1–2 donso parked with vulnerable villagers. As wood allows, keep placing houses around your pit mine to stabilize your gold income.
  • Time: 06:00–12:00: Commit to a plan and spend to hit it. Either: (a) Feudal pressure with donso + javelin (2–3 production buildings, constant queues, ranged armor early), or (b) fast Castle—click the moment you hit the food/gold threshold. If you’re floating, add production first and reassign villagers to balance spend (don’t sit on 800+ gold in Feudal while being raided).
  • Mid game (12:00–18:00): Versus french knights + arbaletriers, anchor your army with mass donso and sustained javelin production; stop investing in archers into arbaletriers. Prioritize early ranged armor and melee armor. If you choose Farimba in future, use it to power a mass javelin timing push; if you go Grand Fulani, still keep donso + javelins as your core. Wall in expansions, add a defensive outpost on exposed eco, and focus-fire lancers to deny chivalry value.
  • Time: 18:00–24:00: Spend your banks by scaling to ~10–15 production in Castle (more barracks + archery, with a stable if you’re using sofa), and add siege access. Use siege (rams/mangonels) to break keeps and punish arbaletrier clumps. Keep armor/damage upgrades rolling and rally armies to a safe staging point to prevent trickle losses.
  • Late game (24:00+): Before clicking Imperial, cap out army and production; target 20–30 production buildings to spend thousands per minute. In Imperial, add hand cannoneers behind your donso to punish heavy units, keep javelins for arbaletriers, and use sofa to dive their backline when knights are pinned. Add long-range siege to remove fortifications, and tighten villager safety with layered walls and safer farm placements.

How do better players handle this?

  • Early game (0:00–6:00): They expect the first french lancers, pre-wall key approaches, park early donso at vulnerable resources, and add a single outpost to keep miners/gatherers safe—while maintaining a clean pit mine + house ring for steady gold.
  • Time: 06:00–12:00: They don’t sit on big floats. They either hit a Feudal donso + javelin timing (open-map pressure) or click Castle immediately, adjusting villager distribution to meet the timing cleanly.
  • Mid game (12:00–18:00): They pick a strong Malian core (donso frontline + mass javelins). If using Farimba, they power out javelins in batches; if not, they still avoid archer vs arbaletrier trades and start armor upgrades early. They pressure french gold to slow knight numbers.
  • Time: 18:00–24:00: They scale production ahead of income and add siege to break keeps and ranged masses, spending down banks quickly and rallying for decisive fights rather than trickling in.
  • Late game (24:00+): They delay Imperial until the field is secure. When they go up, they’re already on 20–30 production, with compositions that answer lancers + arbaletriers (donso front, javelins and hand cannoneers behind, sofa to dive, and siege for structures).

What went wrong in your game?

  • Early game (0:00–6:00): You floated a lot of wood and gold (e.g., by 06:00) while French lancer appeared as early as 04:00 and you had only a handful of donso. The light defensive setup led to early villager picks (05:00–06:00) and ceded tempo.
  • Time: 06:00–12:00: The opponent scaled into a growing archer mass (13 by 09:00, 16 by 10:00) with continuing lancer presence, but you added very few javelin_thrower until 10:00–12:00. You banked heavily for Castle and then took fights around 10:00–11:00 with a composition that underperformed into archers+lancers, costing units and momentum.
  • Mid game: 12:00–18:00: You clicked Castle at 13:00 but immediately lost big (10 donso, 7 javelin_thrower). Then at 14:00 you lost 11 villagers. Despite that pressure, you added a second Town Center at 17:00, which slowed army output while raids continued.
  • Time: 18:00–24:00: A decisive fight around 19:00 wiped much of your army (large donso/sofa losses) into a French arbaletrier + lancer core, while your blacksmith only appeared at 20:00. Your ranged/melee upgrades came very late (many after 22:00+), so your army fought with worse stats, and you floated >1k resources without converting into the right counters.
  • Late game (24:00+): You aged to Imperial at 26:00 while still trading poorly and then lost a massive fight at 28:00 (26 archer, 47 donso, 12 sofa, plus villagers). Upgrades like ranged attack/armor finished very late (27:00–28:00), and your rebuild after the wipe lagged despite large resource banks.

How could you improve?

  • Early game (0:00–6:00): Expect early French cavalry. Open barracks in Dark Age and get continuous donso production; add a few palisade segments/gates and an early outpost on a key resource. Spend early wood/gold on anti-cavalry and defenses instead of banking. Keep queues active so wood/gold don’t sit idle.
  • Time: 06:00–12:00: As archer numbers grow, add an early archery_range and start javelin_thrower production to deter ranged mass while maintaining donso for cavalry. If you’re banking for Castle, avoid big fights until you’re up; otherwise, spend the bank on units and the first ranged attack upgrade to win Feudal trades.
  • Mid game: 12:00–18:00: Stabilize before greedy eco. Finish basic walls/outposts and park a few donso on common paths to reduce villager losses. Versus French knights in Castle, add musofadi_warrior for heavy counters and scale javelin_thrower versus arbaletrier. Use your Malian archers’ poison arrow upgrade with focus fire on knights to stack damage over time.
  • Time: 18:00–24:00: Don’t take even fights without your upgrades. Start blacksmith techs as soon as practical: ranged attack first, then ranged armor, then melee armor, then melee attack. Spend your bank on more production and the correct mix (frontline donso, backline javelin_thrower, a few sofa for chase). Tighten macro by cycling production hotkeys so queues never idle. Balance food/gold for donso+archer lines by leaning on Pit Mines and the mansa_quarry, supplementing food with cattle so you can keep gold-heavy unit production running.
  • Late game (24:00+): If behind or mid‑fight, delay Imperial and pump army/upgrades first. If you do click up, avoid engagements until upgrades complete; wall and buy time. After a wipe, re‑max instantly from all military buildings and rally away from the front to avoid trickle deaths. Versus arbaletrier + lancer, favor javelin_thrower + musofadi_warrior with donso cover over mass donso/archer. Use griot_bara festivals and cattle to convert your big food bank into continuous production.

How do better players handle this?

  • Early game (0:00–6:00): They blind‑respect French early cavalry with immediate spear‑line production, light walls, and a stabilizing outpost. Early resources are converted into units and safety, not banked.
  • Time: 06:00–12:00: They pivot to javelin_thrower as soon as enemy archer mass is visible and either take a clean Feudal timing (with early ranged attack) or a clean, fight‑free Castle click—never scrappy fights during the transition.
  • Mid game: 12:00–18:00: They secure eco first (walls/outposts) before adding extra Town Centers. Against French knights and arbaletrier, they field musofadi_warrior for heavies and javelin_thrower for ranged, then layer Malian archer poison for focused DOT on priority targets.
  • Time: 18:00–24:00: They line up fights with completed upgrades and correct ratios, add production to keep spend high, and maintain reinforce paths that prevent trickle losses. Ranged attack → ranged armor → melee armor → melee attack is the default upgrade flow for mixed infantry/archers.
  • Late game (24:00+): They only go Imperial with map stability and an army buffer, then power-spike with immediate upgrades. After a loss, they re‑queue a full army instantly and adjust composition toward javelin_thrower/musofadi_warrior + donso to specifically counter arbaletrier + lancer.

What is Next

Next, I plan to add support for the new DLC civilizations. The Game Analysis AI Assistant won’t support them on day one, but I’ll add them as soon as possible, realistically, within a few weeks after release.

Hopefully, I’ll continue posting updates and improvements as the project evolves.

Support & Thanks

The Game Analysis AI Assistant is completely free to use. There is no signup or account creation required. You can simply visit the tool, share your match link, and get your analysis instantly.

If you find it helpful, you’re welcome to support my work through donations. It’s completely optional, and donations are not connected to any usage limits.

Thanks to everyone who has tried, shared, or supported the tool so far. Your feedback keeps this project alive!