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
Megalomachy. A huge game with 2x80 pieces, some able to jump over many others. (16x16, Cells: 256) [All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Sun, Apr 21, 2024 04:22 PM UTC in reply to Aurelian Florea from 08:08 AM:

You must only paste the name=value and piece lines, which normally are between HTML <div> and </div> tags. The script line is not part of the Diagram definition; it specifies to the browser what script to run to create an I.D. on  the page. Something the GAME code would never have to do.


💡📝H. G. Muller wrote on Mon, Apr 22, 2024 06:31 AM UTC in reply to Aurelian Florea from Sun Apr 21 06:57 PM:

Strange that it doesn't work for you. When I copy-paste the I.D. definition into the PTA directly from the Page Source (from the line satellite=megalo to the line king::KispO9::k1) I do get a 16x16 board with the Megalomachy setup. It doesn't look very well, because even the specified squareSize of 33x33 is too large to fit it on the PTA page, and the I.D. in the Megalomachy article uses the 50x50 alfaerie pieces. Because it also uses betzaNew.js it automatically shrinks those images to fit the squares, but the PTA still uses betza.js, which doesn't do that, but clips the pieces instead. But that should not affect the generation of GAME code.


💡📝H. G. Muller wrote on Mon, Apr 22, 2024 07:42 AM UTC in reply to Aurelian Florea from 07:10 AM:

I get this error:

Cannot make a diagram with 0 pieces on an 8x8 board!

It probably means that you copy a lot of invisible stuff together with the Diagram definition; the line below the quoted error message makes an attempt to show you what you actually pasted. If I copy-paste directly from your latest comment into the PTA, I also get the error message, and for the pasted text it says:

<main><article id="maincontent"><div class="commentgroup"><div class="Comment"><div><table><tbody><tr><td class="line-content">satellite=megalo</td>...

So there is an enormous amount of HTML garbage prefixed and interleaved with the actual definition, and the PTA chokes on it. What exactly corrupts the Diagram definition might depend on your browser. I made the PTA resistant to the garbage that is added by copying from a FireFox Page Source (but you might have to flush the browser cache to benefit from that?)

Anyway, the safest method is to first paste the Diagram definition into NotePad;this will cleanse it of most invisible stuff. Then you can copy-paste it from there into the PTA.


💡📝H. G. Muller wrote on Mon, Apr 22, 2024 12:06 PM UTC in reply to Aurelian Florea from 11:30 AM:

link?


💡📝H. G. Muller wrote on Mon, Apr 22, 2024 03:12 PM UTC in reply to Aurelian Florea from 11:30 AM:

The correct query for opening the preset in Edit mode is &submit=Edit, not &edit=true.

The problem appears to be the fast castling, and now that I think about it, I believe I never implemented fast castling in the betza.txt GAME-code include file. So the entries in the legdefs table that would be interpreted by the JavaScript powering the Interactive Diagram as fast castling are mistaken for something that makes the GAME code crash.

For now I recommend commenting out the four lines that define the fast castling at the end of legdefs, like:

1  1 -1  1     3
//2 99  1  0    88
//   1  9  0    25
//2 99 -1  0    88
//   1 -9  0    25
0);

The King will then not be able to castle, but at least you can continue implementing the other aspects of the variant in the preset. In the mean time I will try to support fast castling in betza.txt. And when I have done that, you can uncomment the lines again.

 


Play Chess Variants with Jocly. Missing description[All Comments] [Add Comment or Rating]
H. G. Muller wrote on Tue, Apr 23, 2024 07:31 AM UTC in reply to A. M. DeWitt from Mon Apr 22 10:33 PM:

You also have to add a line to /play/jocly/dist/browser/jocly-allgames.js to make Jocly notice the files that you placed in /play/jocly/dist/browser/games/chessbase/ . I think Fergus exempted the Jocly files from CloudFlare caching, so you should see new games immediately after flushing your browser cache. To do that I sometimes have to access the modified .js files (including jocly-allgames.js) directly with the browser.

Unfortunately the wikipedia-fairy-sprites.png file on CVP is not entirely compatible with the one that is now in the source repository.


H. G. Muller wrote on Tue, Apr 23, 2024 07:56 AM UTC in reply to Jean-Louis Cazaux from 05:18 AM:

Where can your work on Jocly with François, HG, can be found?

