Xiangqui board bug

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

Xiangqui board bug

Postby Nguyen Pham » 06 Feb 2011, 06:31

When I set Xiangqui board sizes from Average one to bigger (specially from Large sizes), the board draws wrongly.
Nguyen Pham
 
Posts: 36
Joined: 27 Jun 2010, 08:40

Re: Xiangqui board bug

Postby Josh Pettus » 06 Feb 2011, 07:05

Not really a bug, as I'm sure hgm will verify. Thing is winboard/xboard can scale down from a board size with reasonable accuracy but the way it cuts up the board makes it so that the board can't be any larger than the size of the original image. The only solution I could think of for this is to start with a larger board image.
Josh Pettus
 
Posts: 317
Joined: 11 Mar 2009, 01:11

Re: Xiangqui board bug

Postby Nguyen Pham » 06 Feb 2011, 07:38

I see other problems, can someone check:

1) Can't see the text box for "First/second Engine settings"

2) Usually I use Xiagqui board only (use the link "Winboard XQ Startup"). Today I try WB with normal chess, but instead of normal (Western) chess piece images, they all are still Xiangqui pieces. Thought that I have saved a wrong thing to WB config file, I have uninstalled (and deleted completely the WB folder), re-downloaded WB 4.5 and re-installed. The problem still remains event running WB by using short cut or by clicking WB from its folder
Nguyen Pham
 
Posts: 36
Joined: 27 Jun 2010, 08:40

Re: Xiangqui board bug

Postby Nguyen Pham » 06 Feb 2011, 07:43

Darklord42 wrote:Not really a bug, as I'm sure hgm will verify. Thing is winboard/xboard can scale down from a board size with reasonable accuracy but the way it cuts up the board makes it so that the board can't be any larger than the size of the original image. The only solution I could think of for this is to start with a larger board image.


Sure Muller will solve. Once he has fixed excellently a similar problem for Xiangqui small board
Nguyen Pham
 
Posts: 36
Joined: 27 Jun 2010, 08:40

Re: Xiangqui board bug

Postby Josh Pettus » 06 Feb 2011, 18:31

I'd check the winboard.ini file. Apparently your using the Xiangqi font, and it will always override the pieces. Myself, I use multiple winboard.ini files. One for each major variant that requires a different board and pieces represented by a font, and it has a different list of engines. I then launch winboard with a windows shortcut that has "winboard @whatever.ini"
Josh Pettus
 
Posts: 317
Joined: 11 Mar 2009, 01:11

Re: Xiangqui board bug

Postby H.G.Muller » 06 Feb 2011, 19:57

The algorithm for cutting squares from the board is slightly different when the provided bitmap image is larger or smaller than the board. If the size is exactly right (e.g. for a square size 49x49, when the bitmap is 441x490), the bitmap is just cut up in non-overlapping, touching 49x49 areas. In that case the board you see will be exactly the provided bitmap. The bitmap of the Xiangqi board contains a grid such that the grid points are exactly centered in the squares in this case.

If the board is smaller, WinBoard will cut smaller squares from the bitmap, centered on the same gird points, so they no longer touch. That will still lead to a perfectly centered grid.

But if the board is larger than the bitmap, WinBoard will have to cut squares out of it in such a way that they overlap. It cannot do that centered on the grid points anymore, as the grid points ly tooclose to the edge of the bitmap. WinBoard will cut all squares with equal overlap, and this effectively makes the grid expand a little, as the outer-most lines will stay 49/2 = 24 pixels from the board edge. Upto squares of 73x73 (49+24) all squares cut out of the bitmap will not contain grid lines that do not belong there. Except for the diagonal palace lines, which is usually not too disturbing.

Like Darklord says: the only way to prevent this is provide a larger bitmap of a Xiangqi board.

As to the piece rendering:

Unfortunately the font-based rendering is not dependent on the variant. So if two variants really need different fonts, or one must render through a font, and the other use built-in bit maps, the only way is to redefine the option /renderPiecesWithFont="...". This cannot be done from the menus,so it will require a restart of WinBoard. Just resarting will not work: becuase of the persistence of the options, WB will remember the font. When you restart through the startup menu, you must tick "Additional options", and define /renderPieceWithFont="*" to switch to the built-ins. If "Save Settings on Exit" is on, this will then persist.

The best way to organize things if you want to switch between variants that need different look is to put the required options to define the look in an ini file for each variant (like xiangqi.ini, chess.ini etc.), and include @xiangqi with the combobox line for every Xiangqi engine, and @chess on the line of every Chess engine. Then you will automatically get the required looks when you select the engine. There are no engines I know that play both Chess and Xiangqi, so yo could not switch between Xiangqi and Chess anyway through the menu without the engine complaining. If you predominantly play one variant, you can rely on the look needed for that being the default, and put /saveSettingsOnExit=false in the ini files for all variants that need a different look, to prevent the 'non-standard' look to contaminate your usual settings.


Note that the real winboard.ini file now resides in your AppData folder. This could be a hidden folder! To get rid of any persistent settings, you would have to either locate it and edit it, or start WB with explicit command-line option(s) (in the "Additional options" field) to overrule what was in the ini file. Note that you can write @default as "Additional options" to reset all options to the configuration WinBoard installed with, as there is a file "default.ini" provided as a copy of the winboard.ini file that would be first saved in your AppData folder before you change any settings.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL


Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 8 guests