OMNI-Chess
- 13 Devlogs
- 101 Total hours
A chess engine with a nature theme and puzzles
A chess engine with a nature theme and puzzles
As a prize for your great work, look out for a bonus prize in the mail :)
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:
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.
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;
}
}
};
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.
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
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.
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
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
I fixed preformance :D heres how:
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!
things added in this update:
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
things added in this update:
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
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:
FUTURE IDEAS: