Page 1 of 9

Vetrix AI

Posted: Mon Sep 23, 2013 7:01 am
by KiiNgZoNe
Hello, kiing here. I would like to upload my AI. Vetrix is my first attempt of an AI. The script is very on a newbie level, though it can beat some old AIs so I decided to upload this for much, much GREATER improvements until I can finally put this AI in the ladder or a tournament.

Comments, criticisms and suggestions would be greatly appreciated. Thank you! ;)


Settings
- Arabia, or any land map, but preferably ARABIA :devil (Has some problem in Nomad/LN, I don't know why)
- Any civilization
- Plays with UP version (with few inclusions for WK and DE)
- 200 pop only

Re: Vetrix AI

Posted: Mon Sep 23, 2013 8:25 am
by Promiskuitiv
Nice to meet you KiiNgZoNe!
Downloading and testing your AI now.
What are the settings (maps, civs, 1.0c/UP, ...) it plays?

Edit: Testing on 1.0c now since i didn't detect any UP commands.
- You load a resign file though there isn't one included in your download.
- You researched all cavalry blacksmith upgrades before reaching the castle-age though you didn't have any/plan to train any cavalry.
- You built a second blacksmith later despite not being in a position to keep both busy.
- You didn't boom nor rush while your enemy went for a fast castle-age and boomed with 3 TC's => He reached the imperial age quickly and attacked your LSM army with arbalests. You trained some skirms to defend, but without the e-skirm nor the bodkin arrow upgrade.

This test was versus an old version of my old AI which was still comatible with 1.0c (newer ones are only compatible with the userpatch).
Sorry for only mentioning the bad things your AI did, it looked nice for a first AI!
Testing your AI vs the standard AI now.

- Your AI said "The enemy feudaled fast. Preparing for feudal war." but the first things it built when arriving in the feudal age were a market and two blacksmiths?
- The enemy didn't have any military units while you had quite some m@a and you cancelled your attack plans anyway when he advanced to the castle-age. You might have dealt quite some damage, though the enemy might also have krushed.
- You barely trained any villagers in the castle-age (TC was idle very long) since your militiaman-line training rules are above your villager training rules and always used up your food stockpiles before any villager could be trained.
- At 35 minutes your AI attacked the enemy with man-at-arms with +1/+1 (at least upgrade them to longswordsman first).
- At 45 minutes game-time your attack still didn't deal lethal damage, you had 150 pop and still didn't press the imperial-age button.
At 54 minutes the standard AI resigned.


Again i only mentioned all the negative things so that they can help you when thinking about what to improve in your AI. It is a very nice first AI!
With some adjustments it will get much stronger, but from then on out it's going to be much harder to beat the beasts that lurk in the shadows of this site. >:­)

Re: Vetrix AI

Posted: Mon Sep 23, 2013 9:34 am
by KiiNgZoNe
Promiskuitiv wrote:Nice to meet you KiiNgZoNe!
Downloading and testing your AI now.
What are the settings (maps, civs, 1.0c/UP, ...) it plays?

Edit: Testing on 1.0c now since i didn't detect any UP commands.
- You load a resign file though there isn't one included in your download.
- You researched all cavalry blacksmith upgrades before reaching the castle-age though you didn't have any/plan to train any cavalry.
- You built a second blacksmith later despite not being in a position to keep both busy.
- You didn't boom nor rush while your enemy went for a fast castle-age and boomed with 3 TC's => He reached the imperial age quickly and attacked your LSM army with arbalests. You trained some skirms to defend, but without the e-skirm nor the bodkin arrow upgrade.

This test was versus an old version of my old AI which was still comatible with 1.0c (newer ones are only compatible with the userpatch).
Sorry for only mentioning the bad things your AI did, it looked nice for a first AI!
Testing your AI vs the standard AI now.

- Your AI said "The enemy feudaled fast. Preparing for feudal war." but the first things it built when arriving in the feudal age were a market and two blacksmiths?
- The enemy didn't have any military units while you had quite some m@a and you cancelled your attack plans anyway when he advanced to the castle-age. You might have dealt quite some damage, though the enemy might also have krushed.
- You barely trained any villagers in the castle-age (TC was idle very long) since your militiaman-line training rules are above your villager training rules and always used up your food stockpiles before any villager could be trained.
- At 35 minutes your AI attacked the enemy with man-at-arms with +1/+1 (at least upgrade them to longswordsman first).
- At 45 minutes game-time your attack still didn't deal lethal damage, you had 150 pop and still didn't press the imperial-age button.
At 54 minutes the standard AI resigned.


Again i only mentioned all the negative things so that they can help you when thinking about what to improve in your AI. It is a very nice first AI!
With some adjustments it will get much stronger, but from then on out it's going to be much harder to beat the beasts that lurk in the shadows of this site. >:­)
Thank you for the comments, Promi!

About the resign file, it's was actually based on the Old vs. New AI tournament (thanks for reminding) but I'll definitely put the resign rule in the script once I get Vetrix tweaked, hopefully.

Vetrix trains normally LC as a monk counter, should there be monks, just in case, so the upgrades were just to make sure that once it trains cavalry, it's strong enough not just to counter monks, but be able to kill enemies as well. It trains cavalry in some civs.

Yes, I do believe I have BIG problems dealing with transitions to ages. Best example is that Vetrix stays usually in the Feudal Age, and it seldom goes to Castle Age before the opponents can, but when the opponent gets to CA first, he'd switch plans to try get to the CA too. Before I uploaded Vetrix, I once tried using a goal in which a certain research is available, (long swordsman for example) I have to save resources, which results in reduction in training of units (only counters constantly train, for that matter). It happened to be okay, so I used it when I have enough civilian population, I would focus on advancing to Imperial Age, but then, it went bad; Vetrix dragged too long to advance to Imperial Age after it completed the needed military upgrades. I didn't noticed the villager thing though. I didn't believed the fact that when a certain training rule (villager) is above another (military), it would prioritize the first one more, since they come from different buildings. I guess I was wrong, then. And about staying for feudal war, thanks for reminding. I completely forgot to make that adjustment waaay before. Thanks again! ;)

Re: Vetrix AI

Posted: Mon Sep 23, 2013 5:24 pm
by scripter64
Welcome to the forum, Kiing :)

