Ludii Forum
Separate AI Heuristics specified by player - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Suggestions (https://ludii.games/forums/forumdisplay.php?fid=10)
+--- Forum: Ludii Features / Services (https://ludii.games/forums/forumdisplay.php?fid=11)
+--- Thread: Separate AI Heuristics specified by player (/showthread.php?tid=1023)



Separate AI Heuristics specified by player - dale walton - 06-21-2022

It would help a lot in the testing of strategies and manual tuning of A/B AI if Ludii could define and use a separate set of Heuristics for each player.

(ai { { <role> (bestAgent... ) (heuristics ...) } { <role> (bestAgent... ) (heuristics ...)}... } )


Separately, it might be useful to have variable transforms such as (counter)/(boardSize); (emptyCount)/(boardSize); (MoverCount)/(boardSize); (pieceCount/(boardSize); etc
These would allow the heuristics to change over the course of the game.

I don't know how much they could be optimized so as not to reduce AI depth too much though.


RE: Separate AI Heuristics specified by player - Michael - 06-22-2022

Yes, good idea. I have tried to mock this functionality by giving the different players different restrictions, but this general approach is definitely better.


RE: Separate AI Heuristics specified by player - DennisSoemers - 06-22-2022

The main AI metadata section was never really intended to be used for experimenting with different AIs; it was rather designed just for storing whatever "best" setup we find after already having run experiments. I always run large-scale experiments purely through command-line instructions (without any GUI at all) myself... for command-line experiments, we already have support for building different AIs with different heuristics, different algorithms, different features, and so on. But that's probably not very convenient for all users.

Personally I don't feel like the best solution would be to have a single file with per-role heuristics (or search algorithms or features or anything else AI-related). With such a setup, you'd have to first test the AIs in one matchup (i.e., heuristics A as player 1 vs. heuristics B as player 2), then close Ludii again, edit the file to swap them around, and then finally re-launch to also test the other matchup (i.e., heuristics B as player 1 vs. heuristics A as player 2).

In (probably) the next release, we will allow you to write multiple different .def files (just putting them anywhere on your computer, separate from the .lud file) with different AI configurations, and just load them as AIs through the normal dropdown menus that also contain all the other agents. I think that would be a better solution that avoids the problem I described above?


RE: Separate AI Heuristics specified by player - dale walton - 06-23-2022

Its another thing to learn, but maybe slightly better than defining them in the script and setting up option items in the script that refer to the names of your defines. - which I know how to do already, but others might find the reverse is true...
-- But if these are defines anyway, can the ones in the script also show in the drop down list?

It is useful to actually watch the games to get an understanding of why each heuristic is weak or strong, because there may be local optimal solutions