Cruzada

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: Cruzada

Post by Campeador »

Ok, problem resolved: When Cruzada attacks it always TSA, combining it or not with a very simple DUC depending of the situation. So DUC can improve, in theory, battle performance, but if enemy target is spoted, then TSA will save Cruzada of situations like "I have smashed my enemy but I don't finish it because I see buildings but not people near to the targeted ones".

I think that this version should be +1600 ELO in the Ladder, but it still could have a few bugs. I've added too many things lately.

More doubts:
a) I thought that DUC also send soldiers grouped into enemy's target, but I see themgoing 1 by 1, like with TSA. Can it be resolved or better use atk-groups for the begining of the attack?
b) Is it possible to attack with DUC or TSA keeping archers with defensive stance? My archers just go, shoot, and keep in their place even when attacked. Very manly, but I'd prefer something smarter, like hit&run, etc, optimizing their tactical advantage over mele units.

Meanwhile you save me, again, of the ignorance of the UP world I'm improving other things in my AI:
- Eco balance. My retasks are too radical and I seldom go to send foodies to gold to the opposite and viceversa. I'm sure that I could make a few more adjusts to get the adequate number of woodies.
- New strats. Starting by other types of flushes. Later alternative strats for closed and water maps.

Happy Christmas! :birthday:

User avatar
jdstankosky
Guru
Posts: 911
Joined: Thu Nov 25, 2010 12:30 pm
Location: Florida, USA
Contact:

Re: Cruzada

Post by jdstankosky »

New AI?!? :ph34r:

I must come out of hiding/retirement. I cannot let my eternal rival surpass me so easily! :devil
Do not try to script a counter for everything. That is reactionary, and always slower than taking the initiative in battle. Decide from the start what you are going to do, and do not waiver from it. Own it.

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

Re: Cruzada

Post by Campeador »

Hi my ancestral rival. Glad to see you again! B)

Don't worry yet for my new AI, it's not more powerful than Crusade and ti plays many less settings. Although I am preparing a new system to calculate gatherer percentages based in MEW, by Marathon, which is not so different, I think, to what you are preparing for your Hell-Raven.

My next update is going to include an Excel file to calculate how many villagers do you need in every resource to train units of X type from your current number of buildings. Even if this version is still weak, at least the file will be interesting for every scripter and perhaps even players. B)

User avatar
jdstankosky
Guru
Posts: 911
Joined: Thu Nov 25, 2010 12:30 pm
Location: Florida, USA
Contact:

Re: Cruzada

Post by jdstankosky »

I can tell you I am already interested in seeing such a spreadsheet! Perhaps what I need is a paradigm shift anyways.
Do not try to script a counter for everything. That is reactionary, and always slower than taking the initiative in battle. Decide from the start what you are going to do, and do not waiver from it. Own it.

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

Re: Cruzada

Post by Campeador »

Cruzada updated. Not sure about if this version is stronger, but it includes the mentioned excel file.

It's designed just for Mayans, and it lacks yet a table for imperial age, but you can see the way to do it.

Example: How many villagers are needed to keep a barracks training man-at-arms?

Price: 60F 20 G
Training time: 21''

Food: Obviously you need 60F every 21'', more or less 3 food per second.
How many foodies do you need? Hunters are faster, farmers are better with wheel barrow, which my AI often gets in late feudal. I've considered farmers (hunt and forage is finished soon in feudal) with wheel barrow upgrade. So they have a gathering rate of 0.358 food per second (lower with WB).

So are needed (60/21)/0.358=7'98 farmers with wheelbarrow.

Gold: Considering gold upgrade and WB it's 0.409. Although perhaps I should not consider that gold upgrade because Cruzada often delays it until castle transition or even castle age. Too much work. 0.409.

So (20/21)/0.409=2.33 gold miners. The excel file says 2.32xxxx, but I use the aproximation by nearest decimal, not the lowest.

And it's all. All? Wrong. We forgot wood. Hey, m@a don't cost wood? Yes, they do. As I said in the other thread 5 of them require a house, so, they cost 6 wood.
(6/21)/0.379
Wrong again! They cost food, so they too cost wood because it's needed for farms. Cruzada often gets mill and lumber upgrades. Remember that a farm costs 60 wood, and it can produce 175 food without mill ugprades and 250 with the first one. So we have to add the food cost multiplied by 60/175.

