Page 1 of 1

MiSTer Chess Core (Work In Progress)

Posted: Fri Aug 28, 2020 7:02 pm
by Xbytez
FPGA developer Robert Peip aka FPGAzumSpass is working on a new MiSTer chess core.



https://www.youtube.com/watch?v=FDvZL4sNBhM


Re: MiSTer Chess Core (Work In Progress)

Posted: Sat Aug 29, 2020 4:40 pm
by LamerDeluxe
This is fascinating. I wonder how it works. Does each piece have its own circuitry? Does the computer opponent think multiple steps in advance? How fast is it compared to regular chess games?

Re: MiSTer Chess Core (Work In Progress)

Posted: Sat Aug 29, 2020 9:05 pm
by dshadoff
This looks great !
As I watched this, it seemed that the FPGA's move happened too quickly and I didn't realize where it came from and went to.

It might be nice to add an animation something like:
- complete the move of the player's piece
- roughly 0.5 second delay(*)
- highlight "from" location
- roughly 0.5 second delay(*)
- highlight "to" location
- roughly 0.5 second delay(*)
- move piece and complete move, return control to player 1

(*) - possibly adjustable

Re: MiSTer Chess Core (Work In Progress)

Posted: Mon Aug 31, 2020 12:07 pm
by FPGAzumSpass
The last move is marked on the board, e.g. in screenshot above the black queen moved from F3 to D3, as can be seen by the black borders.
I may add real moving of the figures at some point.

Opponent "thinks" all possible steps for the next N turns, with N being the difficulty you set in the OSD.
It should be faster(=stronger with same real-think-time) than any core , e.g. Chess game on GBA on Mister, but cannot compete against modern multicore PC CPUs.

The pieces don't have logic itself, but all important functions have their own circuitry:
- find all legit moves for a given board (including history for en passant and castling)
- execute a move
- Opponents recursive Minimax algorithmn (unrolled for 7 layers)
- Opponents Evaluate board function (get score of whole board to judge if a move is good or bad)

Drawing is mainly 2 background layers (one for board, one for pieces) + some text overlay elements winning the priority.

Re: MiSTer Chess Core (Work In Progress)

Posted: Sat Sep 12, 2020 5:30 pm
by WolfgangBlack
Another interesting unexpected MiSTer core!
Sounds like you enjoyed writing it!
Thanks!

Re: MiSTer Chess Core (Work In Progress)

Posted: Sat Sep 12, 2020 8:28 pm
by Cebion
I played the core on the highest difficutly and boy every turn took about 5 minutes :D
Stockfish is a nice engine.

Re: MiSTer Chess Core (Work In Progress)

Posted: Tue Sep 15, 2020 3:50 pm
by FPGAzumSpass
Even Level 7 without any randomness should only take 10-30 seconds per turn on a full board, not 5 minutes.
With randomness even less.

But the more crucial question is: could you beat it on 6?
If you answer that with yes, i can improve the speed.
I just didn't feel anyone would really need it.

Stockfish is an engine nobody can beat, which is pointless for a chessgame, but great for analyzing.
The good horsey only jumps as high as it needs to :)

Re: MiSTer Chess Core (Work In Progress)

Posted: Tue Sep 15, 2020 8:07 pm
by Cebion
Haha I beat it alright but not as a human player :D
Used a chess computer on web to play against mister. In the last 5 moves it said Stockfish and my moves until jack mate. Pretty ni ce

Re: MiSTer Chess Core (Work In Progress)

Posted: Wed Sep 16, 2020 4:44 am
by FPGAzumSpass
Yes, unlimitied Stockfish beats it easy :)

I did the same the other way around to test the strength of the Chess Core.
On Lichess it beat Stockfish limited to Elo 2000 with Level 5.

Level 5 needs only ~1 second per turn and 2000 Elo is already VERY strong,
in the area of FIDE title players who wouldn't play such a game anyway, so i called it a day.