Re: Vetrix AI

Posted: Mon Sep 23, 2013 8:14 pm
by KiiNgZoNe
scripter64 wrote:Welcome to the forum, Kiing :)
Thanks scripter! I have a very long road ahead before I can hope to match my AI against Chameleon fairly, or even win at least once. :lol:

Made a slight update...or rather, corrections. You have my gratitude for giving me ideas for improvement. :D

Re: Vetrix AI

Posted: Tue Sep 24, 2013 4:11 pm
by Finaldeath
Welcome! Hope you can save yourself some effort and use 1.4 commands to work wonders :D

Re: Vetrix AI

Posted: Sat Sep 28, 2013 9:17 am
by Campeador
Hi KiiNgZoNe. Welcome to the world of :head.

Your AI is quite interesting. I like scripts with agressive feudal attacks.

A thing to improve (usual in a new AI):
You build too many buildings too soon. Two barracks and two archeries (and even two additional stables with Turks) can be nice in feudal age, but... only once you have enough economic power to afford it. They are good once you can keep constant unit training from your existing buildings while you upgrade your troops. But if you have idle times in a building it means that you should delay the next one of the same type.
So you could reduce your wood gatherers once you create your first essential buildings, to have enough food and gold for other needs.

Re: Vetrix AI

Posted: Thu Oct 24, 2013 5:25 am
by KiiNgZoNe
Campeador wrote:Hi KiiNgZoNe. Welcome to the world of :head.

Your AI is quite interesting. I like scripts with agressive feudal attacks.

A thing to improve (usual in a new AI):
You build too many buildings too soon. Two barracks and two archeries (and even two additional stables with Turks) can be nice in feudal age, but... only once you have enough economic power to afford it. They are good once you can keep constant unit training from your existing buildings while you upgrade your troops. But if you have idle times in a building it means that you should delay the next one of the same type.
So you could reduce your wood gatherers once you create your first essential buildings, to have enough food and gold for other needs.
Thanks Campeador! I realized that too. Now it does work better and it seemingly beats other weaker AIs. (I tested with some of the "newbie" AIs from a tourney pack I had downloaded here somewhere)

Now I just got this updated and I think I got a problem: TS doesn't increase; When I build a military building, it sets the maximum TS to 2, therefore, it goes up to next to 4, but then it stays just to 4 and it never expands. And now it doesn't build a barracks and a mining camp when the AI is now advancing to the Feudal Age. This didn't happened before and I'm pretty sure I got the TS rules right. Can someone check this out when you test this slight update? I'd gladly appreciate it. Thanks! (it indeed does :head after all lol)

Re: Vetrix AI

Posted: Thu Oct 24, 2013 10:03 am
by cakemaphoneige
line 348

(defrule
(timer-triggered idle-time)
=>
(set-strategic-number sn-maximum-town-size 20)
(set-strategic-number sn-gather-idle-soldiers-at-center 1)
)

this rule is looping (firing every rule pass)
This is happening because of line 136

(defrule
(true)
=>
(set-goal g-train-primary gv-yes)
(set-goal g-train-spearmen gv-no)
(set-goal g-train-secondary gv-yes)
(set-goal g-train-skirms gv-no)
(set-goal g-train-cavalry gv-no)
(set-goal can-train-spearmen gv-yes)
(set-goal can-train-skirms gv-yes)
(set-goal g-train-cannoneers gv-yes)
(enable-timer idle-time gather-idle-soldiers) < this bad boy
(disable-self)
)

this timer is enabled and starts your looping rule after 15 seconds game time, until it is maybe activated later from that gather soldiers at center system thingy you have ( do you use that for retreating? because theres is an UP command that directly retreats units to a building you specify or -1 for home tc. You could use the same system and just use the up command instead)

I strongly suggest using this for testing, its how i found your problem.

;Example for up-chat-data-to-player/up-chat-data-to-self
(defrule
(taunt-detected my-player-number xx)
=>
(acknowledge-taunt my-player-number xx)
(up-chat-data-to-self "Town Size = %d" s: sn-maximum-town-size) < can use for sn's,goal's etc

i use it for alot of sn's/goal's for debugging, can solve some issues much easier.

Also, rules that are likely to bug, like the rule that sets the TS to 20, add debug chat to them, only get rid of the chat when your certain it wont bug again.

Re: Vetrix AI

Posted: Mon Oct 20, 2014 11:02 pm
by KiiNgZoNe
It's been a while and I've been trying to :head back and forth with this guy. I have done some minor changes with him, but I don't think on uploading an update because of the script's total hell of a mess here and there, and with such small changes:

- Better selection of primary and secondary units
- Feudal defense made simpler (it almost never attacks in feudal now, because of age advancement problems while flushing, unless its military is FAR superior enough)

- Gather percentages

I'm having trouble with the advancement to Imperial Age. The biggest problem I have is resource control, which too, results with my problem in age advancements. Are there any new instructional AIs out there I can use, especially with using UserPatch codes? I'd love to have them and improve my AIs. Thanks!

By the way, I've been showcasing everyone's AIs for quite some time in Voobly, and players quite tend to lose especially against the best AIs around even with the lag affecting AIs as well. Even the top players have their own losses too! Really great job for everyone, which only inspires me more to work with my AI. ;)