Skip to content

Requirements Document

Hunter Rees edited this page Feb 24, 2017 · 8 revisions

Challenge Chess Requirements Document

View PDF Version Here

Purpose of Document

The purpose of this document is to give an overview of our product and the specific requirements associated with the overall product we hope to complete.

Product Purpose

Our goal is to create an elegant chess application that allows for users around the world to play against each other and an A.I. that learns as it plays. While there are many chess apps out there, we believe our app’s cloud-based machine learning A.I. component makes it unique.

Minimal Viable Product

The key below outlines the importance of each individual requirement. All Critical requirements are part of our minimal viable product. On a high level our MVP will include the following:

  • Ability to Register & Login to our app using an account
  • Local Gameplay against an A.I.
  • Online Gameplay against another user
  • Online Gameplay against our machine learning A.I.

Key
Critical – C
Important – I
Extra - E

User

    1. Registration
      a. User creates an account with username, email, and password C
      b. Information from created account will be stored on server C
      c. User is logged in once registration is completed C
      d. Users can register using Facebook or Google account I
      e. Registration involves email verification E
    1. Login
      a. Users can login in using either email or username C
      b. Users are brought to the navigation page once login is successful C
      c. Server returns user cookie after successful login (used to later validation) C
      d. Users do not have to login for local play I
    1. Account Information
      a. User’s profile information is stored server-side, can be viewed on the app, and include win/lose ratio, ranking, and friends I
      b. User’s account information (password, email, etc.) can be update after initial registration I
    1. User Interaction
      a. Users have friends lists I
      b. Users can chat with their opponent during games I
      c. Users can view each friends’ profiles I
      d. If user is logged into Facebook, then their Facebook friends who play Challenge Chess as well are added to their friend list E
      e. Users are ranked based on win/lose record. This information is part of each user’s profile E
    1. Additional Features
      a. Users can change basic settings C
      -- i. Background of App
      -- ii. Board & Piece Color
      -- iii. Sound Effects
      b. Users can purchase skins for pieces and boards in store E

Local Gameplay

    1. Moves
      a. On a player’s turn, when a piece is selected its valid moves are highlighted C
      b. Movement of player’s pieces will only be allowed on their turn C
      c. On a player’s turn they can offer a draw C
      d. On a player’s turn they can resign C
      e. A player can undo their previous move E
  •  7. **Overall**<br>
    

a. Board orientation can be rotated I
b. Timer at the bottom screen keeps track of allotted time remaining I
c. When timer runs out for a player, the opponent wins I
d. Music plays while game is occurring E

  •  8. **Single Player vs AI**<br>
    

a. Difficulty of AI can be changed between games C
b. AIs will be local and will not make any calls to the server C

Online Gameplay

    1. Creating Match
      a. Users can create match with a user by inputting their username/email C
      b. While waiting for response from server loading screen will appear C
      c. Server returns a game cookie once a game begins (used for later validation) C
      d. User can create match by selecting someone on friend’s list I
      e. Users can begin a match with any random user E
      f. Users will be paired with similarly ranked users in a random match E
    1. Overall
      a. When the game ends a win/lose display appears (corresponding with the result of the game for the player) C
      b. Timer mechanism similar to Local Gameplay (7.b – 7.c) I
      c. Timer information is stored on the server and relayed to both users I
      d. Users can play multiple games at the same time E
      e. Users can restore a game if the last move was within 24 hours E
      f. Users can use a customized AI as their player E
    1. Move Verification
      a. All Critical requirements of Moves Local Gameplay (6.a – 6.d) C
      b. Moves are sent to the other client through the server C
      c. Moves are verified as valid by the other client (all game logic is client-side) C
      d. Moves are verified as part of the correct game by the server (using user and game cookies) C

Machine Learning

    1. Gameplay
      a. AI has correctly learned the rules of chess and therefore does not ever attempt illegal moves C
      b. AI can make smart moves based on a minimax algorithm that looks at least two moves ahead C
      c. AI can play against many users at a single time C
      d. AI can make smart moves based on analyzing at least five moves ahead I
      e. AI can adjust its playing level depending on the ability of the user E
      f. Users and adjust the AI to play a certain way or favor certain moves E

User Interface

    1. Views in App
      a. Login/Register View C
      b. Navigation View C
      -- i. Player vs Player Online
      -- ii. Local Play (2-Player and Local AI)
      -- iii. Player vs Machine Learning AI
      -- iv. Profile
      -- v. Settings
      c. Profile View C
      d. Settings View C

Technical Requirements

    1. Client Application
      a. Android programmed in Java using Android Studio C
      b. iOS programmed in Swift using XCode C
      c. GUI aspects are native, but game logic and AI use interfaces C
    1. Game Logic
      a. C++ C
      b. Interface to verify current board state as valid C
      c. Interface to verify the validity of specific move C
      d. Interface to return possible moves for a given piece C
    1. Local AI
      a. C++ C
      b. Difficulty can be changed at creation (scale of 1-10) C
      c. Does not make use of any server calls C
      d. Uses the Game Logic interfaces like a normal user would C
    1. Database
      a. SQL or Postgres C
      b. Users, Games, and Moves are each stored in a relational database table C
      c. Passwords are hashed and salted C
      d. Machine Learning AI learns proper and advantageous chess moves through a large database of previously played games C
      e. AI database is continually updated the more games that are played by users C
    1. Machine Learning AI
      a. Use alpha-beta pruning to make the algorithm faster I
      b. AI analyzes board states through neural networks I
      c. AI correctly weights game outcomes so that inexperienced users do not actually make the AI worse I
    1. Server
      a. Java using Spring Boot C
      b. No game logic is used on the server C
      c. End-to-end encryption (HTTPS) C
      d. REST API using JSON objects in the request & response body C