Vetrix 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.
Post Reply
User avatar
marathon
Waheguru
Posts: 1984
Joined: Fri May 14, 2010 2:30 pm

Re: Vetrix AI

Post by marathon »

I ran a couple tests.
The AI dropped 2 houses with 2 villagers. Better drop 1 house with two villagers on it, have the third one scouting, then once the house is made maybe drop another one if you like (with one builder this time).
You can possibly find a way to drop the first house very close to one of your villagers. Right now, you have some idle TC time at pop 5.
Tested the test version.

You found 6 sheep early. You made a lumber first, good idea. But you had 7 on food and delayed boar luring, so you had foragers when this happened (you had already sighted both boars).
I say, if the boar is close, go loomless lure. Close is I think < 19 tiles, test and see. But for AIs, it is perhaps wiser to go mill first unless if you find 7-8 sheep. Forage has the plus that it occupies many foodies, so when there is shortage in farms you can still make good food income. So delaying foraging and speeding up farming is good.

Boar hunting without force-drop is NOT good. It is best to totally skip boar hunting if you gonna go without force drop. MEW is a small AI of mine, that has an old boar hunting code but is very easy to read and get the idea. The code there is kinda strange, it was made before UP syntax takes its current form. The force drop is tested and optimal.

Gather sheep at TC.

It went for an archer flush in a teutons wars vs ATE. ATE went knights, took two smith ups in transition but no bloodlines. You hit lumber, killed 2 villies.
But I say you need less goldies and more on wood. Even as Teutons, you had lack of wood. You only had one range early. I say make two, and then a blacksmith, and only when the smith is down you can increase gold miners a bit. Stay at 4 early, not six. Also, limit early farmers to something like 9-10, not more farms. Enough archers can fight even vs knights (and you can always make a couple spears if needed, the rax is there).
But the biggest mistake here was the fact that it decided to stop vill production when it had some 250 food! I searched for escrow percentages but I think it must have been a goal. A bad idea, if you want to go up you don't stop villagers for so long. It is ok to stop them when you have 700 food, or even 600. You flushed yourself this way.

Some pieces of code that you might find useful for now or later. Do not copy, understand and use. The sn-object-repair-level is the only one you can copy without deep understanding.

Code: Select all

(defrule
	(true)
=>
	(set-strategic-number sn-local-targeting-mode 1)
	(set-strategic-number sn-enable-training-queue 1)
	(set-strategic-number sn-enable-offensive-priority 1)
	(set-strategic-number sn-wall-targeting-mode 1)
	(set-strategic-number sn-livestock-to-town-center 1)
	(set-strategic-number sn-object-repair-level 20675)
	(set-strategic-number sn-preferred-trade-distance 254)
	(set-strategic-number sn-dropsite-separation-distance 7))

Code: Select all

(defrule
	(gold-amount >= 200)
	(research-available castle-age)
	(food-amount > 760)
	(current-age-time > 71)
	(food-amount < 800)
=>
	(chat-local-to-self "Forced drop")
	(up-drop-resources food c: 5))

Code: Select all

(defrule
	(building-type-count house == 0)
	(building-type-count-total house == 1)
=>
	(up-assign-builders c: house c: 2)
	(up-assign-builders c: unbuilt-town-center c: 3)
	(disable-self))

(defrule
	(building-type-count house > 0)
=>
	(up-assign-builders c: house c: 0)
	(disable-self))

Archon
Waheguru
Posts: 1905
Joined: Sat Nov 08, 2003 9:22 am

Re: Vetrix AI

Post by Archon »

Marathon, have you tested your really old boar hunting code? Scripter did some changes, I think two years ago, so it may not work.

And maybe related to that: sn-enable-boar-hunting 2 prevents hunting deer.

User avatar
THE RULER
Guru
Posts: 655
Joined: Sat Feb 20, 2010 10:55 am
Location: FRG
Contact:

Re: Vetrix AI

Post by THE RULER »

indeed Lade 0.4 is legendary, a project for winter evenings to adapt it in UP
It's poison and it's blood and big fire, big burn - into the ashes and no return

_II2N_
Guru
Posts: 639
Joined: Thu Jul 14, 2011 8:44 am

Re: Vetrix AI

Post by _II2N_ »

I ran some tests, and Vetrix did pretty well.

Here are some issues I noticed:
-Vetrix takes a lot of researches without checking does it really need them, like town watch or stone mining without any stone miners.
-Similarly Vetrix builds buildings it doesn't need yet, like a stable with flush that only trains archers.
-When going for an archer flush, you should drop 2 ranges before blacksmith. Sometimes Vetrix also builds so much farms it never affords 2nd range.
-There was a lot of excess gold at feudal age with flush; at late-feudal there were 10 miners but gold wasn't used for anything.
-If you're planning to up to castle but lack food (like <650), it's better to keep training villagers to avoid unnecessary idle TC.
-Goths trained longswords at castle age but had 25% gold gatherer percentage, this is too much.
-Assigning more villagers to build TCs could help (ID for TC under costruction is different, so you'll have to use its ID (defconst unbuilt-town-center 621)).
-Vetrix should build more mining camps once it starts mining stone and dropsite distance to stone is too large. It mined a lot of stone without any mining camp nearby.
-More than 100 villagers can be tasked with UP, so you should probably go for 120-130 in 1v1.
-Once economy is up Vetrix should start build more houses. (housing-headroom < 10) is too strict requirement once there are multiple military buildings producing units.
-In a game against offwo_michi Vetrix was winning, but at imperial age it stopped training all units but monks and siege, so michi could make a comeback.

It's nice to see more active scripters :)

User avatar
KiiNgZoNe
Forumer
Posts: 62
Joined: Fri Mar 02, 2012 8:15 am

Re: Vetrix AI

Post by KiiNgZoNe »

Thanks II2N!

I immediately saw that issue with imperial age too, as I was testing it too at that time. It came from a lack of a goal rule. Thanks for notifying!

Thank you for the suggestions! I'll be sure to whoop this AI with updates and fixes....and :head

User avatar
THE RULER
Guru
Posts: 655
Joined: Sat Feb 20, 2010 10:55 am
Location: FRG
Contact:

Re: Vetrix AI

Post by THE RULER »

It's nice to see more active scripters
Oh yes, it is ! :)
It's poison and it's blood and big fire, big burn - into the ashes and no return

