AlistairJah
Skirmisher
posted 10-04-18 02:49 AM
EDT (US)
303 / 406
Yes, because gForecasts is a float array, not int.
Also, I completely agree with a less frequent call of the econMaster.
ylg_hke
Skirmisher
posted 10-05-18 01:35 AM
EDT (US)
308 / 406
ResourceBreakdown creates manages plans = manages villager tasks.
==> Yea, we are lucky, it seems ResourceBreakdown & plans care little about those villagers as long as they are not idle and working at correct resource type. ie: they will not constantly task a villager from treeA to treeB as long as that villager is gathering wood.
Food might need a bit more calculations, huntables, farms, berries, they are all different.
Also, you meant "firing RGP functions with values" (=updating ratios, which doesn't necessarily mean that the values of those ratios have changed), not "firing values".
==> Not sure what you mean exactly, but I broke it into 2 cases, firing the same values & firing different values, so I think we are talking about the same thing...?
I don't think fishing plans take AbstractWhale into account.
==> Now we have a new todo LOL.
ylg_hke
Skirmisher
posted 10-05-18 08:45 AM
EDT (US)
310 / 406
Do you mean, in RGPs or Breakdown?
==>Both, the original foodBreakdown is a disaster.
BTW, I have just done some tests, now i think i will ditch "updateForecasts", its very difficult to get a good result with it, one of the biggest problem is that troops' training time will never be taken into account by using addItemToForecasts.
eg: adding 15 hussars vs 15 musketeers, resource ratios will be very very different if we use addItemToForecasts, but actually the difference is rather moderate.
Maybe we should just hard script it with aiSetResourceGathererPercentage.
don't change ratios too often.
==> 1000% agree with you.
Just to be sure, will AI ever gather gold(AbstractWhale) with the original fish plan?(I don't have time to test fish plan yet)
ylg_hke
Skirmisher
posted 10-06-18 05:53 AM
EDT (US)
316 / 406
ah I see, thanks.
Just tested a bit more on the same map
3 mills 28 villagers, 1 easy plans + 1.0 percentage = 18 idle villagers
aiSetResourceBreakdown(cResourceFood, cAIResourceSubTypeEasy, 1, 30, 1.0, kbBaseGetMainID(cMyID));
3 mills 28 villagers, 2 easy plans + 1.0 percentage = 7 idle villagers
3 mills 28 villagers, 5 easy plans + 1.0 percentage = all villagers on mills, no idle villager
3 mills 28 villagers, 7 easy plans + 1.0 percentage = all villagers on mills, no idle villager
3 mills 28 villagers, 9 easy plans + 1.0 percentage = all villagers on mills, no idle villager
3 mills 28 villagers, 12 easy plans + 1.0 percentage = 8 idle villagers
looks like when there's no huntable/berry, we can simply put the total number of easy plan to 5 and then turn off the rule.
AlistairJah
Skirmisher
posted 10-06-18 06:01 AM
EDT (US)
317 / 406
Cool, thanks! Those values are to be kept in mind. I agree with capping the values.
ylg_hke
Skirmisher
posted 10-06-18 10:48 PM
EDT (US)
318 / 406
hmm...something isn't quite right, the original AI is able to slaughter herds without any custom gatherPlan, and now my AI tends to ignore herds, looks like I fxxked up something....
BTW, a custom gatherPlan is able to disregard cRGP even with 1 priority, as long as we aiPlanAddUnitType after the plan activation. It could be useful for late-game wood gathering.
Is it possible to get the resource amount of Jap orchard only, rather than all subTypeEasy?
AlistairJah
Skirmisher
posted 10-07-18 00:45 AM
EDT (US)
319 / 406
Does that apply to crates too? Because, last time I tested that, they ignored (respectively) food/wood/gold crates when food/wood/gold RGP == 0.0
Nope, there is no way to measure the amount of resources in a unit.
ylg_hke
Skirmisher
posted 10-07-18 11:53 AM
EDT (US)
320 / 406
Does that apply to crates too?
==> it works just fine on my end, but as I montioned before, villagers may ignore their own crates and go gather allies' crates....ah..damn its so fxxking funny LOL.
BTW now it seems "aiPlanAddUnitType after plan activation" could be weaker, and custom gatherPlan & RGP values & resource type, they are related to each other in a subtle way. Also, even with the very same setting, the result may be different by 1 or 2 each time.
Tested on the same map, 28 villagers
RGP values F=0.5 W=0 G=0.5 + a custom gold gatherPlan(1 priority, aiPlanAddUnitType 10 villagers before plan activation)
Result==> 6F 22G (8 villagers added)
RGP values F=0.5 W=0.0 G=0.5 + a custom wood gatherPlan(1 priority, aiPlanAddUnitType 10 villagers before plan activation)
Result==> 5F 10W 12G (10 villagers added, 1 food gatherer gone as house builder)
RGP values F=0.0 W=0.5 G=0.5 + a custom gold gatherPlan(1 priority, aiPlanAddUnitType 10 villagers before plan activation)
Result==> 7W 20G (~6 or 7 villagers added, 1 gold gatherer gone as house builder)
RGP values F=0.0 W=0.5 G=0.5 + a custom gold gatherPlan(1 priority, aiPlanAddUnitType 10 villagers after plan activation)
Result==> 9W 18G (~4 or 5 villagers added, 1 gold gatherer gone as house builder)
RGP values F=0.33 W=0.33 G=0.33 + a custom gold gatherPlan(1 priority, aiPlanAddUnitType 10 villagers before plan activation)
Result==> 3F 8W 16G (~9 villagers added, 1 gold gatherer gone as house builder)
RGP values F=0.33 W=0.33 G=0.33 + a custom food gatherPlan(1 priority, aiPlanAddUnitType 10 villagers before plan activation)
Result==> 12F 9W 7G (~3 villagers added)
RGP values F=0.33 W=0.33 G=0.33 + a custom food gatherPlan(1 priority, aiPlanAddUnitType 10 villagers after plan activation)
Result==> 12F 8W 8G (~3 villagers added)
AlistairJah
Skirmisher
posted 10-07-18 12:32 PM
EDT (US)
321 / 406
Cool, those infos could be useful for potential new scripters I guess...
You are right, unit addition must be done after plan activation. It's pretty slow though.
Aaand you're right, villagers tend to ignore their own crates. To be honest, it pisses me off, so much that I replaced it with cPlanHerd+Query... cPlanNativeResearch+Query works too. Much faster. It's so... I don't even know... f*cky?
Any progress in the attempt to replace void updateGatherer?
ylg_hke
Skirmisher
posted 10-08-18 03:43 AM
EDT (US)
322 / 406
unit addition must be done after plan activation
==> Oh, I guess I didn't make it clear enough? Results are not consistent with each other, so right now I cant say for sure whether to aiPlanAddUnitType before or after the plan activation.
To be honest, it pisses me off
==> yea, have you tested cGatherPlanResourceID? If we can get crates' ID, it might be useful.
cPlanNativeResearch+Query works too. Much faster.
==> not sure what you mean exactly....
But regarding Aztec dance plan, sometimes Warrior Priests get dragged into INF attack plans, even there's a add 0 WP line + the dance plan has higher priority.
=========================================================
aiPlanAddUnitType(InfantryPlan, cUnitTypexpMedicineManAztec, 0, 0, 0);
=========================================================
Any progress in the attempt to replace void updateGatherer
==> hmm...currently I am making some villager ratio schemes, they are equally useful even if we use ZenAI ManualGathering, as addItemToForecasts is 100% disaster unless we deal with most unit types specifically.
I talked about hussar vs musket, but now that I think of it, its probably not the best demonstration, mid-game germans fully on war wagons VS port fully on dragoons will be better. Their villager ratios should be pretty much the same, but with addItemToForecasts germans will have a lower wood ratio, and then "void updateGatherers" will kick in, try to bring up the wood ratio, which will be brought back eventually anyway, that's why we have some ever changing ratios.
Also, in the original foodbreakdown:
=================================================
totalFoodPlans = huntPlans + farmPlans;
aiSetResourceBreakdown(cResourceFood, cAIResourceSubTypeEasy, totalFoodPlans, 79, 1.0, kbBaseGetMainID(cMyID));
if(xsGetTime() < 1200000)
aiSetResourceBreakdown(cResourceFood, cAIResourceSubTypeHunt, totalFoodPlans, 79, 1.0, kbBaseGetMainID(cMyID));
else
aiSetResourceBreakdown(cResourceFood, cAIResourceSubTypeHunt, 0, 79, 0.0, kbBaseGetMainID(cMyID));
==================================================
I don't get it, why hunt + easy plans all get "totalFoodPlans" as the number of plan???
I think thats why villagers still go hunting in mid-game even they have enough mills until (xsGetTime() < 1200000) (20mins). hunting is good but at the time, its likely they have too much hunters and too few huntables.
ylg_hke
Skirmisher
posted 10-08-18 08:33 AM
EDT (US)
324 / 406
LOLx100, that's very creative!
I have tested RicePaddy, it could be tricky.
===================================================
RGP values: F=1.0 W=0 G=0
22 villagers + 5RP
set all RP to gold before gather plans kick in
result = 22 idle villagers
OK now set all RP back to food
result = no idle villager
hmm...lets set them back to gold
result = 22 gold gatherers, no idle villager
set an empty RP to food, then tell some villagers to work at that RP
result = they will eventually go back to the original RP (go back to gather gold)
====================================================
So....once the plan is activated, it will not check RP tactic anymore
BTW, I would like to know more about ManualGathering's impact on computer-resource, let me know if you notice anything new.(any WoL beta tester?)
I wonder which one is better for low-specs PCs when they all have 99 villagers, Plan or ManualGathering(?)
AlistairJah
Skirmisher
posted 10-08-18 09:33 AM
EDT (US)
325 / 406
Fortunately it worked XD
HA! I was sure there was a flaw with Rice Paddies holding two different types of resources! Hopefully it won't have too dramatic impact...
I'd always go with ManualGathering, because it gives nearly 100% of control over what you do, and has no noticeable impact on performance (however I have to admit that what happened in ImpMod was quite strange *hmm*). However if you are super extremely lazy (like me), you can use the RGPs and family. Super fast to code.