Ludii Forum
Equi - But AI is totally broken for this - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Suggestions (https://ludii.games/forums/forumdisplay.php?fid=10)
+--- Forum: Submit Your Games (https://ludii.games/forums/forumdisplay.php?fid=23)
+--- Thread: Equi - But AI is totally broken for this (/showthread.php?tid=322)



Equi - But AI is totally broken for this - dale walton - 12-08-2020

Hi, I finally got Equi to work as per spec (I hope)  It compiles OK, The turn records look correct, and I think I've debugged any endgame hangs.
See the attached.

I noted a couple problems remaining:

Importing a trial works, but the "full" listing contains things like (EndFlagvalue=0= 0) instead of (EndFlag= 0) etc.
The AI completely hangs whenever invoked. - I have to kill the Ludii process.

Please tell me what causes this and what can be done about it.

----------------------
I had to implement my own Turn passing test, which is OK, but gives an example of when it could be useful.

The game is relatively complicated.
The logic of the game technically needs recursion to evaluate restrictions on moves used to control end cycles and give the game an "edge" or tension for the players.  I have made a small rule concession as a work around.

A less computer intensive work-around could be used instead.
It would be to allow those moves, but end the game if they don't fulfill the conditions required at the natural end of the turn. That would mean hops would not clear the EndFlag, and probably the need for a terminating pass logic branch as part of  "EndTurn"

Edit: I've updated the file to correct the player who wins when the system ends the game due to no moves.
I also commented out the Meta rule for situational repeats, which allows the AI to run for a few 1-6 turns before hanging


RE: Equi - But AI is totally broken for this - dale walton - 12-14-2020

Maybe the wrong forum category, but it would really help my script writing to know what's breaking the AI for this.


RE: Equi - But AI is totally broken for this - Eric Piette - 12-14-2020

Hi,

I asked Dennis to check with a profiler but it seems that just a single playout takes a really long time (so that's not a problem with the AIs themselves) but without a specific ludeme to be too slow. Consequently, I think something in the description makes the computation of the legal moves to be just really long.
The description is a bit long to identify which part, what parts according to you can take a long time? Like for example many (forEach ...) inside each other, and some repetition rules and (do ...) ludeme?

If you can identify that, that's probably why the playouts are so slow.
Except that I have no clue.

Regards,
Eric


RE: Equi - But AI is totally broken for this - dale walton - 12-14-2020

Thanks for looking at it.

Probably do...ifAfterwards:(can...) And the noRepeat in the Meta which commenting out helped a bit. Since it plays Human to Human, I am assuming then that it is not infinite cycling in the AI.

Do you think the problem is inherent in the game, or that I should be able to find a way to speed it up by tweaking how I define it.