Json Rules Bot
Json Rules Bot is a simple game where you program a set of rules and conditions using the json rules engine. These are evaluated at each frame of the game to move your robot around the map, avoiding hazards and collecting samples.
The map is a 21 x 21 grid with squares numbered from 0 to 20 in each direction. Each tile can contain one of the following terrain types:
"flat"- A flat, safe tile, takes 1 energy to move through."rocky"- A tile with rocks on it. Takes 2 energy to move through."mountain"- A tile with a mountain on it. Takes 3 energy to move through."water"- A tile with water on it. Ends the game
Additionally each tile may have a hazard, these are:
"radiation"- A tile with radiation on it. Increases radiation level by 1 per turn."storm"- A tile with an electrical storm on it. Moving from this tile may go in a different direction."unstable"- A tile with unstable ground. Your robot my become stuck when moving from the tile.
The robot starts at position (10, 10) and can move up, down, left, or right onto adjacent tiles.
Game
- Rules
- Conditions
Events
The rules should emit one of the following events:
"move"with"params": { "direction": "n" | "s" | "e" | "w" }to move the robot in the given direction."scan"to reveal a 5x5 area centered on the robot, consumes 1 energy."collect-sample", to collect a sample from the current tile, consumes 1 energy."wait"to do nothing, recharges 1 energy.
Facts
Map Facts
"terrain"with"params": { "dx": number, "dy": number }determine the type of terrain if it's been revealed at the given x and y offset"hazard"with"params": { "dx": number, "dy": number }determine the type of hazard if it's been revealed at the given x and y offset"hasSample"with"params": { "dx": number, "dy": number }determine if there is a sample at the given x and y offset
Robot Facts
"playerX"the x coordinate of the robot"playerY"the y coordinate of the robot"powerLevel"the power level of the robot"radiationLevel"the radiation level of the robot
Sample Facts
Every level contains 5 samples indexed from 0 to 4
"sampleRevealed"with"params": { "sampleIndex": number }whether the sample has been revealed"sampleCollected"with"params": { "sampleIndex": number }whether the sample has been collected"sampleDx"with"params": { "sampleIndex": number }the x offset of the sample from the robot"sampleDy"with"params": { "sampleIndex": number }the y offset of the sample from the robot"sampleDistance"with"params": { "sampleIndex": number }the travel distance to the sample from the robot
Game Facts
"level"the current level"totalSamplesCollected"the total number of samples collected across all levels
