02-10-2021, 08:30 PM
(02-10-2021, 08:07 PM)Michael Wrote: By the way, how is proximity to corners measured? What I'm after is a way to prioritize the highest possible straight line distance from the center intersection of the board. Is that the same?
I'm not 100% sure off the top of my mind what the exact calculation was. It's not going to be exactly straight-line distance, but close enough (assuming a regularly-tiled board). The distance computation will be based on either orthogonal steps only (which would mean a distance of 2 for a diagonal step on a chessboard), or orthogonal + diagonal steps (which would mean a distance of just 1 for a diagonal step on a chessboard), whereas straight-line distance would be somewhere in between (with a distance of about 1.4 for a diagonal step on a chessboard). And then proximity is kind of just the inverse of distance.
Proximity to corners is not necessarily the same as distance from centre though. On many boards it will be, but you could imagine some highly irregular shape where there are some corners close to the centre. If you really want distance to centre, you can do that with the "centreProximity" heuristic and a negative weight (in the example in my previous post, for cornerProximity, I did not specify a weight, and that just results in a default weight of positive 1.0). For example, something like:
Code:
(centreProximity weight:-1.0)
---
(02-10-2021, 08:07 PM)Michael Wrote: Haha. I tried adding the corner proximity term in a game where the corners are very important, but the AI still has no clue. On the second players second turn, the agent just walked away form the corner. Of all the possible moves, they made the one that lost them the most important spot on the board.
Which AI was playing? Some AIs, like UCT, do not make use of the heuristics. If you want an algorithm that actually uses the heuristics, make sure to select AlphaBeta. To ensure that this one is automatically picked for Ludii AI, make sure to also include something like this in your AI metadata (as shown by the Chess example):
Code:
(bestAgent "Alpha-Beta")