[Top][All Lists]

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

Re: [Bug-gnubg] Swap Players is broken

From: Michael Petch
Subject: Re: [Bug-gnubg] Swap Players is broken
Date: Thu, 04 Aug 2011 01:19:40 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20110616 Thunderbird/3.1.11

On 03/08/2011 11:51 PM, Philippe Michel wrote:
> On Wed, 3 Aug 2011, Michael Petch wrote:
>> [...] the proper display of the board when importing XGID's (reported
>> by Leo Bueno on BGO).
> What the proper display is may not be that obvious. If the imported
> position has the top player on roll (as displayed), your new code will
> swap players anyway.

I did not get into details in the ChangeLog. But we have to make some
assumptions. The reason this is such a big deal now is that there is a
new Default feature on exports in XG2 "Player on roll always on Bottom".
This is by default on.And is one of the big reasons why people were
wondering about it. I do not KNOW the true orientation of the board
associated with an XGID but I am making an assumption  based on
observations of posts to date on BGO and the new XG defaults on export.

Using defaults from XG2 and the XGID's the code I introduced presents
the best approximation for Cubes and Checker play positions, but it is a
best guess.

But this was half the problem. The SWAP PLAYERS code was flawed so on
BGO I suggested to Leo that he could use "SWAP PLAYER" to fix it. He was
changing player names, the dice etc. After I posted that I went and
tried it and found "SWAP PLAYERS" didn't work.

This was why i sent the email to the list because I had seen you had
modified Swap Player code previously.

The Fix you made now makes it easier to swap players around and have it
work. My Code tries to make some assumptions based on what typical
export settings are for XG2 (Which is increasingly being used for posts
on BGO)

> With these fancy XG exports, I don't think there is a way to be sure
> that the imported position will look like the html from the xgid
> alone. FWIW, XG doesn't do this either : if it exports a position
> upside down to have the bottom player on roll in the html, pasting the
> id will get the original position.

Yes agreed, but this is now not the default for XG2 output. I am trying
to make more sane assumptions based on what appears to be the most used

Realistically what is truly missing in XGID's and GNUBGID's is a way to
specify HOW the position should be rendered. For example if an
XGID/GNUBGID says "Person on roll is on top/bottom". Even a bit that
says "Light/Dark" checkers for player on roll could help as well.

> The question is more like : do we want the pasted positions to always
> have the player on roll at the bottom no matter what the id says ?
> This is reasonable, but then :
> - it should work for cube positions (from the look of the change in
> set.c, this is not the case)
> - it should work for gnubgids
> - it would be nice to have a configuration flag to enable or disable this

The cube positions seem to give the appropriate output based on my
testing with XG exports and posts on BGO. If someone can find a scenario
with XG2 output where I got it wrong - just let me know.

As for GNUBGID's, it may not be a bad idea to create a new option
"Player on Roll on bottom" that is the default. This would  put us
inline with XG2's defaults .But again this only makes for more
reasonable defaults (assumptions), but we have no way of telling whether
someone is actually using the defaults or has "Player on roll is bottom"
turned off.

I am thinking that an extra bit in a GNUBGID and and extra piece of info
in an XGID would allow use to render an XGID or GNUBGID with an
orientation that matches the output of an associated board. In the case
where people just post an XGID or GNUBGID (without actual board output)
matching orientation really doesn't matter.

Michael Petch 
CApp::Sysware Consulting Ltd. 
OpenPGP FingerPrint=D81C 6A0D 987E 7DA5 3219 6715 466A 2ACE 5CAE 3304 

reply via email to

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