Check out Grant Acedrex, our featured variant for April, 2024.


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

Comments/Ratings for a Single Item

Later Reverse Order EarlierEarliest
Game Courier Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Mon, Feb 19 09:58 PM UTC in reply to Daniel Zacharias from 09:46 PM:

Why doesn't chess need to do that to handle promotions?

Promotions are a different type of move than regular moves. Instead of moving a piece from one location to another, a promotion changes the last piece to move to another piece. So, it does not change the values of $origin and $dest. To check whether a promotion has happened, you can compare the value of $moved, which was set when the piece moved from one location to another, with what currently occupies the space moved to (space $dest). When they are different, a promotion has happened, and you can deploy code for testing whether it was a legal promotion.


Daniel Zacharias wrote on Mon, Feb 19 09:46 PM UTC in reply to Fergus Duniho from 09:23 PM:

Why doesn't chess need to do that to handle promotions?


🕸📝Fergus Duniho wrote on Mon, Feb 19 09:23 PM UTC in reply to Daniel Zacharias from 09:14 PM:

For a multi-part move, does the post-move code run just once for the whole thing or once for each part?

Once for the whole thing. To handle multi-part moves, you can rewind the move and handle one part at a time. For details, you can read How to Program Multi-Move Variants for Game Courier or review the code for either Marseillais Chess or Extra Move Chess.


Daniel Zacharias wrote on Mon, Feb 19 09:14 PM UTC:

For a multi-part move, does the post-move code run just once for the whole thing or once for each part?


Diceroller is Fire wrote on Mon, Feb 19 10:50 AM UTC in reply to Daniel Zacharias from 07:41 AM:

Thanks it works!


H. G. Muller wrote on Mon, Feb 19 07:49 AM UTC in reply to Diceroller is Fire from 07:03 AM:

It must be in the Pre-Game section, not the Pre-Move section. It was just that the unset should not have been within the if-clause, but done unconditionally.


Daniel Zacharias wrote on Mon, Feb 19 07:41 AM UTC in reply to Diceroller is Fire from 07:03 AM:

Sorry, I really messed that up. This actually seems to work, if you put it in post-move 1. You don't need the flag.

if != #mover S and == movenum 1:
    die "You must move the S on your first turn";
endif;

Diceroller is Fire wrote on Mon, Feb 19 07:03 AM UTC in reply to Daniel Zacharias from 01:35 AM:

But how to set firstmove flag only on the first move? Otherwise it doesn’t let White to move anything but S if flag is in Pre-Move section, and entirely anything if is in Pre-Game section.


Daniel Zacharias wrote on Mon, Feb 19 06:56 AM UTC:
if capture and match $old (bl br):
    capture where $dest direction $origin $dest;
endif;

I put this in the post move, but when it runs it captures the piece at $dest rather than the specified location. It works correctly if I change it to

if capture and match $old (bl br):
    set x where $dest direction $origin $dest;
    capture #x;
endif;

but I don't see why it would make a difference


Daniel Zacharias wrote on Mon, Feb 19 01:35 AM UTC in reply to Diceroller is Fire from Sun Feb 18 08:04 PM:

how to enforce that first white’s move must be by Superpiece

in the pre-game section add setflag firstmove;

and in post-move 1 add

if != #mover S and flag firstmove:
  die "You must move the S on your first turn";
  unsetflag firstmove;
endif;

Diceroller is Fire wrote on Sun, Feb 18 08:04 PM UTC in reply to H. G. Muller from 07:12 PM:

Well, it works! but how to enforce that first white’s move must be by Superpiece?


H. G. Muller wrote on Sun, Feb 18 07:12 PM UTC in reply to Diceroller is Fire from 05:09 PM:

You have to indicate that in the FEN of the preset. (I think by a dash.)


Diceroller is Fire wrote on Sun, Feb 18 05:09 PM UTC in reply to H. G. Muller from 05:00 PM:

How to make other squares on 1 rank holes?


H. G. Muller wrote on Sun, Feb 18 05:00 PM UTC in reply to Diceroller is Fire from 04:31 PM:

Well, that works as designed. When you move the Radioactive Queen away from d1, d1 disappears.


H. G. Muller wrote on Sun, Feb 18 04:11 PM UTC in reply to Diceroller is Fire from 04:03 PM:

Basically anywhere theat is not inside the definition of another array. Just adding it as a line at the bottom should do.

If you want help in making a preset, it would be useful to post a link to it...


Diceroller is Fire wrote on Sun, Feb 18 04:03 PM UTC in reply to H. G. Muller from 01:55 PM:

Where, after which constants/words it should be to work properly? Now it isn’t.


H. G. Muller wrote on Sun, Feb 18 01:55 PM UTC in reply to Diceroller is Fire from 01:21 PM:

Unfortunately creating holes in the PTA does currently not work, and for a long time I could not repair it, because a wrong classification of the format destroyed the page on any edit. But now that I changed the format to 'text' I can fix things again, so I guess it is high time I do that. In the PTA you would create a brouhaha square by creating a hole and placing a piece on it.

The simplest way to do it now is add a line to the Pre-Game code by hand:

set brouhaha (...);

with ... a space-separated list of the square labels of the squares you want to be brouhaha squares.


Diceroller is Fire wrote on Sun, Feb 18 01:21 PM UTC in reply to H. G. Muller from 01:20 PM:

In preset made through Play-test


H. G. Muller wrote on Sun, Feb 18 01:20 PM UTC in reply to Diceroller is Fire from 01:19 PM:

Through the Play-Test Applet?


Diceroller is Fire wrote on Sun, Feb 18 01:19 PM UTC:

How and where to set brouhaha squares?


Daniel Zacharias wrote on Sun, Feb 18 01:28 AM UTC in reply to Fergus Duniho from 01:26 AM:

