I'm developing my own from an Marathon's idea in his thread to share tips and tricks for UP:
Cruzada uses it fix a similar build order for my dark age (or when I have less than 16 villagers) to my old Crusade. The number of foodies and woodies have changed because Up requires something different, but the philosophy to fix it is the same: empirical essay and error until get correct gatherer percentages. Although Cruzada system allows it without needing any excel file to calculate exact percentages and an easier to implement code.
About feudal and later ages, my last updated version also makes the same than Crusade: determine several age phases with a fixed percentage of woodies and stonies, get a standard percentage for and gold but allowing to change it sending a small percentage from food to gold or viceverse. Diferences:
- It's easier in Cruzada because UP helps.
- Cruzada allows 5 steps instead to 3. Apart from average, high or low foodies percentage, it allows very high and very low. Obviously very high for food means very low for gold and viceversa.
I am trying something very different now. Set a minimal number of foodies, woodies, etc depending of the units that I am training now, their cost, number of buildings and even training time. I've calculated it with the mentioned excel file. For example:
Code: Select all
(defrule (goal g-barracks militiaman) (up-get-fact building-type-count-total barracks g-math-4) (up-get-fact building-type-count-total barracks g-math-5) (up-get-fact building-type-count-total barracks g-math-6) => (up-modify-goal g-math-4 c:* 798) (up-modify-goal g-math-5 c:* 349) (up-modify-goal g-math-6 c:* 233) (up-modify-goal g-min-foodies g:+ g-math-4) (up-modify-goal g-min-woodies g:+ g-math-5) (up-modify-goal g-min-goldies g:+ g-math-6) )
So for example a Hun scout needed 10 farmers (not calculated) it should require too 10*60/275=3/XX woodcutters.
You also can get different rules to consider that you haven't wheel barrow yet or calculate without upgrades and consider them later to adapt to several possibilities. Not only about upgrades like conscripting, which increases the number of villgaers for some units, you acn even do it for possible bonuses, like a possible Briton ally for your archery units.
And once you get the minimal number of villagers to keep unit training, Cruzada in the first age phases uses a fixed gatherer percentages for the rest of villagers (g-extra-food-percent and alike), and in the later ones it calculates them.
For example, imagine that you have every needed building and ugprade and you want 1000/800 gold. Well, you can set for example follow these steps:
1- Set default value for extra woodies and goldies (10 and 25 or alike)
2- Food "should be" 100/80 higher than gold, otherwise multiple that default 25. For example, if the proportion is 200/80 multiply extra gold miners by 2, because food amount is twice higher compared to gold than it should be.
3- Depending of the mill upgrade you'll need to convert part of such extra foodies into extra woodies (see Hun scout example).
Although I recognize that I still have problems with this system. My feudal age now works with the same result than my previous system, and my castle age start too. But later my eco becomes hugely unbalanced, ruining my games. I don't know if I have bugs, I just need tests to set correct number or if the system is wrong itself.
I've read Hell&Raven and I see that you have a not so different idea. Probably I am wrong , but I'd say that want to calculate how much food do you need for your planed units with delta-food-cost (and perhaps this goal is too for planed upgrades or possible age jumps). Same with delta-wood-cost and alike, using the total number of need resources total-delta-units to set proportions and percentages. Isn't it?
I ask to know your ideas about how to implement, or even to know if your idea is very different to what I believe.
Of course, if you prefer to keep your ideas secretly I'll understand it, but be sure your secret will die once you script and upload it.
In any case I am glad to have you here. You always have good and creative ideas for AI scripting, I even use sometimes your Goemul to test the resistence of Cruzada vs trushes (and I'll have to use too Tlamacazqui). Welcome back to the world of .