That depends on what exactly you want. The source code is in my on-line git repository, but it is currently not possible to view that interactively on line because the hosting company disabled the viewer for that ('GtitWeb'), and I haven't had time to fix that. It is still possible to pull from the repository with 'git', to view the source code locally. And I suppose François has a mirror of it on GitHub.

If you want to see a running install featuring the newly added games, you can use the one on CVP (just select any of the dedicated variant links on the Jocly overview page, and then click 'other jocly games' at the bottom right to select a game), or the one on my website, which are old Jocly installs that I hacked to add some variants. I suppose that François has put up a version directly compiled from the most recent source code somewhere.


Megalomachy. A huge game with 2x80 pieces, some able to jump over many others. (16x16, Cells: 256) [All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Tue, Apr 23, 2024 08:43 AM UTC in reply to Aurelian Florea from Mon Apr 22 12:07 PM:

I have made an attempt to support fast castling in the betza.txt GAME-code include file. I could not test it in the context of your preset, though, because there seems to be a mismatch between the labels used in the I.D. that youconverted, and the piece set you use in the preset. So it still crashes because of an unknown piece 'E'. I suppose you would have to use the custom set as the PTA suggests it to make it work.

Anyway, to try the fast castling you should replace the lines

2 99  1  0    88
   1  9  0    25
2 99 -1  0    88
   1 -9  0    25

at the end of the legdefs array by

1 -3  1  0 FastCastle
1 -3 -1  0 FastCastle

This uses the existing mechanism for invoking dedicated routines for generating piece moves. But the routine FastCastle, which is invoked by this, is already supplied in the betza.txt include file.

I still have to adapt the PTA to generate these lines automatically, when encountering a fast castling.

 


💡📝H. G. Muller wrote on Tue, Apr 23, 2024 09:58 AM UTC in reply to Aurelian Florea from 09:44 AM:

Oh, that seems a lot of work. But I'll do it in the evening!

Not really. You should just select the Completely Custom set, and then paste the set definition the PTA suggests into the preset.


Play Chess Variants with Jocly. Missing description[All Comments] [Add Comment or Rating]
H. G. Muller wrote on Tue, Apr 23, 2024 11:21 AM UTC in reply to A. M. DeWitt from 10:37 AM:

Apparently the jocly.game.js was still the original one from 2017. The addition of LetsTwist (to make the Mersenne Twister random generator available to the game-specific code) is the only modification I ever made in the Jocly core. I have now replaced that file with the one on my website; this should make it work.


H. G. Muller wrote on Tue, Apr 23, 2024 12:17 PM UTC in reply to Jean-Louis Cazaux from 11:48 AM:

As the matter of fact, why don't you update that page "Play Chess Variants with Jocly" which was listing all available games until last year?

The problem is that it is a matter of taste what 'available game' means. The Jocly applet itself allows you to select any game that is implemented, through the 'other jocly games' link. But this applet is not able to show rule descriptions or credits, which are also available for most of these games in the Jocly source package.

Therefore Fergus created separate HTML pages for individual variants, which embed the Jocly applet preconfigured to run the corresponding variant, with a rule description. The overview page you refer to contains links to those individual game pages.

In general the reason for there being no link to a certain variant in this overview page is that there doesn't exist such a separate HTML page for that game yet. Someone would first have to create those pages.


H. G. Muller wrote on Tue, Apr 23, 2024 01:30 PM UTC in reply to A. M. DeWitt from 12:25 PM:

Edit: Also, Hectochess doesn't have the 3d Queen, Marshall, and Cardinal for some reason...

Indeed, I noticed that too. I did upload a newer fairy-sprites file, and that made the Champion and Wizard appear.

[Edit] OK, that should be fixed now too. Hectochess was using the proper-*.js files for these 3d pieces, which differ from the original ones by a scale factor, to give them a more natural size. But these were not present on CVP.

[Edit2] I now moved a lot of the new 3d pieces to the CVP Jocly install as well. I had never payed much attention to the version here as far as updates go, because the CloudFlare caching made it pracically impossible to see any changes. But now that Fergus has exempted Jocly from this, it makes sense to bring the version here up to date as well. Makromachy already works. For Minjiku Shogi some of the promoted pieces seem to be still missing.


Megalomachy. A huge game with 2x80 pieces, some able to jump over many others. (16x16, Cells: 256) [All Comments] [Add Comment or Rating]
💡📝H. G. Muller wrote on Tue, Apr 23, 2024 02:59 PM UTC in reply to Daniel Zacharias from 01:53 PM:

I suppose that would heve worked, if you did that as first thing in the Post-Move sections. But I have already changed the betza.txt to use different arrays for the capturer and the victim. So now you have to put in Pre-Game:

set protected (T t);
set restricted (EA T ea t);

💡📝H. G. Muller wrote on Tue, Apr 23, 2024 03:53 PM UTC in reply to Aurelian Florea from 03:06 PM:

You must also put

set opaque (EA FA BA SM AR ea fa ba sm ar);

there to make the flying pieces block each other.


Square Root Chess. Chess on a ladder-alike tilted board. (8x8, Cells: 64) [All Comments] [Add Comment or Rating]
H. G. Muller wrote on Wed, Apr 24, 2024 06:45 AM UTC:
files=15 ranks=8 promoZone=1 promoChoice=NBRQ graphicsDir=/graphics.dir/alfaeriePNG/ squareSize=50 graphicsType=png lightShade=#000000 darkShade=#ffffff firstRank=1 borders=0 useMarkers=1 rimColor=#c0c0c0 holeColor=#c0c0c0 symmetry=none royal=K hole::::a1-d4,l5-o8,e1-f2,a5-b6,n3-o4,j7-k8,a7,c5,e3,g1,i8,k6,m4,o2 pawn:P:iiflmnDflmWflceF:pawn:g2,h2,i2,j2,k2,l2,m2,n2,,b7,c7,d7,e7,f7,g7,h7,i7 knight:N:N:knight:i1,n1,,b8,g8 bishop:B:B:bishop:j1,m1,,c8,f8 rook:R:R:rook:h1,o1,,a8,h8 queen:Q:Q:queen:k1,,e8 king:K:KisO2:king:l1,,d8

H. G. Muller wrote on Wed, Apr 24, 2024 07:02 AM UTC in reply to HaruN Y from 06:49 AM:

I beat you by 4 minutes! :-)

