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


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

Comments/Ratings for a Single Item

EarliestEarlier Reverse Order LaterLatest
Play Chess Variants with Jocly. Missing description[All Comments] [Add Comment or Rating]
François Houdebert wrote on Mon, Feb 19, 2024 08:48 AM UTC in reply to H. G. Muller from Sun Feb 18 08:22 PM:

the fact that you're experimenting explains the change in behavior when the fire demon attacks the king, which was resolved yesterday but no longer today.


H. G. Muller wrote on Mon, Feb 19, 2024 09:02 AM UTC in reply to François Houdebert from 08:48 AM:

I am not sure what isn't resolved in that respect. if I capture the Phoenix, at level Medium Jocly plays FD-e4 (which checks by burning), and prints "A wins", which should be considered a resign. This behavior is different from what it was, but not wrong. It is a consequence of that it now detects the king capture earlier, when it generates the moves for white after it moved his Demon, rather than detecting it only afterl the King capture has been played (by the user).

I think this is acceptable behavior in games where you win by King capture, although it might be considered a bit peculiar that it plays a move together with the resign.

What still isn't resolved is that after loading the game in Self/Self mode, the black Demon is highlighted in white's turn, and that white can move it as if it is a Pawn.

Oh, and there are no separate sprites for unpromotable Falcon and Eagle. I forgot those, because in Chu Shogi it isn't in issue.


François Houdebert wrote on Mon, Feb 19, 2024 11:59 AM UTC in reply to H. G. Muller from 09:02 AM:

that's not what I see, if I capture the Phoenix, at level Medium Jocly plays FD-d5 and start a cycle of attack against the white king.

But may be your personnal site is not updated yet?

Don't hesitate to add missing sprites if necessary.


H. G. Muller wrote on Mon, Feb 19, 2024 03:33 PM UTC in reply to François Houdebert from 11:59 AM:

The version on hgm.nubati.net is the only one I updated. (Not entirely true; I updated the one on CVP for the new sprites. But it can take weeks before anyone will be able to enjoy updates on CVP, because they will all be redirected to CloudFlare, which caches the old files for an unpredictable amount of time.)

If you look at http://hgm.nubati.net/jocly/jocly-master/dist/browser/games/chessbase/tenjiku-chess-model.js you should see for GenerateMoves():

Model.Board.GenerateMoves=function(t){
 var e=this.cbGeneratePseudoLegalMoves(t),ok=0;
 this.mMoves=[];
 for(var r=!0,i=this.kings[this.mWho],a=e.length,n=0;n<a;n++){
  var s=e[n]
  if(this.kings[-this.mWho]==s.t){this.mMoves.push(s),this.mFinished=!0,this.mWinner=this.mWho;return;}else{
   if(ok)this.mMoves.push(s);else{
    var o=this.cbQuickApply(t,s);
    if(!(this.cbGetAttackers(t,this.kings[this.mWho],this.mWho,!0).length>0)){
     var h=this.cbGetAttackers(t,this.kings[-this.mWho],-this.mWho,!0).length>0;
     s.ck=h,this.mMoves.push(s),ok=1,s.f!=i&&(r=!1)
    }
    this.cbQuickUnapply(t,o)
   }
 }}
 if(0==this.mMoves.length){
  if(this.check===undefined)this.check=this.cbGetAttackers(t,this.kings[this.mWho],this.mWho,!0).length>0;
  this.mFinished=!0,this.mWinner=t.cbOnStaleMate?t.cbOnStaleMate*this.mWho:JocGame.DRAW,this.check&&(this.mWinner=-this.mWho);
 }else if(this.ending[this.mWho]){
  if(!r)for(var n=0;n<this.mMoves.length;n++)this.mMoves[n].ko=!1
 }else if(!this.ending[this.mWho]&&r&&!this.check) for(var n=0;n<this.mMoves.length;n++)this.mMoves[n].ko=!0
},

If not, you have an old version cached.

 


🕸Fergus Duniho wrote on Mon, Feb 19, 2024 05:04 PM UTC in reply to H. G. Muller from 03:33 PM:

it can take weeks before anyone will be able to enjoy updates on CVP, because they will all be redirected to CloudFlare, which caches the old files for an unpredictable amount of time.

Include a query string in the call to the script, and you should be able to bypass the CloudFlare cache. And if that doesn't work, change the query string, such as by including a uniqid parameter with a different value. The last time I changed movepiece.js for Game Courier, I just clicked on "Reload Skip Cache" in Firefox, and it used the new version right away.


François Houdebert wrote on Mon, Feb 19, 2024 07:01 PM UTC in reply to H. G. Muller from 03:33 PM:

Correct! It was a cache issue.


