JESTER (V 2.2) & 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
yuenhsiaotieng
Forumer
Posts: 2
Joined: Fri Dec 09, 2016 9:44 am

Re: Forthwind.AI (Version 2.1)

Post by yuenhsiaotieng »

Lol that's awesome, but one of the reasons we love this ai is because it's so chill on the siege. So that's only a bug? If you could teach me how to program something like that in general I'd love it. Build no more than x of a certain unit or class at a time.

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

Re: Forthwind.AI (Version 2.1)

Post by wattle »

screamingkoos wrote:
Mon Nov 20, 2023 3:19 pm
... I've been quietly working on a really big update over the past few months that greatly improves both ai's...
:o :dance
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.

neilkaz
Forumer
Posts: 47
Joined: Fri Jul 15, 2011 10:36 am

Re: Forthwind.AI (Version 2.1)

Post by neilkaz »

wattle wrote:
Mon Nov 20, 2023 4:40 pm
screamingkoos wrote:
Mon Nov 20, 2023 3:19 pm
... I've been quietly working on a really big update over the past few months that greatly improves both ai's...
:o :dance
Great news indeed and I am hoping for an AI that can compete with Immortal which is awesome and clobbers the game's AI now in 4v4's as seen from my testing.

CSAxIsxRecruiting
Forumer
Posts: 5
Joined: Fri Nov 10, 2023 9:27 pm

Re: Forthwind.AI (Version 2.1)

Post by CSAxIsxRecruiting »

screamingkoos wrote:
Mon Nov 20, 2023 3:29 pm
CSAxIsxRecruiting wrote:
Sun Nov 19, 2023 4:57 pm
Can I use this AI with Voobly 1.6 Community Patch? What about with 1.5/WK?


Does this play also Bedouins or Land Nomad? What about MIchi or Nothing maps?
I don't believe it will work in WK or Voobly for multiple reasons. 1 large reason being I use the unit-line commands rather than each individual unit command (for example: archer-line vs. archer, crossbowman, arbalest etc) to save time, and also I don't own or play in either of those versions so unable to test them for it. If you read through these threads I believe there may be an early version of Forthwind that Esty updated and posted to support WK, but don't hold me to that :lol:

Both Jester and Forthwind can play nomad! Even in custom maps. It can also play games where all it has is 100 wood and no town-center and no lumber-camp and has to start from complete scratch. If it isn't working fully then I may have updated it already in the new version to be posted soon.

Both ai's are not optimized for Michi (but can build wonders). I have tested them on custom forest-nothing maps and they did ok, but any other "nothing-type" maps they have not been tested on. They might struggle a bit with those types of maps.
Well, you don't need to "own or play" any of those versions, we (at least I'm here, but pretty sure there're a lot more players) can test it for you and give you results of playing with it...

Just a small update from voobly versions:

1.5 RC + 1.5 Game Data is the same than playing with WK Mod (this means all HD expansions).
1.6 RC + 1.6 Game Data is the same(99%) than playing in Steam DE (You can also use 1.6 Game Data. for new graphics).

Both versions are community edition... The thing is that at least I, and few players inside CSA are getting bored of playing against Barbarian in nomad, and the few AI that we have seen over the game do the same strat everygame in everymap(feudal army and try to push; if you trush them, they start dancing with TC garrison/ungarrison while trush kills them...)

So I was expecting your AI to play nomad maps and if they get trushed, to stay back, check if they can attack tower, otherwise to boom in the back and then kill the enemy... is too hard to do that? (idk if Forthwind do that as you said it's not available for Voobly)

That's all. Regards

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

Re: JESTER V 2.0 & Forthwind V 2.1

Post by screamingkoos »

Hey Everyone!

It's been almost a year I think since I last posted on here, but I have a super exciting update for Jester.

Jester has received a multitude of updates since my last post. I just posted Version 2.0 (November 26, 2023). I left the older Jester version and also the last Forthwind version just in case anyone still wants access to those ai's.

I just want to thank you guys so much for trying out Jester and to all of the other scripters on this site for your invaluable help. Seriously appreciated! Enjoy the download :)

