Ludii Forum
Game specific heuristics - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Questions (https://ludii.games/forums/forumdisplay.php?fid=13)
+--- Forum: About Ludii (https://ludii.games/forums/forumdisplay.php?fid=14)
+--- Thread: Game specific heuristics (/showthread.php?tid=428)

Pages: 1 2


RE: Game specific heuristics - DennisSoemers - 02-11-2021

You're right, there was a bug with default piece weights. It's also possible to specify weights per piece type (useful for example if you think it's very important for pawns to move towards corners but for queens to stay away from corners), and these weights were supposed to be 1.0 by default (if left unspecified), but that was broken. That will be fixed in the next version. In the meantime, you could fix it for your current Ludii version by manually specifying the weights for piece types. Something like:

Code:
(centreProximity weight:-1.0 pieceWeights:{ (pair "Disc" 1.0) })


should work for your case (since your game only has "Disc1" and "Disc2" piece types, which will both be matched by just "Disc")


RE: Game specific heuristics - Michael - 02-11-2021

Thanks! Good to know. I might come back to you about balancing multiple heuristics (I think the AI needs to value material more in this game), if that's ok. BTW: It's supposed to be 1.0, not -1.0, in (pair)?


RE: Game specific heuristics - DennisSoemers - 02-11-2021

Err yeah the 1.0 in the pair is fine. That's the weight per piece type, so both Disc1 and Disc2 get a weight of 1.0. But there's also the "global" weight for the heuristic as a whole, which is still set to -1.0. These numbers get multiplied, so in the end it's still -1.0 * 1.0 = -1.0 for both piece types, so they all still get incentivised to minimise proximity to centre.

Equivalently, you could make the "global" weight of the heuristic 1.0, and then the per-piece-type weights would have to be -1.0 :)