Quote:Original post by Extrarius
It seems like it should be trivial to construct a better hash than "Zobrist" by using the same idea of a table of values for each position-state pair, but constructing the values through some tailored algorithm instead of a PRNG.
Unfortunately, I don't have the background to be able to suggest what such an algorithm might look like except that it'd probably be related to error correction codes.
Unfortunately, once you follow that path you lose some of the advantages of Zobrist.
For instance, it is no longer trivial to construct an arbitrary number of hash functions. Some hash tables require many hash functions (such as a Bloom Hash.)
Further, in some applications of hashing it is important to keep your hashing function unknown to the public or you can become the target of a worst-case behavior attack. Many game developers don't think about problems related to this.
For instance, a problematic user might create many thousands of usernames that all map to the same table entry. This sort of thing can grind your MMORPG server into the dust if you do not guard against it. With Zobrist, even if they know that you are using Zobrist they still don't know your hash function and therefor cannot perform this kind of attack. (I recall a popular chess server, FICS, which was subject to worst-case attacks because the source code had been public)