H. G. Muller wrote on Mon, Feb 19, 2024 07:41 PM UTC in reply to Fergus Duniho from 05:04 PM:

Include a query string in the call to the script, and you should be able to bypass the CloudFlare cache.

The problem is that you cannot do that with Jocly. You can do it on the page it is embedded in, for sure, but when you start it, it will load all kind of JavaScript and image file in the background, the name of those files often read from other json files, where it derives the filname by manipulation of strings in JavaScript. (E.g. concatenating the game name with some postfix.) It is an incredibly complex mess, and Jocly won't append a query string to any of it.


🕸Fergus Duniho wrote on Mon, Feb 19, 2024 07:57 PM UTC in reply to H. G. Muller from 07:41 PM:

I created a rule to bypass the cache for anything with "jocly" in the URI path.


H. G. Muller wrote on Mon, Feb 19, 2024 09:50 PM UTC in reply to Fergus Duniho from 07:57 PM:

Great. That means we can now also easily upgrade Jocly on CVP.

Tenjiku Shogi here now shows the new sprites. (But not the very newest; only those I uploaded last week.) I will upload the latest sprites, model and view file tomorrow.


A. M. DeWitt wrote on Fri, Feb 23, 2024 02:29 PM UTC in reply to H. G. Muller from Mon Feb 19 09:50 PM:

The new Tenjiku sprites look great. Can we also get similar versions for Chu Shogi, Shogi, and Mini Shogi?

