Charon (AOK AI)

Upload your latest creations here.
Please note that by posting comments to posts in this forum you forfeit your personal copyright on whatever you post. AI Scripters reserves the right to re-use objective comments in script reviews without requiring the posting author's permission. Credit, where appropriate will be given in such cases.
User avatar
MrElephant
Swami
Posts: 121
Joined: Sun Dec 20, 2020 6:28 am

Charon (AOK AI)

Post by MrElephant »

Hello All,

Please welcome my AOK Vanilla AoE 2 AI that I will be working on, Charon. The AI's name comes from Greek mythology - the ferryman of the dead.

First, this AI is made for AOK- as mentioned in the title. This means the AI is made for the original base game. The plans are to make this AI support all civilizations in Age of Kings. Currently the preferred civilization is China, but I have tested it with Teutons- and it seems to play fine with them as well. No unique units are created at this point. What you will notice with this AI is that it will only produce 50 villagers, and that is because the original game only supports 50 working villagers. There are also some other key differences which I will not go into here.

Game Types:

Versions: This AI is meant to run on AOK, but has been tested on future iterations of the game- and is compatible.
Map Types: Charon can play on land and water maps. Specifically Black Forest, Arabia, Islands, and Team Islands. Other land maps are supported, but the AI will consider the map to be a land map.
Civilizations: Charon prefers to play Goths followed by Chinese right now. All other AoK civs can be used however.
Population: The AI is meant for 125 population- the competitive population of that era. However, it does not resign if another population limit is selected.

Future Updates:
Implement Japanese Civ.
Implement Viking Civ possibly.
Continue monitoring water strategy, and testing for improvements.
Unique units to be added.
Additional strategies to be added (possibly for water?)

Side Note:

I am also including in this post a previous AI that I worked on, Thanatos. A few of you may of heard of me working on this creation. Originally I spent four months working on this AI only to find out 50 villagers were supported in the base game. This led to me having to completely restart my AI from scratch with a brand new strategy. Thanatos is a decent AI- but it needs the 100 villagers support for its economy. In case you are interested, its name comes from the Greek word, meaning Death. It can play any AOK civ, but I found it prefers to play Persians. It prefers to play land maps, but water maps can be played as well.

Edit: 12Jul2022- Included an old collection of files for Thanatos. Nothing significant should have changed vs 25Jun2022 files, but should have included the 10Jul2022 zip.

Update 15Aug2022- Additional strategies are included. Furthermore, Charon responds to 150 and 151 taunts for tournaments, or removing debug messages.

Update 13Jan2023-Important changes and corrections have been made. Corrections to farm issues, and a lot of additional changes have been made. Especially to Charon. I consider Thanatos to be complete at this point. I may come back to work on Charon in the future. Problem is, he has reached his 1000 rule limit, and is pretty difficult to work on. It should be noted that Charon is the better of the two AIs overall. If the game lasts long enough, Thanatos can beat him though possibly. At this point, Charon does produce Chu Ko Nu, and will produce bombard cannons if Teutons are chosen. Chinese are still preferred.

Update 24Jan2023- Issues with goals and Charon not building his walls in late Imperial-fixed. Water Strategy attacking much improved!

Update 29May2023- Many updates here

-Knight/Camel strategy much improved
-Archer strategy much improved
-MAA strategy much improved.
-Added Goths as a civ. Only plays MAA at this time.
-Team games now will choose a strategy based on player number/pocket/flank play. This is unless the player selects a strategy for Charon to play.
-Other strategies can be selected now. 150 for MAA, 152 for Knights, 153 for Camels, and 154 for Archers.
-Timer reorganized to ask for help more often when under attack. To continue viewing to make sure this is accurately working.

25Jun2023 - Slightly adjusted to play land nomad
-Scout strategy created when camel strategy is chosen for non-camel civs.

19Jan2024
An update for Charon
-Some extra non needed bad farm check rules were commented out. Not needed, and space for rules was needed.
-Some very old special "retreat" code was included. This is based on the old Kosmos and BTG ais, but mainly from Bari. This was very much needed.
-Team Attack rules were updated. Countdown timer was reduced so Charon can attack more often.

An update for Thanatos (I know I said I wasnt going to work on him anymore, but couldnt help it)
-Thanatos now knows which game he is playing (AoK, AoC, HD, or DE). This is still preliminary and in testing, but should work.
-Thanatos should be able to play all game versions mentioned above.
-Thanatos is now capable of boar hunting and other DE specific items when using that version.
-Savar included for Persians on DE only
-Attacking was updated a tad.

