Web
Analytics
Log In  

21

Cart [#52281#] | Copy | Code | 2018-05-02 | Link
21

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-06-13 04:50)

::

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:
flr(sub(s,lastpos,#s)+0)

can be replaced with:

tonum(sub(s,lastpos,#s))
  • save tokens
explode("-21,-19,-12,-8,8,12,19,21")

can be replaced by:

explode"-21,-19,-12,-8,8,12,19,21"
P#52235 2018-05-01 15:22

::

explode"-21,-19,-12,-8,8,12,19,21"

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".

Ew.

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.

Error:
http://snpy.in/8dUg6f

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"))
1

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

> print( cos(".125") )
0.7071

> print( abs("-12.34") )
12.34

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

> print( bor("0b11110000", "0b00001111") )
255
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

Log in to post a comment

user:
password:

New User | Account Help
:: New User
X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2018-06-25 00:30 | 0.246s | 1835k | Q:32