Check out Modern Chess, our featured variant for January, 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 by HGMuller

EarliestEarlier Reverse Order LaterLatest
Game Courier Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
H. G. Muller wrote on Thu, May 30, 2024 08:39 PM UTC in reply to Fergus Duniho from 08:04 PM:

That is a completely unexpected implementation of nand. I would expect x nand true to evaluate to not x. What you describe would be x or not y. I think it is a mistake to call that nand.


Tenjiku Shogi. Fire Demons burn surrounding enemies, Generals capture jumping many pieces. (16x16, Cells: 256) [All Comments] [Add Comment or Rating]
📝H. G. Muller wrote on Mon, Jun 3, 2024 05:51 PM UTC in reply to A. M. DeWitt from 05:38 PM:

I am not so sure this should not happen. I am in fact pretty sure the historic rules were that burning would occur in this case. Any other rule open a can of worms in terms of inconsistencies, and additional rules needed to resolve those..


Featured Chess Variants. Chess Variants Featured in our Page Headers.[All Comments] [Add Comment or Rating]
H. G. Muller wrote on Mon, Jun 3, 2024 06:09 PM UTC in reply to Fergus Duniho from 05:22 PM:

PyChess is a web version of Fairy-Stockfish?

You can also play the latter directly under WinBoard, as a local program. It might be much stronger.

[Edit] I had a look at the PyChess FAQ, to get an idea of how that site works. It states that the "play against AI" functionality there uses a version of the Fairy-Stockfish engine that is running on the server. This means the thinking time of the engine has to be severely limited to not overload the server. The FAQ states that even on level 8 it is limited to less than 1 sec (one assumes using a single CPU thread). The time control that you can select (base time per game and increment per move) is just for the human player.

When you download and run Fairy-Stockfish on your own PC, you can have it think many seconds (or minutes or hours), using all CPU cores.

In normal Chess Fairy-Stockfish should be similar in strength to regular Stockfish. Which would be around 1500 Elo stronger than Zillions of Games (3400 Elo vs 1900 Elo on the CCRL scale). Since the rule of thumb is that doubling thinking time gains an engine some 70 Elo, you would have to make Zillions think a million times longer than Stockfish, to approach the latter in strength. Stockfish at 1msec/move should still easily beat Zillions at 10 sec/move.

The lower levels of the AI on the PyChess website are probably implemented by using Stockfish' UCI_LimitElo option in addition to reducing its thinking time. This option intentionally randomizes the evaluation, increasing the probability for the engine to play moves it would otherwise recognize as sub-optimal / blunders.


Giant Chess. 16x16 board with the same pieces as Turkish Chess, but also the "Dev" piece which takes up four squares. (16x16, Cells: 256) [All Comments] [Add Comment or Rating]
H. G. Muller wrote on Wed, Jun 5, 2024 06:16 AM UTC in reply to Bob Greenwade from 12:30 AM:

There are many ways conceivable for how multi-square pieces would behave, differing in the details. In the Dev case it is especially troublesome for the AI that all occupied squares should be under attack; this means the legality of moves that capture it cannot be judged on their own merits, but require examination of the entire move list. This is a problem that transcends that of multi-square pieces, btw: you would also encounter it in variants that specify some piece can only be captured if it has multiple attackers.

I suppose one could nearly implement this through custom scripting in the existing I.D. code, with the xxxTinker routine, but in a rather complex way: the routine could test whether it is called for a new node by examining the node count, and when it is clear a variable for each Dev to record which of its components is attacked, and set up an empty array for moves. Each move hitting one of the Dev components would initially be rejected, but moved to the array of reserve moves. And the corresponding Dev component would then be marked as attacked.

After generating all moves it should then be tested which Dev has all its components attacked, and the shelved captures of such a Dev could then be appended to the official move list. This can currently only be done by writing a wrapper for the move generator routine. But perhaps an official interface should be provided for the user to add a custom routine for calling after move generation completes (e.g. xxxDone).


H. G. Muller wrote on Wed, Jun 5, 2024 04:38 PM UTC in reply to Bob Greenwade from 02:25 PM:

