Log In  


Cart [#54038#] | Copy | Code | 2018-07-09 | Link

A simple, cute retro version of classic Chess made in Pico-8. Full implementation of almost all of the Chess rules with a juicy interface and some basic AI to play against. Created as part of the Chess Jam 2018. Here is the game's entry on itch.io.

Jucy animations were very important to me. My Chess AI will never be competetive. So I focused on the game being pretty, readable and fun to play. I wanted to add even more functions but sadly, I ran out of tokens. I tried to squeeze in as many as I could.

That being said, the Chess AI is kicking my butt. Let me know if you've beaten it. Not sure how smart it really is - my Chess is rusty. Also, let me know if you find any bugs.

Note: Game will not recognize draw by Threefold repetition.

chess strategy turn-based
P#52226 2018-05-01 12:55 ( Edited 2018-08-08 10:38)


Found a bug with the the Queen putting me into check without LOS, behaving more like a Knight move in fact.

Beautiful board and piece rendition though...:)

P#52229 2018-05-01 13:38 ( Edited 2018-05-01 13:39)


OMG how embarrassing! Bug fixed. Thanks! <3

P#52232 2018-05-01 14:16


Very well put!
As for saving tokens, did not see any obvious wins (you are already decoding string to data).

minor comments:

  • couple of places where you could declare multiple variables using:
local a,b,c=1,2,3
  • use pico API:

can be replaced with:

  • save tokens

can be replaced by:

P#52235 2018-05-01 15:22



gasp What? What function calls does this work on?

P#52240 2018-05-01 15:35


From the Lua manual:

> A call of the form f{fields} is syntactic sugar for f({fields}); that is, the argument list is a single new table. A call of the form f'string' (or f"string" or f[[string]]) is syntactic sugar for f('string'); that is, the argument list is a single literal string.

P#52245 2018-05-01 16:07


Tip: If you leave off the third argument to sub(), it's automatically assumed you want everything up to the end of the string.

So sub("Felice",3) gives you "lice".


P#52263 2018-05-02 07:18 ( Edited 2018-05-02 07:20)


Hey Krystman, this is a really cool chess game. The game has a lot of polish. I like all the animations and presentation of the game. The AI is challenging, maybe 1200 ELO? I could not finish my first game, I was preparing to promote and the game crashed. Unfortunately I don't have a screen grab of the board when this happened, only a screen grab of the error.


P#52264 2018-05-02 07:26


Also, if you have a valid number in a string, you don't have to convert it to a number for flr(). The code inside flr() will do it for you.

> print(flr("1.5"))

Most math functions are willing to take numeric strings, including any format that lua supports, like hex.

> print( cos(".125") )

> print( abs("-12.34") )

> print( band("0xfff0", "0x0fff") )
4080    -- 0x0ff0

> print( bor("0b11110000", "0b00001111") )
P#52265 2018-05-02 07:27 ( Edited 2018-05-02 07:33)


@bbsamurai Oof. That's a serious bug. When did it happen? On your turn or on the computer's? Did it happen when you moved the pawn to promote or at some other time?

P#52266 2018-05-02 07:51


Update: Uploaded Version 3. Fixed this nasty bug:

Also, I tried to reproduce @bbsamurai's issue but couldn't. I will try a few more things. But in the meantime, this new version will continue displaying the board state in case of a crash. So should the game crash on you please take a screenshot and post it here!

P#52282 2018-05-02 12:04


@Krystman: It happened on the AI's turn. The promotion was unavoidable. This error has not happened again, especially since the last update.

I really like the game feel. I think this would be great on mobile.

Here's me getting a victory after a few tries.

P#52309 2018-05-03 04:13


Oh man! You did it! Congrats! I did some testing and the AI's ELO seems to be around 1500. It will beat a Level 3 Stockfish.

I'm pretty sure your bug is still in there. I had another tester report they had a crash. But sadly, they didn't take a screenshot either.

But because the bug is so rare, I have some ideas what the issue could be. Still investigating...

P#52350 2018-05-03 20:35


