Skip to content

Commit

Permalink
Changes to worker allocation / church building
Browse files Browse the repository at this point in the history
- Workers are no longer "occasionally built close"
- Workers are allowed to build churches 'urgently' if they are full on karbonite
  • Loading branch information
ChiCubed committed Jan 30, 2019
1 parent 828fcdd commit 91d7408
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions newstart/MyRobot.java
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,8 @@ private BuildAction tryToCreatePilgrimForResource(LinkedList<Integer> locations,

BuildAction myAction = null;

if (pilgrimsBuilt % 4 == 0 || me.turn < OCCUPY_FARAWAY_RESOURCE_THRESHOLD) {
// Uncomment to reenable building close occasionally.
if (/* pilgrimsBuilt % 4 == 0 || */ me.turn < OCCUPY_FARAWAY_RESOURCE_THRESHOLD) {
// Every now and then, we'll just build a worker somewhere pretty close by.

int closestDist = Integer.MAX_VALUE;
Expand Down Expand Up @@ -1700,7 +1701,9 @@ Action runSpecificTurn() {
}

if (!churchBuilt) {
if (enemyUnitVisible() && canAffordToBuild(SPECS.CHURCH, true)) {
if ((enemyUnitVisible() || me.karbonite == SPECS.UNITS[me.unit].KARBONITE_CAPACITY) &&
canAffordToBuild(SPECS.CHURCH, true)) {

wantChurch = true;
}
if (farmHalfQty == 0 && canAffordToBuild(SPECS.CHURCH, false)) {
Expand Down

0 comments on commit 91d7408

Please sign in to comment.