ZebbaAI

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.
Zebba
Forumer
Posts: 21
Joined: Mon Mar 06, 2023 1:25 pm

ZebbaAI

Post by Zebba »

(Now also available in the in-game mod workshop)

Hello there!

Finally, after I've been working on this AI since Summer 2021 now, I decided that it's time to share ZebbaAI to everyone.

The initial idea behind ZebbaAI was to create an AI that plays all various strategies to see how they tend to work out in varying situations, including adapting its strategy to opponent strategies. For that to work the goal is to give the AI all the necessary tools to make use of everything the game offers, e.g. deer pushing. It's not yet at a point where I'd like to have it, since implementing some of these abilities are quite time consuming, but I'm working on it.

Game Mode: Random Map, Empire Wars & Custom Scenario (consider map restrictions)
Civs: Can play all civilizations, except Armenians & Georgians
Maps: Optimized on Arabia, Yucatan, Arena, Fortress, and similiar maps. Besides that, ZebbaAI can play nomad and other custom maps. (Not optimized on water-maps though)
ZebbaAI can't play properly on island-like maps or on Black Forest type of maps: It needs a map with land connection to the enemy
Taunts in TGs: AI reacts to following taunts: 3 ("food please"), 4("wood please"), 5("gold please"), 6("stone please"),
31("Attack an enemy now"), 38("give me your extra resources"), Flare-Location + 48("I'm being attacked, please help")
Strategies: Drush, Archerrush, Scoutrush, Towerrush (currently deactivated), FC into Unique Unit, FC into Gold Unit,
Fast-Imp (only pockets in team-games or on closed maps like Arena)
Difficulty: There are no levels of difficulties for this AI. However, the game throttles AI performance on difficulties below extreme, so set the difficulty to extreme for the best performance. Its current level is comparable to the HD AI.

Stay tuned for more improvements & updates in the future! :)

====================================================

New in Version 1.2.6 (PoArena Tournament Version)

General:
- further improved FC-builds for 4TC-Boom, relic-fights and pushes
- added micro for rams, trebuchets & bombard-cannons: they will now focus down buildings in a specific order
- added ability to guard rams & bombard cannons with ranged-units
- added ability to repair low-hp castles under attack when villagers are nearby
- added ability for detection and reaction of enemy forwardings
- added ability to research devotion
- added ability to garrison unique units into the castle when under attack
- added ability to focus down rams near a castle with army
- will now save low-hp villager under attack to the TC in some situations
- enemy builder-villagers are now being targeted with scouts more consistently
- considerably improved auto-eco-balance system: AI should now switch to other resources faster, especially from wood to other resources
- extended auto-eco-balance system for prolonged feudal-age scenarios
- added a number of dark-age eco improvements:
1) added a system for food-management under TC, prefering certain food-sources over others, leading to a much more efficient food-collection-rate
2) will now eat only one sheep at a time
3) added precise-point deer-pushing, reducing the total time for deer-pushing
4) added TC-hopping for villagers killing deer
5) first lumber-camp will now be placed using DUC. This should reduce bad lumber-camp placements in some cases
6) resource-drop-off builders are now assigned to the respective resource instead of being retasked somewhere else. This will significantly reduce villager walking & idle time in Dark-Age
7) lumberjacks are now more likely to be sent to trees near lumber-camps instead of straggler trees
8) shepherds will no longer kill sheeps outside the tc and rather wait under the tc until a new sheep arrives

- decreased likelihood to delete all walls
- will now recognize newly sighted deer in its base and switch to deer-pushing accordingly
- adjusted villager training rules to further limit villager production when the AI needs to go for army.
- adjusted outpost building rules to not waste stone required to build TCs
- reduced chance to research town-patrol
- adjusted army behavior settings in imperial-age. Should now slightly improve unit retargeting behavior in certain situations
- added defensive behavior system vs forwardings
- will now train unique-units more consistently with certain civs
- bombard tower is now only being researched if being either far behind or having a considerable advantage

Teamgames:
- will no longer send resource requests to allies if AI does have no way to come back into the game
- improved help-request to enemy attacks and reaction to help-requests
- improved caravanserai placements
- will now stop unit-production when rebooming back into the game

FC-Relics:
- added ability to defend relics with scouts

FC-Unique Unit:
- reduced up-times by 1 villager to -> 25 to feudal -> 27 to castle
- castle drops will now be properly defended with army
- A castle-drop is now followed up by either a push or a fast-imp, dependent on if the opponent has a castle or not

