Coder Social home page Coder Social logo

martimax21 / blitz2020 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from coveooss/blitz2020

0.0 1.0 0.0 121 KB

https://blitz.coveo.com/

License: GNU General Public License v2.0

Dockerfile 0.29% Python 62.91% C# 2.57% Java 7.94% JavaScript 2.26% TypeScript 23.23% HTML 0.52% CSS 0.27%

blitz2020's Introduction

Blitz 2020

Instructions

See server/README.md and ui/README.md specific instructions.

Protocol

The game uses WebSockets to interact with the different bots on port 8765. The bot first need to register itself. After that, it will receive "ticks" containing the game data and will have to respond with a move command.

Register

The first step is to register your bot. The payload should contain a type and a name. All payloads are JSON formatted.

{ "type": "register", "name": "[YOUR TEAM NAME]" }

Ticks

Each turn, the server will send you game data. The game data is composed of the map, the other players information and current game information.

{
  "type": "tick",
  "players": [
    {
      "id": 0,
      "active": true,
      "killed": false,
      "position": { "x": 1, "y": 4 },
      "spawn_position": { "x": 1, "y": 1 },
      "tail": [{ "x": 1, "y": 1 }, { "x": 1, "y": 2 }, { "x": 1, "y": 3 }],
      "direction": "UP",
      "score": 0,
      "name": "[BOT NAME]",
      "stats": {
          "number_of_captured_tiles": 1,
          "number_of_kills": 1,
          "number_of_deaths": 1,
          "number_of_suicides": 1,
          "nemesis_player": "[OTHER BOT NAME]",
          "players_killed": {"[OTHER BOT NAME]": 1},
          "killed_by_players": {"[OTHER BOT NAME]": 1}
        },
        "history": [
            {"timestamp": "1900-01-01T13:14:15.000555", "tick": 11, "message": "message-11"},
            {"timestamp": "1900-01-01T13:14:15.000444", "tick": 10, "message": "message-10"}
        ]
    },
    {
    ...
    }
  ],
  "game": {
    "player_id": 0,
    "tick": 150,
    "ticks_left": 250,
    "map": [["E", "E", "E"], ["E", "E", "E"], ["E", "E", "E"]]
  }
}

Move

After each tick, you are expected to send a move action (can be FORWARD, TURN_LEFT, TURN_RIGHT).

{ "type": "move", "action": "TURN_LEFT" }

##Game rules

  • Game rules:

    • Walking on someone's tail kill him (or suicide if it is player own tail)
    • Walking on a wall commits suicide.
    • When a player is killed, he loses all it's captured tiles and is respawned at starting position
  • Captures:

    • To capture tiles, a player must walk to any tile adjacent to a tile he currently owns
    • Capturing a player current position kills it
  • Scoring rules:

    • Newly captured tiles = 1 point per tile
    • Killing a player reward 50 points
    • At the end of each turn, 0.2 point per captured tiles

Walls:

  • non walkable tiles, not ownable tiles..

Goodies:

  • Planets: more points when while captured
  • Blitzium: walk on it = capture, capture tiles get it.. respawn randomly
  • Black holes: walk on it = kill, respawn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.