Open SloPro opened 1 year ago
Yes you can pass in a new State() object, it would still work since it keeps reference internally. For more controlled use of the states you use, you would have to keep that of those yourself, f.x. through a data structure you devise yourself or using a stack etc.
Yes, I'm aware there are some problems with the current Zobrist implementation, it "works" but causes me some problems with my own engine implementation. For now what you use as a replacement would technically work - but yeah it's kind of slow.
I'm currently attempting to figure out a clever way of fixing it.
Thanks for the details 👍🏻
Hello, I just have a few questions related mainly to making moves.
What is intended to be passed to
position.MakeMove
as thein State
parameter? I've just been using it likegame.Pos.MakeMove(move, new State());
, since based on my digging into the source code and its provided tests, this seemed about alright, but I'm just wondering if that's how you're meant to do it.Secondly, I've been having some issues with trying to implement my own simple transposition table in my Negamax search (yes I know this comes with a prepared TT implementation already).
Namely, the
Position.Key
Zobrist hash seems to be just not working well at all in my Negamax search (implementation is literally from the wikipedia pseudocode), after some preliminary debugging there seem to just be lots of collisions happening, which completely breaks the search results.As a test, I even tried reusing the same code but using the current position's FEN (
pos.GenerateFen().ToString()
) as the table key instead, and while it was obviously much slower, it did end up searching fine and working as expected, indicating it's just the Zobrist keys that are the issue:Could this perhaps be related to me just passing a
new State()
every time I make a move in the search? e.g.:Thanks in advance for your time!