Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
koshambiB committed Apr 18, 2024
1 parent 26c801a commit 71a1620
Showing 1 changed file with 40 additions and 30 deletions.
70 changes: 40 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

## Description

This Chess AI is under development and built entirely with Python for a focus on readability and code clarity. Despite the inherent limitations of the language in performance speed when compared to compiled languages, the core algorithms have been meticulously optimized for maximum speed within Python's capabilities.
This Chess AI is under development and built entirely with Python for a focus on readability and code clarity. Despite the limitations of the language in performance speed when compared to compiled languages, the core algorithms have been changed for maximum speed within Python's capabilities.

The user interface and media controls are powered by the Pygame library, offering a user-friendly and customizable experience. The AI currently understands and utilizes FEN (Forsyth-Edwards Notation) for game state import and export, including castling using FEN support. Further support features are actively being developed.
The user interface and media controls are powered by the Pygame library, offering a customizable experience. The AI currently understands and utilizes FEN (Forsyth-Edwards Notation) for game state import and export, including castling using FEN support. Further support features are actively being developed.

## How to install

Expand All @@ -38,24 +38,29 @@ python main.py

## How to use and configure?

While a dedicated settings screen is still under development, you can customize the program's behavior by editing the [`Constants.py`](defs/Constants.py) file.Here's how to make changes:<br/>
While a dedicated settings screen is still under development, you can customize the program's behavior by editing the [`Constants.py`](defs/Constants.py) file. Here's how to make changes:<br/>

1. **Locate the file**: Navigate to the `defs` folder within your project directory and open `Constants.py`. <br/>
2. **Adjust settings**: The file contains comments explaining each setting and its current value. You can modify these values directly in the code.

### Game modes
## Game modes

The Game Mode, by default, is set to AI vs AI. In case you want to change it to another mode, you must do it in the following way:
The Game Mode, by default, is set to AI vs AI. If you want to play against an opponenet be it AI or a friend, follow these steps to modify the game mode

- First of all, go the `Constants.py` file, and search for the variable, `GAME_MODE`. It will look like the block shown below:
- Locate the `Constants.py` file in the directory containing the game codes and look for the variable `GAME_MODE`. <br/>
It will look like the block shown below:

```python
GAME_MODE = GameModes.AI_VS_AI
```
- The `GAME_MODE` variable is responsible for different modes of playing the game, the values it can take are `GameModes.PLAYER_VS_PLAYER`, `GameModes.PLAYER_VS_AI` (you play as white, and the computer plays as black), `GameModes.AI_VS_PLAYER` (you play as black, and the computer plays as white) and `GameModes.AI_VS_AI` (default).
- You can change the value of the `GAME_MODE` variable to any value out of the above four.
- The `GAME_MODE` variable determines the different modes of playing the game.It can take the following value: <br/>
1. `GameModes.PLAYER_VS_PLAYER` <br/>
2. `GameModes.PLAYER_VS_AI` (you play as white, and the computer plays as black) <br/>
3. `GameModes.AI_VS_PLAYER` (you play as black, and the computer plays as white) <br/>
4. `GameModes.AI_VS_AI` (default). <br/>

### Initial board arrangement

## Initial board arrangement

