Crusade AI Project

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
Campeador
Waheguru
Posts: 1340
Joined: Mon Nov 01, 2010 8:11 am
Location: Spain

Re: Crusade AI Project

Post by Campeador »

I've made a quick reading to CPS_Alexander farming and it looks pretty, but I'm temporaly satisfied with my farm rules. I know that it isn't always necessary get a 30 wood buffer for farms, but I've "increased" it to 40. :unsure: Why? Because now I can build in dark age the hunting mills, which in general work well, although in my last test one of them was builded near forage bushes, even there was built there the first.

I've also improved exploration system copying it from Norman_Duck.

But my best idea (when it became to work :head ) is my countering system. It creates counters until they are sufficient to neutralize threat, and general units later.
At this moment Crusade only trains spears, skirms and scouts. But this is only because a bug that I'm going to discover tomorrow (now it's late in my country and I'm half sleep). But it's supossed to train swords and archers when it has enought counter for the actual situation.

Problems to consider:
- Too late advance to feudal for a flushing civ. My first idea is set more food gatherers when I arrive to 24 villies. Another is revise hunting mill and farm system.
- Train spears when there aren't resources for swords and viceversa. Same with archers. Easy to resolve tomorrow.
- Idle TC in feudal. I'm thinking about add an extra food prerequiste to avoid not disposing 50 for next villies, as in Lade AI. I'm doubting with it because it would supose a later attack, but i's the more probably.

My AI isn't so agressive as I pretended, but at least it can punish unprepared opponents if not FC too well. With manual control I can dominate standard AI quite well and advance to castle with a better position. I realize that with a TSA or alike, attacks aren't so good as with human hands, but my AI doesn't smell bad.
Last edited by Campeador on Mon Dec 26, 2011 11:49 am, edited 3 times in total.

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

Re: Crusade AI Project

Post by marathon »

You can try a 8-7-12 build order for a flush. You can do many things: see in the rather messy Kosmos how it achieves those 12:xx feudal times.

CPS Alexander's farming is good throughout the whole game. It's easy to fix dark age, but how about feudal, feudal-castle for a FC etc? His solution is elegant.

Better train scouts if you can't train spears, unless there are already many enemy spears around.

Don't even think about removing the food buffer from units. A flush is supposed to delay the opponent, not kill him. If you delay yourself, then you are flushing yourself, not the opponent. I have seen my script and Alexander have well over 100 population under 30' and in feudal age. With food buffers, researches and enough resources for castle age. Once again, spy the Horde. See how it functions from vill-8 till early castle age when it's flushing. It's a masterpiece. And it uses food buffers.

Work more on strategy and less on army control for now. I personally have solved most feudal warfare problems, I could help you.

There is some discussion about the forced hunting issue. You can force some of your villagers abandon the slow berries and farms and go hunting if there are deer around. Search in the forums or in Kosmos. It's tricky and risky, but it usually leads to strong 27-28 pop feudals. You wouldn't want an earlier feudal because you couldn't collect all the wood for the buildings.

User avatar
Campeador
Waheguru
Posts: 1340
Joined: Mon Nov 01, 2010 8:11 am
Location: Spain

Re: Crusade AI Project

Post by Campeador »

I'm now trying a 8-8-all food for my flush. When I hadn't well implemented force hunting system, with 8-7-x it always happened that gettting too massed villies in berries, disturbing themselves, only to go finally for wood for farms. I sometimes arrived to 29-pop feudal, but it was more usual 31-pop, or even 33-pop with a little idle TC time. :blink:

Finally, researching in Kosmos and forum, I've copied Kosmos force hunting but trying start at 18th villager, because there are forumers that recommend don't start before than 17th, and it's enough to faster feudal if deers are found early. In my first test deers were too far, don't founded, and it didn't work, but re-starting and with manual exploration I was able to force hunting, but too late because deers distance and get feudal 31-pop but without idle TC. Second test were better, with very early deers, founded even without cheating exploration. Now only 30-pop, but only because too early loom (food gathering too slow at start) because force hunting worked well.

I've also read with a little more deeply building file from CPS_Alexander (not much more :rolleyes: , first was force hunting) and I see that it uses a goal farm, which value depends from strategy and affects building farm priority. I'm thinking about perhaps help my AI with with another goal farming, and depending from the age, food percentage gatherers required by the strategy selected, or even the villagers number, set it at determined value, or perhaps fix another maximum number of farms.

