Page MenuHomeWildfire Games

Petra: Fix some cases that would cause territory expansion with Sandbox difficulty
ClosedPublic

Authored by Sandarac on Aug 1 2017, 10:43 PM.

Details

Summary

From: https://wildfiregames.com/forum/index.php?/topic/22692-error-in-description

There are cases in baseManager.js which can cause new bases to be build with Sandbox difficulty, despite the description in the AI config menu; there are already checks for Sandbox in headquarters.js.

Test Plan

With Sandbox difficulty, a new base will only be build if Petra doesn't have one.

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

Sandarac created this revision.Aug 1 2017, 10:43 PM
Owners added a subscriber: Restricted Owners Package.Aug 1 2017, 10:43 PM
Vulcan added a subscriber: Vulcan.Aug 2 2017, 12:07 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!
Checking XML files...

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

Silier added a subscriber: Silier.Aug 2 2017, 9:30 PM

In conquest map with Sandbox, there was no attack and no new city center build by AI.

mimo added a subscriber: mimo.Aug 5 2017, 7:23 PM

nice catch, but i'm wondering if it would not be better to early return false in buildNewBase when difficulty==0 instead of adding that condition here.
additionally, we could add a new headquarter property this.canExpand, initialized to false in startingStrategy.js when difficulty==0 (would be used there and in the update function of headqsuarter.js)

mimo accepted this revision.Aug 24 2017, 8:15 PM

I'll add the changes i proposed above when committing.

This revision is now accepted and ready to land.Aug 24 2017, 8:15 PM
This revision was automatically updated to reflect the committed changes.