So we need:
6 wood for houses + 60 food * (60/175) = 20'57 wood
=>
(20'57 wood / 21'') / 0.379 gathering rate = 2.59 woodies


WARNING: I've noticed a mistake in my excel file. What I did was to addtion 6+food*60/175. It should be correct if farmers and woodies produced resources at the same rate, but it's false, because they get faster the 60 W needed for a farm the 60 F produced in such farm. Remember farmers produce 0.358 food per second while woodies produce 0.379 wood.


Possible improvements.
You can see that I've used 3 different sheet for feudal, castle and imperial (wel, I haven't added this yet), considering that I get eco upgrades inmediately, which it's false. The most exact way should be to consider NO UPGRADES until the end of the .per file in which you set g-min-foodies, etc. And readjust it in the end depending of the completed eco ugprades. For example you can consider 0.317 rate for farms, but multiplying the required foodies in the end by (0.317/0.358) with plain WB or (0.317/0.412) with HC.

Also remember to do it in the correct order because required woodies depend partially of required foodies.

And more. Remember that Aztecs farm faster, with an advantage which is decreased every age; Teutons and Chinese have a smaller handicap for wood for farms; Hun allies force you to put more villies for your stables; CONSCRIPTION accelerate military units but just for some military buildings, not all of them; Aztecs required too more villagers for any military units (but not for economical ones like boats); Persians have "more expensive" villagers and eco and military boats.

I think that I'll put together later in a file for every age, but using a different one for civ, because otherwise I could make mistake with the up-jump-rule command.

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

Re: Cruzada

Post by Campeador »

I've found an interesting article about real cost of resources:
http://aok.heavengames.com/university/s ... urce-cost/

It shows one fo the things that I've forgotten to consider. Wood cuttersand miners also require "farms", although cheaper ones than farmers need: lumber and mining camps. So it's a good idea to consider that every 10 woodies require a lumber camp, so every woody require 10 extra wood, but with the difference that it's harder to calculate when such 10 woodies finish near wood and need an extra lumber camp. With farmers at least you can know their gathering rate and the time that they need to finish their farms.

Perhaps extra wood for woodies and goldies should be included in the g-exta-percent-wood and -gold goals, even if it's just for simplicity. There are things to think about this. :shoot

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

Re: Cruzada

Post by Campeador »

Apart of the real gathering gates with the third wood upgrade (I've invented for the moment aproximated numbers) I only need a thing to finish my code to calculate required villagers in every resource to train required units:

How can I know how many relics I have got in my monasteries?

It's important, because depending of their number and the proportion about the gathering rate of gold miners and the rate of relics (0'5 gold per second) I should substract more or less gold miners as "necessary" for unit spamming.

scripter64
Waheguru
Posts: 5891
Joined: Fri Jan 16, 2009 8:36 pm

Re: Cruzada

Post by scripter64 »

I think you can (up-get-fact resource-amount amount-relics GOAL) to get your current relic count into a goal or (up-resource-amount amount-relics > X) to do a fact condition check. There are a few different relic "amounts" in the list, so hopefully that's the right one :lol:

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

Re: Cruzada

Post by Campeador »

Thanks. This part of code is completed.

My idea is to upload it with my next version once it becomes tested. And write it in the UP tricks&tips thread once the other part is finished too, although what I've made should be useful itself. Anyway, if someone want to see the code earlier just need to say it. B)

kunyi
Guru
Posts: 758
Joined: Tue Mar 21, 2006 7:48 am

Re: Cruzada

Post by kunyi »

good ai :), i ran some test with my ai, Cruzada really hard flusher, but i sometimes saw this bug again and again : around 50 vills, if Cruzada attackhed, and lost X villager, your all vills go lumberjack, and only 1-2 on farm around 45+ on wood, and he still on wood if enemy retreat too, saw games where cruzada score have 1000+ more, but this bug defeted it some mins,or its not bug? yeah and dont stop your project , need ai which can kill barbarian xd

Post Reply