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

LatestLater Reverse Order EarlierEarliest
Chess. Play Chess with Jocly.[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Fri, Apr 15, 2016 11:10 PM UTC:
The cache had been giving me problems in Firefox, but I figured out that if I clear the cache and reload with a button that reloads a page without using the cache, I regularly get Jocly to use the latest version of my script. In fact, the two pieces of code you suggested had different effects, which I was able to notice because I have been clearing the cache. The first one simply failed to change the colors, while the second replaced the board with a large white square. I checked for your email but didn't see it. So I'll check again later.

📝Michel Gutierrez wrote on Fri, Apr 15, 2016 10:09 PM UTC:
<p>Fergus,</p> <p>I just sent you by mail a version of <code>cavalier-custom-view.js</code> that implements the 3 colors board. I tested it successfully.</p> <p>Maybe the problem you were having was related to the cache. Since embedding Jocly works with an iframe, cache may act weirdly, particularly on Firefox. Chrome might work better for those developments. Or relaunching Firefox also works.</p>

🕸Fergus Duniho wrote on Fri, Apr 15, 2016 06:53 PM UTC:
Neither assignment of orthoBoard3d changed the colors of the spaces. I initially modified your suggestions to use my choice of colors and to replace the % with a +, since I already modified some code to use the + sign based on code for Glinski's Hexagonal Chess. Since that didn't work, I copied them verbatim. Since that didn't work either, I commented out my changes to View.Game.cbGridBoardClassic and View.Game.cbGridBoardClassic2D and copied them verbatim again. It still didn't work. The spaces remained black and white.

📝Michel Gutierrez wrote on Fri, Apr 15, 2016 05:15 PM UTC:
<p>Giving it more thought, it should rather be:</p> <p><code> var orthoBoard3d = $.extend(true,{}, ,this.cbGridBoardClassic3DMargin,orthoBoardDelta,{ 'colorFill' : { ".": "rgba(204,40,0,1)", "#": "rgba(180,180,0,1)", "%": "rgba(180,40,0,1)", }}); </code> </p>

📝Michel Gutierrez wrote on Fri, Apr 15, 2016 05:11 PM UTC:
<p>Maybe i was not clear about where to do that in my previous comment. You should get something like:</p> <p><code> var orthoBoard3d = $.extend(true,{ 'colorFill' : { ".": "rgba(204,40,0,1)", "#": "rgba(180,180,0,1)", "%": "rgba(180,40,0,1)", }, },this.cbGridBoardClassic3DMargin,orthoBoardDelta); </code></p> <p>and a few lines below:</p> <p><code> boardLayout: [ ".#%.#%.#", "#%.#%.#%", "%.#%.#%.", ... </code></p>

📝Michel Gutierrez wrote on Fri, Apr 15, 2016 04:49 PM UTC:
<p>Changing the board display shouldn't be too hard.</p> <p>Look at the customization of the Jocly implementation of courier chess. In file <code>courier-board-view.js</code>, you see an overwriting of the <code>colorFill</code> property. In a 3 colors board, you'll need to add a third symbol in addition to '.' and '#'. You'll also need to modify your existing <code>boardLayout</code> in <code>cavalier-custom-view.js</code> to place the cells as you wish using this third cell symbol.</p>

🕸Fergus Duniho wrote on Fri, Apr 15, 2016 03:50 PM UTC:
Thanks. I rotated the Knight and Unicorn images to show the horse head profile better, to better distinguish Cavaliers and Nightriders from each other, and to remind the player that these are not Chess Knights, which Jocly has normally been displaying in the face-forward orientation. Also, the 2D representation I have previously used for this game shows the same side view of these pieces.

I have been trying to change the colors of the spaces and make this a three-color board, as I usually use for this game, but so far I have been unsuccessful. I have changed the values of colorfill in View.Game.cbGridBoardClassic and View.Game.cbGridBoardClassic2D, but it has had no effect, and I don't see where else the color could be changed.

📝Michel Gutierrez wrote on Fri, Apr 15, 2016 08:46 AM UTC:
Cavalier Chess looks very nice !

Just wondering, is it on purpose you set the knights and unicorns facing side instead of front ?

🕸Fergus Duniho wrote on Thu, Apr 14, 2016 05:52 PM UTC:
Thanks, that makes perfect sense, and removing the wrongly placed Cavaliers fixed the problem. I defined the Cavalier twice, because each color promotes on a different rank.

📝Michel Gutierrez wrote on Thu, Apr 14, 2016 03:49 PM UTC:
<p>Fergus,</p> <p>I had a quick look at your Cavalier Chess implementation and i saw a problem which is likely to cause the issue you are experiencing.</p> <p>You define a piece type for white cavalier:</p> <p><code> pieceTypes: { 0: { name: 'cavalier-w', aspect: 'fr-knight', graph: Model.Game.cbHorseGraph(geometry), value: 2, abbrev: 'H', initial: [{s:1,p:8},{s:1,p:9},{s:1,p:10},{s:1,p:11},{s:1,p:12},{s:1,p:13},{s:1,p:14},{s:1,p:15},{s:-1,p:48},{s:-1,p:49},{s:-1,p:50},{s:-1,p:51},{s:-1,p:52},{s:-1,p:53},{s:-1,p:54},{s:-1,p:55}], }, </code></p> <p>But you define initial position for both white and black, and you do the same for black cavalier. So basically there are 2 cavaliers at each 2nd second row, causing an exception in the code.</p> <p>I'm not sure about the Cavalier Chess rules but if the movements are the same for both sides, you should only have 1 piece type for the cavalier. If they don't have the same movement (like the regular pawns that go towards different directions), you must have 2 different piece types for black and white but ensure that the initial position is only defined for the corresponding side.</p> <p>Tip: when developing on Jocly, you should always have the browser console opened (F12) so that you can spot quickly when there is something wrong.</p>

🕸Fergus Duniho wrote on Wed, Apr 13, 2016 09:55 PM UTC:
<P>I programmed <A HREF="http://play.chessvariants.com/jocly/cavalier.html">Cavalier Chess</A>, but the Cavaliers, which move the same as Chinese Chess Knights, are buggy. When I move one, it leaves an image of the piece on the space it moved from, and after Black moves only one or two times more, the game freezes up. The code I'm using for this piece is <CODE>Model.Game.cbHorseGraph(geometry)</CODE>, which is the same as the Xiangqi model uses for the Knight. <S>Also, is it possible to rescale individual piece types? I would like to scale the Cavaliers a little smaller, since they take the place of Pawns and are currently the same size as the Unicorn image I am using for the Nightrider.</S></P>

🕸Fergus Duniho wrote on Mon, Apr 11, 2016 11:34 PM UTC:
Thanks for spotting that. I refreshed this page until a House of Staunton ad showed up, then it worked. I did recently enable more than in-house ads on these pages, and that is probably what made the difference. So I'll just program the header to not display ebay ads on Jocly pages.

📝Michel Gutierrez wrote on Mon, Apr 11, 2016 11:13 PM UTC:
Having a closer look, some pages work some don't.

My best guess is a jquery conflict between the version 1.10 you insert at the top of the page and version 1.6.2 that is inserted along with an ebay ad. I am not sure jquery.jocly.js would work with jquery 1.6.2.

🕸Fergus Duniho wrote on Mon, Apr 11, 2016 09:56 PM UTC:
It's good to know that it is working for you. It is still not working for me. It may just be a temporary problem with internet connections. So I'll try again later.

📝Michel Gutierrez wrote on Mon, Apr 11, 2016 09:37 PM UTC:
Do you mean at <a href="http://play.chessvariants.com/jocly/grotesque.html">this page</a> for instance ? It works well for me.

🕸Fergus Duniho wrote on Mon, Apr 11, 2016 09:22 PM UTC:
Is anyone else having trouble getting the Jocly scripts here to work right now? None of them are working for me right now.

📝Michel Gutierrez wrote on Sun, Apr 10, 2016 10:59 PM UTC:
Excellent work !

🕸Fergus Duniho wrote on Sun, Apr 10, 2016 07:02 PM UTC:
<P>Thanks, I copied View.Board.xdInput to capachess-custom-view.js, made the one change, and it worked. While testing positions, I also learned that I need to define the regular castling moves as the shortest castling moves. When I had them defined as the longest castling moves, all castling moves on one side would be disabled if the longest one was illegal thanks to a space being attacked. Changing it to the shortest castling moves, I then tested whether castling to b1 would be legal if c1 were attacked, and it wasn't legal, which is good, but castling to d1 was still legal, which was also good. So it is working now, and it even changed how castling works in Capablanca's Chess. Now I just need to modify the regular castling in Grotesque Chess to use the shortest castling moves.</P>

📝Michel Gutierrez wrote on Sun, Apr 10, 2016 05:23 PM UTC:
<p>Ok, i can see in the code why disabling regular castle also prevents extra castle. In the extra castle move generation, we first search for a regular castle move (which ensures king and rook haven't moved and there are only empty squares between them) before generating extra castle moves. If no regular castle, there is no extra castle.<p> <p>Another approach would be to keep the regular + truncated extra method, but change the UI (by overwriting the view js file like you did for the model) to always highlight the king target square and not the rook in case of a castle. In your <code>grotesque-custom-view.js</code> file, copy function <code>View.Board.xdInput</code> from <code>base-view.js</code>, and replace the line:<p> <p><code>var target = move.cg===undefined?move.t:move.cg;</code></p> <p>by</p> <p><code>var target = move.t;</code></p> <p>This has reasonable chances to work.</p>

🕸Fergus Duniho wrote on Sun, Apr 10, 2016 03:39 PM UTC:
<P>So that I don't interfere with people playing Grotesque Chess, I have been trying things with <A HREF="http://play.chessvariants.com/jocly/univers.html">Univers Chess</A>, which has the same castling rule.</P> <P>Setting castle to {} and removing "castle: true," from the Rook's definition both completely disabled castling. Removing castling moves from extraCastle would eliminate the duplication, but it would leave the game with two different methods for castling. My aim is to use the same method of castling for all castling moves.</P> <P>Looking at the base model for Chess, it looked like Model.Board.cbGeneratePseudoLegalMoves would be a suitable method to modify, but simply including it in the custom model without any modification has the effect of disabling all moves. To check whether the code I got from the Jocly Game Inspector was up-to-date, I used Firebug to look at the code it loaded from the base model, and nothing was different. </P> <P>As a further test, I copied Model.Board.cbApplyCastle into my custom model, and it didn't hurt anything.</P>

📝Michel Gutierrez wrote on Sat, Apr 9, 2016 11:03 PM UTC:
<p>Congratulations on your implementation !</p> <p>We have an API documentation of the model on the <a href="http://wiki.jocly.com/">Jocly wiki</a> but it's for the games in general. Unfortunately, we do not have something specific to the base chess implementation.</p> <p>I did not try this myself but i would see 2 different ways to solve the issue of having twice the same castle move defined (with my apologies if you trued that and it didn't work):</p> <p>1/ do not define the "normal" castling definition. You say when you leave it out there was no castling possible. Did you try to set "castle" as an empty object ( castle: {} ) or to just remove the "castle" key (the second might not work).</p> <p>2/ do not define, in the extra castle moves, the one that is already covered by the regular castle definition. That would certainly lead to (just focusing on white left castle):</p> <p><code> var extraCastle={ 0:{k:[2],r:[3]}, ... </code></p> <p>and</p> <p><code> Model.Game.wbExtraCastleRook={ 2:{r0:0,r:3}, ... </code></p>

🕸Fergus Duniho wrote on Sat, Apr 9, 2016 06:53 PM UTC:
Thanks, Michel. I got Grotesque Chess programmed. The one glitch is that I couldn't get it to work without including both styles of castling. Unlike Wildebeest Chess, Grotesque Chess doesn't let the King castle by moving one space. So I had no use for moving the King to the Rook's space, but when I left out the code for that, no castling worked. So I put it back in and mapped it to castling moves that were already covered by moving the King to an empty space. I have thought of studying the base model to figure out how I could rewrite the code for castling, but even with my experience programming the rules of Chess multiple times in my own language, it's still hard to follow. Is there any documentation on the base model for Chess?

📝Michel Gutierrez wrote on Thu, Apr 7, 2016 10:43 PM UTC:
<p>Fergus,</p> <p>No, you cannot do that using the standard castling declaration, with an object with keys matching king-position/rook-position. Note that having twice the same key won't work by nature of the javascript language.</p> <p>However, you should have a look at the Jocly implementation of Wildebeest. This is (almost?) exactly the same case. It has been solved by defining a "normal" castle by declaration, and adding other castle possibilities "manually". You should be able to copy/paste from wildebeest-model.js lines 188 to 326.</p>

🕸Fergus Duniho wrote on Thu, Apr 7, 2016 07:10 PM UTC:
<P>Michel,</P> <P>Is there any way to handle multiple castling options on each side? I am trying to program <A HREF="http://play.chessvariants.com/jocly/grotesque.html">Grotesque Chess</A>, but I can't get the castling to work right.</P> <P>This didn't work at all:</P> <PRE> castle: { "4/1": {k:[3,2,1],r:[1,2],n:"Kb1"}, "4/2": {k:[3,2],r:[1,2,3],n:"Kc1"}, "4/6": {k:[5,6],r:[8,7,6,5],n:"Kg1"}, "4/7": {k:[5,6,7],r:[8,7,6],n:"Kh1"}, "4/8": {k:[5,6,7,8],r:[8,7],n:"Ki1"}, "74/72": {k:[73,72,71],r:[71,72],n:"Kb8"}, "74/73": {k:[73,72],r:[71,72,73],n:"Kc8"}, "74/76": {k:[75,76],r:[78,77,76,75],n:"Kg8"}, "74/77": {k:[75,76,77],r:[78,77,76],n:"Kh8"}, "74/78": {k:[75,76,77,78],r:[78,77],n:"Ki8"}, }, </PRE> <P>This works only for the last one assigned to an initial value. So, for example, castling white King-side moves the King to i1 and the Rook to h1 without providing any options.</P> <PRE> castle: { "4/0": {k:[3,2,1],r:[1,2],n:"Kb1"}, "4/0": {k:[3,2],r:[1,2,3],n:"Kc1"}, "4/9": {k:[5,6],r:[8,7,6,5],n:"Kg1"}, "4/9": {k:[5,6,7],r:[8,7,6],n:"Kh1"}, "4/9": {k:[5,6,7,8],r:[8,7],n:"Ki1"}, "74/70": {k:[73,72,71],r:[71,72],n:"Kb8"}, "74/70": {k:[73,72],r:[71,72,73],n:"Kc8"}, "74/79": {k:[75,76],r:[78,77,76,75],n:"Kg8"}, "74/79": {k:[75,76,77],r:[78,77,76],n:"Kh8"}, "74/79": {k:[75,76,77,78],r:[78,77],n:"Ki8"}, }, </PRE>

📝Michel Gutierrez wrote on Thu, Apr 7, 2016 09:42 AM UTC:
Thanks Fergus.

Chris: to castle, click the king then the rook. It's uncommon (one generally clicks on the king's target square), but this method allows to solve castling ambiguities with some variants.

25 comments displayed

LatestLater Reverse Order EarlierEarliest

Permalink to the exact comments currently displayed.