Check out Makruk (Thai Chess), our featured variant for March, 2025.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Comments/Ratings for a Single Item

EarliestEarlier Reverse Order LaterLatest
Play-test applet for chess variants. Applet you can play your own variant against.[All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Tue, Feb 16, 2021 04:00 AM EST in reply to Daniel Zacharias from Mon Feb 15 09:41 PM:

Indeed, this is a problem. The code used for automation recognizes the white and black pieces through GAME-code operators isupper and islower, which only detect the cases where all characters in the piece names are letters of the specified case. AFAIK there are no similar GAME-code commands that ignore non-alphabetic characters, or just look at the first alphabetic character of the string they act on. So piece sets with non-alphabetic names (or mixed case) are basically incompatible with GAME code.

It is a weak spot of GAME Courier anyway that the names of the image files have to 'leak' into the code; this whole concept of piece sets is an annoying limitation. It would be much better if the mapping internal name -> image URL could be arbitrarily specified on a piece-by-piece basis during creation of a piece set, rather than forcing the user to choose between a limited number of sets, none of which satisfying the needs. If the existence of some standard sets would be desirable for simple applications (e.g.  'modest variants'), they can always be provided as standard 'piece-include files', which pre-define the mappings.


🕸Fergus Duniho wrote on Tue, Feb 16, 2021 10:08 AM EST in reply to H. G. Muller from 04:00 AM:

It is a weak spot of GAME Courier anyway that the names of the image files have to 'leak' into the code

The fairychess include file distinguishes between piece labels and piece notation. Piece labels are the keys used in the $pieces array from the selected set file. By default, piece notation will be the same as the piece labels, but it can be changed with the alias command. Since individual games do not use all the various pieces in the Alfaerie:many set, games that use this set should normally set aliases to use instead of these labels, and these aliases may be made entirely alphabetic. The code should then make sure to use isupper and islower on the piece notation rather than the piece labels. See the documentation on the fairychess include file for more details on how this works.


💡📝H. G. Muller wrote on Tue, Feb 16, 2021 11:00 AM EST in reply to Fergus Duniho from 10:08 AM:

I remember having tried this alias when I was writing the code, but I could not get it to work. Unfortunately I forgot the details.


🕸Fergus Duniho wrote on Tue, Feb 16, 2021 12:05 PM EST in reply to H. G. Muller from 11:00 AM:

Unfortunately I forgot the details.

That's what the documentation is for.


💡📝H. G. Muller wrote on Tue, Feb 16, 2021 12:43 PM EST in reply to Fergus Duniho from 12:05 PM:

What I mean is that I forgot why exactly the behavior as described in the documentation did not provide a solution for the problem that prevented the code from working.


A. M. DeWitt wrote on Tue, May 4, 2021 09:32 PM EDT in reply to H. G. Muller from Tue Feb 16 12:43 PM EST:

Are you using the aliases as the piece IDs instead of the original piece IDs specified by the set file being used? If so, that will not work. You need to use the piece IDs originally specified by the set file, as the alias command only makes a visual change to the piece ID (it does not change the internal ID used in the code).


💡📝H. G. Muller wrote on Wed, May 5, 2021 02:59 PM EDT in reply to A. M. DeWitt from Tue May 4 09:32 PM:

Are you using the aliases as the piece IDs instead of the original piece IDs specified by the set file being used? If so, that will not work. You need to use the piece IDs originally specified by the set file, as the alias command only makes a visual change to the piece ID (it does not change the internal ID used in the code).

The Game-Code generator is not alias-aware. It just uses the piece IDs you specify in the diagram as piece labels. If you want to use aliases, it is up to you to edit the generated Game Code for adding the alias commands, and to decide whether you want to use the aliases or piece labels as piece ID in the Diagram.


💡📝H. G. Muller wrote on Sun, May 30, 2021 09:04 AM EDT:

I now equipped the Play-Test Applet with an (experimental) text entry where you can paste the description of an existing diagram. This so that it can easily be converted to rule-enforcing GAME code: just paste the diagram, press the GAME-code button, and copy the displayed GAME code into your preset.

 

 


💡📝H. G. Muller wrote on Tue, Jun 8, 2021 11:16 AM EDT:

I made some fixes to the diagram. The SAN parser (used when you paste a game into the diagram) choked on moves with a Shogi-style piece id +L, because it tried to handle Shogi promotion suffixes and matching the piece id in the wrong order. It coulld also not understand Chess-style promotion sufixes with Shogi piece names ("=+L"), and unfortunately this is how the SAN generator wrote Shogi promotions. I now altered the latter to just append a + when the promoOffset diagram parameter is defined as non-zero, and the difference beween the promotion piece and the oriinal piece is equal to it. And the parser now understands the + suffix as promotion when promoOffset is non-zero. (Otherwise it inores it, assuming it means 'check'.)

I also made a small improvement to the AI; this searches novel moves deeper than moves that already were possible for the same player in his previous turn. But it has to know the previous two half-moves to determine whether moves are new, and in the root this was not the case. I now let it remember the previous move it played, for that purpose. As a consequence it will now consumate mate-in-1 threats it created with its previous move even on the lowest (2-ply) setting.

I also added a kludge to combat repetition: moves with the same piece as before now are discouraged by a light penalty, and when the move goes back to the square it came from (and nothing was captured with these two moves), it will be penalized with 1/4 of its advantage (if it has any).


Erik Lerouge wrote on Fri, Aug 20, 2021 03:35 AM EDT:

@HG: it seems that there is a new limitation to the play-test applet, I suppose this is a bug. It is not possible anymore to set more than 10 files wide for the board format (while it is still possible for the number of ranks). Beforehand I could do with more than 10 files several times. I tried with Firefox, Safari and Opera, same result.


💡📝H. G. Muller wrote on Fri, Aug 20, 2021 10:21 AM EDT in reply to Erik Lerouge from 03:35 AM:

OK, I fixed it. When you select 11 or more files, the script on the page tries to create more space for the diagram by closing the ad sidebars, and make the article float to the left. It appeared that the standard way to display articles has been changed, so that some of the HTML elements it tried to access no longer existed. Which led to the script aborting.


Erik Lerouge wrote on Fri, Aug 20, 2021 04:55 PM EDT in reply to H. G. Muller from 10:21 AM:

Ok thanks, it works now.


Daniel Zacharias wrote on Thu, Nov 25, 2021 10:36 PM EST:

Is there a way to have different promotion options for different pieces, as in shogi?


💡📝H. G. Muller wrote on Fri, Nov 26, 2021 08:35 AM EST in reply to Daniel Zacharias from Thu Nov 25 10:36 PM:

Is there a way to have different promotion options for different pieces, as in shogi?

Not in the Play-Test-Applet. The Diagram itself of course supports it, and the Design Wizard as well. But it does require a more complex interface than the Play-Test Applet has to specify that. Because it requires the pieces to be listed in the Diagram in some specific order to associate the correct promoted form to a base piece. And the Play-Test Applet uses the order of the table from which you select the pieces. It is already a bit inconvenient to have promotion to pieces that are not initially on the board; in order to generate a Diagram or GAME code that would include those pieces you wuld have to drag those somewher on the board after having pressed the Initial Position button, but before generating the HTML or GAME code.

I am not sure how a Shogi-type promotion could be defined. Perhaps it could be done by, after defining the initial position by pressing the button, replacing all pieces in it by their promoted versions, and then hit some 'Promotion Assignment' button.


Daniel Zacharias wrote on Fri, Nov 26, 2021 05:52 PM EST in reply to H. G. Muller from 08:35 AM:

What is the difference between the play-test applet and the diagram?


Jean-Louis Cazaux wrote on Sat, Nov 27, 2021 03:44 AM EST:

I try this applet but it doesn't work for me, probably I'm doing wrong.

I use the white grid, in "Move definition aid". I tick some squares, they become orange. Then if I tick any of the 3 right-side buttons, for example "both", then the orange disappear, all squares on the diagram are white again and I see nothing where a Betza notation is supposed to appear.

I've tried on a Mac with Safari and Firefox.

Am I doing wrong ?

Thanks


💡📝H. G. Muller wrote on Sat, Nov 27, 2021 05:50 AM EST in reply to Jean-Louis Cazaux from 03:44 AM:

Am I doing wrong ?

Well, that the squares go blank again when you press one of the buttons is intended behavior. But the Betza notation for the cleared squares should appear in the text entry 'Betza move description' just below the table from which you select pieces. E.g. if I click the square above the star piece and press the move-only button, the text fmW should appear there. If I then click the squares diagonally above the star piece, and press capture-only, the text should change to fmWfcF. I have no Mac where I can test this, but on my PC it works with FireFox, and on my Android tablet with the Android browser it works too.


💡📝H. G. Muller wrote on Sat, Nov 27, 2021 08:17 AM EST:

 What is the difference between the play-test applet and the diagram?

The Play-Test Applet is an interface page for altering the Diagram it contains, and use it in-place, or display its HTML source code so that you could post the Diagram elsewhere. In that other location it would still be an Interactive Diagram, but you can no longer change the rules by which it plays. (Unless you edit the page, of course.) In principle you could also have typed the source code of that Diagram by hand, if you knew the definition format. There is a seperate article here over Interactive Diagrams, which contains a 'Design Wizard' that also can generate source code for you. This is a bit less user-friendly (you have to complete a large form for specifying all kinds of parameters, also for defining graphics), but gives you more control over the generated Diagram than the Play-Test Applet.

Of course you can also use a hybrid method for creating a Diagram: use the Play-Test Applet to design a Diagram that is as close as possible you can get to what you want within the Applet's limitations, (e.g. everything except the promotion rules), and then edit the source code to add what it was missing. You can then post this modified source code on a page of your own (or in a comment). Or you can even paste it back into the Play-Test Applet, to test it there.

To implement Shogi-style promotions you would have to redefine the parameters maxPromote (giving the number of promotable pieces) and promoOffset (how much they shift up in the piece table when promoting), and reorder the piece definitions such that they are in the right place in the table to cause the correct promotions.


Jean-Louis Cazaux wrote on Sat, Nov 27, 2021 01:57 PM EST in reply to H. G. Muller from 05:50 AM:

@HG: no, no text at all appear either with Safari or Firefox.I would be grateful if someone else with a Mac could try.


B.E. Dolata wrote on Sat, Nov 27, 2021 02:22 PM EST:

no text at all appear either with Safari or Firefox.I would be grateful if someone else with a Mac could try.

It works correctly for me on Mac in both Safari and Chrome.


Jean-Louis Cazaux wrote on Sat, Nov 27, 2021 02:42 PM EST in reply to B.E. Dolata from 02:22 PM:

Thank you. So it's a mystery.


💡📝H. G. Muller wrote on Sat, Nov 27, 2021 02:46 PM EST:

The only suggestion I can make is that it might be possible to see what is going on through the 'Browser console' in FireFox. This shows whether any errors occur in the JavaScript program of a page. On a PC I can open it in the lower half of the screen by pressing the F12 function key and selecting the 'console' tab, or typing Ctrl + Shift + J to open it in a separate window. But I don't know if a Mac keyboard even has these keys. You might be able to get there through some menu.

If you press the button that would activate the code that is supposed to place the text, an error message might appear in the console, to report what went awry.

Another thought: have you tried to flush the browser cache (Shift + reload on my FireFox). Perhaps you are still using an old version of some JavaScript file that is still cached in your browser.


Jean-Louis Cazaux wrote on Sat, Nov 27, 2021 02:52 PM EST in reply to H. G. Muller from 02:46 PM:

I don't know what's happened: now it works!!!!!

Most probable was a problem of cache I think. Anyway, that's a nice applet. Thanks


💡📝H. G. Muller wrote on Sat, Nov 27, 2021 03:07 PM EST:

Great! Those caching problems are always very annoying.

The idea of having it first write the Betza notation in a text edit is that you can still alter it by typing in case you want something so special that the move-entry tool does't support it. (Like a limited range of 5 squares, or a bent slider.)


Daniel Zacharias wrote on Sun, Nov 28, 2021 09:08 PM EST in reply to H. G. Muller from Sat Nov 27 08:17 AM:

Thank you, I got it working


25 comments displayed

EarliestEarlier Reverse Order LaterLatest

Permalink to the exact comments currently displayed.