How to post chess games

General discussion about computer chess...
pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: How to post chess games

Post by pgn4web »

Jeremy Bernstein wrote:OK, both of those problems are "fixed" (the second one really, the first one is just kind of fixed (throws errors because the PGN is bad, but loads the board and lets you begin to debug your game). I'll look more closely, time permitting, at a better solution for invalid PGN data.
Looks good, that is kind of consistent with the general behaviour of flagging the PGN mistake by flashing the A8 square.

I had a couple of people asking for the variation feature, hope you dont mind I pointed them to get a copy of your pgn4web.js file and see if that works for them.

Havent got the time (and patience) to make your code general enough and configurable (things like variations colors/fonts and so on) for the main pgn4web version. Other things need to be done also, such as extending the SetInitialHalfmove function to allow pointing to a move into a variation and so on.

One final comment, you display variations in square brackets... the PGN standard uses round brackets for that, people used to PGN files would probably find it easier to read with square brackets, but in the end it's just cosmetic.
Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany

Re: How to post chess games

Post by Jeremy Bernstein »

pgn4web wrote:
Jeremy Bernstein wrote:OK, both of those problems are "fixed" (the second one really, the first one is just kind of fixed (throws errors because the PGN is bad, but loads the board and lets you begin to debug your game). I'll look more closely, time permitting, at a better solution for invalid PGN data.
Looks good, that is kind of consistent with the general behaviour of flagging the PGN mistake by flashing the A8 square.

I had a couple of people asking for the variation feature, hope you dont mind I pointed them to get a copy of your pgn4web.js file and see if that works for them.
Of course not.
Havent got the time (and patience) to make your code general enough and configurable (things like variations colors/fonts and so on) for the main pgn4web version. Other things need to be done also, such as extending the SetInitialHalfmove function to allow pointing to a move into a variation and so on.
Look at the function GoToMoveInLine(), which does what I think you're talking about. Modifying SetInitialHalfmove() to use a variations syntax would be pretty simple, implementation-wise. Deciding on a reasonable syntax would probably take most of the time. I'll get around to generalizing the colors and fonts at some point. I just needed to finish up the work quickly and it was appropriately finished for use on this site, so it got filed for TODO.
One final comment, you display variations in square brackets... the PGN standard uses round brackets for that, people used to PGN files would probably find it easier to read with square brackets, but in the end it's just cosmetic.
I just found it cleaner and easier to read. And ChessBase uses square brackets for the top-level variation (with parens for lower-level lines), so I felt justified. :)

jb
Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany

Re: How to post chess games

Post by Jeremy Bernstein »

OK, I've solved the issues with the menu causing the buttons to become invisible. Additionally, the menu doesn't forget which game is selected anymore, and I've fixed a few bugs with the variations support, as well, and some horribleness with IE6+ (thanks Paolo for the head's up and assist!).

Uly
Posts: 838
Joined: Thu Jun 10, 2010 5:33 am

Re: How to post chess games

Post by Uly »

Thanks Jeremy.
Uly
Posts: 838
Joined: Thu Jun 10, 2010 5:33 am

Re: How to post chess games

Post by Uly »

Is there a way to switch off figurines in posted games? I know they look cool and all but in my head I have difficulties reading them, as usually PGNs, web pages and discussions talk about "Ng5 is the best move here" instead of "(Knight figurine)g5 is the best move here", and I read the former as "ene-g5 is the best move here" which is difficult with the figurine in there.

(This is a question about making all the games posted by other people appear with letters instead of figurines, not about how to post games without figurines).
Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany

Re: How to post chess games

Post by Jeremy Bernstein »

Uly wrote:Is there a way to switch off figurines in posted games? I know they look cool and all but in my head I have difficulties reading them, as usually PGNs, web pages and discussions talk about "Ng5 is the best move here" instead of "(Knight figurine)g5 is the best move here", and I read the former as "ene-g5 is the best move here" which is difficult with the figurine in there.