The simplest way that I could see for defining a large piece for the ID ...

That is only simple because you assume you only have to switch on the complex implementation that was already done by someone else. The number of lines needed to implement this in general (i.e. give every piece type a configurable size, 1x1 by default) is not very large. But they would then be executed very often, as they would appear in the innermost of all loops, doing a 2d scan of the specified area for every step in a move, where it now simply tests the occupant of a square. So it would cause an enormous slowdown in all variants, also those having only 1x1 pieces.

A better solution would be to allow custom generation for some given piece types (using X as their Betza descriptor). That would only require one simple test per piece for pieces that do not have it, which can even be combined with the test for already existing special Betza atoms such as the Imitator. So it would cause zero slowdown in normal variants, and a very tiny slowdown in variants that feature an Imitator. The custom script that would then be invoked would only have to deal with the move the multi-square piece actually has, and can ignore complexities like multi-leg, move induction, and in the case of the Dev, even sliding.

'Include files' are an intrinsic HTML feature; the betza.js script is in fact an include file. You could include as many .js files as you like in a page, or write script in the page itself. JavaScript also has the property that you can redefine routines; the last one of the same name it encounters is the one that will apply.

Since the betzaNew.js file is still considered experimental, the xxxTinker routine is not officially documented yet. (Except perhaps burried in the Comments).


H. G. Muller wrote on Wed, Jun 5, 2024 05:50 PM UTC:

I guess there has always ben a distinction between what the I.D. can do through configuring it, and what it can do through additional scripting. The latter was really never documented, as I considered scripting too difficult for the intended users anyway. So it was mainly a feature for making my own life easy. And it involved in a non-backward-compatible way. Documenting it sort of forces you to remain compatible with the documentation.

I did just get an idea, though. There could be a new symbol in the captureMatrix for indicating 'tentative' moves. These then would not be added to the move list right away, but be stored in a separate list. When this list is non-empty after the move generation completed, a custom routine would be called that could process them further. This would be useful for moves the legality of which would depend on a global condition. Such as mandatory capture: all non-captures would be marked as tentative, and the custom routine could copy them all to the real move list if the latter was still empty (i.e. if there were no captures), and discard them otherwise.

A multi-square piece would then be represented by a single 'master piece', and a number of dummies. The latter would have no move of their own. All moves of the master piece, as well as any capture of it, or of a dummy, would be defined as tentative in the captureMatrix. The custom routine could then judge (1) whether moves of the master piece have the required target occupance of th entire target area (and then modify the move by adding the moves of all dummies to it before accepting it), and (2) test for the captures whether the tentative moves include captures to all components of the piece, and only accept those if that is the case (and the add all components that were not on the target square as locust victims of the move).


H. G. Muller wrote on Thu, Jun 6, 2024 05:49 AM UTC in reply to Bob Greenwade from Wed Jun 5 08:23 PM:

Rotation of a two-square piece could be written as a pasW move on the master and dummy that is restricted by the captureMatrix to hop over its own master or dummy.


