Check out Symmetric Chess, our featured variant for March, 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 by FergusDuniho

EarliestEarlier Reverse Order LaterLatest
Game Courier Settings Files. Keep track of all the settings files you have written for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Mon, Oct 4, 2021 01:02 PM UTC in reply to Aurelian Florea from 09:28 AM:

Thanks for reporting this. Although I'm doing most of the development over on the other server, I do copy over changes toward the end of the day after they seem to be working, and then it's Europeans who are the first to encounter any bugs I may have introduced into the code, because they start the day earlier than I do.

The bug here is preventing the Rook's legal moves from being displayed, but it does not seem to be preventing you from manually typing in the move and making it. I will now look into this and try to fix it.


🕸📝Fergus Duniho wrote on Mon, Oct 4, 2021 01:32 PM UTC in reply to Aurelian Florea from 09:28 AM:

This is now fixed. In one line of the rays operator, I was using !empty() instead of isset(), and that's what introduced the bug that affected the operation of rays from some spaces.


About Game Courier. Web-based system for playing many different variants by email or in real-time.[All Comments] [Add Comment or Rating]
🕸💡📝Fergus Duniho wrote on Mon, Oct 4, 2021 08:41 PM UTC in reply to Jean-Louis Cazaux from 07:12 PM:

There was a syntax error in one line. It's now corrected.


Game Courier Settings Files. Keep track of all the settings files you have written for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Tue, Oct 5, 2021 01:19 AM UTC in reply to A. M. DeWitt from Mon Oct 4 08:53 PM:

Okay, I deleted them and the database entries for them too.


