Check out Glinski's Hexagonal Chess, our featured variant for May, 2024.


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

Comments/Ratings for a Single Item

Earlier Reverse Order Later
Question for HG Muller[Subject Thread] [Add Response]
wdtr2 wrote on Mon, Sep 11, 2023 03:08 AM UTC:

First of all Jocely is awesome. I am playing chu shogi on Jocely, and using the 2d symbols on the board when I play. I'd like to design my own 2d piece set. If I download jocely at git hub, does it contain the existing symbols for 2d chu shogi jocely game? If yes, it will make my life easier, I can just edit each piece one at a time. If I design a new chu shogi piece set, would you be willing to add it to CV?


H. G. Muller wrote on Mon, Sep 11, 2023 06:19 AM UTC in reply to wdtr2 from 03:08 AM:

Jocly on github won't include Chu Shogi; it is one of the games I added. I do have a Jocly repository on my own website hgm.nubati.net, which does contain some of the modifications I made. Not all, though, as I originally started by hacking the compiled code, and never finished backporting all that to source code. So I am not sure whether that source would do Chu Shogi.

In any case, Jocly does not contain a 2d piece set especially for Chu. What I remember is this: each game can specify an image file as 'resource', which then contains all the 2d piece images it uses, side by side on a transparent background. For each piece type the game definition contains the number of the piece in that file; apparently the Jocly generic code cuts the piece out of the image, and pasts it on the board it displays.

My Chu implementation uses the standard file with Jocly 2d pieces, ( http://hgm.nubati.net/jocly/jocly-master/dist/browser/games/chessbase/res/fairy/wikipedia-fairy-sprites.png in the Jocly library on my website) which I had extended with a few pieces for other games I implemented. The way to go seems to make an alternative to that file, perhaps by copying and modifying it, and then point the Chu game definition to that file instead of the standard one. If needed by directly editing the Jocly library.

I admit that the current assignment of 2d symbols to the Chu-Shogi pieces sucks. I really only payed attention to creating the 3d kanji tiles. To qualify for incorporating Chu Shogi in the official library I suppose it should use kanji tiles in the 2d representation as well. But I dislike kanji representations, like all westerners other than the miniscule community of non-Japanese Shogi players, so it seemed a good idea to use the 2d representation as an alternative. Personally I would prefer the mnemonic representation for that, but a poll under Chess players revealed they would prefer a pictogram representation, where the symbols are a reminder for the name rather than the move of the piece.


wdtr2 wrote on Mon, Sep 11, 2023 08:29 PM UTC in reply to H. G. Muller from 06:19 AM:

Thank you. I'll try to pull the png. The 2d does not suck, it is pretty good. There are some pieces that I just want to adjust, like the existing camel, and knight. I see the camel and expect 1x3, and the knight 2x1 leap. There a no knights in chu, so the computer often makes a move that I don't expect because I am thinking knight. I really dislike kanji tiles because I can't easily identify one from the other, and if you flip it, whoa! :)

Question: the png file seems to contain everything. at CV the PHP code expects a seperate png/jpg file for each piece and there is some file that glues it all together. Do I need to make about 80 png files including flipped images, or is the code so advanced that somehow jocely can dice and slice the png file and make each piece off that one file?


H. G. Muller wrote on Tue, Sep 12, 2023 07:13 AM UTC in reply to wdtr2 from Mon Sep 11 08:29 PM:

Well, what sucked was the fact that for shortage of piece images I had to assign some images with a strong association to a move to a completely different piece. Such as the Camel and Knight that you mention.

And indeed, Jocly slices the desired part out of a file that contains all pieces. The instructions for which area to take out of the file are in the game's *-view.js file. It appears that I indeed did not backport Chu Shogi to source code yet, but in the library file http://hgm.nubati.net/jocly/jocly-master/dist/browser/games/chessbase/chu-chess-view.js you can see how the association is made by searching for 'sprites' on that page. There you find something like (reformatted for the purpose of showing here):

View.Game.cbFairyPieceStyle=function(e){
return $.extend(!0, {
      1: {default:{"2d":{clipy:0}}},
    -1": {default:{"2d":{clipy:100}}},
  default: {
        "3d":{display:this.cbDisplayPieceFn(this.cbFairyPieceStyle3D)},
        "2d":{file:this.mViewOptions.fullPath+"/res/fairy/wikipedia-fairy-sprites.png",
              clipwidth:100,
              clipheight:100
             }
  },
"sh-pawn":{"2d":{clipx:0}},
"sh-shuttle":{"2d":{clipx:2700}},
"sh-copper":{"2d":{clipx:2400}},
"sh-silver":{"2d":{clipx:900}},

The clipwidth, clipheight, clipy and clipx parameters specified there determine which part of the image should be used. Apparently the square size is 100 x 100 pixel here.

Rather than replacing some of the pictograms in the file, I would recommend extending the file with some new pictograms on the right, and then modify the code in chu-chess-view.js to use those image for the corresponding pieces by changing their clipx.


wdtr2 wrote on Tue, Sep 12, 2023 11:37 PM UTC in reply to H. G. Muller from 07:13 AM:

Awesome. Thank you so much for explaining this. :) Well I now have a new task to add to my "to do" list.


wdtr2 wrote on Tue, Sep 26, 2023 01:03 AM UTC:

https://drive.google.com/file/d/1cSkfAJcEivziYg9H9zpJr-piTqZsFrnw/view?usp=drive_link

Hello, the link above is for my google drive. That folder should have 1 png picture. About two weeks ago I asked about Jocely and Chu shogi. In particular the 2d pieces, and How I would like to make my own piece set. You gave me part of the java script code and a png file. The picture is my progress so far. I'm taking the CV chu set and enlarging it and adding color. The pieces will be 100px by 100px. I've only made a few pieces so far. I wanted to see if you think this is ok or a hunk of junk! My goal is to eventually get this in jocely so that the 2d pieces are less confusing to me. :) If I get the OK from you I will keep going an merge all the pics into 1 ribbon pic, just like the one you have right now. I dont see any advantage in appending these new pics into the existing 2d pic ribbon that came from wiki. (you suggested that I do that). So should I keep going in my direction?


H. G. Muller wrote on Tue, Sep 26, 2023 08:13 AM UTC in reply to wdtr2 from 01:03 AM:

Well, I am sorry to say they mostly qualify as junk. The 100x100 images have a much lower resolution than that, and seem to be blow-ups of a 50x50 image. The Queen image is slightly better; even though it is not anti-aliased it at least really has full resolution; if it would be displayed at smaller size (which Jocly would), averaging the combined pixels would create intermediate colors as a poor-man's alternative for anti-aliasing. But the letter Q on the tile is of course much too small. (That also applies to DK.)

I don't really see the point of using shogi tiles for any representation other than traditional kanji pieces. The tile background hardly conveys any information on piece identity (even if the sizes are slightly different this is quite hard to notice), and take away at least half the area that would have been available for the distinguishing features of the pieces. Furthermore they are a very player-unfriendly method of distinguishing the side they play for; unlike noticing deviating color, for which the human brain can use parallel processing, recognizing orientation requires focus of attention.

So even if the image quality would be perfect (i.e. high resolution anti-aliased), I would still not be very enthusiastic about the design.


wdtr2 wrote on Wed, Sep 27, 2023 10:12 AM UTC in reply to H. G. Muller from Tue Sep 26 08:13 AM:

ok, that is why I checked. :) I'll try again.


8 comments displayed

Earlier Reverse Order Later

Permalink to the exact comments currently displayed.