MiSTer Chess Core (Work In Progress)

Xbytez
Site Admin
Posts: 479
Joined: Wed May 20, 2020 3:36 pm
Has thanked: 227 times
Been thanked: 805 times

MiSTer Chess Core (Work In Progress)

Unread post by Xbytez »

FPGA developer Robert Peip aka FPGAzumSpass is working on a new MiSTer chess core.



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

User avatar
LamerDeluxe
Top Contributor
Posts: 1239
Joined: Sun May 24, 2020 10:25 pm
Has thanked: 887 times
Been thanked: 284 times

Re: MiSTer Chess Core (Work In Progress)

Unread post 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?
dshadoff
Core Developer
Posts: 547
Joined: Sun May 24, 2020 9:30 pm
Has thanked: 20 times
Been thanked: 145 times

Re: MiSTer Chess Core (Work In Progress)

Unread post 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
FPGAzumSpass
Core Developer
Posts: 385
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 42 times
Been thanked: 414 times

Re: MiSTer Chess Core (Work In Progress)

Unread post 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.
WolfgangBlack
Posts: 53
Joined: Mon Jun 01, 2020 3:19 am
Has thanked: 14 times
Been thanked: 1 time

Re: MiSTer Chess Core (Work In Progress)

Unread post by WolfgangBlack »

Another interesting unexpected MiSTer core!
Sounds like you enjoyed writing it!
Thanks!
User avatar
Cebion
Posts: 115
Joined: Sun May 24, 2020 7:30 pm
Has thanked: 1 time
Been thanked: 3 times

Re: MiSTer Chess Core (Work In Progress)

Unread post by Cebion »

I played the core on the highest difficutly and boy every turn took about 5 minutes :D
Stockfish is a nice engine.
FPGAzumSpass
Core Developer
Posts: 385
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 42 times
Been thanked: 414 times

Re: MiSTer Chess Core (Work In Progress)

Unread post 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 :)
User avatar
Cebion
Posts: 115
Joined: Sun May 24, 2020 7:30 pm
Has thanked: 1 time
Been thanked: 3 times

Re: MiSTer Chess Core (Work In Progress)

Unread post 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
FPGAzumSpass
Core Developer
Posts: 385
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 42 times
Been thanked: 414 times

Re: MiSTer Chess Core (Work In Progress)

Unread post 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.
Post Reply