Ludii Forum
Goats Wintering - new game submission - 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: Goats Wintering - new game submission (/showthread.php?tid=429)

Pages: 1 2


Goats Wintering - new game submission - dale walton - 02-12-2021

This is a game invented on the way from Infuse to Refugia.

Please submit it to your database.

You have requested that we not add piece graphics to the data-base and you already have 4 goats, on of which is nice looking so I have used it as a fall-back.

I purposely have not exactly referenced the goat piece, so that a custom piece can be added to the Ludii directory separately, if people want to use my original artwork, supplied separately without affecting your standards. Please leave it this way unless there are security issues involved. (My art is a goat standing on a rock which I designed and drew myself.) I also have an option to play with discs that can be selected.

The game a limited placement / limited movement game with a goal of greatest number of connections leading to clumping. I don't know if you have a category that fits this.

---------------------
As in several of my games, passing reduces the following move's options, and so can be used to force game termination, when the other player can no longer make gains.  Passing is thus very asymmetric.

In this game, the effect of passing can take a few moves, with the result that the AI completely misses its power in concluding the games, passing over shorter solutions for longer combos.

-->> Is there a way to tell the AI not to ignore (or to actually prioritize) passing moves when a player is leading in score, and they lead to mobility losses for the other player, (unless they lead to score turnarounds?)


RE: Goats Wintering - new game submission - Eric Piette - 02-12-2021

Hi,

Thanks, I am going to add it, it will be in the next release.

Regards,
Eric


RE: Goats Wintering - new game submission - dale walton - 02-12-2021

How about the AI question. Does AB ignore passing, or treat it the same as every other move? how can the AI priorities be tweaked?


RE: Goats Wintering - new game submission - DennisSoemers - 02-12-2021

(02-12-2021, 02:14 PM)dale walton Wrote: As in several of my games, passing reduces the following move's options, and so can be used to force game termination, when the other player can no longer make gains.  Passing is thus very asymmetric.

In this game, the effect of passing can take a few moves, with the result that the AI completely misses its power in concluding the games, passing over shorter solutions for longer combos.

-->> Is there a way to tell the AI not to ignore (or to actually prioritize) passing moves when a player is leading in score, and they lead to mobility losses for the other player, (unless they lead to score turnarounds?)

There's no easy way to tell the AI anything like that right now, no. If the AIs can search deep enough, they should be able to see that though and pass accordingly. With the default options (small board), I see that an AI like Alpha-Beta can search quite far ahead. Just ran a game between two Alpha-Betas with 1 second time per move and quite quickly one of them already proved a win about 15 or 16 moves ahead of time, and in the sequence that they subsequently played there were multiple passes. I also see UCT agents passing a few times. I don't personally know anything about the game though, so can't easily judge if those are intelligent passes or not...

Anyway, Alpha-Beta does not take advice in a form like "if this then take that action". It only takes advice in a form like "game states that look like this are bad, game states that look like that are good".

Biased MCTS can take advice in the form that recommends actions (or recommends not taking actions) based on the situation, but currently that only works with geometric patterns around the locations affected by moves. Since pass moves (or swap moves) don't have any location, we can't really provide any recommendations specifically for those moves in this form either. It's something I've been thinking of to improve though...


RE: Goats Wintering - new game submission - dale walton - 02-12-2021

Thanks for the explanation.  In the game, I noticed the AIs racking up better game-states (score spreads) and ignoring nearby wins, that could be obtained simply by passing a few turns and allowing the point spread to lessen, but not turnaround.

Position must include the fact of a previous pass though, if it alters the rules for what can be done.  If the fact of the previous play being a pass is not part of the game-state, that would explain it. This tells me that the problem is that I implemented it as a condition and maybe there is a way to record it as part of a game state.

Here what essentially happens is that the state of the previous pass changes the meaning of the patterns of the pieces (something like who is to play changes their meaning) so the spacial patterns would need another set of probabilities assigned depending on whether the move is after a pass or not after a pass. - In fact this is not as symmetrical as who is to play where the probabilities can be assumed to be complementary. it would rather require a separate model for the two states.


--- or the pass state would need to be a significant part of most of the positional patterns the system recognises...
Does the AI take all the state variables as inputs, or just board position?


RE: Goats Wintering - new game submission - DennisSoemers - 02-12-2021

If there really is a provably 100% certain win at a lower depth, Alpha-Beta should always go for that over any deeper win with a higher score difference though (this is because I use Iterative Deepening in Alpha-Beta, and immediately go for a win instead of continuing to the next search depth if I find a provable win at the current search depth).

