Jester (V 2.21) & Forthwind (V 2.1)

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.
Post Reply
screamingkoos
Forumer
Posts: 43
Joined: Wed Feb 05, 2020 6:27 pm

Jester (V 2.21) & Forthwind (V 2.1)

Post by screamingkoos »

Hi everyone, I have decided to update the main page here, as well make an additional post when a new update has become available! Enjoy!

*The following comes from the main Jester.per file which is included in the download*

JESTER.AI Created by ScreamingKoos
Version 2.21
Release Number: 8
Release Date: March 9, 2024

;==========OVERVIEW FOR BOTH AI's:==========
- Jester & Forthwind are two separate RM (random-map) ai's created by me.
- Jester can play any civilization in the game up to "The Mountain Royals" DLC (up to Armenians & Georgians). Jester can play as or counter any of these civs.
- Forthwind can play any civilization up to "The Lords of the West" DLC. This EXCLUDES: Armenians, Bengalis, Dravidians, Georgians, Gurjaras, and Romans. Forthwind will is not optimized to play as the new civs.
- Jester is stronger, more updated, and less random than Forthwind.
- Forthwind will tower-rush, build walls, and not play as competitively as Jester. Both ai's are, however, quite silly and fun to play with.
- Both ai's can play land maps (like arabia), connected water maps (like coastal), and separated water maps (like islands). They perform best on land maps and the least on island-style water maps. They do have basic water map rules for ships & economy for compatability purposes.
- They both can also play any nomad-style maps (where there is no town-center or lumber-camp to start with and they must start from scratch).
- Please note, both ai's are not tested to play the following map-types: Migration, "Nothing" style maps (like forest-nothing), and Michi style maps.
- Both ai's are aggressive. They have many different strategies that are initially randomly generated at the game start, and improve over time as the game plays. You will experience a different game every playthrough even if they use the same civilizations. You never know what to expect!
- Both ai's are fun to play with as allies, enemies, or even just spectating them fighting other custom created ai's.
- Jester gets his name from having a humorous twist on all things he does! (Forthwind is humorous too).
- Jester & Forthwind are only tested on and work for Age of Empires 2 Definitive Edition (No wololo-kingdoms, or HD editions sadly).
- I am not currently working on new updates for Forthwind (but may in the future), so for this reason the following below is mostly referring to Jester, although many of it still applies to Forthind:

;==========DID YOU KNOW? (quick facts)==========
- Jester can play nomad style maps (land or water just not migration-types), and has rules to always prioritize either a lumber-camp, mule-cart, or town-center when his last tc is destroyed (or the game starts without one!)
- Jester will automatically sling extra resources to any allies that are low on resources. You can still use taunts 3 - 6 for a more manual way to ask for resources (player or computer allies).
- Jester will always mirror your diplomatic stance. Comes along with some chats for every type of stance change during the game. There is NO tricking this guy! ;)
- Jester responds to several taunts in the game and depending on the age may respond differently. Most taunts work when Jester is set as an ally. Taunts are listed below:

;==========;TAUNTS:==========;
; Use taunts 3 - 6 to ask for resources.
; Taunt 31 - Attacks immediately if he is able to (not under attack and has reasonable military).
; Taunt 32 - Pursue default aggressive strategy for current age (dependent on civ-selected).
; Taunt 33 - Pursue economy strategy for current age (boom).
; Taunt 36 - Disable attacking rules (use taunt 31 to re-enable afterwards).
; Taunt 37 - Build a wonder (imperial-age only)
; Taunt 43 - Current strategy information.
; Taunt 44 - Current resources & population information.
; Taunt 45 - Temporary retreat back to main town-center.
; Taunt 50 - flare a location on the map and send this taunt for a chance of Jester to build a tower, donjon, krepost, or castle at the location.
; Taunt 52 - flare a location on the map and then send this taunt for a chance Jester will build a market at the flared location.
; Taunts 61 - 68: Jester will temporarily target the numbered player (this taunt now works as intended, only resets if Jester is under attack or the target-enemy dies).
; Taunt 69 - Deletes the object at the flared location.
; Taunt 72 - Pursue militiaman-line (infantry) strategy.
; Taunt 73 - Pursue melee cavalry units strategy. (knights, shrivamsha-riders, savars, battle-elephants, steppe-lancers, camels, etc.). This is dependent on the current civilization and only works for that current age. Use these in imperial-age for a more permanent strategy.
; Taunt 74 - Pursue archer-line strategy (foot archer only).
; Taunt 76 - Drush the enemy (must be early dark-age to work).
; Taunt 104 - Fully turns off all resign rules (when taunting either enemy or ally Jesters).
; Taunt 105 - Revert back to default resign rules after taunt 104 was issued.
; Taunt 150 - Resign immediately (when spectating as Jester, useful for casting games).
; Taunt 151 - Resign immediately (when taunted to an ally or enemy Jester, useful for a stubborn opponent or casting games).
; Taunt 250 - Chats current Jester version.
; Taunt 251 - Chats certain testing strategic-numbers (I use this for testing Jester, but feel free to use it too lol).
; Jester also responds to some other taunts, but not in a way you would expect! (example: Taunt 69).

