Skip to content

Architecture

Manan Patel edited this page Oct 21, 2024 · 35 revisions

This is the Architecture Milestone.

We will be building an AI Chess app on Android Studio written in Java, implementing the python-chess library through training in TFLite, and using the Android SDK for the framework, the android.graphics library for customizing our app, Gradle for the package manager, and the Camera API to access the camera. We will also implement AI into our app using TFlite to train our model, Roboflow to collect and export our dataset, and Python to write the training in TFlite.

Firebase App Distribution (for binary testing we will be using this so that the testers can test our code.)

No VMs or containers will be used for this app. Android Studio emulator will be used.

We will be using memory in our application, as we do not need a database.

UML Diagram:

image

Views:

Welcome Screen

image

Tap any part of the screen to continue using the CHAISS app.

Main Menu

image

Select through three buttons on the screen. The play button will take you to the play menu, the analysis button will take you to the analysis menu, and the settings button will take you to the settings page.

Pause Options

image

This is the pause options menu for the 2D and 3D analysis parts of the Chaiss app. It has four buttons: resume, settings, retake photo, and main menu. The resume button lets you resume your analysis, the settings button takes you to settings, the retake photo button allows you to retake your photo to reanalyze the board, and the main menu button will bring you back to the main menu.

2D Analysis

image

The 2D analysis screen has five buttons, a scroll bar, and moving pieces. Three bars at the top left of the screen bring up the option menu. At the top right of the screen, a button flips the board around. You can move the pieces to your desired position by dragging and dropping them into squares. The analyze button at the bottom of the screen will analyze the board and give you the best possible moves for your set scenario. You can switch between black and white by tapping the names in the bar under the chessboard. The scroll bar will allow you to scroll the analysis of what pieces to move.

Settings

image

This is the Settings view. It allows the user to choose between two choices which are Customize board which will take them to a separate view and then to switch on or off the app sound.

Customize Board

image

This is the Customize Board view which allows users to select from preset board and pieces. This view also shows a preview of what their board will look like before returning to the game.

Play Menu

image

This will have two buttons. 2D chess button and 3D chess button. The touch function will be implemented to see which button the user will press. A settings button and back button will also be present. Thus, a back function should be implemented whenever the user presses the button. This function will take the user back to the previous screen. The settings function will open up the settings whenever the user presses the button.

3D Screen Difficulty

image

This is the select difficulty portion. There will be 5 buttons on this screen: easy, medium, hard, settings, and back. The settings and back functions will both take the user to their respective option when pressed. The difficulty function will intake the user’s input and take them to the next screen with the difficulty level selected.

3D Play

image

There will be 6 buttons on this screen: options, lockAndUnlock, updateFeed, execute, black, and white. The black and white functions will indicate which side the player is on. The option functions will open up the options menu. The lockAndUnlockToggle function will lock or unlock the pieces on the board. The user will unlock and move the pieces to the respective position when the AI gets the board wrong in the worst case. The lock button will be pressed again to ensure no accidental moves of the pieces. The updateFeed function will allow the AI to recapture an image of the 3D board. The execute function will update the 2D board based on the AI.

3D Determine Outcome

image

There will be 3 buttons on this screen: options, rematch, and main menu. The options function will open up the option menu when pressed. The determineOutcome function will display victory, defeat, or draw based on the outcome. Then based on if the user presses rematch or main menu, then it will take them there.

Analysis Page

image

This will have 2 buttons, 2D chess and 3D chess. The user will be able to pick which option/mode they want to play for analysis. There is also a settings button and back button so the user can navigate through the screens. The settings button will bring the user to a screen where they can customize the UI.

3D Analysis 3D Analysis 2

image

This view is the 3D analysis. The chess board will be created based on a user taking a picture and they have the option to retake the photo if the board is not properly set up. If that still doesn't work, the user can unlock the board, and it will allow pieces to be moved/added/removed per the users decision. The user can also decide what position they want by choosing which color they want, and can orient the UI by flipping the screen. Game settings are in the top left and allow the user to quit, or perform actions relating to the game. There is also a feed that suggests the best move based on the current position.

Taking Picture

image

This is the taking picture view when the user is trying to set up the board for analysis. This will be the simple camera function of any phone and allow to retake photo if needed as well.

Select Difficulty

image

There are three difficulty buttons that each can be clicked to select either “easy,” “medium,” or “hard” difficulty. The screen also contains a back button to return to the previous screen (game mode - screen 3), and it also contains the setting button that takes you to the app settings (screen 11).

Play

image

The top left button (3 lines) contains a button that takes you to in game options. Every piece on the board is able to be moved as long as it follows the rules of chess.

Determine Win/ Loss/ Draw

image

image

image

These screens have two buttons once the game ends in a Win, a Loss, or a Draw. The rematch button will allow you to play again, and the main menu will take you to the main menu screen.

Responsibilities

Everyone will be collaborating with each other and working on whatever is the main priority. Our main priorities and assignments have been:

Manan: Frontend

Justin: Frontend + Backend

Cody: Frontend + Backend

James: Backend

Tilak: Backend

Clone this wiki locally