The following is copy pasted from the beginning of the main Jester.per file:

;JESTER.AI (Formerly Forthwind [T]), Created by ScreamingKoos
;Version 2.0
;Release Number: 5
;Release Date: November 26, 2023

;NOTE: Jester is built off of a similar foundation for Forthwind ai, also created by me. The major differences are that this ai is slightly
;less random, does not build walls or trush, and has more updates which makes it stronger than vanilla Forthwind.
;Currently both ai's play similarly, but if you want to use the "best" ai, then play with this ai (Jester.ai), this ai also does much better in team games and has better stability.

;SUMMARY:
;Jester is much more up to date and competitive than its brother ai, Forthwind, which is more random. Jester was built off of Forthwinds foundation but has since changed in style considerably.
;Jester does not cheat, only Jester V 2.0 can play all civs as of up to and including The Mountain Royals DLC, and all maps excluding migration, "nothing" style maps, and has basic rules for partial or full water maps that it will work on it but not as competitively as land maps.
;Jester does not work for WK or UP or AOE II HD. Jester only works and is tested for AO2 DE (Definitive Edition).

;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 game starts without one)!
; Jester will automatically sling extra resources to any allies that are low on resources, in the imperial-age only. You can still use taunts 3 - 6 for a more manual way to ask for resources (player or computer allies).
; Jester will always match your stance. If you change stance to enemy, Jester will also change his stance to enemy. If you change your stance to ally, Jester will mirror you. 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, 31 to attack, 32 to pursue his default aggressive strategy, 33 to boom, 36 to disable attacking, 37 to build a wonder (imperial-age only), 43 for current strategy information, 44 for number of resources, 45 for a temporary retreat,
; 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, 52 - flare a location on the map and then send this taunt for a chance Jester will build a market at the flared location,
; taunt 61 - 68 - Jester will temporarily target the numbered player (only enemies, note this taunt might be bugged, needs more testing), taunt 72 - jester goes militiaman-line, 73 - Jester goes knight-line (including shrivamsha-rider or savars), battle-elephants, steppe-lancers, or...
;... camels. 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 104 - Jester only resigns when he runs out of villagers and town-centers (both enemy and ally Jesters), 105 resets normal resign rules.
;===========================
;
;==========UPDATES for Version 2.0:==========
; - Every civilization in the game is now playable by Jester up to and including "The Mountain Royals" DLC. There is a chance for Jester to use any units old or new in the game! (NOTE: Does not include special scenario units, only units found in multiplayer games).
; - New strategies have been added for Jester including castle cavalry-archer rush, castle elephant-archer rush, castle bohemian hand-cannoneer rush, Gurjara feudal camel-scout rush, castle shrivamsha-rider rush, and also an all new castle siege-rush strategy that any civ can do!
; - Fixed siege unit rules. Jester now uses battering rams, mangonels, scorpions, bombard cannons (including houfnice's), and trebuchets more intelligently depending on the target enemy's unit composition.
; - Switched out or changed most of the resign chats! They are randomly generated to keep new ones cycling into your games! xD
; - Mostly fixed a terrible DUC leak that would trigger all of Jester's units to the corner of the map when he was attempting to dodge enemy watch-tower arrow fire. I have rewritten or looked over all of the DUC rules and applied fixes, haven't encountered the bug in all recent testing.
; - Jester now uses scout micro to gather gaia sheep more efficiently. Works for every beginning scout type including scout-cavalry, eagle-warrior, and camel-scout (gurjura).
; - Numerous military and economic rules have been tweaked including military countering rules, camp placement rules, gathering rules, defensive rules, and more.
; - Fixed up-set-placement rules for many buildings. This means the first few defensive fortifications are now built towards the front of the base and not as randomly as before. Still testing different numbers for this however.
; - Improved build orders for every age/strategy. EXAMPLE: Jester no longer builds a blacksmith first when flushing, but rather a range or stable.
; - Jester now builds more military buildings in imperial-age over time.
;
;==========KNOWN ISSUES/WIP:==========
; Jester will break easily against tower rushing or castle drops, there is basic defence rules against this but not as intuitive yet. (WIP - on hold)
; Jester sometimes under reacts or overreacts to some unit compositions (sometimes trains no skirmishers against longbowmen or way too many when enemy is making cavaly). (WIP - investigating)
; Sometimes Jester gathers way too much gold or stone in the feudal-age when under attack. This can lead to very long up-times to castle. (WIP - investigating)
; Jester on water maps in general, I'd like to improve the water rules more in the future :) (WIP - on hold)
; Attacking rules are sometimes too aggressive in some situations to the point Jester throws all of his military units away. (WIP - investigating)
; Jester will have more variety in imperial-age strategies in a future update. (WIP - working on)
; 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)
;
;==========CONCLUSION:==========
; Jester can be a fun ai to test your own ai against, play in team games, or even use in some scenarios. It is by means not a perfect ai, and uses minimal DUC, but something I hold dear to working on for years at this point. 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!!!
;-ScreamingKoos

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