;==========UPDATES for Jester Version 2.21 (March 9, 2024):
- This is a smaller update that aims to fix some recently introduced bugs and make Jester playable again for the March PUP. Added a couple new additions as well!
;====================================================
- Fixed a bug that was introduced in the March 2024 PUP that would make Jester unplayable.
- Fixed a circular logic bug that could cause Jester to turn on & off arrow dodging rules repeatedly.
- Provided a bug fix for a rare but critical Direct Unit Control (DUC) bug that would set all military units to no-attack-stance forever. Should not be able to happen anymore with backup conditions added.
- Jester now disregards using villagers to target rams & armored elephants when villager numbers are too low (dynamically based on pop-cap settings).
- Improved focus-player rules by allowing them to update much more often. Jester's initial scout should have less of a chance to dying from early enemy TC's.
- Fixed a bug which consisted of Jester endlessly deleting the first mining-camp foundation even when it was placed correctly near gold or stone. This could sometimes lead to serious delays of the first mining-camp greatly affecting economy.
- Jester now targets and deletes his oldest camps (lumber & mining) one at a time after a number of them have been built.
- Introduced a temporary solution that forces a small number of villagers to nearby berries (if close to a mill) once farms start getting built (useful for Yucatan style maps).
- Testing VERY basic rules in this update that should influence Jester to help AI allies. Ran out of time to test this fully...
- Jester flanks & pockets now properly counter war-elephants and have improved countering for enemy unique siege units (i.e. organ guns, hussite-wagons, etc).
- Jester no longer automatically retreats when pursuing a booming strategy (was causing Jester to stop attacking even when far ahead in military, allowing enemy to reboom in many situations and catch up).
- The first placed castle has improved preference to be placed at the front of Jester's base.
- Jester can now research ri-devotion.
- Changed out a few of the chats/updated existing ones!
- A couple other small improvements/bug fixes.
;----------END OF GENERAL UPDATES:----------