Also, the new cache rule for jocly means we can fix the Two Pawns bug in Shogi and the Three Swallows bug in Tori Shogi (the former doesn't apply to Mini Shogi). If it involves switching lines, I could fix it right now for you, if you tell me which lines to swap.


H. G. Muller wrote on Fri, Feb 23, 2024 04:03 PM UTC in reply to A. M. DeWitt from 02:29 PM:

I swapped the lines now myself.

[Edit] And they now also all use the tenjiku sprites. For Mini-Shogi this is not ideal, though, as the variants of regular Shogi need many different Gold Generals, rather than just a promotable and an unpromotable one. So I had to improvise, and used the Man symbol for the promoted Silver.


A. M. DeWitt wrote on Sat, Feb 24, 2024 03:58 PM UTC in reply to H. G. Muller from Fri Feb 23 04:03 PM:

François Houdebert also made Shogi sprites for use in his Shogi jocly implementations that can easily be used for this site's Shogi and Mini Shogi implementations, although some minor tweaking may be needed for the promoted Lance/Knight/Silver.


François Houdebert wrote on Sun, Feb 25, 2024 04:50 PM UTC in reply to A. M. DeWitt from Sat Feb 24 03:58 PM:

here's the latest version of the sprites  I use for shogi.

To identify the promoted silver, we could also consider putting color on 2 stars?


🕸Fergus Duniho wrote on Sun, Feb 25, 2024 05:15 PM UTC in reply to François Houdebert from 04:50 PM:

here's the latest version of the sprites I use for shogi.

Do you play Shogi with those pieces yourself, or do you just think they are good enough for other people?


François Houdebert wrote on Sun, Feb 25, 2024 05:25 PM UTC in reply to Fergus Duniho from 05:15 PM:

It's an attempt to find a more accessible representation to accompany the reference implementation for the drop model that HG Muller gives to Jocly. So yes, for the moment I'm using it, but I'm going to align myself with the choices made for Jocly.


🕸Fergus Duniho wrote on Sun, Feb 25, 2024 07:09 PM UTC in reply to François Houdebert from 05:25 PM:

From your answer, I gather that you're just using these pieces for testing purposes, but you do not normally use them for playing Shogi. Speaking as someone who normally does use western pieces for Shogi, I find these pieces inadequate. They are inconsistent in design, they make little distinction between Gold and Silver Generals, and they make no distinction between different promoted Knights, Lances, and Silver Generals. Also, they come in different colors instead of appearing on wedges with different orientations.

The most accessible western set I use is based on the Chess Motif font and is featured on the Shogi page here. The other one, which is entirely my own design, is featured on Cut-Out Symbolic Shogi Pieces.


H. G. Muller wrote on Sun, Feb 25, 2024 07:56 PM UTC in reply to Fergus Duniho from 07:09 PM:

'Wedges' are awful. They make the the pieces look more alike than different, and take up valuable space that could have been used to express the difference. Distinguishing sides by color is infinitely superior than distinguishing sides by orientation, as the brain is hard-wired to recognize it by parallel processing. There really is no significant difference between playing with traditional kanji pieces and playing with wedge-like pieces with other inscriptions, for a game with so few piece types as Shogi; they equally suck, for the same reason. But due to the rules of Shogi and physical limitations they are a necessary evil for over-the-board play.

If we would prpose to orthodox Chess players that they should draw wedges around the pieces in their diagrams, they would laugh themselves silly, and think we are insane. And there is no real difference between Chess diagrams and Shogi diagrams; the purpose is exactly the same.


François Houdebert wrote on Sun, Feb 25, 2024 08:42 PM UTC in reply to Fergus Duniho from 07:09 PM:

We could easily add an extra skin inspired by Chess Motif, but we'd have trouble I suppose managing the orientation of the pieces.

If you want to suggest a sprite set (100*100px) we can make a try to give a choice close to the preferences of the player.

The existing generals, lances are used in some variants now and will be kepts for coherence among variants but can still evolve a little I suppose.


A. M. DeWitt wrote on Sun, Feb 25, 2024 08:45 PM UTC in reply to François Houdebert from 04:50 PM:

Perhaps. Ideally, each piece should be easily distinguishable from the others.


H. G. Muller wrote on Sun, Feb 25, 2024 09:23 PM UTC in reply to François Houdebert from 08:42 PM:

Since the move of the generals is very similar, I never considered a big problem that the pictograms for them are somewhat similar too. In Japanese also don't consider it a problem that one of the two kanji on the pieces are identical. I would not have any trouble to play with the generals as they are.

Of course the various promotion Golds should be distinguishable. And I don't think it is a good idea to represent the Tokin as a Pawn; they all move as Gold, so I think it is best they all look like one. I would propose to have 1, 2 or 3 red dots on the cap for promoted Pawn, Knight and Silver, respectively, with as mnemonic that these have 1, 2 or 3 forward moves. That keeps the same symbol for the Tokin as in the larger variants. That leaves the matter of the Lance. Perhaps we should just draw a horizontal red line on the cap for that, to symbolize it is a slider.


🕸Fergus Duniho wrote on Sun, Feb 25, 2024 10:27 PM UTC in reply to François Houdebert from 08:42 PM:

We could easily add an extra skin inspired by Chess Motif

I made these with the help of Game Courier, which I used to position the pieces properly.

shogi-sprites-motif

shogi-sprites-motif

I made the first one based on the colors used for the western set, but based on the orientation of the ones in the Japanese set, I think the second is actually the correct one.

but we'd have trouble I suppose managing the orientation of the pieces.

Game Courier handles this with a variable called $flip, which when set to true switches the pieces for the upsidedown orientation. You might do something similar in Jocly.

If you want to suggest a sprite set (100*100px)

These pieces are normally sized for 50x50 spaces, but I increased the scale to 200, which doubled them in size.


H. G. Muller wrote on Mon, Feb 26, 2024 07:32 AM UTC in reply to Fergus Duniho from Sun Feb 25 10:27 PM:

Game Courier handles this with a variable called $flip, which when set to true switches the pieces for the upsidedown orientation. You might do something similar in Jocly.

I cannot speak for François, but it seems to me you severely over-estimate our abilities to modify Jocly. It is not a program that we wrote ourselves. Implementing new games is one thing, because the original developer intentionally tried to make that easy, and published tutorials for how it should be done. Altering the Jocly core is a completely different matter.

Looking at the code there makes me realize that I only master about 20% of JavaScript (the part it has in common with C); trying to understand the wizardry used there is somewhat similar to reading a Chinese text armed with only the knowledge of the Latin alphabet.

So in short: doing what you propose would be approximately as difficult for me as it would be for you to do it yourself, and comparable to the task of rephrasing one sentence in the Chinese translation of the bible...


François Houdebert wrote on Mon, Feb 26, 2024 07:40 AM UTC in reply to H. G. Muller from Sun Feb 25 09:23 PM:

I'm fine with that, for me the most important thing is that jocly get

-a sprite set and not just the kanjis tiles

-that the pieces used are similars from one variant to the next.

As far as the representation is concerned, you're entitled to decide on the final touch since you're making the contribution.


François Houdebert wrote on Mon, Feb 26, 2024 08:04 AM UTC in reply to Fergus Duniho from Sun Feb 25 10:27 PM:

here's a quick first draft to see what it would look like: select 2d motif in the drop down.

Of course, transparency need to be improved . I don't know if the orientation will be correct in all situations (if you change player and/or view as ...).

I won't be available in the next few days, but we'll be able to try again at the end of the week.


H. G. Muller wrote on Mon, Feb 26, 2024 08:12 AM UTC in reply to François Houdebert from 08:04 AM:

Note that even the Japanese don't draw tiles around the kanji when they publish diagrams (e.g. tsume puzzles).


25 comments displayed

EarliestEarlier Reverse Order LaterLatest

Permalink to the exact comments currently displayed.