Skip to content

Commit

Permalink
Merge pull request #54 from battlecode/post-sprint
Browse files Browse the repository at this point in the history
Post sprint balancing changes
  • Loading branch information
wflms20110333 authored Jan 19, 2022
2 parents 8a7f7db + efcd8da commit e96495d
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 28 deletions.
4 changes: 2 additions & 2 deletions engine/src/main/battlecode/common/AnomalyType.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ public enum AnomalyType {
* {@link #globalPercentage} and {@link #sagePercentage} specify the
* proportion of metals lost.
*/
ABYSS (true, true, 0.1f, 0.2f),
ABYSS (true, true, 0.1f, 0.99f),

/**
* Charge deals concentrated damage to Droids. When global, the top
* {@link #globalPercentage} Droids with the most nearby friendly units are
* destroyed. When envisioned, all nearby enemy Droids lose
* {@link #sagePercentage} of their maximum health.
*/
CHARGE (true, true, 0.05f, 0.1f),
CHARGE (true, true, 0.05f, 0.22f),

/**
* Fury deals concentrated proportional damage to Turrets. When global, all
Expand Down
10 changes: 6 additions & 4 deletions engine/src/main/battlecode/common/GameConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ public class GameConstants {
public static final int PASSIVE_LEAD_INCREASE = 2;

/** The number of rounds between adding lead resources to the map. */
public static final int ADD_LEAD_EVERY_ROUNDS = 40;
public static final int ADD_LEAD_EVERY_ROUNDS = 20;

/** The amount of lead to add each round that lead is added. */
public static final int ADD_LEAD = 3;
public static final int ADD_LEAD = 5;

// *********************************
// ****** COOLDOWNS ****************
Expand Down Expand Up @@ -101,8 +101,10 @@ public class GameConstants {

/** Constants for alchemists converting lead to gold. */
public static final double ALCHEMIST_LONELINESS_A = 20;
public static final double ALCHEMIST_LONELINESS_B = 15;
public static final double ALCHEMIST_LONELINESS_K = 0.02;
public static final double ALCHEMIST_LONELINESS_B = 18;
public static final double ALCHEMIST_LONELINESS_K_L1 = 0.02;
public static final double ALCHEMIST_LONELINESS_K_L2 = 0.01;
public static final double ALCHEMIST_LONELINESS_K_L3 = 0.005;

// *********************************
// ****** GAMEPLAY PROPERTIES ******
Expand Down
10 changes: 10 additions & 0 deletions engine/src/main/battlecode/common/RobotController.java
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,16 @@ public strictfp interface RobotController {
*/
public int getTransmutationRate();

/**
* Get lead to gold transmutation rate for a laboratory of specified level.
*
* @param laboratory_level the level of the laboratory
* @return the lead to gold transmutation rate, 0 if the level is invalid
*
* @battlecode.doc.costlymethod
*/
public int getTransmutationRate(int laboratory_level);

/**
* Tests whether this robot can transmute lead into gold.
*
Expand Down
16 changes: 8 additions & 8 deletions engine/src/main/battlecode/common/RobotType.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public enum RobotType {
*
* @battlecode.doc.robottype
*/
LABORATORY (250, 0, 10, 24, 100, 0, 0, 53, 5000),
LABORATORY (180, 0, 10, 24, 100, 0, 0, 53, 5000),
// BCL BCG AC MC HP DMG AR VR BL

/**
Expand All @@ -36,7 +36,7 @@ public enum RobotType {
*
* @battlecode.doc.robottype
*/
WATCHTOWER (180, 0, 10, 24, 150, 4, 20, 34, 10000),
WATCHTOWER (150, 0, 10, 24, 150, 4, 20, 34, 10000),
// BCL BCG AC MC HP DMG AR VR BL

/**
Expand All @@ -45,7 +45,7 @@ public enum RobotType {
*
* @battlecode.doc.robottype
*/
MINER ( 50, 0, 2, 20, 40, 0, 2, 20, 7500),
MINER ( 50, 0, 2, 20, 40, 0, 2, 20, 10000),
// BCL BCG AC MC HP DMG AR VR BL

/**
Expand All @@ -54,7 +54,7 @@ public enum RobotType {
*
* @battlecode.doc.robottype
*/
BUILDER ( 40, 0, 10, 20, 30, -1, 5, 20, 7500),
BUILDER ( 40, 0, 10, 20, 30, -2, 5, 20, 7500),
// BCL BCG AC MC HP DMG AR VR BL

/**
Expand All @@ -73,7 +73,7 @@ public enum RobotType {
*
* @battlecode.doc.robottype
*/
SAGE ( 0, 20, 200, 25, 100, 45, 20, 34, 10000)
SAGE ( 0, 20, 200, 25, 100, 45, 25, 34, 10000)
// BCL BCG AC MC HP DMG AR VR BL
;

Expand Down Expand Up @@ -298,9 +298,9 @@ public int getLeadMutateCost(int level) {
return 0;
}
switch (this) {
case ARCHON: return 400;
case WATCHTOWER: return 200;
case LABORATORY: return 200;
case ARCHON: return 300;
case WATCHTOWER: return 150;
case LABORATORY: return 150;
default: return 0;
}
}
Expand Down
19 changes: 17 additions & 2 deletions engine/src/main/battlecode/world/RobotControllerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,23 @@ public void mutate(MapLocation loc) throws GameActionException {

@Override
public int getTransmutationRate() {
return (int) (GameConstants.ALCHEMIST_LONELINESS_A - GameConstants.ALCHEMIST_LONELINESS_B *
Math.exp(-GameConstants.ALCHEMIST_LONELINESS_K * this.robot.getNumVisibleFriendlyRobots(true)));
if (getType() != RobotType.LABORATORY) {
return 0;
}
return getTransmutationRate(getLevel());
}

@Override
public int getTransmutationRate(int laboratory_level) {
final double alchemist_loneliness_k;
switch (laboratory_level) {
case 1: alchemist_loneliness_k = GameConstants.ALCHEMIST_LONELINESS_K_L1; break;
case 2: alchemist_loneliness_k = GameConstants.ALCHEMIST_LONELINESS_K_L2; break;
case 3: alchemist_loneliness_k = GameConstants.ALCHEMIST_LONELINESS_K_L3; break;
default: return 0;
}
return (int) (GameConstants.ALCHEMIST_LONELINESS_A - GameConstants.ALCHEMIST_LONELINESS_B *
Math.exp(-alchemist_loneliness_k * this.robot.getNumVisibleFriendlyRobots(true)));
}

private void assertCanTransmute() throws GameActionException {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
52 changes: 40 additions & 12 deletions specs/specs.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# Formal specification

*This is the formal specification of the Battlecode 2022 game.* Current version: *2022.1.0.2*
*This is the formal specification of the Battlecode 2022 game.* Current version: *2022.2.0.0*

**Welcome to Battlecode 2022: Mutation.**

Expand Down Expand Up @@ -117,7 +117,7 @@

There are Lead deposits scattered on the map, which can be collected by Miners. Whereas Lead is comparatively plentiful, Gold is not found naturally. Building a Laboratory will allow you to discover the science of alchemy; the Gold you synthesize will unlock the most powerful mechanics available in the world.

Every round, each team will gain a passive income of 2 Pb. Additionally, every 40 rounds, any square of the map containing at least 1 Pb will generate an additional 3 Pb.
Every round, each team will gain a passive income of 2 Pb. Additionally, every 20 rounds, any square of the map containing at least 1 Pb will generate an additional 5 Pb.

Both teams start the game with 200 Pb and 0 Au. Resource costs for robot construction can be found in the in-depth section further below.

Expand Down Expand Up @@ -200,20 +200,20 @@

| | Archon | Laboratory | Watchtower |
| --- | --- | --- | --- |
| Cost | 100 Au (nominal) | 250 Pb | 180 Pb |
| Cost | 100 Au (nominal) | 180 Pb | 150 Pb |
| Cooldown / action | 10 | 10 | 10 |
| Cooldown / move | 24 | 24 | 24 |
| Health mutations | 600 → 1080 → 1944 | 100 → 180 → 324 | 150 → 270 → 486 |
| Attack mutations | -2 → -4 → -6 | N/A | 4 → 8 → 12 |
| Action radius | (repair) 20 | N/A | 20 |
| Vision radius | 34 | 53 | 34 |
| Bytecode limit | 20,000 | 5,000 | 10,000 |
| Level 2 mutation cost | 400 Pb | 200 Pb | 200 Pb |
| Level 2 mutation cost | 300 Pb | 150 Pb | 150 Pb |
| Level 3 mutation cost | 80 Au | 25 Au | 60 Au |

- Archon: the headquarters robot type. Can construct and repair other Droids. Cannot be built.

- Laboratory: the house of the alchemist. Can convert Lead into Gold. Since alchemists prefer solitude, if there are $n$ friendly robots within the Laboratory's vision range, 1 Au can be created by expending $\left\lfloor A-Be^{-kn}\right\rfloor$ Pb, where $A=20, B=15, k=0.02$. This formula can be accessed with the method `getTransmutationRate()`.
- Laboratory: the house of the alchemist. Can convert Lead into Gold. Since alchemists prefer solitude, if there are $n$ friendly robots within the Laboratory's vision range, 1 Au can be created by expending $\left\lfloor A-Be^{-kn}\right\rfloor$ Pb, where $A=20, B=18$. The value of $k$ depends on the Mutation level of the Laboratory, and is 0.02 at level 1, 0.01 at level 2, and 0.005 at level 3. This formula can be accessed with the method `getTransmutationRate()`.

- Watchtower: a defensive reinforcement. Can attack enemy robots that stray within the attack radius.

Expand All @@ -227,10 +227,10 @@
| Cooldown / action | 2 | 10 | 10 | 200 |
| Cooldown / move | 20 | 20 | 16 | 25 |
| Health | 40 | 30 | 50 | 100 |
| Attack | N/A | -1 | 3 | 45 |
| Action radius | (mine) 2 | (repair) 5 | 13 | 20 |
| Attack | N/A | -2 | 3 | 45 |
| Action radius | (mine) 2 | (repair) 5 | 13 | 25 |
| Vision radius | 20 | 20 | 20 | 34 |
| Bytecode limit | 7,500 | 7,500 | 10,000 | 10,000 |
| Bytecode limit | 10,000 | 7,500 | 10,000 | 10,000 |

- Miners: the resource collecting robot. Can mine squares for Lead and Gold.

Expand All @@ -239,8 +239,8 @@
- Soldiers: the general-purpose attack robot. Can attack nearby robots.

- Sage: the bringer of Anomalies. Sages are able to produce concentrated attacks, as well as the following Anomalies, but at a very slow rate:
- Abyss: 20% of resources in all squares within action range are lost.
- Charge: The air begins to conduct electricity, and all enemy Droids within action range lose health equal to 10% of their maximum health.
- Abyss: 99% of resources in all squares within action range are lost.
- Charge: The air begins to conduct electricity, and all enemy Droids within action range lose health equal to 22% of their maximum health.
- Fury: A searing solar flare erupts from the sun. All buildings within action range in turret mode have 10% of their max health burned off.
- Vortex and Singularity are not available to Sages.

Expand All @@ -253,8 +253,8 @@
The per-turn bytecode limits for various robots are as follows:

- Archon: 20,000
- Builder, Miner: 7,500
- Soldier, Sage: 10,000
- Builder: 7,500
- Miner, Soldier, Sage: 10,000
- Watchtower: 10,000
- Laboratory: 5,000

Expand Down Expand Up @@ -325,6 +325,34 @@

# Appendix: Changelog

- Version 2022.2.0.0 (January 18, 2022)
- Breaking changes: Sprint II Balancing changes
- Archons:
- Decrease level 2 Mutation cost to 300 Pb
- Watchtowers:
- Decrease initial cost to 150 Pb
- Decrease level 2 Mutation cost to 150 Pb
- Laboratories:
- Decrease build cost to 180 Pb
- Decrease level 2 Mutation cost to 150 Pb
- Change exchange rate constants to $A=20, B=18$
- Change exchange rate constant $k$ to 0.02 for level 1, 0.01 for level 2, 0.005 for level 3
- Miners:
- Increase bytecode limit to 10,000
- Builders:
- Increase attack to -2 (ie. repair to 2)
- Sages:
- Increase action radius to 25
- Increase Abyss depletion rate to 99%
- Increase Charge damage rate to 22%
- Lead regeneration:
- Increase rate to 5 Pb every 20 turns
- Client:
- Visualize repair actions and Anomalies
- Add health bar
- Shift attack visualizations so they do not overlap
- Sprint maps released

- Version 2022.1.0.2 (January 16, 2022)
- Engine
- Trigger tiebreakers if all Archons are destroyed simultaneously during Fury.
Expand Down

0 comments on commit e96495d

Please sign in to comment.