Fast-Imp:
- deactivated all fast-imp strategies except monk rushes & Turks Fast-Imp. I will need to rework the other strategies since they were massively lacking performance wise compared to the other strategies.
- the initial attack will now start faster

Evacuating villagers:
- villagers will now be evacuated earliest if the last TC standing cannot be garrisoned anymore

Retreat rules:
- will now retreat with eagle-scouts from garrisoned TCs
- will no longer ignore enemy castles with cavalry in castle-age
- added imperial-age TC retreat for some unit types
- elephant-archer-line will no longer retreat from enemy TCs
- will no longer retreat from TCs & Castles when having a large military advantage

Anti-Ram defense:
- will no longer send villagers to kill rams if AI has a low amount of villagers

Monk Rush defense:
- adjusted unit-training rules vs mass monks

Aztecs:
- will now go for 3-4 militias instead of 2-3 in drushes

Turks:
- will no longer train skirmishers castle-age onwards in any situation

Arena:
- will now always build a siege-workshop on Arena when going for a push or going up to imperial-age
- will now correctly identify opponents gates and target them more likely

Bug Fixes:
- fixed a bug where light-cav would never be researched when playing as pocket in teamgames
- fixed some bugs where the AI would never research town-watch, eagle-warrior or infantry blacksmith upgrades
- fixed a rare bug where the AI would never build a market in feudal-age in FC-builds, causing the AI to never go up to castle-age
- fixed an issue in scenarios with multiple TCs where the AI would prefer to queue villagers in working TCs instead of idle TCs
- fixed some base-scouting & deer-pushing bugs
- fixed a bug where the AI would unintentionally cancel a castle-placement or a castle under construction with low hp in a castle-drop too early
- fixed a bug where the AI would buy & sell wood simultaneously while trying to go up to imp
- fixed some bugs where the AI would unintentionally reselect its castle-age strategy during castle-age

====================================================


I thank everyone for the feedback! If you're noticing any strange behaviour or you have any feedback I'll be more than happy if you'll let me know! :)

What's next:

- adding playability of Armenians & Georgians
- there is a known issue with trebuchets freezing while attacking
- reducing lag caused by the AI in team-games
- improving monk micro
- adding late game army compositions
- reworking fast-imp strategies to make them more viable
- fully implementing proper ranged unit army micro
- fully implementing micro in drushes & scoutrushes
- implementing sheep scouting
- reactivating towerrush & improving it
- adding a new defensive fast feudal strategy
- adding DUC drop-off-building placements & Dark-age lumberjack DUC
- further develop more controlled army behavior


Next Update will focus more on optimizing Dark-Age eco & Arena strategies.
Attachments
ZebbaAI v. 1.2.6 PoArena Version.zip
PoArena Tournament version. Untested for other maps than Arena
(126.64 KiB) Downloaded 164 times
ZebbaAI all published versions.zip
(1.03 MiB) Downloaded 183 times
ZebbaAI v. 1.2.5.zip
(119.56 KiB) Downloaded 244 times
Last edited by Zebba on Wed May 08, 2024 5:52 am, edited 25 times in total.

yuu2319
Forumer
Posts: 3
Joined: Tue Feb 07, 2023 4:49 am

Re: ZebbaAI

Post by yuu2319 »

Thank for sharing the AI. He's a very good AI. Sofar haven't seen any bug

Bandit1990
Swami
Posts: 103
Joined: Tue May 03, 2022 2:38 am

Re: ZebbaAI

Post by Bandit1990 »

Fantastic AI - first 2 games and it beat my latest version of Bright Spark in some close feudal skirmishes!

I applaud you for making ZebbaAI so diverse! It seems that it is strongest when it starts with archers or skirms and weakest when it starts with infantry, but there's nothing new there and I think that's the same with everyone.

Love the TC avoidance, I've seen Bright Spark try to lure in ZebbaAI archers to the TC and they stop just in time, it's brilliant.

Its weakness seems to be towers right now, I don't know if you have any avoidance code in yet but I round ZebbaAI lost the upper hand a couple of times when it started losing archers to tower fire. In the battles I saw this was just enough to turn the tide and defeat ZebbaAI. Tower avoidance or tower preference are both different options that may help with this (dodge the tower or have melee units attack it or archer sit underneath it under the minimum range).

I really look forward to seeing what you do next and I will definitely be using ZebbaAI as one of my regular sparring partners - thanks for the hard work!