23Feb2024
-Providing this update, as Charon is now much better at playing water.
-This includes better training rules on water, researches, and better resign rules as well.
-Charon will attempt to place his TC and lumber/mining camps on your island if given the opportunity late game.

Edit 9Apr2024

-Made updates to the feudal eco buildings and market rules.
-Updated TSA so increasing town size attack would not reduce back to the minimum size after a castle was placed.

Edit 23Jun2024-

Charon has some major changes- and this is a temporary version- rushed to get this out there for the ladder.

-Eco is improved, in conjunction with military training
-Retreating improved especially in terms of castles
-Custom map settings improved - Charon is able to detect if boats are needed including transports on those maps (hopefully).
-Just general ai rule improvements

DE.....
Right now on DE wall-completed-percentage for wall 2 is not working. As I do not wish this to be an issue on that ladder, I have included the below command. This should not have an impact on AoK, but I want full transparency this would not typically be in an AoK ai, but the AI should still function.

#load-if-defined DE-AVAILABLE

(defrule
(civ-selected gothic)
=>
(set-strategic-number 304 1)
)

(defrule
(current-age == imperial-age)
(current-age-time >= 720)
;(goal goal-wall 1)
(can-build-gate 2)
(goal is-town-under-attack 0)
(civ-selected gothic)
=>
(build-gate 2)
)

#end-if

Small Issues

-There is a small issue with Attack-now with Charon. 100% of troops are not being used, this is not affected by sn-percent-attack-soldiers.


Overall, in my opinion, Charon has greatly improved recently- and I hope you enjoy the AI as much as I do.

Civ wise- Goths are strongly preferred. If you are just looking for a simple AI, the other AOK civs can be used.

1Jul2024

There is a minor issue occurring with Attack-now in Charon. (solved- attack-now must be triggered more than once if group is larger than 60 units, which was actually remedied by the workaround.)

Spoke with several individuals, but couldnt figure out why attack-now wasnt sending 100% of troops.

A workaround has been remedied. Hopefully the issue will not persist.

This should mainly impact late castle-age or imperial. (Most single player games shouldnt last that long with Charon).

16Jul2024

Major update for team related games. TSA and Attack-now commands have been updated

1v1 battle style has not been impacted by this change, but Charon should be able to provide support a little earlier.

9Aug2024

An update for mixed maps. Definitely not the strongest game type for Charon- but it is an additional option for him. Took some time to update for this, and is a nice feature to have. Unfortunately, right now Charon has filled up the string table - so max 4 players on AoK, DE can have all 8 players. I might have a quick update here soon after I reduce the number of strings. >75 pop issue fixed in non standard maps for man at arms. This was already done for standard maps.

Charon should use scorpions a little more frequently to counter additional units.

Future updates:
Escrow with counter units - to look into for units that are not used as frequently including mangonels.
I will be reviewing duplicate counter unit rules, to reduce rule count
String table issue described above.
Pikemen research earlier possibly- described by Leif on the ladder.

LINKS INCLUDED ON THIS DIRECT POST ARE OLD VERSIONS- SEE MOST RECENT POST FOR UPDATED VERSIONS!
Charon download: download/file.php?id=7091
Thanatos download: download/file.php?id=6952
Attachments
Charon 25Jun2023.zip
(49.74 KiB) Downloaded 289 times
Previous Versions Charon and Thanatos Updated 13Jan2023 (2).zip
(155.3 KiB) Downloaded 278 times
Thanatos 13Jan2023.zip
(26.51 KiB) Downloaded 299 times
Last edited by MrElephant on Fri Aug 09, 2024 7:43 pm, edited 32 times in total.
Author of Charon, Reactionary, Ahulane, and BlackKnight!

Bandit1990
Forumer
Posts: 98
Joined: Tue May 03, 2022 2:38 am

Re: Charon (AOK AI)

Post by Bandit1990 »

Hi! I wanted to get back to you after playing a few games with Charon. I like that it goes M@A with Chinese and its slow swarm reminds me of the tutorial AI made by BearTheGreat (which terrified me when I first started using different AI!). I’m also quite surprised at just how many resources it can still gather with a cap of 50 vils! I did see a couple of patterns which I think if addressed would give it a good boost. The main one is that it likes to stockpile food and not just when looking to age up. It was quite often for me to look at the top screen and see 1000 food or something close stocked up. I’m not the best person to advise on this but my guess would be if you put less people on food and a little more on gold you would get more wood to build your buildings quicker (because less farms to reseed) and you’d have more gold to age up quicker and make more militia-line. It may make the difference between producing 2-4 m@a constantly on average to something more like 5-7 🙂 that’s the thing I think will have most impact. The other thing I saw was on water maps Charon would have 1 villager bug out being idle. I think it’s because of you setting number of forward builders to 1. I say this because I had the same issue and still to this day don’t really know how forward builders work, or even if they work. I hope that helps! Most importantly it’s been fun to watch (I’ll play against it myself once back from holiday!)