Interactive diagrams. (Updated!) Diagrams that interactively show piece moves.[All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Sun, Jun 9, 2024 07:02 AM UTC in reply to Daniel Zacharias from Sat Jun 1 04:54 AM:

Is it possible to have promotions triggered by capturing that only occur in a specific part of the board?

Not through configuring with standard options. But by custom scripting (e.g. adding a function WeirdPromotion) it should be easy.


💡📝H. G. Muller wrote on Sun, Jun 9, 2024 12:25 PM UTC in reply to HaruN Y from 11:53 AM:

What are the standard options?

Everything for which you don't have to supply additional JavaScript. In the case of promotions morph, captureMatrix, promoChoice etc.


💡📝H. G. Muller wrote on Sun, Jun 9, 2024 03:49 PM UTC in reply to Daniel Zacharias from 03:13 PM:

I suppose this is why Maka Dai Dai Shogi also has many demoting pieces, and makes the promoted state contageous. Demoting pieces are less useful as protectors, as near-equal trades can force those to demote by promoting in the initiating capture. Even if that is a demotion itself. You either gain the captured piece for the price of the demotion (which would always be better than the loss of the capturing piece due to recapture), or you trade with the recapturer's demotion as an additional bonus.

This tips the balance in favor of the attacker.


Demotion. Members-Only Pieces might have to demote to weaker ones on capturing. (10x8, Cells: 64) [All Comments] [Add Comment or Rating]

Since this comment is for a page that has not been published yet, you must be signed in to read it.

Interactive diagrams. (Updated!) Diagrams that interactively show piece moves.[All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Tue, Jun 11, 2024 08:03 AM UTC in reply to A. M. DeWitt from Mon Jun 10 06:04 PM:

I noticed a bug where its Shogi promotion parameter (|) blocks out the second player's promotion moves where the morph parameter comes into effect.

This is fixed now. I had added codes 999 and 998 in the internal representation of the morph array for optional and forced Shogi promotions (1000 already existed for chess-like promotion choice), but these were not exempted yet from adding 1024 if black moved. (Which is done for codes that represent piece type.)

Besides | for optional Shogi promotion there existed a & for indicating forced Shogi promotion (i.e. using promoOffset), which I added to avoid having to specify the ID of the promoting piece (which in Shogi often is a two-letter combination +L). This was undocumented, because it never worked. The reason for this failure was that the editor mutilates the & character in the Diagram definition. So I now use ^ for forced Shogi promotion instead (which did not have a meaning yet in the morph parameter). For Pawns on the last rank this is really the symbol you would want to use.

while you are at it, can you copy the Shogi promotion code from betzaNewer over to betzaNew?

You like the 'purple method' better? I did copy the code, but also left in the old code in an if-then-else construct. For now it always uses the purple method, but it would be easy to make this subject to a new parameter.


💡📝H. G. Muller wrote on Tue, Jun 11, 2024 08:19 AM UTC in reply to Aurelian Florea from 06:41 AM:

I am trying to make an expanded Eurasian chess. I do not know if shogi style promotion (with promooffset) and western style promotion (with promochoice and maxpromote) may coexist, or if they can coexist, which one takes precedence?

They can coexist when specified through morph parameters. With the 'legacy method' of specifying promoZone and maxPromote, promoOffset would be used to decide the type of promotion you get when a promotable piece enters the zone. When it is 0 you get chess-like promotion, the choice defined by promoChoice.

Specification through morph is more flexible, but in simple cases more cumbersome. You can specify for each piece independently on which squares it promotes, and how, and can scatter these squares over the board in any way you want. You either mention for each square the promoted type when that is fixed (with ^ shorthand for the promoted version of the moving piece defined through promoOffset), or when there is choice specify * for Chess-like promotion (or a digit 1-9 for additional promotion sets specified in promoChoice) and | for Shogi-like.


Home page of The Chess Variant Pages. Homepage of The Chess Variant Pages.[All Comments] [Add Comment or Rating]
H. G. Muller wrote on Tue, Jun 11, 2024 12:34 PM UTC in reply to Aurelian Florea from 11:43 AM:

There are no pictures in cgi-bin. By convention it is a directory for server-side scripts/programs, which will run to create dynamic content for sending to the client. The file fen2.php there dynamically creates PNG images, by rendering SVG images with sizes and colors that can be specified in the URL as a so-called query string.

The SVG images it seeks in the directory /graphics.dir/svg/xxx, where xxx is the value specified for theme in the query string t=xxx. Any file yyy.svg in that directory can be rendered, by specifying p=yyy in the query string.

Unfortunately the server does not provide direct access to these directories through the HTTP web interface, because there is a file index.html in them which will be retreived with priority. This is supposed to contain an overview of what is available, but it might not be up to date. (It is a static file, so it would have to be edited to include new images added to the set.) The trick to get around this is to use a script 'list.php' that is also in those directories, and will generate the output that the server would have given you when the index.html file had not been present. (Which is a list of filenames; no preview of what they contain. The Play-Test Applet uses these scripts to build its piece table.) E.g. /graphics.dir/svg/alfaerie/list.php.


Interactive diagrams. (Updated!) Diagrams that interactively show piece moves.[All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Tue, Jun 11, 2024 03:40 PM UTC in reply to A. M. DeWitt from 03:11 PM:

It turned out that the order in which the various promotions were generated determined how clicks were mapped onto piece types, and this was different for promotions resulting from morph and from promoZone. Now it simply uses the type displayed in the square that was clicked.


Betza notation (extended). The powerful XBetza extension to Betza's funny notation.[All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Thu, Jun 13, 2024 12:06 PM UTC in reply to Aurelian Florea from 11:19 AM:

It seems you mean up to 3 times as a W/F, and that you also want the moves to be able to jump. When you already explicitly included the D/A, there is no need to indicate the jumping in the two-step descriptor. So this can simply be mcafW.

The 3-step move is more tricky, if you want to allow triple capture and combinations of jumping and capturing. Ideally this would be mpcafmpcafW, so that on every intermediate square it could either move, hop or capture. But not even the betzaNew.js script can handle that. For technical reasons moves with a destructive (c) and non-destructive (mp) non-final step have to be split, (non-destructive intermediates do not have to be clicked when entering the move), and the script only attempts one such a split. One of these days I should fix that; it is a legacy from the time where you could only have a single locust victim anyway.

But for now the combination cafmpcafWmpafmpcafW (where for the first leg the split has been made by hand, and each descriptor only needs a single split for the second leg, which can be done automatically) works.

Again ideally, the bracket notation for this would be H[cW-D][cD-W][cW-cW-W]. This is a more intuitive description, clearly mentioning all combinations of capture and jump. The [cW-D] component currently doesn't appear to work, though, and is treated as [cW-W]. Which is a bit of an omission, since [W-DD] and even [cW-DD] is understood correctly. Increasing stride in the bracket notation only appears to work when it occurs with a leap-rider transition. I should be able to fix that easily, even before there is a general implementation of the bracket notation.


💡📝H. G. Muller wrote on Thu, Jun 13, 2024 01:50 PM UTC in reply to Aurelian Florea from 01:46 PM:

Either write mpcafW (F), or add a D (A).


💡📝H. G. Muller wrote on Thu, Jun 13, 2024 08:07 PM UTC in reply to Aurelian Florea from 05:16 PM:

How do I put in the promochoice variable an piece that is represented by two letters?

Separate all pieces by commas.


Giant Chess. 16x16 board with the same pieces as Turkish Chess, but also the "Dev" piece which takes up four squares. (16x16, Cells: 256) [All Comments] [Add Comment or Rating]
H. G. Muller wrote on Thu, Jun 13, 2024 08:31 PM UTC:
satellite=giant files=16 ranks=16 promoZone=2 maxPromote=1 promoChoice=GSEQCMNRB graphicsDir=/graphics.dir/utrechtPNG/ squareSize=35 graphicsType=png?nocache=true whitePrefix=W blackPrefix=B theme=OS borders=0 firstRank=1 useMarkers=1 newClick=1 symmetry=mirror captureMatrix=/.^11=/" royal=11 Pawn::fmWfceFiifmnD::a5-p6 Elephant::mBcpB'pyafpyafcB::e3-f4,k3-l4 Shogi::mRcpR'pyafpyafcR:Cannon:a3-b4,o3-p4 Knight:N:::c1-d2,m1-n2 Bishop::::e1-f2,k1-l2 Rook::R::a1-b2,o1-p2 Minister::BN::g3-h4 Chancellor::RN::i3-j4 Queen::::g1-h2 General::QN::i2,j1,j2 King::KisO6::i1 Dev::D:GiantSW:c3,m3 value=350 Dev::D:GiantSE:d3,n3 value=350 Dev::D:GiantNW:c4,m4 value=350 Dev::D:GiantNE:d4,n4 value=350

This is a first attempt. The page contains JavaScript wrappers for the routines that perform and take back moves and the handler for mouse clicks. The Giant is represented by Vizirs on every square it covers. A 'first click' (for origin selection) on a Vizir is rounded to the lower-left corner of the 2x2 area. The move wrappers test whether the moving piece is a Vizir, and if so drags the other 3 with it after saving the old occupants of the destinations (to restore those on take back).

The remaining part is controlled by a custom routine giantTinker. For Vizir moves it suppresses those that are not left-corner. Moves with the latter are suppressed if there are friends in the destination area, and get a burn zone covering that area added when accepted.

Captures of a Vizir by other pieces are initially rejected, but backlogged in an array of spares. After move generation a newly ntroduced custom routine AddSpares (requires browser cache flush!) makes two passes through the list of spares; first it records all attacked squares, and then it test for every move whether all squares covered by the giant it hits are under attack. If so, the move is copied to the normal move list.

I did not address the issue of Cannons jumping over a Giant yet.


H. G. Muller wrote on Fri, Jun 14, 2024 08:25 AM UTC in reply to Bob Greenwade from Thu Jun 13 09:11 PM:

The problem with composit images is that flip view destroys them...


H. G. Muller wrote on Sat, Jun 15, 2024 09:15 AM UTC in reply to H. G. Muller from Thu Jun 13 08:31 PM:

I think the hopper moves are now properly implemented too. I had to make an innocent extension to the standard script, making the move generation remember the location of the latest mount used by a hopper, so the Tinker routine could use it. (Only done when the captureMatrix contains a hop ban, so for most variants no slowdown at all.) I also had to alter the way 'primed' moves were exempted from morphing and capture matrix, so that it would not exempt them from a custom Tinker script as well.

This enabled the custom Tinker routine to test whether the proposed capture of a Giant was made by a hopper, and if so, whether the mount was that same Giant. If so, the move is rejected. This prevents the normal hops cpB and cpR to 'backstab' a Giant. To hop the Giant an extra move pyafpyafcB or pyafpyafcR was added, and the captureMatrix was used to ban hopping over other pieces than Giant (but priming the single hop so that this ban does not apply to it).

The only thing that still doesn't work is promotion to Dev. I am not sure this is worth worrying about. This promotion is a bit ill-defined anyway. (What if there are opponents in the area where the Dev should materialize? Are these captured by the Pawn move?)

Other issues: It is also unclear whether the pieces that provide 'capture assist' by threatening the Dev should do this by pseudo-legal or by legal moves. I assumed pseudo-legal. 'Castling as in orthodox Chess' is impossible, or at least ambiguous, as the Rooks are further away here. Does the King move as in FIDE (i.e. two squares), or the Rook (i.e. producing the same final position as in FIDE). I assumed the latter. Can both Rooks on the back-rank castle, or just those in the corner? (Again I assumed the latter.) Why promotion on the last two ranks? The Pawns only move in steps of 1 there, and they never can get to 16th if they already promote on 15th. Even if they would be allowed to defer there, no one would do that.


H. G. Muller wrote on Sat, Jun 15, 2024 04:12 PM UTC in reply to Bob Greenwade from 04:08 PM:

Remind me, which variant had these (Great) Walls? I know I have seen those, but cannot remember the name.

Some of the code I had to add for getting the Devs to work is very specific for this variant. E.g. it uses the fact that the multi-square piece can only move in steps of its own size.


H. G. Muller wrote on Sat, Jun 15, 2024 06:36 PM UTC in reply to Bob Greenwade from 04:46 PM:

That capture of any of its 'components' can already capture the Wall makes its implementation simpler than that of a Dev, (all  moves can be judged on their own merits), but the fact that it has a sliding move makes it harder: one would not only have to test for blocking of other components on the destination area, but in the entire area swept by the move.

BTW, it is not clear to me how a Wall would capture when it moves in its long direction. I would say it can capture only a single piece then.

Multiple Walls would have to be represented as different types, to prevent that components of different Walls would be mistaken for a single Wall. (E.g. if one stands on e3-f3 and the other on e4-f4.

Remapping of clicks is not really necessary, if one uses the convention that each component can move only in the opposit direction as the other.

There would have to be wrappers for the routines that perform or take back moves, to drag along the companion component.

Testing for the blocking can be done with XBetza. For moving in its long direction there is nothing to worry; the activated component can hop over its companion with a back-and-fort W move, and then continue like a Rook (pabyafR, with a hop ban for all types other than its own). For the 'double-barrel' move you can make a detour that travels over both paths: first hop onto the companion, slide to the right, moving or capturing, take an 'iso' slide back to make that a rifle move, turn left to step back to the origin, and turn left again for another iso slide. So pyarmcaibpyalyailW.

As mentioned before, rotation could simply be pasW, again banned for hopping over all types except its own.


Tenjiku Shogi. Fire Demons burn surrounding enemies, Generals capture jumping many pieces. (16x16, Cells: 256) [All Comments] [Add Comment or Rating]
📝H. G. Muller wrote on Sun, Jun 16, 2024 05:38 AM UTC in reply to A. M. DeWitt from Sat Jun 15 08:08 PM:

The hit-and-run captures are not indicated in this move diagram. Note there is no need to squeeze all possible moves in a single diagram, in a rules explanation. For strongly overlapping moves doing so would result in indecipherable spaghetti. Much better to use as many diagrams as is needed to make each of those clear and easy to understand.

In the Interactive Diagram the move diagrams initially only indicates plain (non-)captures, plus potential hopper mounts and locust victims. The destinations of the latter only appear when you materialize an opponent piece on them by hovering/touching. I think that in the case of static diagrams it would be best to provide a separate diagram for cases where presence of a piece is needed to activate a move to a square elsewhere, and only indicate the squares where this can happen by a special marker symbol in the primary diagram. Or even with a background color, so they can combine with plain moves to the same square.

Of course we could consider including interactive move diagrams in Jocly rule descriptions, similar to those that can be summoned in the Interactive Diagram.


Betza notation (extended). The powerful XBetza extension to Betza's funny notation.[All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Sun, Jun 16, 2024 06:18 AM UTC in reply to Bob Greenwade from Sat Jun 15 05:15 PM:

General implementation of the bracket notation might make some of this unneeded. I mean, [K?fsQ] for Gorgon seems clear enough; why would you need a special notation (which no one would know or remember) for such a rarely used piece? The Griffon is much more common. The 'again, including backwards' issue also solves itself in bracket notation, where you would simply prefix the continuation leg with ab.

Problem with null move is indeed how to enter it, not how to describe it. An unconditianal null move could be assigned to the King, but that is just a kludge, as a null move cannot really be assigned to any piece. There could also be a parameter allowPass=1 to enable null moving, which could then provide an extra button to play it, rather than a tricky combination of board clicks that users might not be aware of. Because there is no enforcement of turn order, turns can always be passed when the AI is off. And when the AI is on there could be a button 'Pass' next to the button 'Move', which would do the same, but for the other player. Of course some provision for this should be made as well in the game notation.

The zig-zag/circular slides now use a different internal representation than other (more general) multi-leg moves. This is undesirable, and should be integrated. The whole problem can be reduced to the possibility for optional early termination of a multi-leg sequence. Using parentheses re-introduces the problem that the special z/q representation tried to solve, namely that slides are expanded into different, strongly overlapping lame leaps. Which makes move generation very inefficient. Problem is that the parentheses often indicate early termination of a sequence of intermediate legs, which must still be followed by a final one. (Which makes them similar to hook movers.) So it is not really an 'early termination' of a longer move. If the entire path was precomputed (maximum number of repeats) there should be a provision for optionally skipping a number of legs, to continue with the final part.

I once coined the idea to use the E atom in the bracket notation for a null leg on an edge square. Which would make the Edge Hog simply [E-Q][Q-E]. Using a semicolon separator in the bracket notation for indicating the remaining legs are for 'shooting only' would probably solve the crooked rifle-capture problem. The modifier cc could then be used for indicating a juggernaut leg, like pp could be used for hopping over arbitrary many.


25 comments displayed

EarliestEarlier Reverse Order LaterLatest

Permalink to the exact comments currently displayed.