;==========KNOWN ISSUES/WIP:==========
1: Jester will break easily against tower rushing or castle drops, There are basic defence rules against this but they are not as intuitive yet. (WIP - this is only really possible with DUC, with the level I'm at now, I may be able to implement defence rules soon! - fixes to come)
2: Jester on water maps in general, I'd like to improve the water rules more in the future :) (WIP - recently identified many bugged rules, but Jester still plays half decent on water maps - fixes to come)
3: Jester will have more variety in imperial-age strategies in a future update. (WIP - needed fixes identified - still prioritizing other issues first)
4: Mule cart logic may need DUC rules to fix the mid to late game of them bunching up together with no resources around them. (WIP - on hold - new DUC logic may come in handy for this down the road)
5: DUC leaks/errors. (Always a WIP as new DUC gets added - Currently there are no known DUC leaks, split rule goals have immensely helped in preventing this)
6: Prioritizing civ bonuses to be taken into account more often! (with upwards of 40+ "playable" civs in this game now for Jester, I plan on accounting for more specific civ bonuses to make them "optimal" and not just playable!
- The following are some of the already implemented civ bonuses with Jester:
- Bohemian castle-age hand-cannoneer rush, Gurjaras milling their starting sheep and having the chance to go "camel-scout" rush, Malay creating a few more villagers before clicking up to the next age faster, Burgundians researching techs an age before,
- Cumans building 2 town-centers & siege in feudal-age, Goths + Huns + Sicilians + and Bulgarians creating units in either their barracks, stables, donjons, or kreposts, the best imperial-age unit strategies for each civ by default etc...
- I will be working on incorporating more of these civ bonuses into Jester for future updates! (in-progress).
7: Jester's rules for helping allies. (WIP - one fix applied in this update for helping ai allies (very basic, not fully tested yet - fixes to come).
8: Boom strategy causes Jester to go fully defensive even when ahead in military, allowing enemies to reboom and catch up. (FIXED - deleted conditions causing this, Jester follows default attack/defense rules for this strategy again).
9: Siege units have questionable behaviour, often times retargeting too often and wandering into tower arrow fire. (WIP - problems identified - I've identified that attack-groups are to blame for this behaviour and a few other things. Have to come up with a solution later)
10: Fishing ship training/deleting logic loop - (FIXED? - I may have fixed this already and forgot about mark it down but it appears to be fixed).

;==========CONCLUSION:==========
- Jester can be a fun ai to play with or against in team games, use in custom games (scenarios), or is commonly used for testing against other ai's.
- It is by no means a perfect ai, sometimes has bugs, and uses minimal DUC. But Jester has been an amazing project to work on for many years at this point (since the AOE II HD days).
- Please leave a comment of your experience on the ai scripters website, AOK Heaven website, or in the ai scripters discord group about your experience and if there is anything you'd like to see added/improved or just your general experience!
- Thank you for playing with Jester! GL & HF!!!
Your Pal, ScreamingKoos

;==========INSTALLATION:==========
- Simply download & unzip the Jester V 2.21.zip file and drag and drop everything into your AOE2 DE ai folder (the .ai file, the .per file, and the Jester folder).
Attachments
JESTER V 2.21.zip
JESTER - Version 2.21 (NEW)
(162.22 KiB) Downloaded 56 times
JESTER V.1.1.zip
JESTER - Version 1.1 (OLD)
(130.45 KiB) Downloaded 379 times
FORTHWIND V.2.1.zip
FORTHWIND - Version 2.1 (OLD)
(133.82 KiB) Downloaded 481 times
Last edited by screamingkoos on Sat Mar 09, 2024 2:41 pm, edited 36 times in total.

User avatar
wattle
Swami
Posts: 196
Joined: Fri Aug 15, 2014 1:06 pm
Location: Germany

Re: Forthwind.AI (Version 1.2)

Post by wattle »

Hi :)
Nice to have yet another DE AI. Maybe that could also take part in Esty's DE AI tournament when it happens.

I watched a couple games on extreme difficulty of your AI vs the Beginner AI and the DE AI.
It had some trouble with Beginners aggressive style (I'm not sure if the default Beginner does cheat on extreme).
It did hold not too bad vs the DE AI until late castle age.
While I'm not a great player, it seemed to me, that Forthwind did lure its boars mostly rather late. Sometimes at pop 27, is that intended.
Do maps influence its playstyle/early build apart from nomad start and watermaps?
It has the normal sheep killing behavior, where it kills multiple sheep under the TC. I guess it requires DUC to eat only one sheep at a time, do you have that on your list maybe?
I liked it milled the shorefish in a small pond, don't know if that is default AI behavior (I'm no AI scripter myself).
Nice to see it can handle nomad start.

Good readme, btw I wouldn't mind if you include some of the key info in your first post.

Did you consider/try to upload Forthwind as a DE AI mod, so more people may find it?

I assume you are not in the AIscripters discord, or are you? If not you may want join that, since it is more active than the forum, esp. for quick feedback. https://discord.gg/5Zea68s
MangudAI-all-in (wip, to be continued, when I retire from work :P )
Btw, thank you s64 for your effort. Was a pleasure to cross your way. Have a good time.

screamingkoos
Forumer
Posts: 43
Joined: Wed Feb 05, 2020 6:27 pm

Re: Forthwind.AI (Version 1.2)

Post by screamingkoos »

Hey Wattle,

Thanks for the feedback! AI tournaments? That would be fun! Initially Forthwind was not created to be competitive, but rather just most compatible with newer versions of the game for "semi-noob" human sort of performance. I would create maybe a seperate AI file if I ever were to submit him into a competitive AI competition.

Yes, so AI's like beginner and even the extreme DE will have no issue eventually out microing my ai, but on some maps Forthwind will never just "bug out" kind of thing (like on nomad or megarandom maps and is compatible with all civs currently now). There are many details I could include about what makes up Forthwind, I just didn't want to fill my first post with too many words lol!

Haha, yes you're not wrong for pointing out the bad boar rules. It used to have some actually pretty decent boar rules but while further testing them awhile ago I accidentally messed them up and just haven't got around to fixing them. I literally just learned what DUC (direct-unit control) was the other day so I'm quite new to some of the userpatch (UP) features. I've been slowly adding in more userpatch features for Forthwind as I test them and find they are stable enough for a release. So yes, DUC is on the list.

For the milling, yes I have it programmed currently to build a max of 2 mills. The first mill is built near a stable source of food (like berries), and a second is usually built by food that is a little further away (example: a mill near the deer on arabia-type maps). There is also an "emergency mill" rule that fires if Forthwind hasn't found any food at all and thinks he needs farms.

I'm not aware of where that is, but I will certainly look into it (about the DE AI mod).

I truly appreciate all of your feedback and for sure I'll check out the discord! Thanks wattle!

User avatar
marathon
Waheguru
Posts: 1984
Joined: Fri May 14, 2010 2:30 pm

Re: Forthwind.AI (Version 1.2)

Post by marathon »

I ran into issues with constants. I use WK (Userpatch 1.5) but the issues were unrelated.
I believe I can easily make this AI compatible with UP and WK, so that I can test it.

Welcome to the world of :head
(although you are an oldie, as it seems, but a proper welcome is imperative)

screamingkoos
Forumer
Posts: 43
Joined: Wed Feb 05, 2020 6:27 pm

Re: Forthwind.AI (Version 1.2)

Post by screamingkoos »

Oh man, the legend himself! (hint: marathon) ;)

Thanks for the welcome! I haven't played WK before but if you are able to get it up and running then by all means! For now I'm only testing Forthwind on DE as that's what I play.

(I've been around for a bit but was a fly on the wall simply observing for a long time, now I'm hoping to be more involved)

I'm very excited about the continuous :head it's what I'm here for, lol.

User avatar
wattle
Swami
Posts: 196
Joined: Fri Aug 15, 2014 1:06 pm
Location: Germany

Re: Forthwind.AI (Version 1.2)

Post by wattle »

I forgot to mention, I noticed Forthwind walls at some point (not sure if always) and it can lead to hurting itself (which is ofc why many AI don't do it), but also it happend to send vills to its death, because it was stubborn to try complete its wall, while the enemy was in full charge. Also it even walled on arena, which was kinda funny :) like double wall arena 11, but that cost it many vills. At least for arena should be disabled.
I guess you use the default wall building method (like aoc/petersen AI), using UP features for defining wall and gate position is probably not too easy.

https://www.dropbox.com/s/kpuclvq3aq3vz ... d_wall.png

Btw did you base your script on something existing like the petersen AI or create it from scratch?
MangudAI-all-in (wip, to be continued, when I retire from work :P )
Btw, thank you s64 for your effort. Was a pleasure to cross your way. Have a good time.

screamingkoos
Forumer
Posts: 43
Joined: Wed Feb 05, 2020 6:27 pm

Re: Forthwind.AI (Version 1.2)

Post by screamingkoos »

Hey Wattle!

I'm not sure how to @ you (if that's possible on this site, I really don't know).

But yes Forthwind does wall, he builds on the "perimeter 2" wall (so the outer wall when compared to perimeter wall 1). There are several rules regarding when he specifically walls. For one, he walls when he senses his military is outnumbered by a decent amount. There is no timer or anything regarding these rules. For actually building the walls there are like 10 to 15 rules affecting walling. I know what you mean though by how he kills himself, it's because the wall foundation is placed and Forthwind is extremely stubborn about building it at all costs. There are a few strategic numbers that come to mind that I may change in a future update (i.e., setting dynamic values for sn-percent-building-cancellation depending on enemy strength etc) to counter this behaviour.

I know there must be a way to sense these situations (vils under attack while building a wall) and then canceling the foundations by using UP commands, I just don't know UP commands well enough yet. Once I can figure something out though (including for other buildings) I will incorporate it into Forthwind. Currently when Forthwind is under attack he "pauses" wall building, but by that time there are already 10+ wall foundation tiles placed down, so he continues heading out to them.

You're right! I need to actually change some of the wall rules too now (they are from a long time ago like a year or more lol). I'll figure out how to disable wall building on "wall maps" once I sit down and revise the rules.

Honestly I don't know who or what peterson AI is, but I built my script and files from scratch. There are certainly bits and parts that have been influenced from other AI's, but I have been working on Forthwind for over like 2 years (very casually, on and off). I started from the bottom and I'm happy I could finally share Forthwind with other people (or even AI's to fight).

Thank you Wattle for your feedback and any questions at all are more than welcome! I could go on all day about AI theory ;)

