Mini-update 1
With these series of mini-updates, I want to share my process for how I try to solve the various programming challenges that come up within the development of the project.
2023-09-26
For today one of the main bugs I was trying to work on was making it so the pieces would move according to what's being returned from the logic helper that I had created prior
The key part of trying to solve for the logic here was trying to make it so it would be possible to stack the two layers on top and get the generalized set of possible places the piece could move to
The next step within this logic is going to be implemented phased (like how a knight moves: ignoring any pieces in the way) vs non-phased movement (how standard pieces get stopped in their path)
Another important thing to get working was how to have pieces move depending on whether it's black or white's turn. In this case, I made a generalized solution where after having created a movement matrix from white's perspective, it would get rotated to then be the same from black's perspective.
2023-09-28
Adding helpful UI elements to make the game more playable
From this, you can see what piece you've selected and where you can move your piece afterwards
Another big thing that I wanted to change was making it so the code is a bit more modular. In this case, that was essentially looking at the UI component game_screen.py and making sure that it's only handling the UI and not the actual logic behind the operation. I separated out the logic to game.py in the logic folder and now I'll be able to implement the rest of the game logic easily.
Right now, since I'm using the states of this game logic object, it's essentially in command of giving what are the valid moves after a button has been pressed, what's the alignment of each piece in the the board, where all the pieces are in the board, what's the currently selected piece and where can the selected piece move to.
Alternate turns have been implemented as well, that's essentially just making it so a piece can only be selected if it's their turn
The next two big things to figure out is the game end state. I'm not sure but I actually might not have to implement check since premature game ending due to mistakes could hopefully automatically be learnt by the neural network. So now, I just want to find a way to encode a prioritized piece / king
A piece can now be made a king piece
- Firstly, in the board draw screen, you can press the middle mouse button over a type of piece you've currently selected and press on it in the board to add a red circle on top of it, that signifies that it is a king piece. I don't have a hard stop right now for how many king pieces you can make so for now, I'll just make the logic so that as soon as you take a king piece, it's a win.
Speaking of which, I need to incorporate being able to take enemy pieces.
I've added that too, that was actually easier than expected since the only thing I need to account for is the alignment for the enemy piece in which case they get wiped out
Files
Get Generalized Chess
Generalized Chess
AI for any version of chess
Status | In development |
Author | Ultraman287 |
Genre | Puzzle |
More posts
- Mini-update 3Nov 21, 2023
- Mini-update 2Oct 01, 2023
Leave a comment
Log in with itch.io to leave a comment.