Skip to content

dane-johnson/diplomacy-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

User Info

First off, read the rules of diplomacy here. The commands are split into two categories, public and private. Public commands are for actions outside of the game, like joining a team, looking at the board, and advancing the game. Public commands are issued in the public channel by mentioning the game master. Private commands are those described in the game rules, like moving pieces and holding. Private commands are issued in a private chat with the game master.

Vocab

  • [nation] One of england, france, germany, austria-hungary, italy, russia and turkey
  • [piece] One of fleet or army
  • [territory] One of the three letter spaces on the board

Public Commands

  • register [nation] - Join the nation of your choice, must be done before the game starts
  • display factions - Show a list of which players are associated with each nation
  • display board - Show the gameboard
  • display retreats - Show a list of units that need retreat orders
  • display orders - Cause the bot to DM you with a list of your orders
  • start - Begin the game
  • end - Advance the game by ending the current round. Be sure all orders have been placed before advancing.
  • amend [nation] ([piece] or remove) at [territory] - The game logic was hard to code and I probably made mistakes. Amend allows you to add and remove pieces to remedy mistakes.

Private Commands

  • [piece] [territory] holds - Order this piece not to move this turn, the default order for every piece.
  • [piece] [territory] to [territory] - Order this peice to move or attack a connected territory.
  • [piece] [territory] supports [piece] [territory] (to [territory]) - Order this piece to give support to another piece.
  • fleet [territory] convoys army [territory] to [territory] - Order this fleet to convoy an army to a different space.
  • [piece] [territory] disbands - Order this dislodged piece to be removed from the board.
  • [piece] [territory] retreats to [territory] - Order this dislodged piece to retreat to a new territory.
  • add [piece] at [territory] ( and [piece] at [territory]...) - Add pieces to territories in the adjustments phase.
  • remove [piece] at [territory] ( and [piece] at [territory]...) - Add remove to territories in the adjustments phase.
  • display - You can do display requests in the direct message channel now

Development Blog

I made a number of mistakes on this project, particularly early on. The minimum viable product for this would have been me taking photos of the board and sending it over text. Fully automating the game logic for a game I have never played was a mistake, and I realized that each page of the 20 page instruction manual translated to about 100 lines of code.

Regardless, I'm looking ahead now, the new minimum product is simply the game logic, over Discord. I will not make another time estimation because I have been wrong so many times, so I will simply say soon. Ready yourselves for war. It is live.

I've put time into this, but it is untested and likely to have bugs. I will still be developing the game as it is being played, so expect changes, and refer to this document for updates.

UPDATE: The game is live

Developer Info

To Run:

  1. Set up a virtualenv environment virtualenv ENV
  2. Activate the virtualenv environment source ENV/bin/activate
  3. Install the requirements pip install -r requirements.txt
  4. Create a .env file with the variables APP_TOKEN=<your_app_token> and BOT_TOKEN=<your_bot_token>
  5. Select your interface, one of cli, slack, or discord
  6. If using discord, install node and npm, and run npm i
  7. Start the server ./bin/start