ok, now it does for me too. Thanks anyway.


🕸📝Fergus Duniho wrote on Sun, Feb 18 01:26 AM UTC in reply to Daniel Zacharias from 12:48 AM:

I agree with you that it should produce f2, and that is what it produced when I ran it.


Daniel Zacharias wrote on Sun, Feb 18 12:48 AM UTC:

Could I get help with this?

set wbl (e3 f2);
def other cond == #0 #wbl.0 #wbl.1 cond == #0 #wbl.1 #wbl.0 0;
print fn other e3;

The result is always 0, but I would expect f2.


🕸📝Fergus Duniho wrote on Fri, Feb 9 10:32 PM UTC in reply to Daniel Zacharias from 09:49 PM:

If I change the starting position for a game, would it break existing logs for that game?

Yes, it will unless you change the name of the settings file.


Daniel Zacharias wrote on Fri, Feb 9 09:49 PM UTC:

If I change the starting position for a game, would it break existing logs for that game?


🕸📝Fergus Duniho wrote on Thu, Feb 8 08:09 PM UTC in reply to Daniel Zacharias from 07:40 PM:

When a preset doesn't work properly because of something in your code, you can add "&submit=Edit" to the query string to edit your code without running it.


Daniel Zacharias wrote on Thu, Feb 8 07:40 PM UTC in reply to Fergus Duniho from 05:12 PM:

Probably!

I have a bigger problem now. I was working on this game but if I try to open it now I just get a blank page

https://www.chessvariants.com/play/pbm/play.php?game=Overboard&settings=overboard-1


🕸📝Fergus Duniho wrote on Thu, Feb 8 05:12 PM UTC in reply to Daniel Zacharias from 08:06 AM:

Would path be what you want?


Daniel Zacharias wrote on Thu, Feb 8 08:06 AM UTC:

I want a function that returns an array of all the spaces between two inputs. I've tried this