User avatar
MrElephant
Swami
Posts: 121
Joined: Sun Dec 20, 2020 6:28 am

Re: Charon (AOK AI)

Post by MrElephant »

Bandit- thank you for the feedback. I am very much trying to improve Charon at the moment.

Releasing an update to the AI today- and included is an updated water strategy. It also can play camels, archers, and knights (not very well). Charon can reply to taunts 150 if you want to play its tournament (strongest) version, which is its militiaman strategy.

Charon can also keep track of civilian superiority, score superiority, and population superiority with the help thanks to Goose AI.
Author of Charon, Reactionary, Ahulane, and BlackKnight!

Bandit1990
Forumer
Posts: 98
Joined: Tue May 03, 2022 2:38 am

Re: Charon (AOK AI)

Post by Bandit1990 »

Hello!

Just wanted to write some feedback after running a few test games. Tests included current Charon vs your previous version and current Charon vs some older iterations of my AI from when I started using HD.

On land current Charon either went archers or militia, not had the camels come up yet but I’m sure it will. Archer strat lost to old Charon’s militia mainly because the archers stood still and fired. Adjusting the set-difficulty-parameters will allow them to run back and shoot whilst steering clear of UP commands. New Charon was also low on wood to sustain all its archery ranges, gold was okay though so a couple less villagers on food and a couple more on wood will match archer production with the rate old Charon does militia-line :)

My old AI doesn’t do water so I played it vs Charon on land, it was a good fight that lasted through to imperial. Charon’s militia-line chewed through the trash units well but we’re held back by watch tower fire and the siege was a little late. Overall though I think had my AI also been limited to 50 vils then it would have been overwhelmed by the stream of longswordsmen. I don’t know if this has already been tweaked but a couple less villagers on farms and placed on gold instead should improve gold and lower wood spent maintaining farms, allowing Charon to produce even more militia-line or siege when required.

On water new Charon lost to old Charon but this may have been down to factors like map placement. There was a large skirmish at castle age of equal numbers that old Charon won and the remaining numbers advantage allowed it to just about keep control of the water. I found food was in surplus again for new Charon but it was wood that it was lacking preventing regular navy production and the building of extra docks. Another observation was that new Charon had enough stone to build a castle for most of the late game but never tried to made one. It had the space so wondered if it had code to try or whether it deliberately doesn’t build them. Building a castle on any edge would have probably brought new Charon back in the game, though if it is not meant to build a castle then I would say take the villagers off stone entirely and place them on wood. The resources from that would boost Charon’s navy. Another thought for the water map is related to monks. In the game I saw a few times when a monk stood on the edge and converted ships but would then get picked off by fire ships. If you researched block printing then monks should be able to convert fire ships while staying out of range :)

It’s cool to see Charon try new strategies and I think those archers will get scarier if they learn to run and shoot. I’m going to keep testing to see the camel strat and I’ll also give it a try on team games as I expect that any trade it does will balance its eco better than in 1v1, allowing more militia-line production or camels if that strat is picked.

I hope the feedback helps and I’m excited to see what’s next. Again, amazed at how hardy it is with a max of 50 vils!

User avatar
MrElephant
Swami
Posts: 121
Joined: Sun Dec 20, 2020 6:28 am

Re: Charon (AOK AI)

Post by MrElephant »

Important version updates to both Thanatos and Charon have been made!
Author of Charon, Reactionary, Ahulane, and BlackKnight!

User avatar
MrElephant
Swami
Posts: 121
Joined: Sun Dec 20, 2020 6:28 am

Re: Charon (AOK AI)

Post by MrElephant »

Charon has been updated with many important functions. I must say thank you to Bandit for reviewing Charon and providing feedback.

Charon lost around 250 rules, and were replaced with many new ones. More to come, of course.

Sometimes, Charon can take games off of BlackKnight- which I consider to be impressive haha..
Author of Charon, Reactionary, Ahulane, and BlackKnight!

User avatar
MrElephant
Swami
Posts: 121
Joined: Sun Dec 20, 2020 6:28 am

Re: Charon (AOK AI)

Post by MrElephant »