(This is a question about making all the games posted by other people appear with letters instead of figurines, not about how to post games without figurines).
I'm sure this is possible (although I'd have to look into setting it up), but the use of figurines was my internationally-sensitive choice. Since I bounce between KQRBNP and KDTLSB in my own chess world, I find the figurines easier to navigate. Will investigate -- if it's something that could be toggled via a click on a board square, I'm all for it, but then I'd only support english piece names.

jb
pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: How to post chess games

Post by pgn4web »

Jeremy Bernstein wrote:
Uly wrote:Is there a way to switch off figurines in posted games? I know they look cool and all but in my head I have difficulties reading them, as usually PGNs, web pages and discussions talk about "Ng5 is the best move here" instead of "(Knight figurine)g5 is the best move here", and I read the former as "ene-g5 is the best move here" which is difficult with the figurine in there.

(This is a question about making all the games posted by other people appear with letters instead of figurines, not about how to post games without figurines).
I'm sure this is possible (although I'd have to look into setting it up), but the use of figurines was my internationally-sensitive choice. Since I bounce between KQRBNP and KDTLSB in my own chess world, I find the figurines easier to navigate. Will investigate -- if it's something that could be toggled via a click on a board square, I'm all for it, but then I'd only support english piece names.
the easiest way to fallback on KQRTBN piece initials rather than figurines is to avoid loading in board.html the font definition file font/*.css; in fact, using an older browser that would not support web fonts would give you exacltly what Uly asked for. The difficult part is to make it configurable on a per user basis, ideally this should be linked to a phpbb user preference, but I have no idea how to doit. Less optima option would be to configure a shortcut square to remove the figurines, but then the user would have to click there every time. not sure if that would be practical. To implement the latter option, either you find a way to modify on the fly a css class definition (not really trivial to do I'm afraid) or you have two css classes defined at load and then you use the one with the figurine or the one without depending on a javascript variable (not very elegant, but would do the job).

pgn4web is not setup for international piece names, only English is supported. The idea is that using figurines takes away the need of customizing piece names for each language.

PS: I recently published a new version of pgn4web with some changes to the core function of loading PGN data... I remember you mentioning the intention of refreshing your core pgn4web.js file, if you do that you should definitely use v2.22
Uly
Posts: 838
Joined: Thu Jun 10, 2010 5:33 am

Re: How to post chess games

Post by Uly »

pgn4web wrote:using an older browser that would not support web fonts would give you exacltly what Uly asked for.
Ah, so updating to Firefox 4 is what changed them.
pgn4web wrote:the easiest way to fallback on KQRTBN piece initials rather than figurines is to avoid loading in board.html the font definition file font/*.css
Thanks, I blocked pgn4web-fonts.css with AdBlock+ and got the desired effect.

Solved :)
pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: How to post chess games

Post by pgn4web »

Uly wrote:Thanks, I blocked pgn4web-fonts.css with AdBlock+ and got the desired effect.
Good thinking! I should have thought of that myself and suggest you to AdBlock my own code :-)
Jeremy Bernstein
Site Admin
Posts: 1226
Joined: Wed Jun 09, 2010 7:49 am
Real Name: Jeremy Bernstein
Location: Berlin, Germany

Re: How to post chess games

Post by Jeremy Bernstein »

pgn4web wrote:PS: I recently published a new version of pgn4web with some changes to the core function of loading PGN data... I remember you mentioning the intention of refreshing your core pgn4web.js file, if you do that you should definitely use v2.22
Thanks, I saw, and will (try to) merge those changes in at some point (the code bases are divergent enough [in places] at this point to make merging non-trivial -- I need to find the time and patience to deal with it...).

Btw, I just added some code to handle auto-scrolling of the move list (so that the move list follows the move on the board), which works well in every browser I've tested. Might be worth integrating into the trunk.
Post Reply