bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with auto-roll and auto-play functions


From: MK
Subject: Re: Problems with auto-roll and auto-play functions
Date: Thu, 18 Jan 2024 14:22:33 -0700
User-agent: Mozilla Thunderbird

On 1/18/2024 6:31 AM, Ian Shaw wrote:

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 allowed to make their own move, EXCEPT
if the auto play options are checked for forced
moves or greedy bearoff,

Hi Ian,

GnuBG's implementation of auto-roll and auto-play is
a very bad patchwork and needs to be  improved.

The latest version of play.c has the following code:

1621 StartAutomaticPlay(void)
1622 {
1623  /* FIXME? doesn't PLAYER_EXTERNAL imply automatic task as well ? */
1624  if (ap[0].pt == PLAYER_GNU && ap[1].pt == PLAYER_GNU) {
1625   automaticTask = TRUE;

https://cvs.savannah.gnu.org/viewvc/gnubg/gnubg/play.c?revision=1.485&view=markup

This is what I meant by "exception for the bot". It
defeats the use of auto-roll and auto-play settings.
(In programming, I consider such hard-coded values
as exceptions.) There is no reason to make the bot
always auto-roll and auto-play. The bot's behavior
should be controlled by the auto-roll and auto-play
flags just as for the human player.


If the bot looked at the auto-roll or auto-play
options, how would you expect behaviour to differ from what it does now?

  * The bot will always roll if it can’t double.
    Auto-roll can't change this.

Why not? It should act as the auto-roll flag says.

  * The bot will always play a forced move. Play
    forced moves can't change this.

This is fine. Forced moves are obviously forced.

  * The bot will always select the best bearoff
    play.

Selecting the best move is not an issue here. Bot
should obey the auto-play setting before moving.

Also, there should be a separate auto-play setting
for all moves, forced or not. All other auto-play
settings should be secondary/complimentary to this.

Ideally, all settings that effect player behavior
should be kept in each player's profile record in
a profiles file allowing unlimited records for bot
and human players alike but this may be too much
to expect from GnuBG. :(

You can’t make the gnubg engine only be itself
for some moves, and ask you to make the choices
for other moves.

There is no reason for this arbitrary, unnecessary
limitation. Bot can wait to roll and/or move until
it's told to do so (i.e. "play" command). If the
user wants it to play automatically, he can just
select the auto-roll and auto-play setting. Simple
logic and clean implementation...

The Options, Players dialogue does have a 3rd
option for an external player.

There is a comment in play.c (see above quoted) to
hard-code automaticTask even for external player.
I can't believe it. Please don't do that. It also
should act according to auto-roll and auto-play
settings.

You didn’t say what script language you are using.
As far as I know, gnubg only supports Python.

I don't know Python but it may be worth learning
it just enough for this purpose. Otherwise I may
try a Windows process to read/write to the console
of a child process or such. A collectively created
Python script may be the best option as it can be
modified and reused by all GnuBG users for similar
purposes. I hope people familiar with Python will
contribute efforts towards this.

It’s interesting that you think the cube decision
can be improved upon. ... What’s your algorithm?

I will reply to this separately in order to not
talk about too many subjects in a single thread.

MK



reply via email to

[Prev in Thread] Current Thread [Next in Thread]