Save diagram not working for large board sizes.

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

Moderators: hgm, Andres Valverde

Save diagram not working for large board sizes.

Postby EdCollins » 08 Jul 2010, 05:26

When the board size is "Average" or smaller, the SAVE DIAGRAM (to a bmp file) works fine. However, when I increase the size of the board to anything larger than "Average" it doesn't work at all... WinBoard creates a bmp file that is empty.

May I assume that this is normal / okay? The program isn't capable of creating a bmp with those larger board sizes?

With my monitor and my preferred screen resolution, I usually use WinBoard with my board size set at "Bulky" or "Large." Anything smaller is just too small for me. Is it possible in a future version to allow the saving of bmp files at some of the larger sizes?

It's kind of a pain for me to keep changing the size, each time I wish to save the position to a bmp.

Thanks in advance for any replies.

Ed
EdCollins
 
Posts: 71
Joined: 16 May 2010, 09:05
Location: Southern California

Re: Save diagram not working for large board sizes.

Postby H.G.Muller » 08 Jul 2010, 10:04

This was indeed sort of intentional. The save-diagram command was only intended for making small diagrams. In the implementation it needs to allocate a buffer somewhere to fetch the bitmap of the board display before copying it to disk, and currently I always allocate 1MB there, to save me the trouble of figuring out how large the buffer would actually have to be. I guess I could easily enlarge that to 4MB.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Save diagram not working for large board sizes.

Postby EdCollins » 16 Apr 2011, 04:24

H.G., did you ever decide if allocating the save-diagram command buffer to a size more than 1 MB is worthwhile?

(I still can't create a BMP file for any board size above "average.")

Ed
EdCollins
 
Posts: 71
Joined: 16 May 2010, 09:05
Location: Southern California

Re: Save diagram not working for large board sizes.

Postby H.G.Muller » 16 Apr 2011, 09:19

Good that you remind me. I can still try to put this in 4.5.2 (which so far is hardly different from 4.5.1, where WinBoard is concerned).

I put an alpha version that should work to any size at http://hgm.nubati.net/WinBoard-4.5.promo.zip . (This also contains the new promotion and edit-position patche eliminating the popups there, hence the name.)

Can you test it?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Save diagram not working for large board sizes.

Postby EdCollins » 16 Apr 2011, 15:50

Tested. It works fine on my system, for all board sizes, including Titanic.

The file size of the resulting bmp Titanic image was 4,532 KB, if that helps or is relevant.

As always, good work and thanks a lot.
EdCollins
 
Posts: 71
Joined: 16 May 2010, 09:05
Location: Southern California

Re: Save diagram not working for large board sizes.

Postby EdCollins » 16 Apr 2011, 16:04

Quick question... that bmp feature isn't possible as a command line parameter, is it?

I'm re-reading the documentation now, but so far I don't see it, and I don't recall it.

I only ask because if so, it would come in handy for a small project I'm doing.
EdCollins
 
Posts: 71
Joined: 16 May 2010, 09:05
Location: Southern California

Re: Save diagram not working for large board sizes.

Postby H.G.Muller » 16 Apr 2011, 22:36

I am not sure how you imagine it to work as command-line option. It seems an intrinsically interactive action, like 'resign' or 'copy position'.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Save diagram not working for large board sizes.

Postby EdCollins » 17 Apr 2011, 05:21

Yea, now that I think about it, I'm not sure it would work.

I have several different FEN positions that I wanted to have a diagram of. I thought maybe I could automate the entire process. I thought maybe I could run WinBoard from a batch file, several times, and for each instance automatically load the FEN positon I wanted with the /lpf switch. And with the "/bmp switch" I could automatically make a diagram.

But the process wouldn't be entirely automatic because I'd still have to manually exit WinBoard. But once I did, the batch file would continue, and again load WinBoard with the next position I wanted and again produce a diagram.

But I don't have THAT may positions, so it's no big deal. I was just sort of thinking out loud.
EdCollins
 
Posts: 71
Joined: 16 May 2010, 09:05
Location: Southern California

Re: Save diagram not working for large board sizes.

Postby H.G.Muller » 17 Apr 2011, 10:07

Indeed, there is only a single case where WinBoard exits automatically (apart from fatal errors such as crashing engines), which is after a completion of a match, started with the -mm or -mg option on the command line.

A match can run autmatically through all positions in a position file, though. WinBoard now has an option -savePositionFile (which I never used, so I hope I am right about this...), to save the final position of each game (as FEN) on a file. This might get close to what you want, except that it should save as diagram, and that the game should end immediately with the read FEN. The latter could be achieved by supplying a dummy "engine", which would be ust a program that replies "resign" to any "go" command, to immediately terminate the "game" with the stup position still on the board.

But there still would be the problem that you would not want all bitmaps to be written to the same file, which for the FENs is no problem. So any -saveDiagramFile option could not specify the exact file name, like -savePositionFile can. This could be solved by allowing some "meta-characters" in the filename. E.g. a "%d" as part of a filename could be taken to mean WinBoard should substitute the game number there before using it, so that a user could specify "-saveDiagramFile diagram%d.bmp". This might even be a generally useful feature, which could be applied also to other save-file names.

Still, it would require a lot of changes. I will keep it in mind, though. At some point I want to enhance match mode anyway, for doing other things than playing complete games, such as running test suites from EPD files (where the "game" should be terminated after a single move), and terminating immediately kind of naturally fits in there too.
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 5 guests