battle-snake / battle_snake

AI Programing Competition Game Server
GNU Affero General Public License v3.0
12 stars 11 forks source link

Your snake (You) is sent twice #31

Open exzizt opened 6 years ago

exzizt commented 6 years ago

Since this year your snake (You) is sent over as a Snake object (and not an id used to identify your snake in the Snakes list), I don't think it is necessary to send over your snake again in the Snakes list.

`interface World {
  object: 'world';
  id: number;
  you: Snake; # Your snake
  snakes: List<Snake>; # Contains your snake again
  height: number;
  width: number;
  turn: number;
  food: List<Point>;
}`

This is a minor optimization, but it will be removing redundancy and therefore reducing the size of the JSON string.

brandonb927 commented 6 years ago

@exzizt Thanks for this, would you mind opening this over at https://github.com/sendwithus/battlesnake-server/issues?

Cheers 🍻