Zebba
Forumer
Posts: 21
Joined: Mon Mar 06, 2023 1:25 pm

Re: ZebbaAI

Post by Zebba »

yuu2319 wrote:
Mon Mar 20, 2023 7:42 pm
Thank for sharing the AI. He's a very good AI. Sofar haven't seen any bug
Thank you for your Feedback! I really appreciate it :)
Bandit1990 wrote:
Wed Mar 22, 2023 4:50 pm
Fantastic AI - first 2 games and it beat my latest version of Bright Spark in some close feudal skirmishes!

I applaud you for making ZebbaAI so diverse! It seems that it is strongest when it starts with archers or skirms and weakest when it starts with infantry, but there's nothing new there and I think that's the same with everyone.

Love the TC avoidance, I've seen Bright Spark try to lure in ZebbaAI archers to the TC and they stop just in time, it's brilliant.

Its weakness seems to be towers right now, I don't know if you have any avoidance code in yet but I round ZebbaAI lost the upper hand a couple of times when it started losing archers to tower fire. In the battles I saw this was just enough to turn the tide and defeat ZebbaAI. Tower avoidance or tower preference are both different options that may help with this (dodge the tower or have melee units attack it or archer sit underneath it under the minimum range).

I really look forward to seeing what you do next and I will definitely be using ZebbaAI as one of my regular sparring partners - thanks for the hard work!
Thank you a lot, Bandit! I agree, it seems like archers/skirmishers don't require a lot of army control and can be dangerous by just sending them forward, compared to scoutrushes or drushes. Most likely because pathing & unit targeting is something I'm struggling to fix properly.

I'm really curious though about the tower-avoidance you mentioned, since it actually has an avoidance code for towers as well. I'm planning to implement the ability to send archers underneath the tower as well.

Overall, attacking behaviour is something I haven't focused on yet with this AI, but it's the next thing on my list where I want make an overhaul, adding patrol attacking and targeting areas in the opponents base more precisely. Hope to get that out pretty soon, but rather unlikely to get a new version with this before the "Prince of Arabia" tourney.

User avatar
Esty
Waheguru
Posts: 1160
Joined: Wed Dec 30, 2015 7:37 am

Re: ZebbaAI

Post by Esty »

Lately curious to test the latest AIs... i tested Zebba.

this AI deserves more congratulations than encouragement, as it already offers diversity of strategies while being playable for all civs at a pretty decent level. Many details like the use of TC to kill the boar show that this AI is already very advanced. I had the curiosity to test it last week and I was impressed. I just needed time to post a feedback :)
Author of TRiBaL_Warrior, Yggdrasil, PharaoN, WoodyWood Pecker and currently :o dette :dance

Zebba
Forumer
Posts: 21
Joined: Mon Mar 06, 2023 1:25 pm

Re: ZebbaAI

Post by Zebba »

Esty wrote:
Fri Mar 24, 2023 12:25 am
Lately curious to test the latest AIs... i tested Zebba.

this AI deserves more congratulations than encouragement, as it already offers diversity of strategies while being playable for all civs at a pretty decent level. Many details like the use of TC to kill the boar show that this AI is already very advanced. I had the curiosity to test it last week and I was impressed. I just needed time to post a feedback :)
Thank you for your kind words, Esty! :)

venomus
Forumer
Posts: 66
Joined: Sun Sep 05, 2021 10:26 am

Re: ZebbaAI

Post by venomus »

Hey. I have tested on Nomad and just build houses nonstop.

Zebba
Forumer
Posts: 21
Joined: Mon Mar 06, 2023 1:25 pm

Re: ZebbaAI

Post by Zebba »

venomus wrote:
Sun Mar 26, 2023 7:54 am
Hey. I have tested on Nomad and just build houses nonstop.
Hey! Thanks for your feedback. I'll bring out a new version very soon that should fix this and several other issues on nomad.
I haven't tested my AI on nomad for a while, therefore it might face some issues here and there on this map right now.

Zebba
Forumer
Posts: 21
Joined: Mon Mar 06, 2023 1:25 pm

Re: ZebbaAI

Post by Zebba »

Updated for the recent patch.

Zebba
Forumer
Posts: 21
Joined: Mon Mar 06, 2023 1:25 pm

Re: ZebbaAI

Post by Zebba »

Updated to v. 1.2.0 for the upcoming Prince of Arabia Tournament.

Post Reply