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

OMNI-Chess

  • 13 Devlogs
  • 101 Total hours

A chess engine with a nature theme and puzzles

Super Star

As a prize for your great work, look out for a bonus prize in the mail :)

Ship #2

I made a chess engine in raylib with puzzle functionality and a movelog with a nature theme.

Migrating from pygame to raylib was a big challenge that took me a while to fix all the kinks.

idk the leaves are hoverable for a cool fidget thing and have fun!

  • 6 devlogs
  • 63h
  • 17.79x multiplier
  • 873 Stardust
Try project → See source code →
Open comments for this post

4h 45m 31s logged

UPDATE #13

This is the last update before i ship

So basically this was just the last update for this project cuz i decided i would start work on a different project, the changes i made this update are just to get ready to ship and complete the project:

  • removed fps counter
  • removed openings and play menu
  • removed variants from selection as they arent polished enough
  • removed misc debug features
  • audio bug fixed on button hovers
  • audio bug fixed on puzzle win
0
0
10
Open comments for this post

17h 8m logged

UPDATE #12

added features

  • added variants support
  • added giveaway chess
  • added duckchess (kinda)
  • added the start of a play screen, still working on it not much yet
  • added easing functions to some visuals so they appear instead of popping in

fixed bugs/cleanup (like 50% of this devlog)

  • split code back into multiple files
  • fixed that puzzle code was directly in frame update loop
  • tons of crash fixes todo with variants and puzzles
  • animation broke on variants
  • draw legal moves didn’t work on custom pieces

future ideas

  • clock
  • bots
  • particle system effects
  • screen shake
  • randomize leaves
  • menu transitions

i was mainly struggling to fix crash bugs this devlog as there were multiple that i had to fix, most notably there was a crash bug when swapping between the game and puzzle menus, and loading a new ruleset for variants. My current plan now is to finish the create game screen, then work on fixing the last duckchess bugs, programming a bot then variants + polish. I may ship again if i get a chance before i finish this though.

Screenshot here shots duckchess in action but I made the duck sprite using AI just so we’re clear about that because i am bad at art.

0
0
8
Open comments for this post

8h 59m 2s logged

Update #11

Added Features

  • added puzzle side menu
  • added puzzle streak counter
  • skip retry hint puzzle buttons
  • sucess rate puzzle counter
  • sound effect for hovering button
  • puzzles are basically done

Fixed Bugs

  • 3 fold occured in puzzle mode if you made the same wrong move 3 times
  • same thing with 50 move rule as 3 fold
  • puzzle would start with you instead of the computer
  • swaps turn on failed move
  • animations didn’t work in puzzles
  • fixed you can select the opponent’s pieces in the puzzle during animation
  • if you hit a frameperfect from the animation finishing on the puzzle screen and switch to the game screen it moves the piece in the game screen if there was a piece on the starting tile
  • same bug with next puzzle button
  • leaves sfx looped infinitely

Smart Bool

I added a new datatype to make my life easier called a smartbool, this is basically a boolean with a third state called NewTrue which is only true for the first cycle the boolean is updated to true. This boolean is useful for when you want to play a sound effect on hover but if you use a traditional boolean it will play every frame. you can use it like a normal boolean too like smartbool = true; or if (smartbool){}. But this new datatype makes the code easier to understand for me.

struct smartbool {
    enum State {
        False,
        NewTrue,
        True
    };

    State state = False;

    void operator=(bool value) {this->set(value);}
    operator bool() const {return state != False; }
    bool is_new_true() const { return state == NewTrue; }
    
    void set(bool value) {
        if (value) {
            if (state == False) state = NewTrue;
        } else {
            state = False;
        }
    }
    void update() {
        if (state == NewTrue) {
            state = True;
        }
    }
};

Future Ideas

  • clock
  • bots
  • variants
  • more moving graphics/sfx
  • randomize leaves on borders
  • menu transitions (maybe)
  • finish polishing puzzles (pretty much done)
0
0
4
Open comments for this post

16h 29m 31s logged

UPDATE #10

added features/changes

  • added a sidebar
  • added a settings page with the ability to toggle 50 move counter,3 fold counter,board markings with more settings to come like high contrast and animation speed
  • added a makefile to compile code to test instead of running a bunch of commands back to back
  • added puzzles to the puzzle tab pulls random puzzle out of a csv

things before next ship

  • more sfx
  • click and drag to move piece
  • sfx plays infinitely on hovers
  • randomize leaves placements
  • menu transitions
  • polish puzzles page and get rid of bugs

general ideas

  • theme switcher
  • animation speed control
  • move clock

In this update i messed up my codebase so massively bad trying to refactor the code so alot of my time was fixing the nuke i dropped into my codebase. uhhh one of the big bugs i had to squash before this that took eternity was playing sound effects would just crash the game. It turned out the reason was i didnt add the compile flag to my makefile causing the audio mixer to crash the game. After that i added sound effects back in and then started to work on puzzles. for puzzles i took the lichess puzzle database of 6m puzzles and condensed it down to 100k for file space. I pull a random row from this file to create the puzzle and it kinda works but its still in progress.

0
0
5
Open comments for this post

7h 26m 6s logged

UPDATE #9

I presented my changes in the stardance slack and was able to get some new ideas like adding a theme switcher. I added the leaves cuz i thought it would add to the theme and then after seeing the leaves, they looked very interactable so i made them interactable. idk thats about it

changes/added features

  • leaves on outside of board
  • leaves enlarge on hover for fidgeting i guess idk its fun tho
  • made move log more narrow to fit a sidebar on the left
  • added a 3 fold repetition warning that appears after 2x repetition (make togglable)
  • added a background i got from itchio
  • made hover dots enlarge on hover again
  • fixed animation issues
  • changed board markers to inside the board like originally in python
  • updated itchio page

things before next ship

  • add sound effects back
  • click and drag to move piece
  • add sidebar
0
0
4
Open comments for this post

7h 53m 54s logged

UPDATE #8

This version is not live yet as there are a few bugs that need fixing still as the port from python introduced alot.

Some things i liked about porting from python to
c++ is that i was able to fine tune things more and use namespaces which i like. ENUMs are also a feature i like.

changes/added features

  • Updated graphics to use pieces from itchio
  • 50 move rule counter under game log (i plan to make it togglable)
  • says whos turn it is to play in top right ontop of the highlighting
  • changed entire game to pixelart because i found some assets on itchio that i thought looked really nice

things needed for next ship

  • going to add a sidebar on the left side instead of the right side
  • add sound effects back
  • add a background
  • click and drag to move piece
  • animation issues
  • fold repetition counter under move log
  • make itchio page look better

next devlog should be when i update the itchio page and other stuff also i spent closer to 15-16 hours on this cuz it includes the last devlog

0
0
9
Ship #1

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
  • 16.63x multiplier
  • 638 Stardust
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

0
0
7
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
0
0
3
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
0
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!

0
0
3
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

0
0
5
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

0
0
5
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
0
0
5

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…