In scenario editor I’ve tested that without blacksmith upgrades spears seems defeat militias (no man at arms, of course) resource-costing (8 spears vs 6 militias). But if you count extra 6 wood resources for any unit (30 for a house divided by 5 pop population supported) it results in 10 militias defeating 13 spearmen.
I was thinking about start with trash units to delay gold mining, as in human flushes. But now I’m considering build a gold mining camp when first barracks finished, and then start gold mining. Archery range won’t be delayed too much, because 100 wood from mining camp can be half-compensated by don’t “waste” wood in first spears.
Another advantage of this change would be that I think that so I could start militia training in transition to feudal for a faster attack, of course saving food for economical researches.
Another changes would be the priority in blacksmith researches (ranged units arrive a little later, so improve first infantry) and delay market until get 400 wood and don’t disturb farming and ranged units spamming.

P.D: Marathon, I can’t find it now, but in one thread I read searching about force hunting information you mentioned another problem about barracks huskies. You had problems to fix how many huskies number you need from barracks and castle to counter because both are “different” units for AI’s engine. If you have interest, I’m considering about a “simple” although only approximated solution:
Supose that with actual ranged units threat, your AI calculates x huskarls as necessary. You know how many castles and barracks you have, and you “know” approximately, that depends of strategy and circumtances, how much percentage of time can dedicate your castles and barracks to huskies (you can need trebs, spearmen or different techs). Now you have how many huskies you can create at castles and barracks in the same time.
For example, you need 30 huskies. You have two castles, but half of time you need one of them for trebs, ellite huskarls tech, etc. So you "have" 1’5 castles. You also have four barracks, but you need one only for spears and upgrades, so you “have” 3. Then you need 10 castle huskies and 20 from barracks. As this can’t be exact, you can fix in this strategy and situation 12 from castle and 25 from barracks. B)

P.D: I’ve uploaded my last Crusade version with chat command to unsure that I’ve understood, or not, force hunting.

User avatar
MuRRay Jnr
Waheguru
Posts: 1990
Joined: Mon Jul 27, 2009 3:03 am
Location: Queensland, Australia

Re: Crusade AI Project

Post by MuRRay Jnr »

Finally, researching in Kosmos and forum, I've copied Kosmos force hunting but trying start at 18th villager, because there are forumers that recommend don't start before than 17th, and it's enough to faster feudal if deers are found early.
just dont forget about the gothic +15 hunt carry bonus. force hunting with goths sometimes cause massive problems. the 17th villager is a good time to start IMHO, but with goths i would start it earlier pero a hunting mill balances it out a little bit.
cheers,
murrayj

my current attempt at scripting, avarice ai

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

Re: Crusade AI Project

Post by Leif Ericson »

pero a hunting mill balances it out a little bit.
Haha...pero :)

I seem to remember a post by someone either deciding to forgo a hunting mill or forced hunting for the Goths (marathon maybe?).

User avatar
MuRRay Jnr
Waheguru
Posts: 1990
Joined: Mon Jul 27, 2009 3:03 am
Location: Queensland, Australia

Re: Crusade AI Project

Post by MuRRay Jnr »

Haha...pero
:rofl
I seem to remember a post by someone either deciding to forgo a hunting mill or forced hunting for the Goths (marathon maybe?).
i vaguely remember having a discussion about forced hunting with marathon and scripter64.
http://forums.aiscripters.com/viewtopic ... ing#p35536

its nothing to do with goths but still some useful thoughts in there.
cheers,
murrayj

my current attempt at scripting, avarice ai

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

Re: Crusade AI Project

Post by marathon »

In my tests Goths and Aztecs have problems with forced hunting. If they start too late, they may reach in feudal after 34 vill.

I am now implementing another solution: forced hunting early without hunting mill and small hunt distance (<= 20), later forced hunting with hunting mill and larger hunt-distance.

With a swift transition to wood and then to food one can instantly see whether there are any deed near. If there aren't any, another try with larger hunt distance could possibly help.

