Log In  


Cart #nicev1freestyle-0 | 2024-12-28 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2


Freestyle Chess == Chess960 == Fischer Random

NICE: Nice Is Camp39's Engine

The Good

  • pass n play and board flip option
  • clean interface & themes
  • play against computer
  • opening book for standard chess
  • endless openings with Freestyle Chess (press up while on chess960 to view positions)
  • all rules, including 50 move and 3-fold repetition

The Bad

  • my first engine ever... its a little slow
  • my first engine ever... its a little dumb
  • maybe 2.0 will be better!

About NICE


This was a real accomplishment for me and is my first engine. The move generation follows the tutorial of Bluefever Software video series on Youtube: Programming a Chess Engine in Pure Javascript.

When it came to the search functions I learned a ton by following the book: Chess Algorithms by Noah Caplinger.

The limitations of Pico-8 though make for a challenging adaptation of these types of tutorials. (translating from zero-based arrays can give some crazy nasty bugs). The speed limitations make some variation strategies useless e.g. "killer moves" only make sense with a depth of at least 4. It was a really cool experience and gave me more insight into the game.

I liked the board layout from cart #quickchessyness-4 by @Adam_Howell so much that I copied it :)

This cart will need some updates however. I was unable to get quiesence to work without a move taking FOREVER. Maybe due to my move ordering, maybe due to the evaluation function, maybe due to lots of things. Its all very complicated and hurts my brain since it is recursive at iterative depths. Hard to pinpoint problems like that. If any kind soul wants to offer tips, I'm all ears!

@Krystman of course released the fabulous Pico Checkmate, cart #54038 6 years ago. I definitely looked through his code for clues but couldn't manage to find a way to cut off a search if time got too long. But I did follow his lead and purge illegal moves right off the bat instead of making and taking them. Without a full quiesence search though, I don't think NICE will stand a chance against Pico Checkmate.

This cart, while not having the best engine still has some nice features. Chess960 is chess but with almost random starting positions. Its just like standard chess with the exception that castling can be a little weird. Just remember that king and rook end up in the same ending positions as in regular chess, regardless of where they started. Otherwise, same rules apply. This eliminates the same opening every time you play against the computer. Also, to prevent that from happening in standard chess, I coded in a small opening book with response options being chosen randomly so that you can get different responses even if you play the same.

I hope this cart is popular with hand-held users (I don't personally own one). The pass n play is not something I've seen on other chess carts and I imagine a game of chess on a long flight or bus ride would be cool, but playing upside down is a bit awkward.

Crazy idea: what if there was a cart with the move generation and graphics already on it (and optimized to the max) and then two different users could put in a tiny engine each and let them battle. Maybe more realistic on picotron?

2


1

Woah this is pretty sweet. Super impressed it works with Chess960.

To clarify how to cut off a search - you need to use a Coroutuine. They are functions that can be paused and resumed at a later point. You make it so that the search is paused and resumed over multiple frames. And when it take too long you cancel it.

https://www.lexaloffle.com/bbs/?tid=3458



[Please log in to post a comment]