SebLague / Chess-Coding-Adventure

A work-in-progress chess bot written in C#
https://youtu.be/U4ogK0MIzqk
MIT License
1.45k stars 302 forks source link

Mistake in PSTQ Evaluation #13

Closed archishou closed 1 year ago

archishou commented 1 year ago

https://github.com/SebLague/Chess-AI/blob/d0832f8f1d32ddfb95525d1f1e5b772a367f272e/Assets/Scripts/Core/PieceSquareTable.cs#L5

I believe this line should be !isWhite. The PSTQ is already given in white's perspective. We should only be switching when black. Please let me know if I'm misunderstanding.

SebLague commented 1 year ago

Hi, it is correct, but definitely confusing. My engine considers a1 to be square 0, whereas the square with index 0 in the piece square tables is a8. (Technically I should be doing 'file = 7-file' to properly convert, but the tables are symmetric along the files so it doesn't matter). I hope that makes sense!