Seems like the AI is just above 1500 ELO

P#52419 2018-05-05 14:48


Hi Krystman, I wanted to include this game on playpico.com, but it appears to be domain locked to prevent piracy. If you don't want me to include it on PlayPico, that's totally cool, but if you're okay with it being added, would you be kind enough to add that domain to the exclusions list?

If you're not familiar with the site, here's a rundown:

PlayPico was started by me in 2016, and has been around for almost 2 years. All games on there have their code completely untouched, authors fully credited and linked, and BBS descriptions left intact; it's not a site for pirating, hacking, or otherwise, just a list of only games, with various features for helping visitors discover new ones that may otherwise get lost or buried on other sites (such as 24 random games featured every week, and various searching/sorting/filtering features). The site is completely free and ad-free as well, and is just a labor of love.

P#53062 2018-05-27 20:59 ( Edited 2018-05-27 21:18)


your youtube tutorials are helping a bunch man cheers

P#53521 2018-06-13 04:50


With some help from Alex Huang on Twitter I was finally able to fix a nasty bug that would occasionally cause the game to crash. It turns out the bug would occur if the AI had to evaluate a position where the a king was in the upper left corner of the board. Understandably, it was a pretty rare bug so I'm quite relieved I was finally able to track it down.

With this specific bug fixed I'm also publishing the game more widely. I've uploaded it to Kongregate and Newgrounds. If you'd like, you could help me out by giving the game an upvote on those platforms!



Also @scathe: I whitelisted the game for playpico.com! Go ahead and publish it there too!

P#53953 2018-07-05 10:03 ( Edited 2018-07-05 10:05)


Update: With the game being out on other platforms I've gotten more feedback. One player on Newgrounds noticed that in some circumstances, you could castle with the opposing player's piece. Ooops!

That bug was now fixed!

P#54039 2018-07-09 17:15


I decided to write a little about how I made this game. This is the first article on the design:


P#54469 2018-07-27 13:20 ( Edited 2018-07-27 13:21)


The second article is up. This one is about Juicyness:

P#54777 2018-08-06 19:58


Okay, this is NICE ! Seems to be smarter than your average bear and speedy too. Surprising in independent interpretive programming languages.

You DEFINITELY need an option to SAVE GAME. I'm working on some ways of dicing up that infernal 256-bytes, but you are in luck !

You can save neatly 64-numbers, just the board size, quite easily to standard storage.

P#54778 2018-08-06 22:08


So cool! Thanks!

P#54822 2018-08-07 16:34


In playing this more, I'm noticing something. It seems right after you make your move, your opponent knows IMMEDIATELY what piece to move of theirs by highlighting it - but then takes time "..." to determine where it should go.

If you can apply its way of immediately knowing which piece to move during turns, could that somehow be a way of speeding up the intelligence of where that same piece wants to move to ?

P#54830 2018-08-07 18:36 ( Edited 2018-08-07 18:37)


@Krystman explains this in the secpond article above:

> It takes some time to move the cursor to the desired piece. I decided to exploit this to mask some of the "thinking" the AI is doing. The AI will start moving the cursor while it's still calculating their move. Even before the calculations are done, the AI will already have a preliminary candidate for the possible best move. I let the AI move the cursor to that candidate. If the candidate turns out to be the best move, it will look as if the AI took less time to calculate the move than it actually did. If the AI abandons its first candidate for a better move, it will look as if the AI "changed its mind". It makes the AI look more human. On a more technical level, it also gives me some insights into the AIs "thought process".

P#54852 2018-08-08 07:37


Well, with that in mind, I suppose you could slow the computer cursor down a bit, not too much, to give the illusion of deep thought. :)

Still, a marvel of a cart. Were the PICO a true console of yesteryear, back with the Atari 2600 and Sinclair 1000, I would definitely buy this game to add to my library.

P#54855 2018-08-08 10:38

Log in to post a comment


New User | Account Help
:: New User
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2018-08-14 19:25 | 0.139s | 1835k | Q:41