MPsuzumu-shogi[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Tue, Oct 5, 2021 02:23 AM UTC in reply to Daniel Zacharias from Mon Oct 4 09:06 PM:

The problem was that the board was too large to rotate 180 degrees. When I switched the shape from Grid to Square, it worked. To make it work for the provided background images, I replaced imagerotate() with imageflip(), which could get the same effect as rotating by 180 degrees by simply mirroring the image across both dimensions. Because this used fewer resources, it could handle the images provided for this game.


Changes to PHP Code[Subject Thread] [Add Response]
🕸Fergus Duniho wrote on Tue, Oct 5, 2021 08:58 PM UTC:

Since I can now work on code on the development server, I took the time to remove the remaining code for creating offline pages. While David used to make offline versions of the website, I have never done that. For one thing, I wasn't familiar with how he went about it. But I also didn't see the use for it. Things have changed since David wrote the code for this. Back when we got on the internet with 2400 baud modems that used the phone line, it would have been convenient to have an offline version of the site. But now that broadband and WIFI-enabled mobile devices are both common, it is easy enough to connect directly to the website. When the site is down, as it was recently, archived copies of pages can be found at archive.org. So, an offline copy is not needed for archival purposes. Additionally, the website has grown more interactive than it used to be. While it was originally a set of static HTML pages, it now includes comments, database-generated pages that may be revised on the website, and ongoing games. Finally, when I program code, I write it simply for a website, and I do not want to have to take care to build in support for generating offline pages.

Besides code that was run with the condition $foroffline or $offlineindex, I replaced every instance of echoandwrite with echo, and I removed the function definitions for echoandwrite and echoorwrite. The latter wasn't even being used anyway.

Removing some of the $foroffline code created a bug, and this happened to draw my attention to the icons that appear to the left of links. I had thought of these as slightly informative decoration, but they included links to information pages and included a bunch of ALT text telling some things about the item linked. I got rid of the links to the information pages, changed the ALT text to TITLE text, and reduced the provided information to just telling what the icon meant. With this done, I was able to remove the remaining $foroffline code in make_author_line, and I also removed the $foralttext option from it. There was really no need to include author information in the ALT text for the icon when it was already on the screen anyway. Removing the little-used links to info pages and reducing the information provided by what is now a tooltip should reduce page size and make index pages quicker to load. With that in mind, I may look into extending how many links may appear on an index page.


🕸Fergus Duniho wrote on Wed, Oct 6, 2021 01:42 AM UTC in reply to Ben Reiniger from Tue Oct 5 09:59 PM:

I did occasionally use the "info" page, previously linked to from the icon of an index entry. But I do not consider this worth keeping either. Those pages can still be reached from the "info" link in the footer of the item's actual page (except perhaps for multi-item pages?).

That's why I figured it would be okay to get rid of the link from the icon. The link in the footer had been the only link to the info page I had been aware of, and I figured it would be enough for anyone who wants to go to that page. I think most people would be unaware that the icon links to an info page or would just be interested in the link to the actual page rather than the link to a page with metadata about it. The index page really gave no indication that the icons linked to something different than the actual page, and most people who clicked on an icon would probably be surprised that it didn't go to the actual page.


Chess Variants Query. More options for searching in these pages.[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Wed, Oct 6, 2021 01:45 AM UTC in reply to Ben Reiniger from Tue Oct 5 10:08 PM:

I have been working on replacing absolute URLs with relative URLs. But I had mainly been looking for chessvariants.com URLs. I guess I'll have to look for chessvariants.org URLs too.


Game Courier. PHP script for playing Chess variants online.[All Comments] [Add Comment or Rating]
🕸💡📝Fergus Duniho wrote on Wed, Oct 6, 2021 01:55 AM UTC in reply to A. M. DeWitt from 01:30 AM:

I noticed that in one of your games yesterday, and when you mentioned it, I thought perhaps it was because there were no adjustments for your boards in the image_dimensions.php script. But I just tested Shogi and Xiangqi, and I am seeing the same thing. As I've been editing code to not show warnings in the PHP error log, I have made lots of edits to draw_grid_png.php. I'll have to take a look at it and see what's causing this.


Changes to PHP Code[Subject Thread] [Add Response]
🕸Fergus Duniho wrote on Wed, Oct 6, 2021 02:06 AM UTC:

One more reason for no longer supporting offline pages is that many pages now include script-generated images with the drawdiagram.php script. These will work on a website running PHP, but they will not work offline. If I wanted offline pages to support them, I would have to write a script that finds each link to a script-generated image, creates a copy of the image with a unique name, and replaces the link to the script-generated image with a link to the copy of its output. That's too much work for something no one probably needs anyway, and archive.org can already make copies of them.


Gods on Pluto ZIP file. Plays with extremely weak pieces, no pawns, and drops.[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Wed, Oct 6, 2021 01:28 PM UTC in reply to Christine Bagley-Jones from 12:19 PM:

The problem is that there is no file to download. As the author of this page, it is up to you to fix this. Please upload it with the file manager in the same way you have uploaded images. There is a link to the file manager in the Edit menu.


Game Courier Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Wed, Oct 6, 2021 04:52 PM UTC in reply to A. M. DeWitt from 02:17 PM:

Is there a way to detect suicide moves in GAME code?

There are two ways of doing a suicide, and these have different effects on the $old variable. Adding an @ to a space works like a promotion, which leaves the value of $old unaffected. Moving a piece nowhere gives $old an empty value. This may give a better indication that the move included a suicide, but it would come at the expense of the information about where the piece moved to.

Since it sounds like your Fire Demon piece is making a multi-part move, you may want to break down the whole move and analyze it step-by-step. You will find examples of this in multi-move variants like Marseillais Chess and Extra Move Chess.

With that in mind, another option would be to move the Fire Demon to the piece's space, then immediately move it back.

Another possibility for detecting a suicide move is to store the board position before the move into a variable, then compare the new position after the move to the stored position and see what differences there are.


Game Courier. PHP script for playing Chess variants online.[All Comments] [Add Comment or Rating]
🕸💡📝Fergus Duniho wrote on Wed, Oct 6, 2021 05:44 PM UTC in reply to Fergus Duniho from 01:55 AM:

As I've been editing code to not show warnings in the PHP error log, I have made lots of edits to draw_grid_png.php. I'll have to take a look at it and see what's causing this.

It does not appear to be caused by any recent edits to draw_grid_png.php. I temporarily reverted to an earlier version, and the problem remained.


🕸💡📝Fergus Duniho wrote on Thu, Oct 7, 2021 02:16 AM UTC:

So far, I can't tell what the problem is. It affects both Square and Grid boards. I have been testing Chess, and the numbers look right when I examine the generated source code. Each square is 50x50, and after file a, each empty image for displaying a legal move has a left position that is 50 pixels greater than that for the file to its left. The a file starts at 16 pixels left, and each empty image for an empty space on that file starts at 23 pixels left. The h file starts at 366, and each empty image for an empty space on that file starts at 373. In each case, the difference is 7. Also, 373-23 and 366-16 are both 350, which is the expected value when each square is 50x50. With all these values being correct and equivalent, it remains a mystery why the empty image shifts slightly to the right with each file from left to right.


🕸💡📝Fergus Duniho wrote on Thu, Oct 7, 2021 05:23 PM UTC:

While the right-shifting was more readily apparent, I also checked for vertical shifting by creating a position where a Rook covered a whole file. What I found is that there is also downward-shifting. No matter whether the board is rotated for Black, the empty gifs in the lower right are closer to the lower right corner than empty gifs in spaces more to the left or top. This is consistent with right and down being the two directions that increase as the x or y position of the image increases, since 0,0 is in the top left corner.


🕸💡📝Fergus Duniho wrote on Thu, Oct 7, 2021 05:52 PM UTC:

Checking a screenshot of a Rook's legal moves in Chess in a graphics program, the squares for legal moves were at the right pixel locations, but the board was smaller than it should be. The image was 427x431. For comparison, I loaded the image by itself, took another screenshot, and checked its size. This time, it was 436x440. So, the browser is shrinking the image to fit the space, and after the browser has shrunk it, the precalculated positions for the empty images do not align with it. Therefore, I have to prevent the browser from shrinking the image.


🕸💡📝Fergus Duniho wrote on Thu, Oct 7, 2021 06:05 PM UTC:

I added max-length: 100% !important to the STYLE field for the board image, and this fixed the problem. The squares for highlighting pieces and legal moves now align correctly.


🕸💡📝Fergus Duniho wrote on Thu, Oct 7, 2021 09:12 PM UTC in reply to A. M. DeWitt from 06:49 PM:

Pieces are normally centered, but if you have odd-sized pieces on an even-sized space, or vice versa, 100% alignment may not be possible. Also, centering works best for pieces with nothing beyond the image of the piece itself. Some piece sets, such as Alfaerie, make all piece images a fixed size by adding extra space around most images. If the image of the piece is not properly centered in an image with extra space on the sides, it will not look properly centered on the board.


🕸💡📝Fergus Duniho wrote on Sat, Oct 9, 2021 02:13 AM UTC in reply to A. M. DeWitt from Fri Oct 8 01:01 AM:

What I meant to say was the the highlights for empty squares are slightly off center.

I've been working on that today, and I just copied over the changes I made. The highlight area is now larger. It had been small to fit on hexagonal spaces. Instead of using the same CSS for square and hexagonal spaces, I made the highlight area for hexagonal spaces round and increased its size. I'll see if anything more needs to be done tomorrow.


🕸💡📝Fergus Duniho wrote on Sun, Oct 10, 2021 02:15 AM UTC:

I've been working on this more today. Thanks to having a development server, I've been able to make extensive changes without regularly introducing bugs into the scripts people were using to play games. I realized that I could use margins to position the highlighting, and I moved as much of the CSS as I could from each IMG's STYLE element to some STYLE tags. This reduced the HTML code and the filesize of the page. I also added some code that is more adaptive to grids with unusual geometries, though I didn't test it on anything more unusual than Shogi. I made the highlighting of the last move made always the same color as the other highlighting, and I increased the border size for the piece that last moved to 5px, which fits the space better. As mentioned before, I'm now using circular borders to highlight hexagonal spaces. I slightly reduced the size of borders highlighting empty spaces from the size I made them yesterday, because it looks better that way, though I kept them larger than they used to be.


Game Courier Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Sun, Oct 10, 2021 11:15 PM UTC in reply to A. M. DeWitt from Sat Oct 9 01:23 AM:

Another possibility for detecting a suicide move is to store the board position before the move into a variable, then compare the new position after the move to the stored position and see what differences there are.

This could potentially solve the problems of detecting a suicide move if I knew how to do it.

Here's a preset I made to demonstrate how to do this:

https://www.chessvariants.com/play/pbm/play.php?game%3DChess%26settings%3Dspotcaptures

This records the position of every piece on the board in an array whose keys are coordinates and whose values are piece labels. It does this both before and after a move. It then goes through the current positions of pieces. For each empty space, represented with the @ piece, it compares it with the previous value to see if it was empty before. If it wasn't empty before, it records it as a capture.

Since I am already writing this, would the system used for the multi-move variants be able to handle moves with three or more parts (i.e. that of the Lion Dog in Maka Dai Dai Shogi)?

You could adapt it. For the multi-move variants, there are usually the same number of move parts each turn. So, it makes sense for these games to do the multi-part analysis globally for all pieces. But for games that include pieces with multi-part moves, you may want to reserve the multi-part analysis for specific pieces and tailor it to each piece that needs it.


🕸📝Fergus Duniho wrote on Mon, Oct 11, 2021 06:48 PM UTC:

I realized the role that $width and $height play in centering the borders for highlighting spaces, and with that in mind, I simplified the code in draw_grid_png.php and made adjustments to the $width and $height of Shogi pieces and to the values of $offx and $offy in image_dimensions.php. By using proper values for $width and $height, the code will always apply CSS for margins and padding to the space class rather than to each element of the space class.

I didn't immediately recognize the importance of $width and $height, because I created these variables years before I ever added the ability to display legal moves by highlighting spaces. These variables describe the width and height of spaces, and they are used when automatically generating a board to know what dimensions to give to spaces. But sometimes an image of a board is used instead, and when it is used, $width and $height should match the size of the spaces on the image.

This is what I was neglecting to do. The highlighting in Shogi was a bit off, because the value of $height did not match the height of the spaces on the images of Shogi boards.

Since Shogi divides each space by lines, there are two choices on how to specify the dimensions of a space. One is to use the inner space between the lines, and the other is to extend the size to include the lines. I tried both and chose the latter for Shogi.

For automatically-generated boards, the centering of borders for highlighting should now be done automatically. But for boards provided as pre-drawn images, it's important to match them up with the correct values for $width and $height. One way would be to size the board with spaces the same size as the dimensions given for the piece sets to be used with it. Abstract and Alfaerie sets both normally use 50x50 spaces. Another way would be to provide correct values for your board. I could add these to the image_dimensions.php script for specific boards.


🕸📝Fergus Duniho wrote on Thu, Oct 14, 2021 12:22 PM UTC in reply to A. M. DeWitt from 04:06 AM:

If something similar could be used to detect the type of piece affected by the suicide, that should be everything I need to enforce the burning rules using suicides, at least in theory.

That information is in #pfore. Just use the coordinates of the spaces with missing pieces as keys to this array.


Home page of The Chess Variant Pages. Homepage of The Chess Variant Pages.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Sat, Oct 16, 2021 12:55 AM UTC in reply to A. M. DeWitt from Fri Oct 15 10:43 PM:

The Edit Comment scripts aren't working properly. Whenever I try to edit a comment it fails. Posting comments still works though.

Until I'm feeling better, I have simply reverted this to Sunday's version. I have been having fever symptoms. I had chills last night, and now I'm feeling too warm. I will continue debugging code when I'm feeling better.


Zillions of Games. It can play an endless variety of abstract board games, and we have a large collection of Chess variants you can play on it.[All Comments] [Add Comment or Rating]
🕸📝Fergus Duniho wrote on Sun, Oct 17, 2021 01:49 AM UTC in reply to Robert Mate from Sat Oct 16 10:08 AM:

Guess I could try emulating windows 95

I don't think that will help. I think you just need to coordinate with another person who is willing to play against you at a certain time.


25 comments displayed

EarliestEarlier Reverse Order LaterLatest

Permalink to the exact comments currently displayed.