User avatar
wattle
Swami
Posts: 196
Joined: Fri Aug 15, 2014 1:06 pm
Location: Germany

Re: Forthwind.AI (Version 1.2)

Post by wattle »

screamingkoos wrote:
Wed Feb 03, 2021 11:27 pm
I'm not sure how to @
I don't know either, assume it is not possible here, but on discord it is.
edit: Apparently if you quote me/someone it should send a notification.

Thx for your detailed reply and I like it walls only in specific situations. For AI vs AI it might overall be stronger to not wall, but I imagine against human player there are some that even prefer to have a walled AI.

I think the default aok/aoc AI is often here referred to as petersen AI because it's been scripted by Sandy Petersen iirc.
MangudAI-all-in (wip, to be continued, when I retire from work :P )
Btw, thank you s64 for your effort. Was a pleasure to cross your way. Have a good time.

User avatar
Leif Ericson
Waheguru
Posts: 1423
Joined: Wed Dec 09, 2009 8:15 pm
Location: United States

Re: Forthwind.AI (Version 1.2)

Post by Leif Ericson »

Yeah, Petersen is just the CD version AI.

For your current experience level, if you want your AI to build walls then your walling rules may make sense. Making walls with UP commands is a lot harder. You could try adding in (up-assign-builders c: stone-wall-line c: 0) whenever your AI is under attack and setting it back to a number higher than 0 when the town is safe. You can also use this to assign more than one builder to the walls. https://airef.github.io/commands/comman ... n-builders

