Skip to content

Commit 845733e

Browse files
authored
Merge pull request #259 from battlecode/release-1.0.9
Release 1.0.9
2 parents 048aa74 + 412f9bf commit 845733e

File tree

7 files changed

+82
-17
lines changed

7 files changed

+82
-17
lines changed

client/visualizer/src/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export enum Mode {
111111
export function defaults(supplied?: any): Config {
112112
supplied = supplied || {};
113113
return {
114-
gameVersion: supplied.gameVersion || "2020.1.0.8", //TODO: Change this on each release!
114+
gameVersion: supplied.gameVersion || "2020.1.0.9", //TODO: Change this on each release!
115115
fullscreen: supplied.fullscreen || false,
116116
width: supplied.width || 600,
117117
height: supplied.height || 600,

frontend/public/javadoc/battlecode/common/RobotController.html

+16-5
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ <h4>digDirt</h4>
12181218
<dt><span class="throwsLabel">Throws:</span></dt>
12191219
<dd><code><a href="../../battlecode/common/GameActionException.html" title="class in battlecode.common">GameActionException</a></code> - if this robot is not a landscaper, if
12201220
the robot is still in cooldown, the robot cannot carry more dirt,
1221-
or the location is not valid (there is a robot/building).</dd>
1221+
or the location is not valid.</dd>
12221222
<dt><strong>Bytecode cost:</strong></dt><dd><code>0</code></dd></dl>
12231223
</li>
12241224
</ul>
@@ -1265,7 +1265,12 @@ <h4>depositDirt</h4>
12651265
<li class="blockList">
12661266
<h4>canPickUpUnit</h4>
12671267
<pre>boolean&nbsp;canPickUpUnit(int&nbsp;id)</pre>
1268-
<div class="block">Tests whether a robot is able to pick up a specific unit.</div>
1268+
<div class="block">Tests whether a robot is able to pick up a specific unit. Checks
1269+
whether this robot is a delivery drone that is not holding anything right
1270+
now, whether the robot it is trying to be picked up can be picked up
1271+
(and that that robot is not currently held by another drone), that
1272+
the robot is within the pickup radius, and that there are cooldown
1273+
turns remaining.</div>
12691274
<dl>
12701275
<dt><span class="paramLabel">Parameters:</span></dt>
12711276
<dd><code>id</code> - the id of the robot to pick up</dd>
@@ -1300,7 +1305,10 @@ <h4>pickUpUnit</h4>
13001305
<li class="blockList">
13011306
<h4>canDropUnit</h4>
13021307
<pre>boolean&nbsp;canDropUnit(<a href="../../battlecode/common/Direction.html" title="enum in battlecode.common">Direction</a>&nbsp;dir)</pre>
1303-
<div class="block">Tests whether a robot is able to drop a unit in a specified direction.</div>
1308+
<div class="block">Tests whether a robot is able to drop a unit in a specified direction.
1309+
Checks whether the robot is a drone that is currently holding a unit,
1310+
that the target location is unoccupied and on the map, and that
1311+
there are cooldown turns remaining.</div>
13041312
<dl>
13051313
<dt><span class="paramLabel">Parameters:</span></dt>
13061314
<dd><code>dir</code> - the specified direction</dd>
@@ -1334,7 +1342,10 @@ <h4>dropUnit</h4>
13341342
<li class="blockList">
13351343
<h4>canShootUnit</h4>
13361344
<pre>boolean&nbsp;canShootUnit(int&nbsp;id)</pre>
1337-
<div class="block">Tests whether a robot is able to shoot down a specific unit.</div>
1345+
<div class="block">Tests whether a robot is able to shoot down a specific unit.
1346+
Checks whether the robot is a net gun (or HQ), whether the target
1347+
robot exists, can be shot and is in the shoot radius, and whether
1348+
there are cooldown turns remaining.</div>
13381349
<dl>
13391350
<dt><span class="paramLabel">Parameters:</span></dt>
13401351
<dd><code>id</code> - the id of the robot to shoot</dd>
@@ -1384,7 +1395,7 @@ <h4>canSubmitTransaction</h4>
13841395
int&nbsp;cost)</pre>
13851396
<div class="block">Tests if the robot can submit a transaction
13861397
to the blockchain at the indicated cost. Tests if the team has enough soup,
1387-
that the provided cost is non-negative, and that the message doesn't exceed the limit.</div>
1398+
that the provided cost is positive, and that the message doesn't exceed the limit.</div>
13881399
<dl>
13891400
<dt><span class="paramLabel">Parameters:</span></dt>
13901401
<dd><code>message</code> - the list of ints to send (at most of GameConstants.MAX_BLOCKCHAIN_TRANSACTION_LENGTH many).</dd>

frontend/public/specs.html

+24-4
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
<div class="main">
170170

171171
<h1 id="battlecode-2020">Battlecode 2020</h1>
172-
<p><em>The formal specification of this year’s game.</em> Current version: 2020.1.0.8</p>
172+
<p><em>The formal specification of this year’s game.</em> Current version: 2020.1.0.9</p>
173173
<p><em>Warning: This document and the game it describes will be tweaked as the competition progresses. We’ll try to keep changes to a minimum, but will likely have to make modifications to keep the game balanced. Any significant changes will be done before the Seeding Tournament.</em></p>
174174
<h2 id="background">Background</h2>
175175
<p>As we all know, the world is changing. Water levels are rising, pollution is becoming a global problem, and we are rapidly depleting our most valuable natural resource: soup. This year’s game is as much about surviving the changing climate as defeating the enemy team.</p>
@@ -268,7 +268,7 @@ <h3 id="units">Units</h3>
268268
<ul>
269269
<li>Produced by the <strong>fulfillment center</strong></li>
270270
<li>Can move into flooded tiles without dying, but not onto other <strong>robots</strong>.</li>
271-
<li>Can perform the action <code>rc.pickUpUnit()</code> to pick up a single <strong>unit</strong> from an adjacent tile, removing it from the map, to be placed later.</li>
271+
<li>Can perform the action <code>rc.pickUpUnit()</code> to pick up a single <strong>unit</strong> from an adjacent tile, removing it from the map, to be placed later. The picked up unit is frozen; it cannot execute any code and its remaining cooldown is constant, until it is dropped by the drone.</li>
272272
<li>Can perform the action <code>rc.dropUnit()</code> to place the currently held <strong>unit</strong> on an adjacent empty or flooded tile, but not onto another <strong>robot</strong>.</li>
273273
<li>When a <strong>delivery drone</strong> is destroyed, if it is holding a unit, that unit is placed on the tile where the drone died.</li>
274274
<li>If the unit is placed on a flooded tile and is not a drone, it is destroyed as usual.</li>
@@ -405,12 +405,12 @@ <h3 id="cows">Cows</h3>
405405
<p>There is one final unit which cannot be built and is not controlled by any team: <strong>cows</strong>. <strong>Cows</strong> are NPCs which produce tons of local pollution (plus 2000) in a radius squared of 15 around them. They move around the map at random, with a base cooldown of 2. However, cows are similar to other units:</p>
406406
<ul>
407407
<li>They die if the end up on a <strong>flooded</strong> tile.</li>
408-
<li>They can be picked up by <strong>drones</strong> (ideally, towards the enemy team).</li>
408+
<li>They can be picked up by <strong>drones</strong> (ideally, towards the enemy team). While carried by a drone, they don’t pollute.</li>
409409
</ul>
410410
<p>Initial cow positions are a property of the map, and some maps may not have any.</p>
411411
<h2 id="communication">Communication</h2>
412412
<p>Robots can only see their immediate surroundings and are independently controlled by copies of your code, making coordination very challenging. Thus, we provide a global, append-only, immutable ledger any robot can read and write to, which we call the <strong>blockchain</strong>*.</p>
413-
<p>The <strong>blockchain</strong> is a series of <strong>blocks</strong>, one per round, each with at most 7 <strong>transactions</strong>. Each <strong>transaction</strong> is 7 integers, a message chosen by the sender of the transaction. Every robot can read <em>all</em> transactions (with <code>rc.getBlock()</code>), which are not labeled by sender or team. (So you will need to find a way to distinguish them.) Any robot can submit a transaction to the <strong>transaction pool</strong> with the function <code>rc.submitTransaction</code> and by paying, in <strong>soup</strong>, a <strong>transaction fee</strong> (think of it as a bid). At the end of each round, the 7 transactions in the <strong>transaction pool</strong> with the highest <strong>transaction fee</strong> are removed from the pool and added to that round’s <strong>block</strong>. For every round thereafter, those 7 transactions are visible to all robots at all times. Transactions which were not in the top 7 stay in the transaction pool and continue to be eligible until they are added to a block.</p>
413+
<p>The <strong>blockchain</strong> is a series of <strong>blocks</strong>, one per round, each with at most 7 <strong>transactions</strong>. Each <strong>transaction</strong> is 7 integers, a message chosen by the sender of the transaction. Every robot can read <em>all</em> transactions (with <code>rc.getBlock()</code>), which are not labeled by sender or team. (So you will need to find a way to distinguish them.) Any robot can submit a transaction to the <strong>transaction pool</strong> with the function <code>rc.submitTransaction</code> and by paying, in <strong>soup</strong>, a <strong>transaction fee</strong> (think of it as a bid). At the end of each round, the 7 transactions in the <strong>transaction pool</strong> with the highest <strong>transaction fee</strong> are removed from the pool and added to that round’s <strong>block</strong>. For every round thereafter, those 7 transactions are visible to all robots at all times. Transactions which were not in the top 7 stay in the transaction pool and continue to be eligible until they are added to a block. Reading and submitting transactions are not considered actions, and thus do not interact with the cooldown.</p>
414414
<p>*(Ok technically it’s not a blockchain because it’s not hash-linked, it’s just a series of blocks, but otherwise it’s pretty similar.)</p>
415415
<h2 id="bytecode-limits">Bytecode Limits</h2>
416416
<p>Robots are also very limited in the amount of computation they are allowed to perform per <strong>turn</strong>. <strong>Bytecodes</strong> are a convenient measure of computation in languages like Java, where one Java bytecode corresponds roughly to one basic operation such as “subtract” or “get field”, and a single line of code generally contains several bytecodes. (For details see http://en.wikipedia.org/wiki/Java_bytecode) Because bytecodes are a feature of the compiled code itself, the same program will always compile to the same bytecodes and thus take the same amount of computation on the same inputs. This is great, because it allows us to avoid using <em>time</em> as a measure of computation, which leads to problems such as nondeterminism. With bytecode cutoffs, re-running the same match between the same bots produces exactly the same results–a feature you will find very useful for debugging.</p>
@@ -475,6 +475,26 @@ <h1 id="lingering-questionsclarifications">Lingering Questions/Clarifications</h
475475
<p>If something is unclear, direct your questions to our <a href="https://discordapp.com/channels/386965718572466197/401552721095688193">Discord</a> where other people may have the same question. We’ll update this spec as the competition progresses.</p>
476476
<h1 id="changelog">Changelog</h1>
477477
<ul>
478+
<li>2020.1.0.9 (1/10/20)
479+
<ul>
480+
<li>spec changes:
481+
<ul>
482+
<li>clarify that picked up units are frozen, including their cooldown</li>
483+
<li>clarify that cows don’t pollute when carried by a drone</li>
484+
<li>clarify that blockchain methods don’t incur cooldown</li>
485+
</ul></li>
486+
<li>client changes: none</li>
487+
<li>engine changes:
488+
<ul>
489+
<li>add conditions to documentation of canShootUnit, canDropUnit, canPickUpUnit</li>
490+
<li>fix bug where drones could pick up units that were already picked up by another drone</li>
491+
<li>dropUnit, pickUpUnit, shootUnit now all incur cooldown</li>
492+
<li>blockchain now has a minimum cost limit of 1 soup</li>
493+
<li>fix bug where cow would continue to pollute at the location they were picked up</li>
494+
<li>fix bug where replay files would not always store the global pollution level</li>
495+
<li>internals: add option to limit the size of logs in replay files</li>
496+
</ul></li>
497+
</ul></li>
478498
<li>2020.1.0.8 (1/9/20)
479499
<ul>
480500
<li>spec changes: none</li>

frontend/public/version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2020.1.0.8
1+
2020.1.0.9

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ teamB=examplefuncsplayer
44
maps=maptestsmall
55
source=src
66
mapLocation=maps
7-
release_version=2020.1.0.8
7+
release_version=2020.1.0.9

specs/specs.html

+24-4
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
<div class="main">
170170

171171
<h1 id="battlecode-2020">Battlecode 2020</h1>
172-
<p><em>The formal specification of this year’s game.</em> Current version: 2020.1.0.8</p>
172+
<p><em>The formal specification of this year’s game.</em> Current version: 2020.1.0.9</p>
173173
<p><em>Warning: This document and the game it describes will be tweaked as the competition progresses. We’ll try to keep changes to a minimum, but will likely have to make modifications to keep the game balanced. Any significant changes will be done before the Seeding Tournament.</em></p>
174174
<h2 id="background">Background</h2>
175175
<p>As we all know, the world is changing. Water levels are rising, pollution is becoming a global problem, and we are rapidly depleting our most valuable natural resource: soup. This year’s game is as much about surviving the changing climate as defeating the enemy team.</p>
@@ -268,7 +268,7 @@ <h3 id="units">Units</h3>
268268
<ul>
269269
<li>Produced by the <strong>fulfillment center</strong></li>
270270
<li>Can move into flooded tiles without dying, but not onto other <strong>robots</strong>.</li>
271-
<li>Can perform the action <code>rc.pickUpUnit()</code> to pick up a single <strong>unit</strong> from an adjacent tile, removing it from the map, to be placed later.</li>
271+
<li>Can perform the action <code>rc.pickUpUnit()</code> to pick up a single <strong>unit</strong> from an adjacent tile, removing it from the map, to be placed later. The picked up unit is frozen; it cannot execute any code and its remaining cooldown is constant, until it is dropped by the drone.</li>
272272
<li>Can perform the action <code>rc.dropUnit()</code> to place the currently held <strong>unit</strong> on an adjacent empty or flooded tile, but not onto another <strong>robot</strong>.</li>
273273
<li>When a <strong>delivery drone</strong> is destroyed, if it is holding a unit, that unit is placed on the tile where the drone died.</li>
274274
<li>If the unit is placed on a flooded tile and is not a drone, it is destroyed as usual.</li>
@@ -405,12 +405,12 @@ <h3 id="cows">Cows</h3>
405405
<p>There is one final unit which cannot be built and is not controlled by any team: <strong>cows</strong>. <strong>Cows</strong> are NPCs which produce tons of local pollution (plus 2000) in a radius squared of 15 around them. They move around the map at random, with a base cooldown of 2. However, cows are similar to other units:</p>
406406
<ul>
407407
<li>They die if the end up on a <strong>flooded</strong> tile.</li>
408-
<li>They can be picked up by <strong>drones</strong> (ideally, towards the enemy team).</li>
408+
<li>They can be picked up by <strong>drones</strong> (ideally, towards the enemy team). While carried by a drone, they don’t pollute.</li>
409409
</ul>
410410
<p>Initial cow positions are a property of the map, and some maps may not have any.</p>
411411
<h2 id="communication">Communication</h2>
412412
<p>Robots can only see their immediate surroundings and are independently controlled by copies of your code, making coordination very challenging. Thus, we provide a global, append-only, immutable ledger any robot can read and write to, which we call the <strong>blockchain</strong>*.</p>
413-
<p>The <strong>blockchain</strong> is a series of <strong>blocks</strong>, one per round, each with at most 7 <strong>transactions</strong>. Each <strong>transaction</strong> is 7 integers, a message chosen by the sender of the transaction. Every robot can read <em>all</em> transactions (with <code>rc.getBlock()</code>), which are not labeled by sender or team. (So you will need to find a way to distinguish them.) Any robot can submit a transaction to the <strong>transaction pool</strong> with the function <code>rc.submitTransaction</code> and by paying, in <strong>soup</strong>, a <strong>transaction fee</strong> (think of it as a bid). At the end of each round, the 7 transactions in the <strong>transaction pool</strong> with the highest <strong>transaction fee</strong> are removed from the pool and added to that round’s <strong>block</strong>. For every round thereafter, those 7 transactions are visible to all robots at all times. Transactions which were not in the top 7 stay in the transaction pool and continue to be eligible until they are added to a block.</p>
413+
<p>The <strong>blockchain</strong> is a series of <strong>blocks</strong>, one per round, each with at most 7 <strong>transactions</strong>. Each <strong>transaction</strong> is 7 integers, a message chosen by the sender of the transaction. Every robot can read <em>all</em> transactions (with <code>rc.getBlock()</code>), which are not labeled by sender or team. (So you will need to find a way to distinguish them.) Any robot can submit a transaction to the <strong>transaction pool</strong> with the function <code>rc.submitTransaction</code> and by paying, in <strong>soup</strong>, a <strong>transaction fee</strong> (think of it as a bid). At the end of each round, the 7 transactions in the <strong>transaction pool</strong> with the highest <strong>transaction fee</strong> are removed from the pool and added to that round’s <strong>block</strong>. For every round thereafter, those 7 transactions are visible to all robots at all times. Transactions which were not in the top 7 stay in the transaction pool and continue to be eligible until they are added to a block. Reading and submitting transactions are not considered actions, and thus do not interact with the cooldown.</p>
414414
<p>*(Ok technically it’s not a blockchain because it’s not hash-linked, it’s just a series of blocks, but otherwise it’s pretty similar.)</p>
415415
<h2 id="bytecode-limits">Bytecode Limits</h2>
416416
<p>Robots are also very limited in the amount of computation they are allowed to perform per <strong>turn</strong>. <strong>Bytecodes</strong> are a convenient measure of computation in languages like Java, where one Java bytecode corresponds roughly to one basic operation such as “subtract” or “get field”, and a single line of code generally contains several bytecodes. (For details see http://en.wikipedia.org/wiki/Java_bytecode) Because bytecodes are a feature of the compiled code itself, the same program will always compile to the same bytecodes and thus take the same amount of computation on the same inputs. This is great, because it allows us to avoid using <em>time</em> as a measure of computation, which leads to problems such as nondeterminism. With bytecode cutoffs, re-running the same match between the same bots produces exactly the same results–a feature you will find very useful for debugging.</p>
@@ -475,6 +475,26 @@ <h1 id="lingering-questionsclarifications">Lingering Questions/Clarifications</h
475475
<p>If something is unclear, direct your questions to our <a href="https://discordapp.com/channels/386965718572466197/401552721095688193">Discord</a> where other people may have the same question. We’ll update this spec as the competition progresses.</p>
476476
<h1 id="changelog">Changelog</h1>
477477
<ul>
478+
<li>2020.1.0.9 (1/10/20)
479+
<ul>
480+
<li>spec changes:
481+
<ul>
482+
<li>clarify that picked up units are frozen, including their cooldown</li>
483+
<li>clarify that cows don’t pollute when carried by a drone</li>
484+
<li>clarify that blockchain methods don’t incur cooldown</li>
485+
</ul></li>
486+
<li>client changes: none</li>
487+
<li>engine changes:
488+
<ul>
489+
<li>add conditions to documentation of canShootUnit, canDropUnit, canPickUpUnit</li>
490+
<li>fix bug where drones could pick up units that were already picked up by another drone</li>
491+
<li>dropUnit, pickUpUnit, shootUnit now all incur cooldown</li>
492+
<li>blockchain now has a minimum cost limit of 1 soup</li>
493+
<li>fix bug where cow would continue to pollute at the location they were picked up</li>
494+
<li>fix bug where replay files would not always store the global pollution level</li>
495+
<li>internals: add option to limit the size of logs in replay files</li>
496+
</ul></li>
497+
</ul></li>
478498
<li>2020.1.0.8 (1/9/20)
479499
<ul>
480500
<li>spec changes: none</li>

0 commit comments

Comments
 (0)