You are browsing as a guest. Sign up (or log in) to start making projects!

Chess Engine

  • 7 Devlogs
  • 38 Total hours

A chess engine with a bunch of chess variants

Ship #1 Pending review

I made a chess game where you locally 1v1 someone with a move log to see move history and all the special rules/draw conditions like 50 move rule, 3 fold, insufficient material, castling, enpessent.

It was challenging doing the historical move rendering because you have to keep track of all the previous board positions and the checks and square highlights

Im proud of the move log because its cool

yall should know that it's low res cuz it's not that efficient and uses pygame and am working on a re-release utilizing raylib for more proformance

  • 7 devlogs
  • 38h
Try project → See source code →
Open comments for this post

8h 20m 47s logged

UPDATE #7

i wanna have the time logged for shipping but basically all i did was change some file formats for web assembly and turned down the resolution so that it would automatically scale so that it’s playable.

I’m currently in the process of converting the game from pygame to c++ raylib since i know c++ already and c++ is better for WASM thats about ittttttttt

live ver: https://thestarviper.itch.io/chess-engine

UPDATE #7

i wanna have the time logged for shipping but basically all i did was change some file formats for web assembly and turned down the resolution so that it would automatically scale so that it’s playable.

I’m currently in the process of converting the game from pygame to c++ raylib since i know c++ already and c++ is better for WASM thats about ittttttttt

live ver: https://thestarviper.itch.io/chess-engine

Replying to @andrew_

0
1
Open comments for this post

8h 17m logged

UPDATE #6

fixed bugs:

  • all game end conditions were broken
  • move log scrollbar didn’t appear
  • on pawn promotion move log didnt use proper notation
  • canceling pawn promotion didnt undo move log
  • canceling pawn promotion capture didnt undo capture
  • when going back in move log, if there was a check the square didnt light red
  • couldn’t change piece to move after selecting a piece

added features/changes:

  • promotion menu is inline column
  • added sfx
  • better sprites for pieces
  • draw and resign buttons now use icons
  • move log text now uses the Audiowide regular fond
  • massive code restructure

things needed for shipping:

  • optimization, didn’t optimize since last devlog
  • maybe learn WHAT DA HAIL bitboards are to optimize yk
  • click and drag to move piece
  • pieces flicker for a frame when transitioning from animation to static on the board

UPDATE #6

fixed bugs:

  • all game end conditions were broken
  • move log scrollbar didn’t appear
  • on pawn promotion move log didnt use proper notation
  • canceling pawn promotion didnt undo move log
  • canceling pawn promotion capture didnt undo capture
  • when going back in move log, if there was a check the square didnt light red
  • couldn’t change piece to move after selecting a piece

added features/changes:

  • promotion menu is inline column
  • added sfx
  • better sprites for pieces
  • draw and resign buttons now use icons
  • move log text now uses the Audiowide regular fond
  • massive code restructure

things needed for shipping:

  • optimization, didn’t optimize since last devlog
  • maybe learn WHAT DA HAIL bitboards are to optimize yk
  • click and drag to move piece
  • pieces flicker for a frame when transitioning from animation to static on the board

Replying to @andrew_

0
1
Open comments for this post

3h 1m 39s logged

UPDATE #5

fixed bugs:

  • checkmate didnt work (again)
  • when king is in check the square didnt light red
  • move log overflowed when filling up so i added a scroll feature

added features/changes:

  • promotion gui is now like chess.com and vertical
  • move log is striped and alternates colors for each row
  • board markings for the rows and columns

things needed before shipping:

  • optimization, still runs at like 45fps on itch.io
  • sound effects
  • maybe change fonts cuz im using default ugly ones
  • draw/resign icons instead of text
  • click and drag to move piece
  • better sprites for pieces
  • (BUG) can’t move a different piece after selecting one
  • (BUG) draw conditions are broken
  • (BUG) sidebar buttons are broken even though they dont do anything
  • (BUG) when looking back in the move log when the king is in check the square stays red

UPDATE #5

fixed bugs:

  • checkmate didnt work (again)
  • when king is in check the square didnt light red
  • move log overflowed when filling up so i added a scroll feature

added features/changes:

  • promotion gui is now like chess.com and vertical
  • move log is striped and alternates colors for each row
  • board markings for the rows and columns

things needed before shipping:

  • optimization, still runs at like 45fps on itch.io
  • sound effects
  • maybe change fonts cuz im using default ugly ones
  • draw/resign icons instead of text
  • click and drag to move piece
  • better sprites for pieces
  • (BUG) can’t move a different piece after selecting one
  • (BUG) draw conditions are broken
  • (BUG) sidebar buttons are broken even though they dont do anything
  • (BUG) when looking back in the move log when the king is in check the square stays red

Replying to @andrew_

0
4
Open comments for this post

4h 56m 24s logged

UPDATE #4

I fixed preformance :D heres how:

  • i drew the move log table 3x per frame instead of once so i made it do it once now
  • was calculating if someone was in checkmate every frame which was checking if anyone had legal moves every single frame, changed it to check for checkmate on clicks which is every time someone made a move
  • some of the stuff we were rendering were static background elements that never changed and they were being drawn every frame. So instead we render them once at the start and cache it so that we don’t render static elements so many times.
    (i accidentally changed the opacity of the background and dont feel like retaking the screenshot and accidentally moved the sidebar)