For detecting wall maps you can simply use
#load-if-not-defined ARENA-MAP
#load-if-not-defined FORTRESS-MAP

...add walling code here

#end-if
#end-if

screamingkoos
Forumer
Posts: 43
Joined: Wed Feb 05, 2020 6:27 pm

Re: Forthwind.AI (Version 1.2)

Post by screamingkoos »

Hey Wattle,
wattle wrote:
Thu Feb 04, 2021 12:02 am
screamingkoos wrote:
Wed Feb 03, 2021 11:27 pm
I'm not sure how to @
I don't know either, assume it is not possible here, but on discord it is.
edit: Apparently if you quote me/someone it should send a notification.
Is this how you quote someone?

Yeah I agree! Forthwind does like to get stuck once in awhile with lumberjacks when the wall is between a lumbercamp and a forest. Forthwind has always originally been able to wall and I guess I kept it that way cause it's nostalgic a bit. Most AI's don't wall so I enjoy it that mine does.

OH. Haha. I had no idea that was the aok ai! To answer your question from before (does my ai use the default method) then yes it does, using perimeter wall and such, but the rules implement a few goals as checks and balances (I'm also improving them before I release version 1.3).

Hey Leif,

Thank you for your comment! Forthwind builds palisade walls and gates + stone walls and gates depending on different criteria. I am currently updating the rules so they are more clean as well I I will incorporate both of your ideas here! When I was trying to define which maps NOT to build on I was having trouble getting (map-type hideout) and (map-type hillfort) to work, so using the #LOAD-IF-NOT-DEFINED commands will be super useful.

Also I found a command called up-reset-placement. Would this command be useful for temporarily resetting the wall-class and gate-class placement? I'll run some tests, and thanks for the feedback!

Really appreciate both of your replies Wattle and Leif!

Post Reply