Page MenuHomeWildfire Games

follow-up and complement of D446 to adapt garrisoning to the structure attackers
ClosedPublic

Authored by mimo on May 9 2017, 8:22 PM.

Details

Summary
  • take the healthLevel of the units into account
  • take Sandarac comments on D446 into account
Test Plan

check in game that the AI behaves as expected

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mimo created this revision.May 9 2017, 8:22 PM
Vulcan added a subscriber: Vulcan.May 10 2017, 12:12 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/1108/ for more details.

There is also a check for target.healthLevel() < 0.55 in defenseManager.js and some other places, but these are special cases.

binaries/data/mods/public/simulation/ai/petra/config.js
128 ↗(On Diff #1797)

It is not clear from the name what this var is for, it should mention it has to do with health levels for garrisoning.

binaries/data/mods/public/simulation/ai/petra/garrisonManager.js
283 ↗(On Diff #1797)

I'm not sure about this. Ideally for the emergency case, the ent should stay garrisoned until it is fully healed (if the holder has buffHeal), as for the current use (hero in regicide), if the ent dies, it's over for the AI (although before there was just the simple check for enemies around).

mimo added a comment.May 11 2017, 7:26 PM

There is also a check for target.healthLevel() < 0.55 in defenseManager.js and some other places, but these are special cases.

ok this one is included with a medium value. The other ones are for structures to be repaired: not a problem as used only in one function, but if needed in the future, we could add a Config.repairHealthLevel for those ones.

binaries/data/mods/public/simulation/ai/petra/config.js
128 ↗(On Diff #1797)

ok renamed to garrisonHealthLevel

binaries/data/mods/public/simulation/ai/petra/garrisonManager.js
283 ↗(On Diff #1797)

Yes, but if the siege units manage to destroy the structure, the hero will be in a poor position. If in this situation and my hero would have health>0.7, i would use it to defend and regarrison it when its health becomes < 0.4 (which is what the AI was doing).
But anyway, i've modified it to use the hero only when only range siege are around.

mimo updated this revision to Diff 1850.May 11 2017, 7:29 PM

update

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/1147/ for more details.

This revision was automatically updated to reflect the committed changes.