Evaluation Function in AB Pruning

Started by
3 comments, last by RJSkywalker 13 years ago
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?
Advertisement
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.
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..
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.
that's exactly what my back up plan was!!! In case my algorithm without A* did not work

This topic is closed to new replies.

Advertisement