/puzzler2018

Help hexy collect his brandwatch features and bring them to the super product

Primary LanguageJavaScriptMIT LicenseMIT

Puzzler 2018

Attributions

SVGs are from https://game-icons.net:

Requirements

Rules

  1. Implement your bot anywhere you'd like using the 'http://127.0.0.1:5000/simulator/tick' endpoint and (optionally) the 'http://127.0.0.1:5000/simulator/new' endpoint. For your convenience, yourBot.py is available to give you a starting point and baseBot.py is available to see how the enemies work.
  2. The entities will execute their actions in the order they're listed in the sim.board.entities list
  3. The player's bot can't move on to a space occupied by another entity, except for a collectible the player is picking up
  4. The player can't hold up more than 5 collectibles
  5. When the player attempts to move on to their home base, they will instead deposit all their collectibles in their base
  6. There is a limit to the number of frames in a round
  7. There is a limit to the number of rounds before the final judgement
  8. Your bot is judged on the avg, high, and low of the following:
    1. Score. This is the number of collectibles you rescued minus the number of collectibles you lost.
    2. Rescued. This is the number of collectibles you deposited in your base.
    3. Lost. This is the number of collectibles your enemy deposited in their base.

Running

Gotchas

On Mac, you may need to install https://www.anaconda.com/download/#macos so pythonw for python3 is available. You may need to install pygame directly: python3 -m pip install -U pygame --user to get the visualizer working

First steps

Execute the following to install your dependencies and start a annoying-sounding aliens example game. you should hear sound and see a some alien space ships, which will automatically close when they get to your vehicle.

make && make test-visualizer

Run server

this actually runs the simulation and has endpoints to control the simulation

for testing (100 rounds)

make && make run-server-simple

for submission (1000 rounds)

make && make run-server-submission

Print routes

print all available endpoints

make && make print-routes

At the time of this writing, that was:

Endpoint Methods Rule
health GET /
new POST /simulator/new
scores GET /roundScores
state GET /simulator/state
tick POST /simulator/tick

Run visualizer

this shows the current state of the local server's simulation by hitting the endpoints of the server

make && make run-visualizer

Interactive Mode

In addition to visualizing the current state of the simulator (and ending score summary), the visualizer can be used to interact with the server for testing. Press 'i' to toggle interactive mode

  • Use the arrow keys to send a tick with all player bots going in that indicative direction. This uses the '/simulator/tick' endpoint.
  • Use the 'r' button to go to the next round. This uses the '/simulator/new' endpoint

Run the enemy random movement bot as the player bot

make && make run-base-bot

Run your own bot (see yourBot.py/yourBot.js to implement. By default will just print 'implement me', stay in the same spot, and wait a second)

python

make && make run-your-bot

js

make install-js-bot && make run-your-js-bot

Swagger Editor

https://editor.swagger.io/?url=https://raw.githubusercontent.com/smmathews-bw-boston/puzzler2018/master/swagger/swagger.yaml

Requested Feature List

  • Ability to demo top implementations
  • Run simulator/visualizer locally
  • Local Web api to control the bot
  • Move limit
  • Same number of collectibles, but random location and random starting position of enemies
  • Score = bot collected collectibles - enemy collected collectibles
  • Simulation mode, 1000 games run. Record all scores.
  • 5 collectible carrying capacity, then must touch your base
  • Base bot to be used as a template
  • Well (ish) understood images for all entities
  • Display Leaderboard after max number of rounds

Extra Challenges for bragging rights

  1. Set simulator.ALLOW_STEALING to True. If you move in to an enemy, you'll take what they're holding. If they move in to you, they'll do likewise.
  2. Change numEnemies=2 to greater than 2.