Advertisement

Hashing connect -4 board (for Transposition table)..need some help :)

Started by June 26, 2013 02:54 AM
81 comments, last by Tom Sloper 8 years, 8 months ago

thank you , i wll try it without the clearing process. actually in the 4 first moves i use an evaluation function and after that i am brut forcing to the end of the game tree,so i hope that this is still ok (to retain the positions searched in the "evaluation" part of the program).

and one more thing please.. i am trying to understand what exactly is a "hash move".. i know that when i am storing a position in my TT i should also store the best move (or something like that...). but when should i use it? at the beggining of alpha beta, when i am probing the table for a position, if the position is found in the table i just returning the score, or updating alpha/beta accordingly.. so when i get the change to use the hash move?? can you please advice on that?

I tries reading stuff on the net, but no one actually gets to the technical part

You get to use the hash move whenever you find the position in the TT but you can't use the information there to just return a score. What you do with it is try it first, of course.

Advertisement

ok, so every situation where i don't return the score (nor exact, and not alpha>= beta after updating them). and i guess that the hash move can be not only when i get a cut-off but also after a complete branch search (?) thx again for all the answers, i will conclude this topic in that final question .(.unless someone else will want to post something ofcourse)


and i guess that the hash move can be not only when i get a cut-off but also after a complete branch search (?)

I always store a move, but I think there are people that only do it if the move caused a beta cutoff. This is the kind of thing that you should determine by testing.

Do you do TT and killermoves (etc) operations in the root alpha beta functions also? right now i am just iterating through all the root moves without any further operations, all of the TT and killer moves operations are happening inside my recursive alpha beta functions (not for theroot moves), but i would like to try and get an early cut off in the root moves as well. right now my root moves order is static (starting from the middle column and going to the side columns)

The order at the root is very easy to do well if you use iterative deepening: Whenever a move is determined to be the best so far, move it to the top of the list.

If you are going to always search to the end of the game, you should probably start with the hash move if there is one. Then sort the other moves using history heuristic (John Tromp swears his particular flavor of history heuristic made his program dramatically faster).

Advertisement

yes,right now i am starting with the hash move and than trying my two killers..after that i just continue to go through the rest of the columns list that wasn't played.
I also got some very good improvements with the killer moves (and the TT ofcourse). but like i said,i am not doing nothing at the root negamax and i think that this is the main reason that the search is not optimal. I am not using iterative deepening yet,but i will investigate about it. thx!

Just another question, i can't stop thinking that i am doing something wrong. so i need to check some things:

A. whenever the alpha beta function returns a score (beta cut off or not), i am saving the current position in the Hash table with the evaluation and the current move that was tried. this is the so called "hash move" that i will use later in case this position ever occur again. but I read somewhere (a chess blog) that i don't always have a best move to store...that is a little confusing, because i DO always have a best move! the move under investigation will be the best move! so i don't get it...what am i missing here?

B. the times when i store a position in the TT after a beta cut off, the hash move that i store is the same as the killer move for that same depth (if i understood correctly,a killer move is a move that caused a beta cut off). so many times i have both hash move and a killer move that are actually the same(!). is this normal? i always try the hash move first, and after that i check if the killer is the same move,and if it is ,i don't play it and just move on to the next. so many times, i don't benefit at all from using the hash move cause i have the killer moves anyway. up until now i haven't noticed a significant improvement from using the hash move sad.png that got me thinking that maybe i am doing something wrong

A. Most chess programs use a so-called "null move" heuristic which can result in finishing a search without a move. This doesn't apply to connect 4 (it only works for games where Zugzwang is the exception).

B. Nothing wrong with what you describe. Most of what you read is geared towards minimax searches that don't get to the end of the game, where a lot of things are quite different. It is not surprising that heuristics that work well in a typical searcher don't work well in a program that does exhaustive search to the end of the tree. Even between programs of the same type, most heuristics don't work for everybody because they interact with other decisions made when building the program.

Thanks for the explanation. totally forgot about schemes like null moves :)

This topic is closed to new replies.

Advertisement