It is interesting how we both chose a different rectification of the board; mine spoils the coordinates, yours spoils the moves of the pieces. In your representation it would in principle be possible to use a whole-board image as background that has the original diamond-shaped cells.

I tried using the Atlantic SVG set through fen2.php, but this set is not suitable for use on a black-and-white board. (Alfaerie doesn't do so well either, on the dark squares...)

[Edit] Concerning Pawn: Ah yes, I had overlooked that detail in the description. Thanks!


Play Chess Variants with Jocly. Missing description[All Comments] [Add Comment or Rating]
H. G. Muller wrote on Wed, Apr 24, 2024 08:33 AM UTC in reply to A. M. DeWitt from Tue Apr 23 08:34 PM:

There appears to be a mismatch between the shogi graphics on CVP and that in the current source code. On CVP there are directories .../chessbase/res/shogi and .../chessbase/res/shogi2. The first contains the tile meshes and diffusemap for mini-Shogi, the second for Chu and Tenjiku Shogi. The current source code was derived from the latter, even though it reorganized the location where the diffusemaps are stored.

The problem occurs because the newly made Seireigi diffusemaps are made according to the Tenjiku design, (and placed so the view files can find them), but use the mini-Shogi tile mesh files. And it appears that these mesh files specify the use of a different part of the diffusemap for painting the top face: the mini-Shogi tiles use the top-left quarter, while the Chu-Shogi tiles use the bottom-left quarter of the maps.

I fixed the problem by editing the chu-seireigi-view.js file, to make it use the mesh files from the shogi2 folder. The kanji then appear. But apparently not all mesh files used by seireigi are there, as some of the pieces now disappear completely.

[Edit] The problem was in the map files: some Seireigi pieces use the diffusemap of Chu-Shogi pieces, and these are in a different location on CVP from where they are in the current source code (and have different filenames too). I adapted the path for the diffusemaps of Copper, Kirin, Phoenix, Lion and Queen to where these images are on CVP, and now the initial position of Chu Seireigi is correctly displayed.


Chu Seireigi. Variant of Chu Shogi playable with drops. (12x12, Cells: 144) [All Comments] [Add Comment or Rating]
H. G. Muller wrote on Wed, Apr 24, 2024 01:51 PM UTC:

Note that it is possible to control the way the captured pieces are placed next to the board by defining arrays Model.Game.handLayout[color][handIndex]. This array should contain the square numbers where you want the first captured piece of the given color (1 or -1) and hand value to be placed. (A second piece will be placed at sqr+color, and after that counters will appear between the two shown pieces.)

Currently the default assignment is used, which places the white pieces on the first 'file' on the right of the board, the hand number equal to the rank number (which starts at 0). By defining a handLayout you could also use the ranks under or above the board to place pieces, thus requiring fewer extra ranks.

E.g. with a single extra rank (instead of the 4 you have now) you could place 6 white pieces below the board, and 14 white pieces to the right of the board.


H. G. Muller wrote on Wed, Apr 24, 2024 05:59 PM UTC in reply to François Houdebert from 04:18 PM:

No, you have to write something like

Model.Game.handLayout[1] = [0,2,4,6,8,10,12,14,30,46,62,...];

if you want the first 8 'hand squares' for white to be at the bottom, and the rest along the right edge.


H. G. Muller wrote on Thu, Apr 25, 2024 07:02 AM UTC in reply to François Houdebert from Wed Apr 24 09:15 PM:

I guess the drop model still needs some tweeking. The square painting on the hand ranks should be the same as that of the other hand squares. Now there seems to be no coloring at all, so that the rim texture shines through. I suppose the logical way to do this is that the square-painting array that has to be defined in the game's view file should include the extra ranks.

It is also not clear to me why the 'counter piece' in the lower-right corner is larger than the others.

[Edit] The array boardLayout defined in the view file is accessed in two places in grid-board-view.js, inside nested loops over rows and columns. The loop over rows was modified to skip the extra hand ranks. I suppose this was a bad idea; especially in the 'paintCells' function it should have run over all ranks, requiring the boardLayout to also specify how the cells in these extra hand ranks should be colored. There is a second routine 'paintInCoordinates' that also loops over all cells, which does more complex things and might need more subtle modification than just changing the loop limits. But it seems this function is not normally used.

The handLayout[-1] in the view file appears to have a 16 where there should be a 17, which causes misplacement of the 'counter piece' on 15 rather than 16.


H. G. Muller wrote on Thu, Apr 25, 2024 09:37 AM UTC in reply to François Houdebert from 08:41 AM:

I think that all that is needed is to make the 'row' loop run from 0 to NBROWS, and remove the -NBVHND from

this.cbView.boardLayout[NBROWS-NBVHND-row-1][col]

 And then putting the extra hand ranks in the boardLayout defined in the game's view file. I don't think there are any other games yet that use extra hand ranks. I implemented that feature with Wa Shogi in mind.

The paintCells function is not involved in drawing the grid.

I had already looked at the sources, by looking at the chu-seireigi-view.js of the compiled version. Since you build Jocly without uglification all used source files are in there unmodified.


H. G. Muller wrote on Thu, Apr 25, 2024 11:32 AM UTC in reply to François Houdebert from 10:22 AM:

Uncaught TypeError: this.cbView.boardLayout[((NBROWS - row) - 1)] is undefined

This sounds like an out-of-bounds access on boardLayout. Are you sure you defined that array with sufficiently many ranks? To further diagnose the problem you could add console.log(NBROWS-row-1); just before the access to boardLayout in paintCells; then you could see in the console  what the offending value is.


H. G. Muller wrote on Thu, Apr 25, 2024 12:30 PM UTC in reply to François Houdebert from 11:54 AM:

Strange. 13 should be a valid index for an array of length 19. That means the array should have some internal elements that are undefined. What happens if you print

console.log( this.cbView.boardLayout )?


H. G. Muller wrote on Thu, Apr 25, 2024 01:47 PM UTC in reply to François Houdebert from 12:40 PM:

Should I add : Should I add " ##############" before and after?

Indeed, you should, because you want the extra hand ranks to be colored black as well.


H. G. Muller wrote on Sat, Apr 27, 2024 04:45 PM UTC in reply to François Houdebert from 04:10 PM:

The Wikipedia has it that the player with the weakest player has the Jade General, and the strongest player the King. I am not sure if and how we should implement that in Jocly.


25 comments displayed

EarliestEarlier Reverse Order LaterLatest

Permalink to the exact comments currently displayed.