Jump to content
  • Advertisement
Sign in to follow this  
patishi

Killer moves heuristic question

This topic is 2135 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My killer moves implementation is usually consists of 2 killers for each depth.  whenever a new move cause a cut off, i check if it is != from the main killer move, and if it is ,I switch the main and secondary killer and than place the new move instead of the main killer.  

The code is like this: 

 

void insertKiller(int depth,int killer){
    if(killersTable[depth][0] == -2){     //The killers table is initiated with -2..indicates that no moves yet inserted.   here i check if the main killer move  
        killersTable[depth][0] = killer;    // is occupied, and if not i just insert the move to the first position. 
    }
    else{     // if there is already a move in that certain depth, i check if it is different from the one in the first position, and if it is, i do the switching 
        if(killer != killersTable[depth][0]){
            killersTable[depth][1] = killersTable[depth][0];
            killersTable[depth][0] = killer;
        }
    }
}
 
 
My question is ,when i try to play the second killer in a certain position, and it causes a cut off,  do i need to replace it with the first killer (the main killer)   or should i just keep it placed in it's original position (the second position)  
I hope my question is clear,  my english is not the best :)

Share this post


Link to post
Share on other sites
Advertisement
My first thought is that yes, you should promote the second killer to first killer if it produces a beta cutoff. But the correct answer to this type of question is always "test it both ways".

Share this post


Link to post
Share on other sites
By the way, couldn't you simplify your code like this?
void insertKiller(int depth,int killer){
    if(killer != killersTable[depth][0]){
        killersTable[depth][1] = killersTable[depth][0];
        killersTable[depth][0] = killer;
    }
}
I think that takes care of every case...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!