In any case, I seem to be able to hit 29-vill feudals with all civs and without hunting. I tried a 9-8-8-mixed order that offers early food and helps with the violent retasking to wood in dark-feudal. Problem is that there is too much traffic at the forage site, but only when forced hunting doesn't work. Often, feudal is taken at 31-vill... Some other times I see that at 27-pop I have all necessary food.
On particular maps I had the chance to see some 17:xx castle age times, but also some 21:xx...

Considering the Husky thing, I can't calculate the time it takes for the creation of units because my resources are usually at bottom. Also, the most important thing for me is to be able to maintain a good ratio between units during endless battles. When I need 25 champions, I order it to train 40, not 30, because it's too messy on the field and in the resource pool and because other units have a higher priority in training, particularly siege units.

Suriel
Yogi
Posts: 259
Joined: Sun Oct 03, 2010 7:40 am
Location: Poland

Re: Crusade AI Project

Post by Suriel »

Maybe I'll put my two cents in and say something about farms :P

First thing - forced hunting - I wouldn't rely so much on it. You may or you may not find deers early enough. I think that farms will give you robust economy while hunting is only temporary solution. When deers are gone you get group of vills that can only chop wood until you get enough farms to bring them back to food. Good farming will give you stronger eco but with a little slower feudal, while forced hunting will give you faster feudal but with less stable eco. Unless you are making AI that is designed to play mainly against humans (faster feudal is more important then) I would suggest to sacrifice faster-feudal in exchange for more stable eco. So better build many farms and hunt deers when there is a possibility - don't treat them as a main food source.

Second thing - hunting mill - I think that it shouldn't be built when deers are very close to your base because this is just waste of wood. It's better to save that 100 wood for 2 extra farms.

Another thing - VNS_None wrote in his script that adding more build rules causes the AI engine to optimise builder. I run some test to check this and it seems that when you have more "build farm" rules AI engine tends to pick villagers that are closer to place where the farm is going to be build. That decreases time between each farm construction and speeds up eco a bit. So, more "build farm" actions you have, the more farms are built in a given amount of time. I don't know where lies the upper limit, but with one "build farm" rule you will definitely get worse eco than with let's say four.

And last thing - idle farm count - marathon suggested somewhere there that having this quite high is good idea (8 or something like that, at least for castle and imperial age). This has the same effect as more build rules - faster farming.

In short - farming is key point to good eco. Make it good and you will avoid TC-idle-time and and have better chances to win :)

I'm not expert but I believe that what I've written here is right :D
If I'm wrong in some point correct me :P

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

Re: Crusade AI Project

Post by marathon »

I've always thought that I had done my best to improve my farming, but some scripts like CPS Alexander are better.
I had no idea about that effect of multiple building rules. My script lately has a problem with farming and housing and it ends up building pavillions... I will introduce one farming sn and one housing sn. This will help merge building rules and make many copies of them.

After my latest tests on forced hunting I will have to agree: since it is possible to advance in feudal with 28-30 villagers everytime and without hunting, then who needs deer? Besides, I have seen that extra food sources are a very good thing during flushing or booming, since one may find himself in position that he has not enough farms. Finally, deer are better exploited with wheelbarrow and the presence of some troops helps other hunters keep collecting meat instead of helping against a wolf.

A strange thing in my script is that often attacked villagers keep doing their job instead of defending or going away. Both difficulty parameters are set to zero. :huh:

As for the hunting mill, I still haven't decided.

Sometimes I see that terrain takes a farm-like appearence. I am afraid that this is due to farms being for too long unexploited. Does anyone know anything? Because I have an upper limit of 65 farms in my script, and I have seen up to 63 farmers so far, but most of the time there are a ton of idle ones and I am afraid that they are somehow auto-deleted.

Suriel
Yogi
Posts: 259
Joined: Sun Oct 03, 2010 7:40 am
Location: Poland

Re: Crusade AI Project

Post by Suriel »

Back to hunting mill - I don't think it should be dropped completely, but maybe there should be some system to check when it's necessary. If deer pack is placed to far away, not building that mill may result in eco problems. My AI currently doesn't build it at all (it was using it in older versions - code for it is still present though it's commented), but I've been thinking about system that would check distance to deers, maybe I will implement it someday, but first I need to finish code restructurisation - I've made nice mess that I need to clean :D

Post Reply