# Evaluation Function in AB Pruning

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

## Recommended Posts

Hey guys...i m working on a 2-player car racing game through a maze. I'm more focused on the AI part rather than the graphics. To solve the AI I'm using the AB pruning which so far hasn't given me
any problems. However I was wondering what could be the best evaluation function that could be used in a 2-player game involving a maze with the players being able to put obstacles in their opponent's path.
At the moment, I was just thinking about a simple heuristic involving the distance between the players and distance between the finish point and the current position of the player.
Can u guys suggest some commonly used evaluation functions?

##### Share on other sites
A turn-based car racing game? I've never written an evaluation function for that type of game, but writing evaluation functions is typically an iterative process. You start with something very simple, you find situations where it doesn't play well, try to understand why and then try to modify the evaluation function (or the search) to improve the playing strength in those situations.

##### Share on other sites
by 2-player car game, I meant..there is a maze and the 2 players have to reach the finishing point. The one to reach the finishing point first wins. In addition the players can put obstacles in their opponent's path like sand or oil slick or any other obstacles...Anyways I'll check out what evaluation function can work best..

##### Share on other sites
Beware dilettante at work!

It could very well be that my post won't make ANY sense because i have only a faint idea how ab-pruning/minimaxing works and i'm not quite sure i understand what you want, but anyways:
Why don't you use a* to get the best path available and do your ab pruning from that. I'd think getting nearer to the finish line would be pretty much the most important thing. The further you get from the best path the higher the penalty/cost, so if you can steer just a bit to do something it's better than if you have to steer far. Also you could use a* to evaluate the usefullness if you throw an obstacle with the tile with sand/oil etc having a greater cost to traverse it now.

##### Share on other sites
that's exactly what my back up plan was!!! In case my algorithm without A* did not work

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 18
• 20
• 12
• 14
• 9
• ### Forum Statistics

• Total Topics
633363
• Total Posts
3011514
• ### Who's Online (See full list)

There are no registered users currently online

×