def getrange filter lambda (== direction #start #end direction #0 #end) (b3 c3 d3 e3 f3 g3 h3) =start =end;
set yy fn getrange b3 e3 ;
print #yy;

but the output is just an empty array. what am I doing wrong?


Daniel Zacharias wrote on Tue, Feb 6 03:22 AM UTC in reply to Fergus Duniho from 03:13 AM:

Thanks, that works


🕸📝Fergus Duniho wrote on Tue, Feb 6 03:13 AM UTC in reply to Daniel Zacharias from 02:52 AM:

I made some more corrections and got it to work. Here is what your custom sets should be:

{
    "custom-alfaerie-png": {
        "dir":"/graphics.dir/alfaeriePNG/",
        "pieces": {
            "P": "wpawn.png", "p": "bpawn.png",
            "N": "wknight.png", "n": "bknight.png",
            "B": "wbishop.png", "b": "bbishop.png",
            "R": "wrook.png", "r": "brook.png",
            "Q": "wqueen.png", "q": "bqueen.png",
            "K": "wking.png", "k": "bking.png",
            "I": "wbird.png", "i": "bbird.png",
            "Z": "wzebra.png", "z": "bzebra.png",
            "Y": "wgryphon.png", "y": "bgryphon.png"
        }
    },
    "custom-greenwade-svg": {
        "pieces": {
            "P": "wpawn.svg", "p": "wpawn.svg",
            "N": "wknight.svg", "n": "wknight.svg",
            "B": "wbishop.svg", "b": "wbishop.svg",
            "R": "wrook.svg", "r": "wrook.svg",
            "Q": "wqueen.svg", "q": "wqueen.svg",
            "K": "wking.svg", "k": "wking.svg",
            "I": "wosprey.svg", "i": "wosprey.svg",
            "Z": "wzebra.svg", "z": "wzebra.svg",
            "Y": "wgriffin.svg", "y": "wgriffin.svg"
        }
    }
}

Daniel Zacharias wrote on Tue, Feb 6 02:52 AM UTC in reply to Fergus Duniho from 02:49 AM:

Still doesn't show up with "custom-greenwade-svg" but if I use "custom-greenwade" I see "custom-greenwade" in the set menu but it doesn't work to select it


🕸📝Fergus Duniho wrote on Tue, Feb 6 02:49 AM UTC in reply to Daniel Zacharias from 02:30 AM:

Try it again. I made some corrections to sets.php.


Daniel Zacharias wrote on Tue, Feb 6 02:30 AM UTC in reply to Fergus Duniho from 02:20 AM:

"custom-greenwade-svg" results in the set not showing up at all in the set menu


🕸📝Fergus Duniho wrote on Tue, Feb 6 02:20 AM UTC in reply to Daniel Zacharias from 02:16 AM:

The set name you want is "custom-greenwade-svg".


Daniel Zacharias wrote on Tue, Feb 6 02:16 AM UTC:

I'm also having trouble with custom sets. I have this

{
    "custom-alfaerie-png": {
        "dir":"/graphics.dir/alfaeriePNG/",
        "pieces": {
            "P": "wpawn.png", "p": "bpawn.png",
            "N": "wknight.png", "n": "bknight.png",
            "B": "wbishop.png", "b": "bbishop.png",
            "R": "wrook.png", "r": "brook.png",
            "Q": "wqueen.png", "q": "bqueen.png",
            "K": "wking.png", "k": "bking.png",
            "I": "wbird.png", "i": "bbird.png",
            "Z": "wzebra.png", "z": "bzebra.png",
            "Y": "wgryphon.png", "y": "bgryphon.png"
        }
    },
    "custom-greenwade": {
        "dir":"/graphics.dir/svg/Greenwade/",
        "pieces": {
            "P": "wpawn.svg", "p": "bpawn.svg",
            "N": "wknight.svg", "n": "bknight.svg",
            "B": "wbishop.svg", "b": "bbishop.svg",
            "R": "wrook.svg", "r": "brook.svg",
            "Q": "wqueen.svg", "q": "bqueen.svg",
            "K": "wking.svg", "k": "bking.svg",
            "I": "wosprey.svg", "i": "bosprey.svg",
            "Z": "wzebra.svg", "z": "bzebra.svg",
            "Y": "wgriffin.svg", "y": "bgriffin.svg"
        }
    }
}

but if I try to select Custom set of Bob Greenwade's pieces it just says The set does not exist.


Daniel Zacharias wrote on Mon, Feb 5 11:11 PM UTC in reply to H. G. Muller from 04:53 PM:

I suppose that 'moves more than once per turn' always means 'can move on after capturing'

Specifically, I need the same piece type moving one or more times in a turn, so XBetza isn't enough.


H. G. Muller wrote on Mon, Feb 5 04:53 PM UTC in reply to Daniel Zacharias from 05:09 AM:

I suppose that 'moves more than once per turn' always means 'can move on after capturing', as making multiple non-captures per turn is indistinguishable from moving once, directly to the final destination. Even in the case of multiple capture it is a matter of taste whether you consider it moving more than once. (E.g. does the Ultima Long Leaper make one or two moves, when it jumps over two enemies?)

If it is expressible in XBetza notation, GAME code for it can be shown by the Play-Test Applet. But ths is probably not what you want.


🕸📝Fergus Duniho wrote on Mon, Feb 5 02:56 PM UTC in reply to Daniel Zacharias from 05:09 AM:

Chess. When a Pawn promotes, it moves twice in a turn. The official and up-to-date version of movepiece.js that Game Courier runs handles this by recognizing that multiple legal moves for the piece begin with the same initial move. It then opens up a requester asking the player which of these multipart moves he wishes to make. It works this way so long as each Pawn promotion was previously listed as a separate multipart legal move. The same principle may be applied to other multi-movers.

Marseillais Chess, which is currently being featured, allows any piece to move twice. It does this by rewinding the move and splitting it into separate parts. So after a player has moved once, he will be given the option to move again. Unlike the first method, which treats a multipart move as a single and distinct legal move, this treats a multipart move as one legal move followed by another. Pawn promotion in Chess used to work this way on a smaller scale. Instead of rewinding a move, it would use the askpromote command to ask what to promote to.

So you have two options. One is to precalculate all possible combinations of two moves a piece may make and list each as a separate legal move. The other is to list only the first move as legal, then to handle the second part after the first part has been made. The latter works better for Marseillais Chess, because it also allows two different pieces to move on the same turn, and that could become difficult to calculate if you tried to handle each combination of two moves as a separate legal move. The former method may be better when double moves are limited to one piece.

Note that when you allow double moves for one piece, you also have to take precautions against other pieces having double moves. With the Pawn, its second move was of a different move type than its first move, and the code had to make sure other pieces were not promoting. With a piece that has two normal moves on one turn, making sure other pieces do not make a second move will be more complicated.


Daniel Zacharias wrote on Mon, Feb 5 07:52 AM UTC in reply to Aurelian Florea from 07:22 AM:

Chu shogi, elven chess, atlantean ballroom shatranj

Of those three only chu shogi has rules enforced and I'm not sure I can understand out how it works with such complicated rules.


Aurelian Florea wrote on Mon, Feb 5 07:22 AM UTC in reply to Daniel Zacharias from 05:09 AM:

Chu shogi, elven chess, atlantean ballroom shatranj.


Daniel Zacharias wrote on Mon, Feb 5 05:09 AM UTC:

Is there a simple example of a game using a piece that can move more than once on a turn?


🕸📝Fergus Duniho wrote on Mon, Jan 22 12:29 AM UTC:

I have changed two default values for Game Courier. The default for render is now css, and the default for font is now Noto Sans. As the loaded serif font for this site, Noto Sans is one that should always work, and its look will be the most consistent with the look of this site. While the Table method is still supported, all it was working for was the Square shape, which the CSS method now works with. Besides using a table, the Table method sticks to HTML for things, so that it still works on old browsers. But for newer browsers, the CSS method is better and more lightweight, and it avoids using deprecated HTML, such as the FONT tag.


🕸📝Fergus Duniho wrote on Mon, Jan 22 12:01 AM UTC:

While working on the CSS Square combination, I added support for the $font value, and I noticed that the Table Square combination was not supporting it. So, I gave it proper support, added a font menu to the form for customizing an ongoing game for both Table and CSS methods, and made some changes to the font selections. While leaving some support for fonts people have used, I removed unused fonts, deprecated little used fonts, and added some new fonts. The deprecated fonts are supported for backwards compatibility, but they are not featured as options. The removed or deprecated fonts included some decorative fonts and some from CD ROM collections, and the new fonts were mainly serif or sans-serif fonts from Google fonts. Some of the new fonts include Literata and Noto Sans, which are the serif and sans-serif fonts used throughout this site. Because each page loads these fonts, they should always work with the Table or CSS method even if you don't have them installed. Also, Courier will use the loaded Courier Prime font. But other fonts will not work with the Table or CSS methods unless you have them installed. In case you don't have them installed, some include some lookalikes in the font list. Notably, the Table method had been using Noto Sans by virtue of not using the chosen font. So, if you got used to that font, you may want to switch your font to Noto Sans. I also added a System-UI option, which is not a specific font. It will use the UI System font on your computer, and for GIF, JPG, and PNG boards, it will use Noto Sans, which is effectively the UI System font for this website.


🕸📝Fergus Duniho wrote on Sat, Jan 20 02:20 AM UTC:

Until now, Game Courier had no support for generating boards with square spaces using CSS. But now it does. The newly supported combination of a Square shape with the CSS rendering method will use CSS Grid to display the board. Note that CSS Grid is completely unrelated to the Custom Grid shape, as I created the Custom Grid shape before CSS Grid was ever a part of CSS. The shape here is Square, not Custom Grid, and it produces square spaces in solid colors.

Like Interactive Diagrams, it will display pieces as background-images. This allows for consistency of size in the borders that show up on spaces to indicate legal moves or past moves, as these borders belong to an image placed on each space, and now they can all be empty images of the same size instead of some being piece images.


Jean-Louis Cazaux wrote on Tue, Jan 16 06:33 AM UTC in reply to H. G. Muller from 06:31 AM:

It works fine now. Tonight I will update more GC from my side, this method is pretty efficient, thks to Fergus and HG.


H. G. Muller wrote on Tue, Jan 16 06:31 AM UTC:

Oops, I misplaced one of the double quotes that had to be added, and hadn't noticed it on visual inspection. It should be fixed now.


🕸📝Fergus Duniho wrote on Mon, Jan 15 11:30 PM UTC in reply to Jean-Louis Cazaux from 10:51 PM:

I've made those corrections for the set, but now I get that message: A Custom set cannot work unless it is described in JSON format as a super constant. And a diagram with only question marks.

Okay, first I updated the error message, because I abandoned the practice of calling anything a super constant. The problem is that your custom set description has an error in it. It is on this line:

"pieces: {"

It should instead be this:

"pieces": {


Jean-Louis Cazaux wrote on Mon, Jan 15 10:51 PM UTC in reply to H. G. Muller from 09:41 PM:

Thank you. I have corrected my mistake for the Prince.

I've made those corrections for the set, but now I get that message: A Custom set cannot work unless it is described in JSON format as a super constant. And a diagram with only question marks.

I don't understand nothing there, JSON, super constant, I don't know how to fix that.


H. G. Muller wrote on Mon, Jan 15 09:41 PM UTC in reply to Jean-Louis Cazaux from 09:24 PM:
  1. The graphics are NOT those I expected. For example I wanted Archers and I get Crocodiles.
  2. The Pawns which were correct on the ID, are wrong on the GC. They are moving diagonally forward even for a non-capture.

Well, (1) is caused by the fact that you have 'Set group' specified as 'Metamachy'. To use what you copied to the 'Custom set' text entry you should set that to 'Custom'. And the 'Set' then to "Completely Custom Set'. Now you are using the Metamachy set, which apparently has V for Crocodile. It just uses what you select. It doesn't help to define a custom set if you don't select it. (But Fergus advocated the definition, even of multiple custom sets, just for creating the opportunity to switch to those.)

As to (2), I am pretty sure that the Pawns will not only move diagonally forward, but also sideways and backward. Because they are in fact Princes. Note that the Prince was also represented by a Pawn image. The problem is that you defined P to stand for both Prince and Pawn. This is probably also why setting the Set Group to Custom does not work, but gives you an error message; only when you do that it starts to look at the text you posted, and will discover the double P.


Jean-Louis Cazaux wrote on Mon, Jan 15 09:24 PM UTC:

I confirm that for a guy like me, it is quite difficult to understand what is JSON, etc.

Well, I've tried to see how is going with the new Play-test Applet and the new Custom set. I've chosen Teramachy, because it is one of the least popular of my variants, to make a test.

See here: https://www.chessvariants.com/play/pbm/play.php?game%3DTeramachy%26settings%3DDefault-Alternate

  1. The graphics are NOT those I expected. For example I wanted Archers and I get Crocodiles.
  2. The Pawns which were correct on the ID, are wrong on the GC. They are moving diagonally forward even for a non-capture.

May I have your help?


🕸📝Fergus Duniho wrote on Mon, Jan 15 06:18 PM UTC:

To make it easy to convert the old style of custom set, which made use of GAME Code, to the new style, which does not, I have added some code to populate the Custom Sets field with your GAME Code created custom set when you click on Run in Edit mode. All you have to do after clicking Run is to check that it looks accurate, delete your lines of GAME Code for creating a custom set, and switch your game to using the "Completely Custom set" in the Set Group called Custom.

This works appropriately only if you had a single custom set. If you had multiple custom sets for one game, then you probably know something about programming, and you can consult the documentation to figure out what to do.


H. G. Muller wrote on Mon, Jan 15 02:08 PM UTC in reply to Fergus Duniho from 01:36 PM:

The fact that you mention JSON or PHP at all makes it technical. The reader couldn't care less whether GC was implemented in PHP, Javascript or COBOL. It is totally irrelevant for him. Just as whether the server uses AMD or Intel chips. To non-programmers the term JSON is just gobbledegook, not telling them anything useful, and to programmers it would likely not be telling anything new.


🕸📝Fergus Duniho wrote on Mon, Jan 15 01:36 PM UTC in reply to H. G. Muller from 08:35 AM:

Only the last sentence even mentions why JSON is being used instead of PHP. And it’s not a technical comparison of JSON vs PHP.


H. G. Muller wrote on Mon, Jan 15 08:35 AM UTC in reply to Fergus Duniho from Sun Jan 14 07:41 PM:

I would leave out the second paragraph, about JSON vs PHP. I don't see how that information would benefit a non-programmer user that wants to create a preset in any way, other than scare him off. The purpose is to explain how to use Game Courier, not to justify why it was designed like it is.


Jean-Louis Cazaux wrote on Mon, Jan 15 07:58 AM UTC:

@Fergus: I would like to have the Vao represented by an Archer instead of a Crocodile in Alfaerie for Metamachy.

I believe I can't do it myself. Could you please do it for me?


🕸📝Fergus Duniho wrote on Sun, Jan 14 07:41 PM UTC:

I have added a section on creating Custom Sets. This is a new feature that does not rely on using GAME Code like the old method for creating custom sets did. So, it will work even in Edit mode, which does not run any code. It will also support multiple sets, and it will not break the ability to use other sets.


Max Koval wrote on Wed, Nov 22, 2023 05:09 AM UTC in reply to Fergus Duniho from Tue Nov 21 01:54 AM:

I think I missed something. The white pieces were not uploaded in the Atlantic Graphic's File Manager fully. I uploaded ten missing SVGs there, so, they can be added to the directory, and then I will make a set file.


🕸📝Fergus Duniho wrote on Tue, Nov 21, 2023 01:54 AM UTC in reply to Max Koval from Mon Nov 20 09:46 PM:

I think now this set can be listed in sets.php .

That can't happen until it has a set file in the /play/pbm/sets/ directory.


Max Koval wrote on Mon, Nov 20, 2023 09:46 PM UTC in reply to Bob Greenwade from 02:49 PM:

Well, this set covers mostly the games that I liked, sort of.

I think now this set can be listed in sets.php .


Bob Greenwade wrote on Mon, Nov 20, 2023 02:49 PM UTC in reply to H. G. Muller from 08:39 AM:

I'll agree with H.G. about the lack of unorthodox pieces in this set. Expand it a bit, and I might even find a use for these!


Max Koval wrote on Mon, Nov 20, 2023 12:55 PM UTC in reply to H. G. Muller from 12:41 PM:

Thanks. I knew that the space could cause some problems, but didn't bother to change that.


H. G. Muller wrote on Mon, Nov 20, 2023 12:41 PM UTC in reply to Max Koval from 12:26 PM:

Ah, I overlooked that zip file. Perhaps because the name was displayed in quotes, because of the space in it. Anyway, I copied all the svg files to /graphics.dir/svg/atlantic/ .


Max Koval wrote on Mon, Nov 20, 2023 12:26 PM UTC in reply to H. G. Muller from 12:08 PM:

I uploaded the SVG files in the page's file section, I hope now it works. The Zip file is also available there (Atlantic Graphics.zip), it was originally uploaded at the time the page was created.


H. G. Muller wrote on Mon, Nov 20, 2023 12:08 PM UTC in reply to Max Koval from 11:08 AM:

That must be an oversight, as I see no reason to exclude any particular graphics format. I tried to change the file upload script to also allow svg extension, and hope I did this right. So please try again. You could also put them in a zip file and upload that; this was already amongst the allowed extensions.


Max Koval wrote on Mon, Nov 20, 2023 11:08 AM UTC in reply to H. G. Muller from 08:39 AM:

Well, that's how most chess fonts handle such designs, I didn't like it either. The quantity is not an issue as I've designed another block of pieces, which covers pretty much all common chess variants as well as Shogi, yet I wanted to try out the original ones before moving forward.

It was impossible for me to directly upload SVG files in the page's directory and I got a message saying 'Upload of ... has been aborted, because it has an extension of: .svg ... To upload any other kind of file, it must be preapproved by an editor who will upload it for you the first time.'


H. G. Muller wrote on Mon, Nov 20, 2023 08:39 AM UTC in reply to Max Koval from 05:56 AM:

Well, I don't like them very much (too many of them look like Knights, with only minute differences), and the number of unorthodox pieces is very small. But I don't think that should stop them from being available. I could not find any SVG files in the upload directory for the Atlantic Graphics page, though; it seems you put all the pieces in a single (non-SVG) image there. So there was nothing for me to copy to /graphics.dir/svg/atlantic/ .


Max Koval wrote on Mon, Nov 20, 2023 05:56 AM UTC:

Would it be possible to create a directory at /graphics.dir for Atlantic Graphics?


A. M. DeWitt wrote on Tue, Nov 7, 2023 10:22 PM UTC in reply to Fergus Duniho from Sun Nov 5 06:24 PM:

Thanks for fixing that.


🕸📝Fergus Duniho wrote on Sun, Nov 5, 2023 06:24 PM UTC in reply to Fergus Duniho from 05:42 PM:

Since each() is deprecated, I used key() to tell whether it had reached the end of the array. Although the documentation said it returned false upon reaching the end of the array, tests showed that it returned null. So, I just checked whether it was empty, which should be safe, as the key will have incremented beyond 0 after calling next(). So, now the foreach command will not terminate early when reaching a false value, and your original code should now work properly.


🕸📝Fergus Duniho wrote on Sun, Nov 5, 2023 05:42 PM UTC in reply to Fergus Duniho from 03:55 PM:

I decided to look into why this is a problem. It's that foreach, which is used to go through the values of a -Range function in the stalemated subroutine, exits when it gets a false value. This is because the PHP next function, which the next command uses to get the next value in an array, returns false if the array has no more elements. So, I have a conditional checking whether this value is false, and if it is false, it decrements the scope, which breaks out of the loop. To allow array elements with false values, I need another way to tell whether there are any more elements in the array.


🕸📝Fergus Duniho wrote on Sun, Nov 5, 2023 03:55 PM UTC in reply to A. M. DeWitt from 02:32 PM:

Here is the function that is probably at fault:

def Black_Heavenly_Horse-Range merge leaps #0 1 1 array where #0 -2 -2 where #0 0 -2 where #0 2 -2 where #0 -1 2 where #0 1 2 where #0 0 -1;

Since your Black Heavenly Horse is on the side of the board, some of the where clauses will return false, but the array of coordinates to check for legal moves on should not contain any false values. To weed out the false values, you should build your array with a lambda function, probably using aggregate. So this code may work:

def Black_Heavenly_Horse-Range merge leaps #frm 1 1 aggregate lambda (where #frm #0 #1) array ((-2 -2) (0 -2) (2 -2) (-1 2) (1 2) (0 -1)) =frm;

I'll leave it to you to test it.

This might also work. It feeds your original array into aggregate to weed out any empty values. Within parentheses, #0 should just be the value of each element passed to the lambda function, not the first argument passed to the function. If it doesn't work that way, you can replace the outer #0 with a named variable, as I did above.

def Black_Heavenly_Horse-Range aggregate lambda (#0) merge leaps #0 1 1 array where #0 -2 -2 where #0 0 -2 where #0 2 -2 where #0 -1 2 where #0 1 2 where #0 0 -1;


A. M. DeWitt wrote on Sun, Nov 5, 2023 02:32 PM UTC:

It seems that Game Courier is having trouble displaying legal moves for pieces in certain situations. Take for example this game from Seireigi:

1. p 3g-3f 
1... P 7c-7d 
2. n 2i-3g 
2... N 8a-7c 
3. n 3g-2e 
3... N 7c-8e 
4. n 2e-1c; +n-dest 
4... N 8e-9g; +N-dest // If you click on Black's Heavenly Horse on 1c, it shows only legal mvoes to 1a, 3a, 2b, and 2d. GC should also show legal moves on 2e and 1b, but it doesn't. However, rule-enforcement-wise, there are no problems when the Heavenly Horse moves to the latter two squares.


H. G. Muller wrote on Mon, Oct 23, 2023 06:18 AM UTC in reply to Bob Greenwade from Sun Oct 22 08:52 PM:

I have made a large fraction of the existing alfaerie SVGs, (Greg did the others), but I never tried to do it in an automated way. I use Inkscape on Linux, import the GIF image into it (e.g. by 'open with'), magnify it to the desired nominal size of the SVGs (2048 x 2048?), and then trace out all outlines by placing points on those from Bezier curves. You don't need many points; for a circle a hexagon would do. (But of course there is a special function for drawing circles.) After the curve is a closed loop, I select it with the 'edit points' tool. With that I grab all the sides of the polygon that should not be straight lines, to bend those. This makes tow 'handles' appear at the ends of the side, the direction of which I adjust to the tangent of the curve in the GIF, while their length is adjusted to give a smooth curve. Then I adjust the width, color, fill color and corner rounding therough the menu that appears clicking on the lower left of the bottom tools bar. (I often start with red instead of black, to see whether I cover the outlines of the GIF well.) Finally I remove the GIF, and save the lot (after grouping everything with the menu).

This is not difficult, but it is tedious for complex images. This is why I haven't done it for every GIF that exists. That it exists doesn't necessarily mean it is useful. So I convert the remaining images only 'on demand', when I am equiping articles on variants that the AI of the Interactive Diagram can handle with such Diagrams, and the original diagram in that article used an image that doesn't exist as SVG yet.


Bob Greenwade wrote on Sun, Oct 22, 2023 08:52 PM UTC in reply to H. G. Muller from 08:27 PM:

For the most part, the discussion is academic, at least as far as my original and modified icons are concerned; I've tried several different tools now, and the best SVGs come out blurry, blocky, or both. The only exceptions would be those made up of only horizontal and vertical lines, and out of 151 such images there are only 7 of those, 6 of which are Tifinagh letters.

To be sure, I'd love to have SVG icons for most of these pieces, especially those used in Vanguard Chess, Short Sliders, and Zwangkrieg. My ability with static arts is just too meager.

If additional images would have to be added to any directory, it would be better to convert the GIF images for which no SVG version exists to PNG, and add those to the PNG directories. (It should be possible to do that automated in bulk.)

I can testify that this is not an especially difficult thing to do, as it's what I've done for most all of the other 360+ icons I've handled -- certainly, all of those not already shown in the Play-Test Applet. If you want to copy some of the results, they're right there for the taking (and I can handle anything that's missing).


H. G. Muller wrote on Sun, Oct 22, 2023 08:27 PM UTC in reply to Fergus Duniho from 05:28 PM:

Not all GIF images have been converted to SVG. So, if you want to use certain images, GIF is still your only choice. So, he may as well make his images available as GIFs.

I think this is a bad plan, because the most-used pieces exist as quality PNG in the alfaeriePNG and alfaeriePNG35 directories, and using GIF files would also use the low-quality images for those. If additional images would have to be added to any directory, it would be better to convert the GIF images for which no SVG version exists to PNG, and add those to the PNG directories. (It should be possible to do that automated in bulk.) These pieces are only very rarely used, and one or two low-quality images don't degrade the experienced quality of a large diagram in a very conspicuous way.

In time the low-quality converted GIFs could be replaced by SVG-derived high-quality PNG, when they are actually used. Diagram-Designer links or Interactive Diagrams using the PNG pieces would then automatically be upgraded to the better quality.

The problem is that there is little incentive to put any effort in creating SVG that is unlikely to be ever used. So use should come first. But when people will be automatically referred to using GIF for their diagrams when they need a rarely used image, no use case for these images as SVG/PNG will ever be created. And if they were, the existing diagrams would not benefit from it.


Bob Greenwade wrote on Sun, Oct 22, 2023 05:37 PM UTC in reply to Fergus Duniho from 05:28 PM:

Not all GIF images have been converted to SVG. So, if you want to use certain images, GIF is still your only choice. So, he may as well make his images available as GIFs. But if he can, he should also make them available as SVG.

I'm not sure how well those (the SVGs) would work out. But I can give it a shot.

Update: I tried a converter, and got some very interesting-looking white-on-black impressionistic figures that would work wonderfully if that had been my intent.

Anyone else is welcome to give some PNG-to-SVG conversion a shot to do better.


🕸📝Fergus Duniho wrote on Sun, Oct 22, 2023 05:28 PM UTC in reply to H. G. Muller from 01:47 PM:

Why would you do that? The GIF images are legacy, and should no longer be used for new projects.

Not all GIF images have been converted to SVG. So, if you want to use certain images, GIF is still your only choice. So, he may as well make his images available as GIFs. But if he can, he should also make them available as SVG.


Bob Greenwade wrote on Sun, Oct 22, 2023 02:06 PM UTC in reply to H. G. Muller from 01:47 PM:Excellent ★★★★★

The GIF images are legacy, and should no longer be used for new projects.

I did not know that. I won't worry about that, then. Never mind. :)


H. G. Muller wrote on Sun, Oct 22, 2023 01:47 PM UTC in reply to Bob Greenwade from 01:34 AM:

As an aside, I do plan to convert most if not all of those that I created (by one means or another) to GIF for putting into the download area.

Why would you do that? The GIF images are legacy, and should no longer be used for new projects.


Bob Greenwade wrote on Sun, Oct 22, 2023 01:34 AM UTC in reply to Fergus Duniho from 12:51 AM:

The directory I cited is full of PNG images, which can be used on Game Courier. There are over 500 pairs of them right now. (The Interactive Diagram is just a demo of how the pieces move.)

As an aside, I do plan to convert most if not all of those that I created (by one means or another) to GIF for putting into the download area.


🕸📝Fergus Duniho wrote on Sun, Oct 22, 2023 12:51 AM UTC in reply to Bob Greenwade from Sat Oct 21 03:17 PM:

Easier to just use /membergraphics/MSdealerschess/. It's what I made/am making it for.

I moved your comment here, because I assumed you were responding to A. Dewitt, whose comment I also moved here. The link you provided goes to an Interactive Diagram, but this is Game Courier. Do you plan on making a Game Courier set out of the pieces in your Interactive Diagram?


🕸📝Fergus Duniho wrote on Sun, Oct 22, 2023 12:38 AM UTC in reply to A. M. DeWitt from Sat Oct 21 10:59 PM:

the Chushin Shogi and Taishin Shogi sets (as well as their corresponding set files) can be deleted from the sets.php file, as the corresponding games no longer exist.

Okay, for now I have commented out these sets in sets.php. I used grep to confirm that no settings files are using any of these sets. I also used grep to check the logs, and I found three logs using chushin_shogi_mnemonic_pieces. Here is what I got:

mitsugumi_shogi/sesquipedalian-cvgameroom-2022-45-765.php:chushin_shogi_mnemonic_pieces
suzumu_shogi/arx-cvgameroom-2021-348-992.php:chushin_shogi_mnemonic_pieces
suzumu_shogi/arx-cvgameroom-2021-348-992.php:chushin_shogi_mnemonic_pieces

A. M. DeWitt wrote on Sat, Oct 21, 2023 10:59 PM UTC in reply to Fergus Duniho from 04:55 PM:

While we're at it, the Chushin Shogi and Taishin Shogi sets (as well as their corresponding set files) can be deleted from the sets.php file, as the corresponding games no longer exist.


🕸📝Fergus Duniho wrote on Sat, Oct 21, 2023 04:55 PM UTC in reply to A. M. DeWitt from 03:06 PM:

It seems that this feature is not working. Whenever I try to make a move in the sample preset, GC responds by saying that the selected set does not exist.

In general, I think this was a bad idea, and if it's not working for you, I would recommend not doing it. The problem with this idea is that it defines a piece set entirely with code, but the preset needs to know how to identify pieces even when not running any code. The alternative, which I would recommend instead, is to use a piece set that includes all the piece images you want to use, then use aliases to specify the notation you want players to use for the pieces during the course of the game. The fairychess include file is set up to use aliases, and the tutorial on it describes how you should make use of them with it.


Bob Greenwade wrote on Sat, Oct 21, 2023 03:17 PM UTC in reply to A. M. DeWitt from 03:06 PM:

Easier to just use /membergraphics/MSdealerschess/. It's what I made/am making it for.


A. M. DeWitt wrote on Sat, Oct 21, 2023 03:06 PM UTC:

I have added the ability to use entirely custom piece sets in a game. These are defined in GAME Code and do not use an external PHP file. Here is some sample code I wrote:

// A demo of using multiple internal sets that do not match any set file.

// Name the sets you will use by assigning them to the $groupsets array.
// Use capitalized names for the sets. These do not match any file names.
setsystem groupsets array Abstract Alfaerie AlfaeriePNG Magnetic Motif;

// Define pieces in an array variable called mypieces.
// Start by creating an associative array of all pieces shared in common.
// The key should be a label, and the value should be a filename.
// A single line of code is broken into multiple lines of text for legibility.
set mypieces assoc 
  K "WKing.gif"   k "BKing.gif" 
  Q "WQueen.gif"  q "BQueen.gif" 
  R "WRook.gif"   r "BRook.gif" 
  B "WBishop.gif" b "BBishop.gif" 
  N "WKnight.gif" n "BKnight.gif" 
  P "WPawn.gif"   p "BPawn.gif";

// Set the $dir system variable to match the set, and modify filenames as needed.
if == pieceset Alfaerie:
  setsystem dir "/graphics.dir/alfaerie/";
  foreach (k v) #mypieces:
    setelem mypieces #k tolower #v;
  next;
elseif == pieceset AlfaeriePNG:
  setsystem dir "/graphics.dir/alfaeriePNG/";
  foreach (k v) #mypieces:
    setelem mypieces #k tolower str_replace .gif .png #v;
  next;
elseif == pieceset Magnetic:
  setsystem dir "/graphics.dir/magnetic/";
elseif == pieceset Motif:
  setsystem dir "/graphics.dir/motif/";
else:
  // Have a default set for when the set does not match any allowed set.
  // The default is Abstract.
  setsystem dir "/graphics.dir/abstract/";
endif;

// Now that the pieces are defined, copy the #mypieces array to $pieces
setsystem pieces #mypieces;

It seems that this feature is not working. Whenever I try to make a move in the sample preset, GC responds by saying that the selected set does not exist.


Daniel Zacharias wrote on Wed, Oct 4, 2023 01:19 AM UTC in reply to Fergus Duniho from 12:45 AM:

That seems to work


🕸📝Fergus Duniho wrote on Wed, Oct 4, 2023 12:45 AM UTC in reply to Daniel Zacharias from Tue Oct 3 11:15 PM:

The same thing was happening. Since the code checks the legality of an actual move after it has moved the pieces, the destination space is always occupied at that time. So, the problem is just the same as it is for a potential move that is a capture.

I think I fixed it by changing this code:

function logleap ($from,  $to,  $ra) {
    global $map,  $space;

    $ns = $from;
    for ($i = 0; $i < count($ra); $i++) {
        $dir = $ra[$i];
        $temp = false;
        if (is_array($dir)) {
            if (($temp = logleap($from,  $to,  $dir)) == $to)
                return $temp;
        }
        elseif (isset($map[$ns][$dir]))
            $ns = $map[$ns][$dir];
        else
            $ns = false;
        if ($space[$ns] != '@')
            break;
    }
    if (($temp == false) && ($i < count($ra)))
        return false;
    return $temp ? $temp : $ns;
}

to this:

function logleap ($from,  $to,  $ra) {
    global $map,  $space;

    $ns = $from;
    for ($i = 0; $i < count($ra); $i++) {
        if (($i > 0) && ($space[$ns] != '@'))
            break;
        $dir = $ra[$i];
        $temp = false;
        if (is_array($dir)) {
            if (($temp = logleap($from,  $to,  $dir)) == $to)
                return $temp;
        }
        elseif (isset($map[$ns][$dir]))
            $ns = $map[$ns][$dir];
        else
            $ns = false;
    }
    if (($temp == false) && ($i < count($ra)))
        return false;
    return $temp ? $temp : $ns;
}

Daniel Zacharias wrote on Tue, Oct 3, 2023 11:15 PM UTC in reply to Fergus Duniho from 11:09 PM:

I've had that first problem you mention too and I solved it by adding a subroutine for the piece that checks the move in reverse just for post move testing. I don't know what exactly is going on there, but I've seen it with other complex pieces too.


🕸📝Fergus Duniho wrote on Tue, Oct 3, 2023 11:09 PM UTC in reply to Daniel Zacharias from 09:18 PM:

I've gotten to the point where I see the problem. I'm testing the a modified Knight in a modified version of Cylindrical Chess. At first, it wouldn't let me move with the Knight at all. I eventually realized this was because the Knight is on the destination space during an actual move. So, I hacked the code to empty the Knight's space when it moves, and then it allowed the Knight to move. But when I gave it a target to capture, it would not display it as a legal move, though because of the hack I did, I was able to make the move anyway. I will look into this more after I eat something.


Daniel Zacharias wrote on Tue, Oct 3, 2023 09:18 PM UTC in reply to Fergus Duniho from 08:26 PM:

Yes. I've tested in in an empty preset to make sure it wasn't other code interfering.


🕸📝Fergus Duniho wrote on Tue, Oct 3, 2023 08:26 PM UTC in reply to Daniel Zacharias from 05:01 PM:

This works, except that logleap doesn't seem to allow captures. Is that intended?

Are you saying that if a space is occupied, logleap will not return that space as one of the spaces a piece may move to?


Daniel Zacharias wrote on Tue, Oct 3, 2023 05:01 PM UTC in reply to Fergus Duniho from Sun Apr 30 03:10 PM:

you can use logleap to specify a series of lame leaps that must go by a certain path

This works, except that logleap doesn't seem to allow captures. Is that intended?


🕸📝Fergus Duniho wrote on Tue, Oct 3, 2023 03:54 PM UTC:

I modified the section on Data Storage to make the distinction between the name of a variable, constant or flag and a call to one. While this distinction has long been a part of the language, I hadn't expressed it in these terms.


🕸📝Fergus Duniho wrote on Sun, Apr 30, 2023 03:10 PM UTC in reply to Daniel Zacharias from 02:46 AM:

Using logical directions, for which I would recommend either degrees or the numbers on a clock face, you can use logleap to specify a series of lame leaps that must go by a certain path. Each lame leap would be a possible move for the piece, and each series of steps constituting a single lame leap should go in parentheses.


🕸📝Fergus Duniho wrote on Sun, Apr 30, 2023 11:22 AM UTC in reply to Daniel Zacharias from 02:46 AM:

It is probably best to use logical directions with a hexagonal board, and the details will depend upon what kind of hexagonal board you use. Game Courier currently supports two kinds of hexagonal boards, and it will eventually support four kinds, as the Diagram Designer currently does.


Daniel Zacharias wrote on Sun, Apr 30, 2023 02:46 AM UTC:

What would be a good way to define a piece for a hexagonal board that can slide through any path exactly 3 spaces long to any space that is no fewer than 3 spaces away? When I try checkpath or checknsteps the result is wrong because they assume a square grid.


🕸📝Fergus Duniho wrote on Wed, Mar 1, 2023 09:32 PM UTC in reply to Daniel Zacharias from 07:33 PM:

Since where can take two or three arguments, it will take three if it finds three. So, where #0 n where #0 e; is treating the value of where #0 e as an argument for the leftmost where. Try this instead:

print aggregate lambda (where #frm #0) (n e) =frm;


100 comments displayed

Later Reverse Order EarlierEarliest

Permalink to the exact comments currently displayed.