Hi Murat,


The code doesn’t "make an exception for the bot". The bot already ALWAYS 
automatically decides whether to roll or move. The exceptions are for the 
human, to speed up our play when the decision is trivial. The human is allowed 
to roll, EXCEPT if the auto roll is checked and he doesn’t have cube access; 
the human allowed to make their own move, EXCEPT if the auto play options are 
checked for forced moves or greedy bearoff, in which case it makes the move 
generated by the bot.



If the bot looked at the auto-roll or auto-play options, how would you expect 
behaviour to differ from what it does now?
[cid:image003.png@01DA4A11.D6B50D20]

  *   The bot will always roll if it can’t double. Auto-roll can't change this.
  *   The bot will always play a forced move. Play forced moves can't change 
this.
  *   The bot will always select the best bearoff play. It wouldn’t save any 
time by enforcing greedy bearoff, but it would lead to occasional errors.



As I understand it. what you are trying to do is make have Player 1 make 
decisions that are not the one the bot would make. If you want a Player to make 
moves that gnubg would not make, then gnubg can’t be the player. You can’t make 
the gnubg engine only be itself for some moves, and ask you to make the choices 
for other moves.



That is I why I suggested setting Player 1 as Human, because you can make your 
own choices, but also ask gnubg for a Hint as to what it recommends. (What you 
seem to want to do is to make gnubg ask YOU for a hint and play that move 
instead of its own!)



The Options, Players dialogue does have a 3rd option for an external player. 
But I’ve never heard of anybody using it and I don’t know whether  it works.



[cid:image001.png@01DA4A0E.0C9FAE80]



You didn’t say what script language you are using. As far as I know, gnubg only 
supports Python. You can also run  a simple file of gnubg commands, but there 
is no calculation of choice options there if I recall correctly (any scripts I 
wrote were at least 2 computers ago and I’ve lost them ☹).


The simplest way to ensure both sides are using the same evaluation parameters, 
set Player 0 to GNU Backgammon to World Class, as above. Set Settings, Analysis 
to World Class and the Hint Level to use the same as analysis.

[cid:image005.jpg@01DA4A12.A1F9CB60]



The alternative is to look in gnubgautorc and ensure the settings are as you 
wish, or edit the settings you want in another file of commands that you load.



It’s interesting that you think the cube decision can be improved upon. Have 
you reviewed the changes that Philippe has just announced to 0-and 1-ply cubes? 
I haven’t, but I’m wondering what changes you have planned compared to the 
originals or to his.

What’s your algorithm?



Regards,

Ian



-----Original Message-----
From: MK <playbg-...@yahoo.com>
Sent: Wednesday, January 17, 2024 5:34 PM
To: Ian Shaw <ian.s...@riverauto.co.uk>; bug-gnubg@gnu.org
Subject: Re: Problems with auto-roll and auto-play functions



On 1/17/2024 2:52 AM, Ian Shaw wrote:



> Hi Murat,



Hi Ian,



Thanks for trying to help with such detailed suggestions, which I don't get too 
often. So, I appreciate it. I will respond to your ideas and also explain what 
I want to do, so that you or others may offer further/better ideas.



> I would expect the auto-roll and auto-play functions to only apply to

> the human player. The bot makes it's own decisions on whether to roll

> or move.



I understand. Bot can still make its own cube and checker decisions with or 
without auto-roll or auto-move. The code should not waste additional logic to 
make an exception for the bot. The flags should work the same for human and bot.

What's wrong with that? It will take five minute to take out the addition "if" 
in the code. Very simple with huge flexibility and benefits to experimenters.



> If you have a script that makes moves, perhaps you could approach it

> in another way. Set the player to human. Get a hint. Parse the first

> hint and make that move.

> In the CLI, “hint 1” shows the best move. But if you have a script,

> perhaps can extract the output of hint.



Parsing the bot's cube and checker hints and then making the human player 
execute these would take excessive and unnecessary effort and even then it may 
not work if the hints don't exactly match how the bot actually plays at the 
same ply settings.



> What are you trying to achieve?



Okay, let me explain. I want to experiment with alternative double/take points, 
etc. using the CLI. Both players will be the bot set at, let's say, 3-ply cube 
and 3-ply checker.



When Player-1 is on roll, the script simply will say "Play"

and the bot will make its cube and/or checker move as usual.



When Player-2 is on roll, if it doesn't have access to the cube, the script 
simply will say "Play" and the bot will make its checker move as usual.



If it has access to the cube or has to respond to a cube action from Player-1, 
the script will get its winning chances from the hint and make a cube decision 
based on that to double, beaver, take or drop, according to a set of custom 
cube points hard-coded within the script.



After that, again the script simply will say "Play" and the Player-2 bot will 
make its checker move as usual.



Not only that this is much easier and cleaner since it will only need to parse 
for one value from the hint, it also makes sure that both sides will make 
checker moves per the same player settings, without worrying if hints based on 
analysis settings will exactly match those.



I hope I explained clearly. I will appreciate any further suggestions and even 
an existing similar script that I can modify instead of inventing the wheel 
from scratch.



MK


  • Problems with... MK
    • RE: Prob... Bug reports for and general discussion about GNU Backgammon.
      • Re: ... MK
        • ... Bug reports for and general discussion about GNU Backgammon.
          • ... MK
            • ... MK
              • ... Bug reports for and general discussion about GNU Backgammon.
                • ... MK
                • ... Bug reports for and general discussion about GNU Backgammon.

Reply via email to