The initial board in the game, by default, is set to the standard initial board. To be able to understand and edit the initial board arrangement, you should be familiar with the [FEN notation](https://www.chess.com/terms/fen-chess) in chess. In case you are familiar, and want to change the inital arrangement, you must do it in the following way:

Expand All @@ -80,66 +85,71 @@ The depth to which the AI can think, by default, is set to $2$, which is suffici

### Colors

The Colors, by default, are set according to a visually pleasing and less noisy palette, so unless you crave for certain colors, you should leave them unchanged. In case you want to change the colors, you must do it in the following way:
The Colors, by default, are set to a visually pleasing and less noisy palette but if you wish to customize it, here's how to do it using FEN notataion.

- First of all, go the `Constants.py` file, and search for the following block of code somewhere in the middle:
- Locate the `Constants.py` file and look for the following block of code:

```python
# Colors format - [LIGHT, DARK]
colors = [(238, 216, 192), (171, 122, 101)]
highlight_colors = [(207, 172, 106), (197, 173, 96)]
legal_move_colors = [(221, 89, 89), (197, 68, 79)]
```
- All the colors are in `RGB` format, in the order `(R, G, B)`. The first `tuple` in every `list` of colors denotes the color applied to the white squares, and the next one denotes the color applied to the black squares.
- The instructions below provide the steps to alter the colors correctly:
- All the colors are formatted as `RGB` in the order `(R, G, B)`. The first `tuple` in every `list` applies color settings to the white squares while the second `tuple` does the same for the black squares.

- The instructions below provide the steps to configure these settings:
- To change the color of the squares when the board is in `idle` state, change the values in the `colors` variable;
- To change the color of the square of a piece which is clicked upon by the user, change the values in the `highlight_colors` variable;
- To change the colors with which the `legal_move` squares are filled, change the values in the `legal_move_colors`.

### Dimensions and FPS
## Configuration Options <br/>
#### (Use with Caution)

The `WIDTH`, `HEIGHT` and `FPS` variables are not recommended to be changed, so as to provide a seamless experience, but in case you want to change them, you must do it in the following way:
The default settings for the `WIDTH`, `HEIGHT` and `FPS` variables are carefully chosen for a seamless experience, but you can customize them if absolutely necessary.

- First of all, go the `Constants.py` file, and find these lines:
- Locate the `Constants.py` file, and look for these lines:

```python
WIDTH = HEIGHT = 720
FPS = 60
```
- Change the values of `WIDTH` and `HEIGHT` variables, keeping both equal to each other, and a multiple of $8$, to avoid any visual inconsistency.
- Change the `FPS` to any value supported by your display.
- Change the values of `WIDTH` and `HEIGHT` variables, keeping both equal to each other, and a multiple of $8$, to avoid any visual inconsistencies.
- The FPS variable controls the game's update rate (frames per second) and is highly dependent on your display's capabilities. You can change the `FPS` to any value supported by your display.

### Final notes on usage and configuration
## Final notes on usage and configuration

All the other variables/functions in the `Constants.py` file, or any other files not mentioned above are not supposed to be edited, and are important in providing necessary functionality to the program. If you want to experiment with the program, or make changes for contributions, you are free to do so with a threshold amount of knowledge in Python and about the project. Comments have been added wherever necessary to help understand the program better.

If you need further assistance with configuration, or any other topic related to this project, you can [create an issue](https://github.com/a2ys/chess-ai/issues/new/choose), or mail me at [oreus@duck.com](mailto:oreus@duck.com). Happy experimenting. :)
All the other variables/functions in the `Constants.py` file, or any other files not mentioned above are not supposed to be edited, and are important in providing necessary functionality to the program.Comments have been added wherever necessary to help understand the program better.

## Libraries in use

The program currently uses only one library, `Pygame`.

`Pygame` provides the necessary working GUI for the program, and connects it to the logic of the program. It also facilitates easy rendering of the images, as well as timely production of appropriate sounds.

## Minimum system requirements
## System prerequisites

- OS: Any operating system with Python 3.x and the required libraries installed.
- Processor: Any dual-core processor
- **OS:** Any operating system with Python 3.x and the required libraries installed.
- **Processor:** Any dual-core processor

> The program makes an extensive use of your machine's processing power, so it is recommended to use a **quad-core** processor, for a seamless experience, even though the minimum requirement is **dual-core**.
- RAM: At least 2GB or above, DDR3 or above
- **RAM:** At least 2GB or above, DDR3 or above

> The program extensively uses hashing and rapid storage and access of information from the machine's primary memory, so it is recommended to have a **DDR4** memory to have a hassle-free experience.
- Permanent storage: Any storage type (SSD recommended)
- **Permanent storage:** Any storage type (SSD recommended)

## Willing to contribute?
## Contributing:

If you are willing to add functionality to the program, you should [fork the repository](https://github.com/a2ys/chess-ai/fork) and make the desired changes. Then you should [create a pull request](https://github.com/a2ys/chess-ai/compare) to allow to merge your changes in the main branch.
If you'd like to make changes or contribute to the project, consider the following options:

Alternatively, if you find a bug/issue in the program, you can [create an issue](https://github.com/a2ys/chess-ai/issues/new/choose), and wait for it to be fixed.
- **Fork the Repository:** [Fork the repository](https://github.com/a2ys/chess-ai/fork) to create a copy of it on your local machine which you can later modify. <br/>
-**Make Modifications:** Make your desired changes while following coding conventions and best practices. <br/>

-**Create a Pull Request:** [Create a pull request](https://github.com/a2ys/chess-ai/compare) to propose your changes for review and potential inclusion in the main project. <br/>

Your contributions are wholeheartedly welcome.

If you need further assistance with configuration, or any other topic related to this project, you can [create an issue](https://github.com/a2ys/chess-ai/issues/new/choose), or mail me at [oreus@duck.com](mailto:oreus@duck.com). Happy experimenting. :)

## License

The project abides by the GNU GPL Version 3, which can be found [here](LICENSE.md).
Expand Down

0 comments on commit 71a1620

Please sign in to comment.