FPS my machine 30-40 -> 200+
FPS itch.io 10 -> 45

we still have a ways to go to get a fully smooth experience but 10 to 45 fps from the demo link is much much more playable and i thought i would get a devlog out.

next update ill continue to optimize and polish to get ready to ship!

UPDATE #4

I fixed preformance :D heres how:

  • i drew the move log table 3x per frame instead of once so i made it do it once now
  • was calculating if someone was in checkmate every frame which was checking if anyone had legal moves every single frame, changed it to check for checkmate on clicks which is every time someone made a move
  • some of the stuff we were rendering were static background elements that never changed and they were being drawn every frame. So instead we render them once at the start and cache it so that we don’t render static elements so many times.
    (i accidentally changed the opacity of the background and dont feel like retaking the screenshot and accidentally moved the sidebar)

FPS my machine 30-40 -> 200+
FPS itch.io 10 -> 45

we still have a ways to go to get a fully smooth experience but 10 to 45 fps from the demo link is much much more playable and i thought i would get a devlog out.

next update ill continue to optimize and polish to get ready to ship!

Replying to @andrew_

0
2
Open comments for this post

3h 23m 28s logged

UPDATE #3

things added in this update:

  • added a subtle background
  • added a sidebar
  • added “Game Log” text
  • moved board and bar to the right a bit
  • added a GitHub readme
  • rounded corners of chess board and other stuff

Issues:
I started to notice the rendering of my chess pieces moving were slightly lagging, after doing a performance test of my code using python’s profile tool i noticed that my logic for getting legal moves was called 160k+ times and my pieces were rendered 50k+ times. This made my chess engine run at 30-50 fps so i will have to fix the performance issues soon. Next update will prolly be addressing these issues and adding more UI changes

UPDATE #3

things added in this update:

  • added a subtle background
  • added a sidebar
  • added “Game Log” text
  • moved board and bar to the right a bit
  • added a GitHub readme
  • rounded corners of chess board and other stuff

Issues:
I started to notice the rendering of my chess pieces moving were slightly lagging, after doing a performance test of my code using python’s profile tool i noticed that my logic for getting legal moves was called 160k+ times and my pieces were rendered 50k+ times. This made my chess engine run at 30-50 fps so i will have to fix the performance issues soon. Next update will prolly be addressing these issues and adding more UI changes

Replying to @andrew_

0
4
Open comments for this post

2h 57m 43s logged

UPDATE #2

things added in this update:

  • created an itch.io page to demo the game by compiled the PYgame with pygbag
  • added a move log with the ability to look back in time
  • legal move dots now enlarge on hover

i plan on actually making the itch.io page look good and actually add a readme to my github repo that looks good but i plan on doing that later.

next update i think will be gui changes then after that i will work on QOL changes then feature additions like variants

Fully functional game though and i did work on my laptop without wakatime so sad it wasnt tracked :c

UPDATE #2

things added in this update:

  • created an itch.io page to demo the game by compiled the PYgame with pygbag
  • added a move log with the ability to look back in time
  • legal move dots now enlarge on hover

i plan on actually making the itch.io page look good and actually add a readme to my github repo that looks good but i plan on doing that later.

next update i think will be gui changes then after that i will work on QOL changes then feature additions like variants

Fully functional game though and i did work on my laptop without wakatime so sad it wasnt tracked :c

Replying to @andrew_

0
2
Open comments for this post

7h 24m logged

UPDATE #1

I have created using pygame a chess engine complete with all of the rules of chess and is fully playable for local 1v1 with the features:

  • on piece hover, piece tilts a bit
  • piece moves to next square instead of teleporting
  • checkmate
  • resign and draw buttons
  • stalemate
  • 3 fold repetition
  • 50 move rule
  • en pessant
  • castling
  • captured pieces are shown on the side that captured them
  • captured piece zone is aligned to board
  • pawn promotion

FUTURE IDEAS:

  • SFX
  • Better GUI on loss/draw screens
  • Better GUI for promotion
  • Main menu
  • variants (atomic,duckchess,giveaway chess, Horde, etc)
  • time control
  • bots (pinging chess.com api idk how to code a chess bot from scratch)
  • color change of boards
  • better graphics for pieces
  • move log
  • when hovering on dot of the move you want to make the dot becomes bigge
  • pull and drag pieces around board to make moves like chess.com

UPDATE #1

I have created using pygame a chess engine complete with all of the rules of chess and is fully playable for local 1v1 with the features:

  • on piece hover, piece tilts a bit
  • piece moves to next square instead of teleporting
  • checkmate
  • resign and draw buttons
  • stalemate
  • 3 fold repetition
  • 50 move rule
  • en pessant
  • castling
  • captured pieces are shown on the side that captured them
  • captured piece zone is aligned to board
  • pawn promotion

FUTURE IDEAS:

  • SFX
  • Better GUI on loss/draw screens
  • Better GUI for promotion
  • Main menu
  • variants (atomic,duckchess,giveaway chess, Horde, etc)
  • time control
  • bots (pinging chess.com api idk how to code a chess bot from scratch)
  • color change of boards
  • better graphics for pieces
  • move log
  • when hovering on dot of the move you want to make the dot becomes bigge
  • pull and drag pieces around board to make moves like chess.com

Replying to @andrew_

0
2

Followers

Loading…