19Jan2024
An update for Charon
-Some extra non needed bad farm check rules were commented out. Not needed, and space for rules was needed.
-Some very old special "retreat" code was included. This is based on the old Kosmos and BTG ais, but mainly from Bari. This was very much needed.
-Team Attack rules were updated. Countdown timer was reduced so Charon can attack more often.

An update for Thanatos (I know I said I wasnt going to work on him anymore, but couldnt help it)
-Thanatos now knows which game he is playing (AoK, AoC, HD, or DE). This is still preliminary and in testing, but should work.
-Thanatos should be able to play all game versions mentioned above.
-Thanatos is now capable of boar hunting and other DE specific items when using that version.
-Savar included for Persians on DE only
-Attacking was updated a tad.

30Jan2024
Updated version of Charon
-Had to remove the gather at center SN, as it is >AoC only :( Retreating is definitely not as effective.
-Improved feudal and early castle rules for MAA strat.
Attachments
Charon 30Jan2024v2.zip
(52.8 KiB) Downloaded 212 times
Charon 18Jan2024.zip
(51.58 KiB) Downloaded 232 times
Thanatos 19Jan2024.zip
(30.49 KiB) Downloaded 254 times
Author of Charon, Reactionary, Ahulane, and BlackKnight!

User avatar
MrElephant
Swami
Posts: 121
Joined: Sun Dec 20, 2020 6:28 am

Re: Charon (AOK AI)

Post by MrElephant »

Providing this update, as Charon is now much better at playing water.

This includes better training rules on water, researches, and better resign rules as well.

Charon will attempt to place his TC and lumber/mining camps on your island if given the opportunity late game.

Edit 9Apr2024

-Made updates to the feudal eco buildings and market rules.
-Updated TSA so increasing town size attack would not reduce back to the minimum size after a castle was placed.
Attachments
Charon 9Apr2024.zip
(54.22 KiB) Downloaded 123 times
Charon 13Feb2024.zip
(53.56 KiB) Downloaded 175 times
Author of Charon, Reactionary, Ahulane, and BlackKnight!

User avatar
MrElephant
Swami
Posts: 121
Joined: Sun Dec 20, 2020 6:28 am

Re: Charon (AOK AI)

Post by MrElephant »

23Jun2024-

Charon has some major changes- and this is a temporary version- rushed to get this out there for the ladder.

-Eco is improved, in conjunction with military training
-Retreating improved especially in terms of castles
-Custom map settings improved - Charon is able to detect if boats are needed including transports on those maps (hopefully).
-Just general ai rule improvements

DE.....
Right now on DE wall-completed-percentage for wall 2 is not working. As I do not wish this to be an issue on that ladder, I have included the below command. This should not have an impact on AoK, but I want full transparency this would not typically be in an AoK ai, but the AI should still function.

#load-if-defined DE-AVAILABLE

(defrule
(civ-selected gothic)
=>
(set-strategic-number 304 1)
)

(defrule
(current-age == imperial-age)
(current-age-time >= 720)
;(goal goal-wall 1)
(can-build-gate 2)
(goal is-town-under-attack 0)
(civ-selected gothic)
=>
(build-gate 2)
)

#end-if


Overall, in my opinion, Charon has greatly improved recently- and I hope you enjoy the AI as much as I do.

Civ wise- Goths are strongly preferred. If you are just looking for a simple AI, the other AOK civs can be used.


1Jul2024

There is a minor issue occurring with Attack-now in Charon. A workaround has been remedied. Hopefully the issue will not persist.
Attachments
Charon 23Jun2024v2.zip
(61.12 KiB) Downloaded 66 times
Author of Charon, Reactionary, Ahulane, and BlackKnight!

User avatar
MrElephant
Swami
Posts: 121
Joined: Sun Dec 20, 2020 6:28 am

Re: Charon (AOK AI)

Post by MrElephant »

There is a minor issue occurring with Attack-now in Charon.

Spoke with several individuals, but couldnt figure out why attack-now wasnt sending 100% of troops.

A workaround has been remedied. Hopefully the issue will not persist.

This should mainly impact late castle-age or imperial. (Most single player games shouldnt last that long with Charon).

16Jul2024

Major update for team related games. TSA and Attack-now commands have been updated

1v1 battle style has not been impacted by this change, but Charon should be able to provide support a little earlier.
Attachments
Charon 16Jul2024v1.zip
(65.37 KiB) Downloaded 47 times
Charon 1Jul2024.zip
(61.29 KiB) Downloaded 65 times
Author of Charon, Reactionary, Ahulane, and BlackKnight!

Post Reply