User avatar
KiiNgZoNe
Forumer
Posts: 62
Joined: Fri Mar 02, 2012 8:15 am

Re: Vetrix AI

Post by KiiNgZoNe »

I have uploaded another file done by my recent edits of my AI. Please evaluate the new one. (Vetrix Test Version 2)

I've ran a couple of tests and it went bad. I thought I've been fixing my AI bit by bit, but now I think there must have been something wrong, losing 0-3 to my older versions of Vetrix and my other derelict AIs.

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

Re: Vetrix AI

Post by marathon »

Archon, the boar hunting code you refer to (the one in MEW) is not functioning. It was the first attempt to lure 2nd boar before first one was over, it was I think before the introduction of boar-lure-size. Since it is not very elegant to lure boar this way, Scripter had to change the whole code (although the power of human-like luring of 2nd boar was demonstrated by that AI of mine).
I only mentioned MEW for the force-drop code. The AI is small, it is easy to map it, and this little piece of force drop is ok. The rest of it is before some great stuff like up-get-player-fact were introduced, it was made in the first stages of UP and it is in fact a relic of the UP history.
I have a better MEW here, but still without deer luring or sheep scouting.

User avatar
THE RULER
Guru
Posts: 655
Joined: Sat Feb 20, 2010 10:55 am
Location: FRG
Contact:

Re: Vetrix AI

Post by THE RULER »

OkOk...

entirely unbalanced and missing any clear strat.

archers aren't that units in feudal ( unless awaiting milrush), rock in early castle as x-bows + bodkin ( so around 20 to 24th minute)
die like flies vs skirmis (or towers lol)

too early on wood ( farming around 7th minute)
runs out of farms and food supply . lots of gold (no market activity)
unnecessary researches like stone mining, mil ups
too far located mills in defensive state

have a look at strongbow AI

you'll get it

Edit: off topic regarding Marathon's comment deleted; sry for that
Last edited by THE RULER on Wed Oct 29, 2014 9:37 am, edited 1 time in total.
It's poison and it's blood and big fire, big burn - into the ashes and no return

User avatar
KiiNgZoNe
Forumer
Posts: 62
Joined: Fri Mar 02, 2012 8:15 am

Re: Vetrix AI

Post by KiiNgZoNe »

Vetrix indeed misses any clear strat. I'll arrange for a better strategy far later after I can fix the problems of this AI. These include:

- Boar hunting (especially the 2nd lure. No one helps the lurer of the 2nd boar at all. As a result, it takes too long to eat a 2nd boar; the next created villagers will be sent to eat the boar which is outrageously :head :head :head and get better food to advance efficiently.) In fact, my older AIs advance faster than the Vetrix's new update (which takes him to almost 15mins just to hit Feudal.)

- Resource control. I have already tried escrowing wood but II2N is right. It can only help so little. All the wood to build another important building is wasted on farms AND also, SKIRMISHERS. In fact, Vetrix may NEVER advance to the Castle Age at all or if it does, it never builds a 2nd and 3rd TC (which I applied a goal that if Vetrix successfully builds 3 TCs, it can build the more important buildings such as siege workshop etc., get unrestricted training of units, and finally get unrestricted farming)

- Ways to advance efficiently. In one game when I pitted Vetrix vs SkielAI (one of the first AIs I made. It loves Fast Castle. It has no variety of units, and has useless goals and messy script but is more efficient in advancing), Vetrix lost in no less than 40 mins when Skiel attacked with a great mass of units while Vetrix is STILL AT THE FEUDAL AGE while it trains almost a hundred skirmishers along the way despite the restriction in advancing-attempts.

- Skirmishers. They are what KILLS this AI. Vetrix's own skirmishers. I don't know why, I'm sure I arranged how it trains these units especially based on the threat goal. Once the threat hits to its requirement, Vetrix will never stop training skirmishers despite the restrictions. I don't believe that it somehow overrides any restrictions I made, especially I made goals to not train any at all if there are < 3 TCs in the early Castle Age, but I'm starting to believe that somewhere in the script, it totally releases the restriction to train these units, but I've already searched AND added restrictions, but I still don't know where.

After I deal with these, I certainly will add clear strategies to Vetrix. :P

EDIT: I took the easy way out by editing back the later, but more useful test version to deal with the skirmisher problem part in feudal and early castle-age restrictions, but the problem still arises in the sense that it never really would stop training skirmishers even if what I would observe that the threat goal of archers is really little to none. The threat goal for spearmen doesn't have this kind of problem. Hopefully fixing this would be easier now. :dance (by this, I've uploaded a new update on the Test Version 2)

Post Reply