If it is easy for you to generate a trial and save it at the point in time where you think Alpha-Beta makes such a mistake (so not all the way the end of the trial, just where you see that it should have an obvious short win but doesn't go for it), and explain to me which sequence of move would result in that win, I could investigate.


RE: Goats Wintering - new game submission - dale walton - 02-12-2021

Ok, I should be able to do that, I ran back several games where I could significantly shorten the win by playing human. (but maybe before the AI recognised a forced win.  Hmm.

Another nuisance "bug": when I finish a game with AI vs AI and restart, the board clears. then I click on the play arrow and the AI starts to work (Ludii AI shows color dots for example, and the II pause symbol shows) And then the AI stops, and Shows the play arrow again without having made a move.  After that I can click the play and the game starts. 

No big deal, but often I forget, click the play, and go off to do something else only to return and see I actually didn't start the game yet.

Oh, and in this game, it is searching to depth 9 but making avoidable moves that cost the loss of say 2 pieces and 4 points going from 7:10 to 7:6 in a single turn as if it doesn't see the captures - it might be because of how the captures are implemented as a consequence in an independent select in a do, after the moves are completed...

Just now saw it twice move to create a solid block of pieces, which causes the middle one to die on the NEXT turn  (provided the opponent doesn't pass. losing 6 points.) 
Looks like they were unavoidable for those two, as the opponent could have moved to kill otherwise - just wasted initiative.

Backed up to another point where white had a 7 point lead, and 7 passes could bring that to a win with a one point lead. but to be fair, the AI could only see 10 moves ahead at that point, not 14. changing from 10 to 300 seconds brought it to depth 13, so it still missed it, but the move it chose instead cut its lead to 2 on the opponent's next turn.

So I'm still looking... I guess its finding them OK, its just a case of humans being able to short-cut such cases to see at greater depth than other cases... something like queening pawns.


RE: Goats Wintering - new game submission - dale walton - 02-13-2021

Hi. I regret that there is a mistake in the script for the options:  option for leaving 3 spaces clear has the value 2 instead of 3. meaning that the default game is playing incorrectly.

Re the AI

Alpha-Beta found a proven loss at depth 14.
UCT made move after 4929 iterations (selected child visits = 4559, value = 0.9350734810265409).
Alpha-Beta found a proven loss at depth 11.
UCT made move after 7942 iterations (selected child visits = 2411, value = 0.9908751555371216).

This means the AI search was not exhaustive at 14, right? - so you are not doing strictly level first searches with regards to losses. Sorry, I didn't save the game.

But I did save this one:
Alpha-Beta completed search of depth 14.
UCT made move after 4034 iterations (selected child visits = 3133, value = 0.3258857325247367).
Alpha-Beta found a proven win at depth 13.
UCT made move after 3260 iterations (selected child visits = 2727, value = 0.014301430143014302).
Alpha-Beta found a proven win at depth 11.
UCT made move after 3171 iterations (selected child visits = 3061, value = 0.020581509310682783).
Alpha-Beta found a proven win at depth 11.
UCT made move after 3020 iterations (selected child visits = 2887, value = -0.025978524419812955).
Alpha-Beta completed search of depth 12.
UCT made move after 3975 iterations (selected child visits = 2799, value = -0.22186495176848875).
Alpha-Beta completed search of depth 14.
UCT made move after 990 iterations (selected child visits = 989, value = -0.25783619817997977).
Alpha-Beta completed search of depth 16.
UCT made move after 5482 iterations (selected child visits = 5397, value = -0.024272744117102094).

AB finds a "proven win" on move 53, but somehow it isn't....at move 57 AB still thinks it is winning, but there is a removal...

(This game was after I corrected the above option to 3 and recompiled)
------
If they are held over from previous turns, the removals that occur can be unrelated to which pieces moved in the turn, only to the fact that a piece moved in the turn.

I have now added the corrected script.  (I also changed the default board to the next size bigger)

I've seen more cases: proven win 15, then 7, then back up to 15, and toward the end switching to even numbers... Just pop the board size up and run a few times and you should be able to see these.

But the point I wanted to add is that the turn register does not note the removals in its listing. You need the move full listing option to see them under moves, as well. is this related to the problem?  Is the fact that removals can happen to pieces not related to the moved pieces a factor?


RE: Goats Wintering - new game submission - DennisSoemers - 02-13-2021

You're right, some of those proven wins or losses seem incorrect.

The tree search itself seems fine though. If I internally in the code disable use of the Transposition Table, everything appears to be correct. So, likely, something in our Zobrist hashing is incomplete, causing the AI to think that certain states are equal to ones stored in the transposition table when in fact they aren't.

I'm seeing two things so far that appear to be important in your game which weren't being properly tracked yet specifically in the zobrist hash. The first thing is keeping track of the number of consecutive pass moves that have been made in the game. This is necessary due to the use of (was Pass). That's easy, I've added that in our code just now.

I'm more worried about the use of repetition rules though (which actually is definitely not just unique to your game, but also present in common games like Go). The use of such rules essentially means that really the entire history of all game states that have been encountered so far is an important aspect that must be factored into the current game state. For games like Go that have been widely studied in AI research, there are some techniques that mitigate most cases of incorrect hashes in practice, while still being computationally efficient (but not 100% theoretically correct). I don't think we can afford to rely on any of that for our much more general game system with hundreds of games though... I'm thinking I'll probably just make Alpha-Beta not use a transposition table anymore in any game that involves any kind of state repetition checks in our next release.


RE: Goats Wintering - new game submission - dale walton - 02-13-2021

The 2nd point, sounds like killing a fly with a sledge-hammer for most games, even if it is a pesky fly.  From a practical point of veiw, added depth could be more important to play than blunders - but could you give the author control of how many previous states to track before giving up?

Or better:  maybe store the previous state's hash value as one element of the hashed current state, which should solve the problem by its recursive nature without adding much overhead.

-----------------------------------
OK I see that's too strong a definition of game state - No game would have a repetition under a definition that included its entire history as being part of its state....
But something similar could be done to find repetitions of specific periods but each period would need a separate hash, which would get very heavy fast.

-----------------------------------
Another point.  I did a search, and the "repeat in game" in my script is dead code, and the entire define "Finished" can been removed.  Ithink I wanted to use it to make the game finite, but it may have given some problem so I took another approach and forgot to review it.

So it may be important for the Ludii environment, but doesn't have to do with this issue.

"The use of such rules essentially means that really the entire history of all game states that have been encountered so far is an important aspect that must be factored into the current game state."

Well... The use of such a rule means that the tree search must include a procedure that compares game states e.g hashes. -- And not factored into the current game state

The state is what actually happened.  I don't know of strategy games where what could have happened really means the position is in a different state from the point of view of using a state history comparison.  Deduction games?? i.e. the state of the game includes what is known when?  -- But repeat in Game, etc, are not relavent to that.