𖣯 ChessCam [◉]: Chessboard Detection
Abstract
ChessCam is a mobile application that allows users to take a picture of a chessboard (in both the real world and a digital one) at any game state and instantly generate a digital version to continue playing. Users can choose to play as White or Black, challenge AI opponents with adjustable Elo points, or invite friends to play. The app also offers features such as the ability to save and review past games, and a custom setup mode where users can manually place pieces to create specific board states.
Author
- Name: Minh Long Vu
- Student number: 47595903
Functionality
- Account:
- Utilizes PlayFab for login/register features and manages user details.
- Requires general details such as, a unique username, email, and password.
- Chessboard Recognition:
- Detects real-world or digital chessboards using OpenCV or ChessVision across multiple themes.
- Player Mode Selection:
- Built with game engines such as Unity, Cocos, or Unreal.
- Users can continue the game in White or Black or let the AI complete the match.
- AI Opponent:
- Integrates chess engines such as Stockfish, and AlphaZero, with adjustable Elo points, from beginner to grandmaster.
- Provides solving hints with the given board state.
- Invitation:
- Using PlayFab’s real-time multiplayer features or game networking solutions (Photon, Mirror, or Unity Netcode) for lobbies and matchmaking.
- Game Storage:
- Saves and reviews previous game boards using cloud storage solutions like PlayFab’s Cloud Save or Firebase Realtime Database.
- Custom Setup:
- Implemented with Unity UI system.
- Users can manually place pieces to create a custom board state.
Scope
The scope for the MVP of this system will include the following features:
- Camera/Photo Access: Ability to access the camera and photo gallery.
- Digital Chessboard Recognition: Detects pieces and board state from a digital chessboard and generates an according digital version of the game.
- Game Continuation: Continue playing from the detected board, following standard chess rules.
- Basic AI Opponent: Integrates a chess engine with specific Elo points for single-player mode.
Quality Attributes
Reliability (Highest Priority):
Reliability is the most crucial attribute of the ChessCam as the core functionality depends on accurately detecting chess boards and generating digital versions. When users use image recognition of ChessCam with real-world pieces, there are many variables like lighting, camera angles, and different board designs that could affect detection accuracy. If ChessCam frequently fails to detect the board correctly or generates incorrect board states, it would ruin the user experience and make the application unusable.
Scalability:
ChessCam should be designed to accommodate growing users without performance degradation. As more users use the app simultaneously, the number of API calls, such as those for chessboard detection (OpenCV, ChessVision) and AI opponent (Stockfish AI), will increase within a short period. The system has to manage these high-frequency requests efficiently to ensure smooth performance and prevent delays or crashes. If ChessCam fails to scale effectively, users may experience delays in board detection, or AI responses, making the application inconvenient for practical use.
Extensibility:
Extensibility ensures that ChessCam can be easily expanded with new features and functionality without changing the system significantly. The app will be built with modular components, such as a camera detection module, or an independent AI opponent system. This design ensures that adding new features like new AI opponents, extra board themes, or even online multiplayer won’t require major changes to the system. Without extensibility, it would become increasingly difficult to implement new features and also lead to complex maintenance and application crashes.
Evaluation
To maintain reliability, scalability and extensibility, various types of testing will be conducted.
Reliability
- Fault Tolerance Testing: The system should be able to handle minor image imperfections or unclear boards, such as glare, slight misalignment, or partially visible pieces.
- Response Times Measurement: The AI’s move response times will be measured will be measured across different levels of difficulty and problem complexity to ensure a smooth user experience.
- Environment Testing: The system must accurately detect chessboards and generate digital versions regardless of different conditions such as various board themes, camera angles, and lighting conditions to ensure consistent performance.
Scalability
- Simulated Load Testing: The system will be tested under increasing numbers of users and workloads to analyze its performance under high traffic conditions.
- Response Times Measurement: The system’s response times will be measured under different usage scenarios to ensure a smooth user experience.
Extensibility:
- Module Testing: Ensure that when adding, updating, or removing components, such as new AI opponents, board themes or chat features independently, this should not negatively impact other parts of the system.
- Performance Testing: After introducing new features, the system’s overall performance will be measured. Any significant performance drop will indicate issues with the system’s extensibility.
- Code Maintainability Testing: Tools like SonarQube will be used to ensure that the code is easy to read, modify, and make future updates.