Re: JESTER V 2.0 & Forthwind V 2.1

Post by venomus »

Woah! Thanks for the update!

I always play against a team of Forthwind and Jester and for some time it was noticeable that they had lost a lot of strength. I love that Forthwind is able to create a wall even if it doesn't optimize it, it's a great feature.

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

Re: JESTER (V 2.1) & Forthwind (V 2.1)

Post by screamingkoos »

Well it's almost the end of 2023, so I thought I would post my last big update for sometime as I'll be drop dead busy in the new year. I spent an insane amount of time on this update, endlessly testing & fixing lots of issues that seemed to come from the Version 2.0 update. I think its safe to say that Jester is better than ever now finally :rofl

There's some new content to explore as you'll see in the update below. New chats and strategies (and a heck of a lot of fixes)! My favorite part is always adding new resign chats in once I spend over 100 hours on the nitty gritty scripting ;)

Just want to wish everyone a Merry Christmas and Happy New Year! Let me know if you have any feedback, and as always, GL HF!
- ScreamingKoos

;==========UPDATES for Jester Version 2.1:==========
- Provided additional fixes for micro rules that were causing rare but serious DUC leaks when Jester is attempting to dodge arrow fire from fortification buildings (i.e. town-center, watch towers, castles, etc). Is much more stable now, will fully optimize in next update.
- Went through entire strategy file & fixed many bugs, including a rare issue where sometimes a pocket Jester would pursue a flank Jester's strategies (ex: scouts into archers as a pocket player).
- Fixed several bugs severely affecting Jester's scouting rules (not related to the ai scouting bug that was recently patched). This especially hurt Jester in games beginning with no town-center (nomad games). Scouting works as intended now.
- Added a new system of rules that Jester uses when deciding to prioritize villagers over military training. This system ensures Jester balances out villager and military training until required conditions are met for optimal economy.
- If Jester is specifically taunted 104 (DON'T RESIGN) by an enemy or an ally, he will never resign now. He will have to be fully defeated if taunted. If not taunted, Jester follows specific 1vs1 or team game resign rules by default.
- Gurjara civillization Jester's now take advantage of garrisoning starting sheep in a mill for passive food income. Uses basic DUC rules and other special rules to avoid harvesting sheep too early.
- Tweaked rules for hand cannoners so they are less prioritized over other unit combinations in the mid to late game (hand-cannoneers were being excessively prioritized over other important units, thereby preventing needed training).
- Adjusted feudal-flushing rules so Jester is less likely to immediately cancel his flush strategy early on (unless he is outnumbered by military and under attack). Before Jester would tend to cancel flushing immediately because of small threats.
- Adjusted feudal-age gathering rules for slightly better efficiency and less stone gathering to prioritize other needed resources.
- Jester is now SLIGHTLY less aggressive and will retreat a little sooner when going aggressive and outnumbered. (will refine this more in a future update).
- Scout-cavalry-line, hand-cannoneers, slingers, and many other counter units have been tweaked less to prioritize Jesters main strategy (less training and only when really needed).
- Bulgarians (konniks), Goths (huskarls), Huns (tarkans), and Sicilians (serjeants) now all have special rules for when to pursue these units.
(ex: konniks training from kreposts, huskarls from barracks (after tech research), tarkans from stables (after tech research),
and serjeants when pursuing unique-unit-line or infantry.
- Franks and Persians have been tweaked to prefer their powerful knight-lines when they would normally pursue only their unique-units in the later game. (TLDR: stompy grandpa chonker, and bearded throwy boy => BAD! more smol stampy fellas => GUD!).
- Fixed Persians so they can now research the new savar technology for their knight-line.
- Small adjustments made to encourage Jester to train siege units a little sooner and in a more gradual way (as military increases, siege units increase in small increments).
- Fixed errors that were causing Jester to ignore creating counter units to enemy unique units (specifically unique-archer and unique-cavalry units).
- Fixed Sicilians infantry strategy so they properly pursue donjons and serjeants over militiaman-line in all ages (when possible).
- Also fixed serjeant-set upgrades so donjon created serjeants now also get imperial infantry upgrades (was only castle created serjeants [my-unique-unit-line] before).
- Adjusted several research-related rules so Jester better prioritizes more important research tech's in early castle and early imperial-age.
- Added conditions to prioritize ri-wheel-barrow & ri-hand-cart to be researched sooner (sometimes neither tech would be researched even after 100+ villager population LOL).
- Added extra garrison rules so Jester will ungarrison certain counter units quicker when smaller groups of enemies are in his base, (compared to garrisoned units being released far too late for defending).
- Made some changes to Jester's Trash-Unit strategies to be more intelligent & reliable in the late game.
- Scorpions are now only trained when pursuing a siege-unit strategy OR for countering small numbers of specific enemy units. They are no longer blindly trained based on land military size.
- Tweaked market rules to be more reliable and useful (including Jester dropping stone for quicker castle-age research, buying & selling resources to get a town-center when none are built etc). Currently testing new market-placement rules.
- Tweaked escrow rules to be more reliable and useful (especially if Jester has no town-center and needs certain resources to build a TC, escrowed resources were not releasing as intended before).
- Fixed and modified slinging rules to be more reliable and have a higher chance of Jester slinging resources when allies are in need (automatically without asking for resources).
- Updated other old market and trade unit rules & strategies. Jester trains trade-units more intelligently based on population numbers as well as strategy.
- Changed castle building rules so Jester no longer wastes excessive resources on buying stone and thereby doesn't build infinite castles anymore (was preventing other important rules from triggering when needed in the late game).
- Added additional rules & conditions for Jester to lower villager population in more specific circumstances (to allow more population space for military & trade-unit training in the late game).
- my-unique-unit-upgrade now researches quicker when Jester is pursuing unique units as a strategy.
- Fixed a bug where Jester would sometimes research unique-researches when he was not supposed to! (be careful when using "my-unique-research" & "my-second-unique-research" without defining the civs my fellow scripters!
- Changed up several of the resign chats... cause... why not? ;) Also modified/added many chats that trigger during "specific" circumstances. try to find them all!

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

Re: JESTER (V 2.1) & Forthwind (V 2.1)

Post by venomus »

Huge update :o

Thanks for the gift!

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

Re: JESTER (V 2.1) & Forthwind (V 2.1)

Post by wattle »

I had a great read through your chat messages in the ai script :lol:
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: 41
Joined: Wed Feb 05, 2020 6:27 pm

Re: Forthwind.AI (Version 2.1)

Post by screamingkoos »

yuenhsiaotieng wrote:
Mon Nov 20, 2023 3:38 pm
Lol that's awesome, but one of the reasons we love this ai is because it's so chill on the siege. So that's only a bug? If you could teach me how to program something like that in general I'd love it. Build no more than x of a certain unit or class at a time.
Hey Yuen!

Sorry for the late reply! If you guys like playing with Jester and want to modify the number of units it makes it would be good to know basic scripting. It is pretty logical to understand the basics, for example check out Interlepus on Youtube and watch the ai scripting tutorial videos or there are other resources on this site for the basics of ai scripting. You don't have to invest too much time into it but would be a huge help. All you need is notepad or I personally use Visual Studio Code with a built in add-on specifically for scripting AOE2 ai's. If you have any specific questions about Jester, please let me know, but for any basics its definitely best to watch those videos or refer to other ai tutorials and go from there :)

But outside of that, specifically for Jester, feel free to open up one of the files in the folder that comes with the download called "Civ-Strategy.per". You can open with any text editing program, such as notepad and use the CTRL + F keys to find certain keywords in the file. For the most part this file controls when Jester trains military units. Be aware that ANY changes you make can potentially break the script and it will not work. So CTRL + Z keys can be helpful for undoing any changes you made, saving, and playing a game again to see if its fixed (the scripting language of AOE2 is very sensitive so the scripting language has to be followed exactly, just like any coding program). Be aware if you change too much and don't know what you are doing, even if the game runs with and has no errors upon game start, he may be completely broken and have wild behavior (would require a redownload of Jester). With that word of caution out of the way, here is the most basic example of the script telling an ai to train 1 battering-ram whenever it is able to:

(defrule
(unit-type-count-total battering-ram-line < 1)
(can-train battering-ram-line)
=>
(train battering-ram-line)
)

This command basically states: IF there is less than 1 alive or queued battering-ram-line (the -line on the end includes all variants of the unit such as battering-ram, capped-ram, and siege-ram) AND the unit can be trained (there are enough resources to train the ram, there is a building where the ram can be trained, there is enough population space etc, THEN train the battering-ram (or any variants like the capped or siege ram).

If you use CTRL F in the civ-strategy.per file, you will be able to find all instances of when Jester trains siege units. There will be quite a few instances when you consider Jester can train any siege unit in the game. This would include battering-rams, armored-elephants, mangonels, scorpions, bombard cannons, trebuchets etc... So to change Jester the way you want, you would need to find all instances of when Jester trains siege units in all of the files and just change the number on the end of (unit-type-count <unit> < <# of units to train>). For example, this is an excerpt from Jester on line 3468 in civ-strategy.per:

;(1st set) (battering-ram)
(defrule
(current-age >= castle-age)
(goal MILITARY-TRAINING yes)
(up-compare-goal my-mil-pop c:< max-mil-pop)
(goal is-town-under-attack no); was training too many rams when town was under attack
(or (strategic-number sn-military-level >= 1) ;train at least 1 ram if we are ahead or attacking
(goal ATTACK yes))
(can-train battering-ram-line)
(unit-type-count battering-ram-line <= 1)
=>
(train battering-ram-line))

Where it says (unit-type-count battering-ram-line <= 1), if you change just the "1" to say "2", then as long as all the other conditions are met in the rule, Jester would train 3 battering-ram-line instead of 2 in this specific instance. Keep in mind the operators (< > =) they are read as (< less-than), (> greater-than), and (= equals-to), so in the above rule it is actually saying (less-than OR equal to 1), so it actually trains 2 battering-ram-line in total. I would avoid attempting to change any of the other conditions if possible as lots of the rules rely on each other for many different reasons to properly work. So just stick to changing the number in the unit-type-count conditions and Jester will be on his way to not training as many siege units for your liking :)

I hope this helps!
- ScreamingKoos

Post Reply