Page MenuHomeWildfire Games

[Petra/Ai] Fix not traning champion cavalry and infantry after rP24640 and rP24657
ClosedPublic

Authored by Silier on Jan 16 2021, 11:50 AM.

Details

Summary

Specificaly research unlock champion technologies.

Test Plan

run ai match

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Silier published this revision for review.Jan 16 2021, 11:50 AM
Silier created this revision.

Great, thanks!
Do you think you could also make the AI able to use the Seleucid choice (traditional army vs reformed army)?

Yeah,
but that choice would be pure random I guess

That's fine!
Also, rP24635 might be problematic for the AI as well.

that one not too much, for training gatherers she checks if can gather

A grep -r shows the "Worker" class is use in baseManager.js, headquarters.js, and startingStrategy.js and the "CitizenSoldier" class in attackPlan.js, baseManager.js, headquarters.js, and victoryManager.js.
I don't know what they're used for or how the AI works, though.

Worker class means it can build and/or gather, citizensoldier it can fight, basically it was used in attackplan to not train champions and make use of barracks in hugeattack as champions were not in barracks so barracks would not be idle,

but in some places it uses citizensoldier to decide if unit can work, as long as they can build, I think classes should not be issue

Good to know, thanks for checking!

(I suggest removing the minor tech queue check L2722 of headquarters.js, as it's redundantly done in researchManager).

I think the priority of the minorTech queue needs to be bumped from 40 to something like 250. The AI currently only queues one tech at a time (it can research several at once, but only has one in its own queue), and that means it actually researches things very slowly in the beginning.
Because of how it works, it'll always try researching eco techs first, then the unlocks.

I think it's fine if the AI is too eager to research eco techs, they _are_ pretty powerful.

binaries/data/mods/public/simulation/ai/petra/researchManager.js
162 ↗(On Diff #15375)

I would remove the check for majorTech.

Build is green

builderr-debug-macos.txt
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libsimulation2_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libengine_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libgraphics_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libgui_dbg.a(precompiled.o) has no symbols
ld: warning: text-based stub file /System/Library/Frameworks//CoreAudio.framework/CoreAudio.tbd and library file /System/Library/Frameworks//CoreAudio.framework/CoreAudio are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Fra

See https://jenkins.wildfiregames.com/job/macos-differential/2890/display/redirect for more details.

Freagarach added inline comments.
binaries/data/mods/public/simulation/ai/petra/researchManager.js
85–90 ↗(On Diff #15375)

Maybe combine them? if (tech[0].indexOf("unlock_champion") != 0)

binaries/data/mods/public/simulation/ai/petra/researchManager.js
89 ↗(On Diff #15375)

Has been renamed to unlock_champion_infantry.

Silier retitled this revision from [Petra/Ai] Fix not traning champion cavalry after rP24640 to [Petra/Ai] Fix not traning champion cavalry and infantry after rP24640 and rP24657.

Build is green

builderr-debug-macos.txt
ld: warning: text-based stub file /System/Library/Frameworks//CoreAudio.framework/CoreAudio.tbd and library file /System/Library/Frameworks//CoreAudio.framework/CoreAudio are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd and library file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback.tbd and library file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreVideo.framework/CoreVideo.tbd and library file /System/Library/Frameworks//CoreVideo.framework/CoreVideo are out of sync. Falling back to library file for linking.
ld: warning: text-based stu

See https://jenkins.wildfiregames.com/job/macos-differential/2916/display/redirect for more details.

You have an if(if(

Otherwise I tested this to work yesterday.

This revision is now accepted and ready to land.Jan 17 2021, 4:53 PM