Glavin001 / battlecode

A scaffold for players of battlecode 2016
3 stars 0 forks source link

Common setting for debug strings #5

Open CameronFc opened 8 years ago

CameronFc commented 8 years ago

Each unit in the game has a maximum of three debug strings it can display at once. So you can't have more than 3 debug strings set during a round on a single unit. I propose we adopt the following standard:

Index 0: Unit state (Exploring, travelling to known location, attacking, retreating, etc.) Index 1: Messaging Strings (Id, message, location, ...) Index 2: Anything else.

LizardLeliel commented 8 years ago

Will messaging string be the last message string it has sent (as well as a turn timestamp)?

CameronFc commented 8 years ago

In what I have written right now, each robot calls a method at the beginning of every cycle that clears any debug strings, so messages will not persist between rounds. This is done by calling Debug.emptyIndicatorStrings() at the start of the loop in every unit. You can disable it temporarily for testing if you want, but re-enable if you push.

There are no rules on what is displayed on the messaging string, but right now it should display the contents of the most recent message processed this round.

Glavin001 commented 8 years ago

How about tick looks like:

  1. Start: Debug.emptyIndicatorStrings()
  2. Set / append to static variables for unitState, messagingStrings, anythingElse (variable names should change)
  3. End: set the debug indicator strings to those variables