I would like to share the AI that I have been working on over the past few years - Bright Spark!
What games does it play on?
Bright Spark plays on Definitive Edition.
Game Mode: Random Map
Maps: Should play on any map connected by land (and now Team Islands and Fencrazy!) - if you find one that doesn't work, then please let me know and I can add it in

Victory Condition: Standard or Conquest
Pop: 200+
Civs: Any, including expansions
Difficulty: Any - difficulty levels have been built in so it will play easier on lower levels.
What's the story behind Bright Spark?
6/7 years ago, my wife introduced me to AoE2 with the old disk she still had from when she played it growing up. I was terrible, and she won easily all the time. In the box I found the guide to writing custom AIs in AoE, so I joked that while I wasn't good enough to beat my wife at the game, I would create an AI that would. After trial and error (and some help from BearTheGreat's tutorial) I put together an AI that could beat my wife at the game, but it was also able to beat us both 2 vs 1 working together (we were fairly beginner level back then). Thus began a tradition of us playing co-op together to beat the AI, and when we did, I would work on it to improve it further, and then jump back in the ring.
Later on we discovered our friends also played AoE 2, but the HD version, so we moved over to that and played with them. Not all of our friends liked PvP, so Bright Spark was used as a sparring partner for friendly co-op games with our mates.
When the pandemic hit and we were all in lockdown, our co-op games became a weekly event and quite frankly kept us all sane as a few of us lived alone at the time. That weekly game has continued on and we still play, and as you can imagine us and Bright Spark have improved lots over that time.
At the start of this year we switched over to DE and I've made a start of using DUC which has started to help it improve a lot. In it's first iteration, Bright Spark would go about just spamming spearmen + skirmishers and going attack-now - now it adapts to its opponents, takes into consideration what civs are on its team, and it can now do some early raids while (mostly) avoiding TC fire. I'm at the point now that I think it is worth sharing, and possibly entering the ring against some other AIs in the community. It's definitely not finished and I know of places it can improve, but I also know I will be better off having feedback from more people rather than carry on working on Bright Spark in isolation

Thank yous
A big thank you to BearTheGreat and interlepus for helping me improve from the base paperwork and for those who created the AI Scripting Encyclopedia (I wasn't sure if it was just Leif Ericson or a team of people), I only just discovered it a couple of months ago and it's been so so helpful (I was using the userpatch reference guide before that and not everything worked XD)!
Finally thank you for the kind welcome to the AI Scripters Discord channel too!
I hope you enjoy playing against Bright Spark and if you have any feedback then please let me know.
Best wishes,
Bandit
Update - October 9th 2022
Major update for Bright Spark, which should be a stronger foundation for later updates. Here is what has changed:
- DUC villagers: villagers are now commanded by the script rather than default behaviour. This wastes less food and spreads villagers out better across resources. In practice this means sometimes a slower feudal age but with a stronger food economy and a much stronger Castle and Imperial age.
- Improved fast castle: Reduced castle time for fast castle strategy from an average of 18:00-20:00 to 15:30-17:30.
- Arena strategy.
- Prioritise upgrades: Unit production will halt temporarily to get upgrades quicker.
- Quicker castle-age aggression.
- Improved siege in late game.
- Improved assault mode (units will guard siege and not just throw themselves at castles).
- Bright Spark will now cul...send unproductive villagers to an improvement programme when reaching pop cap to make room for larger military.
- Bright Spark no longer sends its army after deer.
- Updated counter system to adapt to Indian civ unique units.
- Burgundians can now research Flemish Revolution.
- Improved decision making when building farms.
- Bright Spark will lock gates on Arena when enemies are near.
- Improved market placement.
- Improved trade.
- Improved villager allocation to optimise military production.
- Bright Spark will queue villagers in Dark Age to get an extra villager by age up.
- Bright Spark no longer "counters" Genoese Crossbowmen with spearmen.
- Villager allocation changes when stone and gold are off the map, improving late game eco.
- Altered scouting on Arena so scouts didn't get stuck on trees.
- Pause villager production when rushing to Imperial Age.
- Villager production can now borrow from escrow sources, maintaining better villager production.
- Will free resources or buy them to build camps when required.
- Slight adjustment to how Bright Spark understands team bonuses.
The villager DUC is a big change and so I have added the latest version of (Bright Spark 22) as a separate file should people prefer the old version (which is actually Bright Spark 14). There are a couple of issue below that I know about and am working on:
Update - October 31st 2022
This update only changes a few things but seems to have made a big impact on Arena. Bright Spark can now compete with DE AI on Extreme Difficulty on Arena. Here are the changes:
- Faster fast-castle
- Alternative starts for Mongols and Malay
- Siege pathing has been improved and no longer likes walls as much
- Siege protection improved
- Improved eco balance
- Bright Spark no longer builds scorpions or mangonels without other units for cover
- Some castle and TC avoidance (just started this, not great)
- An attempt at mangonel fire avoidance for archers, cav archers and hand-cannoneers (again not great as just starting with this)
- Bright Spark now builds more mills, lumber-camps and mining-camps to keep vills closer to resources
- Held back a bit on the villager culling
- When losing, Bright Spark will hide units in buildings rather than trickle them out
- Fixed bug where Bright Spark was trying to train Condottieri when they weren't Italians, or at imp.
- Better assault targeting on team games and free for all.
Update - January 5th 2023
- Increased military buildings to 12 in late game
- Added resign rules so Bright Spark resigns quicker when losing (only when 1 team member so far, more to follow)
- Increased max villagers to 120
- Added mill production after dark age, food eco is much better
- Added some taunts for fun, each colour has a different taunt set
- Builds 7 TCs in the late game allowing Bright Spark to rebuild quicker after defending assaults.
- Bright Spark now has difficulty levels! Main difference is villager production, trade and lower difficulties won't rush. Will build on these as I go.
- Monks now collect relics again.
- Can now play on mixed water maps and full water maps where there are 2 islands (like Team Islands).
- Bright Spark won't sell stone as quickly when going castle-age so can build 2 more TCs at castle-age start.
- Can now do Land Nomad starts and play on Fencrazy.
- Started added Tower avoidance for early raids.
- Fixed bug that delayed feudal-age on Arabia.
- Bright Spark's second wall on Arena now only gets built on Arena...
Update - January 30th 2023
- New military micro! Rewritten raiding, defending and ally defending scripts. Adding as an extra version as this will raise difficulty even on lower difficulty levels.
- Bright Spark attacks a lot sooner
- More likely to make siege late game
- Better TC, Tower and Castle avoidance in raid mode
- Fixed a bug causing Bright Spark to retreat too early in team games
Next on the list:
- Rewriting assault script to match the new micro - military still try and protect siege but it is a bit awkward.
- Cross AI/Human compatibility: early experiments show I can identify AI names/PlayerIDs and adapt Bright Spark's behaviour to support them as allies.
- Long distance boar luring with scout
- Adapt navy rules to work on multiple islands
- Build navy into Bright Spark's dynamic unit selector to allow for unique ships - it's pretty static for now.
- Pockets are much more likely to go into castle age units in team games.
As always if you have any feedback then please let me know
