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 by FergusDuniho

LatestLater Reverse Order EarlierEarliest
Game Courier. PHP script for playing Chess variants online.[All Comments] [Add Comment or Rating]
🕸💡📝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.


🕸💡📝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 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 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 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 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 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 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.


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.


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.


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.


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.


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.


Changes to PHP Code[Subject Thread] [Add Response]
🕸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.


🕸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.


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.


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.


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 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.


🕸📝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.


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 Sun, Oct 3, 2021 01:23 PM UTC in reply to Daniel Zacharias from 04:42 AM:

I was looking for a global way to eliminate some PHP warnings, but that requirement proved to be too restrictive. So, I have removed it.

I then tried requiring minimal argument counts instead, but even that caused problems for unary, binary, and mixed unary/binary operators. But since they seemed to work with operators requiring 3 or more arguments, I left those minimal argument count requirements in.


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 Fri, Oct 1, 2021 06:25 PM UTC in reply to A. M. DeWitt from Thu Sep 30 04:41 PM:

After thinking about it, I decided to cancel the renaming of Futashikana Shogi. Please delete both presets for Dai Shosu Shogi.

It looks like someone has taken care of this.


🕸📝Fergus Duniho wrote on Thu, Sep 30, 2021 04:28 PM UTC in reply to A. M. DeWitt from Wed Sep 29 02:54 PM:

I decided to rename Futashikana Shogi to Dai Shosu Shogi.

While it has apparently been done, or is in the process of being done, I would like to advise against renaming in general. When you release a game, it takes on a life of its own that may extend outside of this site. While I was working on the taginfo.php script today, I was testing it with the Ai Ai tag, and one line on the page was displaying as empty. When I tracked down what was causing this, it was the ItemID for Futashikana Shogi. Apparently, someone has programmed Futashikana Shogi for Ai Ai, where it remains known by that name and not by the name Dai Shosu Shogi.

Additionally, the name has been changed without updating the RelocatedPages table. This table should have a row added to it for each page whose URL and ItemID both change. It may be done by editing the table in PHPMyAdmin, which the main editors have the URL, userid and password for.

When the page gets rewritten, it should mention the original name and why the name was changed.


Yangsi. A very playable chess variant with 12 different pieces on a 10x10 board.[All Comments] [Add Comment or Rating]
🕸Fergus Duniho wrote on Thu, Sep 30, 2021 12:11 PM UTC in reply to A. M. DeWitt from 02:35 AM:

See the Ai Ai tag at the bottom of the page.


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 Wed, Sep 29, 2021 09:22 PM UTC in reply to Ben Reiniger from 04:52 PM:

I'm open to feedback on how best to manage this sort of thing. One possibility is to create a new Item with the new name, we can move over the references in the database I've mentioned, and leave the old page with just a link forwarding to the new page (possibly even an automatic redirect, though I'm not sure if that'd work in a member submission view script).

The database has a RelocatedPages table. Just add an entry that includes its old URL and its new ItemID, and the 404 script will take care of the details.


25 comments displayed

LatestLater Reverse Order EarlierEarliest

Permalink to the exact comments currently displayed.