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

EarliestEarlier Reverse Order LaterLatest
ChessVA computer program
. Program for playing numerous Chess variants against your PC.[All Comments] [Add Comment or Rating]
Carlos Cetina wrote on Sun, Apr 11, 2021 06:01 PM UTC:

Hi Greg,

I can't download ChessV2.3 RC1.zip. The link does not work. Chrome seems to block it. I wonder if it has nothing to do with the fact that this browser wants URLs to be safe and I see that the protocol you use is http and not htpps.


📝Greg Strong wrote on Mon, Apr 12, 2021 12:36 AM UTC in reply to Carlos Cetina from Sun Apr 11 06:01 PM:

Thanks, Carlos. That is helpful.

It seems you are correct. Chrome will not download a file that is not secure if the link is on a page that is secure. So it was possible to download a link from chessv.org, since that site is not https, but linking it from here does not work because this page is https. Funny, even Chromium would download it, while Chrome would not.

Anyway, I have posted it here for the time being:

/programs.dir/ChessV2.3RC1.zip

Carlos Cetina wrote on Wed, Apr 14, 2021 02:31 PM UTC:

Okay, Greg, you are welcome. The new link does work. I see that you have added 12 variants including 2 invented by Vitya Makov: Chess 9x9 and Cardinal Chess. Those interested in seeing how ChessV handles these 2 variants take a look at the following YouTube links:

Chess 9x9

Cardinal Chess

Congratulations and thank you for such a commendable work you do!


Aurelian Florea wrote on Thu, Apr 15, 2021 12:05 PM UTC:

Greg, What is chess with jokers supposed to be? To me it looks like regular chess!


Aurelian Florea wrote on Thu, Apr 15, 2021 12:12 PM UTC:

Duplex chess is a clerver game!


📝Greg Strong wrote on Thu, Apr 15, 2021 01:24 PM UTC:

In Chess with Jokers, the queen piece is a joker. I used this for developing and testing the joker piece. It seems I never updated the graphic used. I'll fix that now.

Thanks, Duplex Chess is a very good game that I need to get posted. It is my attempt to make a double-move variant that isn't too overwhelming. No piece moves farther than two spaces. A few notes: the same piece cannot be moved on both moves - except for the king. He can make two moves, including two captures, making him the most dangerous piece. But, if you lose him, the game is over. Also, there are three ways to win: capture your opponent's king, capture all your opponent's pawns, or move your king to the last rank.


Aurelian Florea wrote on Thu, Apr 15, 2021 01:59 PM UTC in reply to Greg Strong from 01:24 PM:

Impressive work, Greg!

I really appreciate implementing my 2 games: Apothecary chess classic and Apothecary chess modern as they were quite a challenge. I can hardly wait for the source code once you post everything from the official release.


Aurelian Florea wrote on Thu, Apr 22, 2021 05:05 PM UTC in reply to Greg Strong from Thu Apr 15 01:24 PM:

I just wanted to ask, because it would be very difficult, if this version implements all the endgame conditions for apothecary. I doubt it because the AI is hard to reprogram for this. Have you given them any thoughts though?


Aurelian Florea wrote on Fri, Apr 23, 2021 08:32 AM UTC in reply to Aurelian Florea from Thu Apr 22 05:05 PM:

I really like the piece description that appears when right clicking a piece.


📝Greg Strong wrote on Fri, Apr 23, 2021 04:01 PM UTC in reply to Aurelian Florea from 08:32 AM:

I just wanted to ask, because it would be very difficult, if this version implements all the endgame conditions for apothecary. I doubt it because the AI is hard to reprogram for this. Have you given them any thoughts though?

If you mean the way a game can have additional outcomes, such as 3/4 - 1/4, that is not something that I know how to do.  And, even if there is a way, I would not alter the core AI to do it.

I really like the piece description that appears when right clicking a piece.

Thank you.  I'm rather proud of this.  ChessV definitely makes the most sophisticated movement diagrams that I have seen, offering good support for showing multi-path moves and bent rider moves.


Christine Bagley-Jones wrote on Mon, Apr 26, 2021 04:02 AM UTC in reply to Greg Strong from Sat Apr 10 02:41 PM:

Yes, I clicked on that link and it downloaded ChessV2.3RC1.zip.

Sorry, been away for a bit.


B.E. Dolata wrote on Fri, Apr 30, 2021 01:14 PM UTC:

Hi Greg, Thanks for the updated version. I received an exception while playing Tripunch chess

ChessV.Exceptions.ChessVException: An item with the same key has already been added. ---> System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at ChessV.Game.SearchRoot(Int32 alpha, Int32 beta, Int32 depth, List`1 movesToExclude)
   at ChessV.Game.Think(TimeControl timeControl, Int32 multiPV)
   --- End of inner exception stack trace ---
   at ChessV.Game.Think(TimeControl timeControl, Int32 multiPV)
   at ChessV.InternalEngine.startThinking()
   at ChessV.Match.OnMoveMade(Player sender, List`1 moves)
   at ChessV.MoveMadeEventHandler.Invoke(Player sender, List`1 moves)
   at ChessV.Player.emitMove(List`1 moves)
   at ChessV.GUI.BoardControl.tryMoveToLocation(Location location)
   at ChessV.GUI.BoardControl.BoardControl_MouseUp(Object sender, MouseEventArgs e)
   at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.UserControl.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

The final board state was

r1h1kh1r/ppp1pppp/3p4/8/4n1c1/3PPN2/PPP1K1PP/RNH5 b ha - 2 10

I had just moved my Nightrider from g1 to f3.


📝Greg Strong wrote on Fri, Apr 30, 2021 04:58 PM UTC in reply to B.E. Dolata from 01:14 PM:

Thank you for the detailed bug report. This should be what I need to reproduce. I'm travelling at the moment, but will take a look this weekend. Thanks!


Aurelian Florea wrote on Thu, May 6, 2021 09:10 AM UTC in reply to Greg Strong from Fri Apr 30 04:58 PM:

Hello Greg, Any hope for the latest ChessV version this weekend? I hope to share it with my friends.


📝Greg Strong wrote on Thu, May 6, 2021 11:23 PM UTC in reply to B.E. Dolata from Fri Apr 30 01:14 PM:

Hi Greg, Thanks for the updated version. I received an exception while playing Tripunch chess

Thanks again for finding this.  I've found the issue.  The next version will resolve this problem in Tripunch and be more resistant to this issue in general.  But, in the meantime, you can fix this by going into the ChessV include directory and editing the Tripunch Chess.cvc file in a text editor. Inside the SetGameVariables function, add the following line:

DeduplicateMoves = true;

Then restart ChessV and you should be good.


B.E. Dolata wrote on Mon, May 10, 2021 03:17 PM UTC:

Hi Greg, I received an error while playing Do-Or-Die Chess.

This is the log

Do-or-Die Chess
Player(White) = Human
Player(Black) = ChessV
Moves = {
    d2d3 c4c3 f2f3 g4f3 e2f3 e4e3 d1e2 c3b2 c1b2 a4a3 b2c1 b5c3 b1c3 b4c3 g1h3
}

Exception type: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
Source: ChessV.Base
Stack Trace: 
   at ChessV.Board.SquareToLocation(Int32 square)
   at ChessV.GUI.BoardPresentation.Render(Boolean highlightComputerMove, Boolean rotateBoard, Piece piece, Boolean endgame)

📝Greg Strong wrote on Fri, May 14, 2021 03:59 PM UTC in reply to Greg Strong from Thu Apr 8 08:28 PM:

ChessV 2.3 Release Candidate 2

This is a pre-release of upcoming version 2.3. It corrects a few issues reported with Release Candidate 1. It also adds support for a new movement capability for bent riders: the ability for a piece to slide followed by a manditory step in a different direction. As such, Renniassance Chess is now fully supported.

Since it is not an official release, there is no installation program. Just unzip to a new directory and run ChessV.exe. The official release will contain an install program.

Download here:
/programs.dir/ChessV2.3RC2.zip

Please let me know if you run into any issues. Enjoy!


Aurelian Florea wrote on Fri, May 14, 2021 04:30 PM UTC in reply to Greg Strong from 03:59 PM:

That is probably nitpicking but the wizard and griffin in apothecary chess modern seem to be evaluated in close value. The are most definitely not. I have some evaluations made earlier in the development of the 2 games. Would them be useful. I can send a full list of piece values.


📝Greg Strong wrote on Fri, May 14, 2021 04:37 PM UTC in reply to Aurelian Florea from 04:30 PM:

Are we looking at the same thing? The Wizard has midgame, endgame values of (460, 460) and the Griffin has values of (800, 900) so not very close.


Aurelian Florea wrote on Fri, May 14, 2021 06:30 PM UTC in reply to Greg Strong from 04:37 PM:

I had only seen some weird exchanges in a game. I definitely could be wrong. I'll try to reproduce it. By the way I don't think that I can check the piece values to either apothecary chess game without the source code.


📝Greg Strong wrote on Fri, May 14, 2021 06:52 PM UTC in reply to Aurelian Florea from 06:30 PM:

I don't think that I can check the piece values to either apothecary chess game without the source code.

Sure you can. Right-click on a piece and select "properties".  You recently commented that you liked the information it showed you there...


Aurelian Florea wrote on Sat, May 15, 2021 04:23 AM UTC in reply to Greg Strong from Fri May 14 06:52 PM:

Oh, I had forgotten. I am sorry!


Aurelian Florea wrote on Sat, May 15, 2021 04:59 AM UTC in reply to Aurelian Florea from 04:23 AM:

I could not reproduce the situation. It was probably a tactical move I have not seen deep enough.


Daniel Zacharias wrote on Sun, Jun 27, 2021 11:29 PM UTC:

I'm trying to describe Expanded Chess for ChessV but I'm having trouble with the Osprey. I used this:

AddPieceType( "Osprey", "O", 500, 500, "Bird");
Osprey.XBetza = "DmpafyafsW;

but apparently everything before the y in the xbetza description is ignored, so it's interpreted as equivalent to DyafsW. Is that intended, and is there another way to describe that piece for ChessV?


📝Greg Strong wrote on Sun, Jun 27, 2021 11:57 PM UTC in reply to Daniel Zacharias from 11:29 PM:

If you use the 'y' operator, it can only handle one step before (you can't have an 'a' before the 'y'.) It only interprets that which the internal move generator can handle. In this case, the internal move generator could handle it because the 'mp' really just joins the two steps into a single leap, but it's not smart enough to figure that out.

But, yes, this piece can be done, just not with XBetza.  Actually, I've already written the include file for Expanded Chess, which will be included in the next release.  I will email it to you now.  But for reference, here's how you do the Osprey:

AddPieceType( "Osprey", "O", 750, 750, "Bird" );
Osprey.Step( <2, 0> ).SlideAfterStep( <1, 1> );
Osprey.Step( <2, 0> ).SlideAfterStep( <1, -1> ).MinSteps = 2;
Osprey.Step( <-2, 0> ).SlideAfterStep( <-1, 1> );
Osprey.Step( <-2, 0> ).SlideAfterStep( <-1, -1> ).MinSteps = 2;
Osprey.Step( <0, 2> ).SlideAfterStep( <1, 1> );
Osprey.Step( <0, 2> ).SlideAfterStep( <-1, 1> ).MinSteps = 2;
Osprey.Step( <0, -2> ).SlideAfterStep( <1, -1> );
Osprey.Step( <0, -2> ).SlideAfterStep( <-1, -1> ).MinSteps = 2;

In case you're wondering about the MinSteps = 2 on every other move path, that is to prevent the moves for the (0, 2) leaps from being generated twice.


Robert Mate wrote on Thu, Aug 5, 2021 01:41 PM UTC in reply to Robert Mate from 12:28 PM:

Silverman and Microchess cvc files. Microchess is playable between humans, but crashes the ChessV engine. Not sure why.

https://www.dropbox.com/sh/8t14o11x6lq5294/AACVwG8aPAtAswr-LUd0EqZDa?dl=0

EDIT: I'm slowly adding small chess variants here.


Robert Mate wrote on Thu, Aug 5, 2021 04:22 PM UTC in reply to Robert Mate from 01:41 PM:

I just noticed a bug. If all I do is start a game, make one move, and then take back the move while the computer is thinking.. it crashes. This happens in 2.2 and the new update.


📝Greg Strong wrote on Fri, Aug 6, 2021 01:33 AM UTC in reply to Robert Mate from Thu Aug 5 01:41 PM:

Microchess is playable between humans, but crashes the ChessV engine. Not sure why.

This is interesting.  It is happening because the number of pieces is so small.  Quick fix - the problem is with the default (sudden death) time control.  Use a different time control and you should be fine.

More detailed explaination ...  At the start of each move, the computer decides how much time it would like to commit to the current move.  You could use some fixed percentage of the remaining time always, and you will use less and less for each concurrent move without running out.  But that isn't very good.  It would be better if we had some idea of how many moves the game likely to go on before being "decided" (doesn't need to be actually over if you are so far ahead you can continue to win without requiring much thought.)  This is already an interesting problem in Chess.  It's an even more difficult problem for a variant engine such as ChessV...  I make the basic assumption that games with more pieces are likely to last longer...

So, here's my current formula.  Using four variables: Number of player 1's pieces at the start of the game (P1s), number of player 2's pieces at the start of the game (P2s), number of player 1's peices still remaining (P1r), and number of player 2's pieces still remaining (P2r).  With sudden death time control, the targettime allocated for a move is:

timeRemaining / min( P1s + P2s - 10, P1r + P2r + 6 )

This crashes Microchess since it starts with 10 pieces so it tries to allocate 0% and divides by zero.  Obviously this formula was designed for larger games.  And, in general, ChessV was designed to play the common variants which are typically 8x8 or larger.  I'm sure lots of things are not optimized for tiny variants.  The obvious fix here is to always allocate at least a minimum amount (maybe 1%).  Probably, you would never want to allocate less than 1% of remaining time...  But how many moves does an average game of Microchess last?  Maybe for some games the assumption that length of game is related to number of pieces is not valid.  Perhaps the lower bound should be a configurable game variable with a default of 1%.

I just noticed a bug. If all I do is start a game, make one move, and then take back the move while the computer is thinking.. it crashes. This happens in 2.2 and the new update.

Yup.  Thank you for the easily reproducable bug report.  I will fix this.

 


B.E. Dolata wrote on Fri, Aug 20, 2021 06:13 PM UTC:

Is there a typo in the Duke of Rutlands Chess include file in RC2?

Should 

AddPieceType( Chancellor, "Concubine", "C", 100, 1050 );

be

AddPieceType( Chancellor, "Concubine", "C", 1000, 1050 ); 

The CPU seemed willing to trade the Concubine for a Bishop when I played. 


📝Greg Strong wrote on Sat, Aug 21, 2021 09:03 PM UTC in reply to B.E. Dolata from Fri Aug 20 06:13 PM:

Correct. Thank you. Good catch!


B.E. Dolata wrote on Sun, Aug 22, 2021 04:57 AM UTC:

The Rhino in Grand Betza Chess appears to display the incorrect moves when one right clicks to get to properties. It shows the moves of a Wazir for me.


📝Greg Strong wrote on Tue, Aug 24, 2021 10:51 PM UTC in reply to B.E. Dolata from Sun Aug 22 04:57 AM:

The Rhino in Grand Betza Chess appears to display the incorrect moves when one right clicks to get to properties. It shows the moves of a Wazir for me.

That's right.  The Rhino's move is not supported by the internal move generator.  It is implemented with custom code so the diagram display can't show it.  I need to add an override that suppresses the diagram and instead displays a description of the move.


Robert Mate wrote on Sat, Aug 28, 2021 06:41 AM UTC in reply to Greg Strong from Tue Aug 24 10:51 PM:

Pocket Knight Crash: For the first move, pick up the pocket knight and then put in back in the same place.


📝Greg Strong wrote on Sat, Aug 28, 2021 04:50 PM UTC in reply to Robert Mate from 06:41 AM:

Pocket Knight Crash: For the first move, pick up the pocket knight and then put in back in the same place.

Good catch!  I fixed it.  Thanks!


Robert Mate wrote on Tue, Sep 21, 2021 01:56 AM UTC in reply to Greg Strong from Sat Aug 28 04:50 PM:

For the future, have you considered implementing NNUE? https://en.wikipedia.org/wiki/Efficiently_updatable_neural_network

It would be a solution for piece drop games, and you'd be the only one doing this with large variants in mind.


Robert Mate wrote on Sat, Sep 25, 2021 04:52 AM UTC in reply to Robert Mate from Tue Sep 21 01:56 AM:

Not sure if it's a bug, but for example, fairy-max should be able to play Los Alamos but can't. I've seen keywords "losalamos" and "los-alamos". Perhaps better access to the keywords?


Aurelian Florea wrote on Mon, Sep 27, 2021 03:53 AM UTC:

Hello Greg, I have written you a few mails a while ago. I'm not sure if you got them or if you had answered. Please say something about this.


Daniel Zacharias wrote on Tue, Oct 5, 2021 08:52 PM UTC:

I'm trying to test a game with ChessV, and I get an error saying "Not enough Zobrist keys" when I try to start it. What does it mean?


Aurelian Florea wrote on Wed, Oct 6, 2021 11:47 AM UTC:

Are you here, Greg?


📝Greg Strong wrote on Wed, Oct 6, 2021 03:31 PM UTC in reply to Daniel Zacharias from Tue Oct 5 08:52 PM:

I'm trying to test a game with ChessV, and I get an error saying "Not enough Zobrist keys" when I try to start it. What does it mean?

You must be using a very large number of piece types on a large board.  There is an upper limit on #Players * #Piece Types * #Squares, although it can be increased if I add more random numbers to the list of keys.  How large is what you are trying to do?


Daniel Zacharias wrote on Wed, Oct 6, 2021 06:40 PM UTC in reply to Greg Strong from 03:31 PM:

I am, unfortunately. I have 144 squares and 21 piece types. What is the limit?


📝Greg Strong wrote on Wed, Oct 6, 2021 08:48 PM UTC in reply to Daniel Zacharias from 06:40 PM:

It looks like this should not be over the limit. Can you send me the include file so I can give it a try?


📝Greg Strong wrote on Thu, Oct 7, 2021 01:15 PM UTC in reply to Robert Mate from Sat Sep 25 04:52 AM:

Not sure if it's a bug, but for example, fairy-max should be able to play Los Alamos but can't. I've seen keywords "losalamos" and "los-alamos". Perhaps better access to the keywords?

Thanks for pointing this out.  For now, you can get it to work by editing the Los Alamos Chess include file.  Open it with a text editor and add the following line in the first section, where Invented and InventedBy are defined:

XBoardName = "los-alamos";


Aurelian Florea wrote on Fri, Oct 8, 2021 06:14 AM UTC in reply to Greg Strong from Thu Oct 7 01:15 PM:

Greg, could you indulge me over this weekend?


📝Greg Strong wrote on Fri, Oct 8, 2021 01:02 PM UTC in reply to Aurelian Florea from 06:14 AM:

Greg, could you indulge me over this weekend?

With what?


Aurelian Florea wrote on Fri, Oct 8, 2021 02:59 PM UTC in reply to Greg Strong from 01:02 PM:

Greg, Actually a while ago I have sent an email. But I had solved the problem on my own. But there is still the issue of a bug I had found. When trying to change the appearance of the "white" squares, it does not work. Can you send me again the source files you currently are confident they work. I want to try some things with the joker. I'm not sure if my email is fine. It probably is and I had missed the previous mail, when you did just that.


📝Greg Strong wrote on Fri, Oct 8, 2021 03:18 PM UTC in reply to Aurelian Florea from 02:59 PM:

It seems we have email problems. I think you are getting most of my emails, but when I include a hyperlink it seems you don't receive it.

Here is a link to a recent set of source code. You will probably need to cut & paste this link - don't click on it - or it probably won't open since my site is not https:

http://chessv.org/downloads/ChessV2_2021-08-29.zip

Open with Visual Studio 2019. The free Community Edition is fine.

Regarding square colors, I need more information. There must be an unusual circumstance since the code that handles that hasn't changed in a long time and no one has ever reported a problem with that.


Aurelian Florea wrote on Fri, Oct 8, 2021 04:01 PM UTC in reply to Greg Strong from 03:18 PM:

Unfortuneatly, I could not reproduce the bug, but I'll tell you if I find it again!


Daniel Zacharias wrote on Fri, Oct 15, 2021 11:10 PM UTC:

I think I found another problem. I've tried giving a piece the xbetza move pB, but even though it can only move by jumping, it can still capture like a bishop.

Also, I have a question about promotion rules. Is it possible to have pieces promote only when making a capture in a certain area of the board, and only if the promoting player has no pieces on the board of the type being promoted to?


Samuel Trenholme wrote on Sun, May 8, 2022 07:00 AM UTC:Excellent ★★★★★

https://samiam.org/chessv continues to host the ChessV software, and, indeed, has been updated to have version 2.2 of ChessV. Should chessv.org ever go down, this is an alternate download link.


Samuel Trenholme wrote on Wed, May 11, 2022 08:21 AM UTC:Excellent ★★★★★

I don’t know the correct procedure to file a bug report for ChessV, so I will just note the bug here.

Description of bug

ChessV does not use the standard Chess960 numbering scheme for opening setups. See https://chess960.net/wp-content/uploads/2018/02/chess960-starting-positions.pdf for the reference of correct number to starting position. In particular, ChessV is off by one (Position 0 in the official spec is position 1 in ChessV, etc.)

Steps to reproduce

Open up ChessV. Choose Fischer Random Chess. When it asks for an expected setup, choose setup #692.

Expected results

The opening setup should be RBBQKNNR (Mongredien chess)

Actual results

The setup is BRQKNNRB

Notes

Position 693 is the Mongredien setup in ChessV, so one just needs to add 1 to the official position number to get the corresponding position in ChessV.

Position 518 (519 in ChessV) is the standard chess starting position.


Aurelian Florea wrote on Thu, May 12, 2022 08:25 AM UTC:

I don't think this is a bug. At most it is a missing feature. Greg usually takes care of these but he probably not knew the rule.


📝Greg Strong wrote on Fri, May 13, 2022 12:32 AM UTC:

Thanks, Sam. This is not too bad... I gather my algorithm was correct, but I assumed that the positions would be numbered 1-960 (as people count), not 0-959 (as programmers count). In fact, it looks like I just add one at the end after placing the pieces. Not sure where I got that - it's unlikely I just made it up, but it does seem that the consensus is to number the positions starting at 0. Anyway, easy fix.


Aurelian Florea wrote on Thu, Oct 13, 2022 01:15 PM UTC:

Hello Greg!

I have a few questions:

  1. How do I specify 2 promotable types in with the script language?
  2. How do I enter the pawn double move for the maasai pawn?
  3. Why are the rank and files reversed when you define a move with steponly (I have : AddMoves{ AddMovesOf(Pawn) StepMoveOnly(< 0,-1>) StepMoveOnly(< 0, 1>) }) and with the AddMoveCapability (example: PawnDoubleMove.Direction = new Direction( 0,1 );). The first is lateral and the second is up!

📝Greg Strong wrote on Thu, Oct 13, 2022 02:38 PM UTC in reply to Aurelian Florea from 01:15 PM:

How do I specify 2 promotable types in with the script language?

You can add additional promotion rules for other promotable types.  You aren't limited to one.  So for the Maasai:

AddRule( BasicPromotionRule( Maasai, { Queen, Eagle, Lion, Sorceress, Duchess, Rhinoceros, Buffalo }, { location: location.Rank = 11 } ) );

How do I enter the pawn double move for the maasai pawn?

The simple way to do this is with XBetza.  Don't specify an internal type and set it's move with XBetza like this:

AddPieceType( "Maasai", "M", 200, 200, "Sergeant" );
Maasai.XBetza = "msWcfFmfR2";

In this example, Sergeant specifies the preferred graphic to use.  Also, under the Tools menu, there is an XBetza Expression Tester so you can make sure your XBetza is supported.  (ChessV does not support everything.)

For a more complicated example, lets say the double move is only supported on the second rank.  Then you have to use PieceType.AddMoveCapability, which takes a MoveCapability object, who's constructor looks like this:

MoveCapability( Direction dir, int maxSteps = 9999, int minSteps = 1, bool canCapture = true, bool mustCapture = false )

So you would have something like:

FancyPawn.AddMoveCapability( MoveCapability( <1, 0>, 2, 2, false ) ).Condition = { location: location.Rank == 1 };

The maxSteps is 2.  The minSteps is also 2 because the single step would already be generated by the regular move capability that is applicable everywhere.  canCapture is false, and mustCapture is left as the default (false).  Then we set the Condition under which the move is available, which is a lambda function taking a location as a parameter and returning a bool.  (location.Rank == 1 because, like all good programmers, we start counting at 0.)

For a good example of a game that does everything manually, look at the include file for Duke of Rutlands chess.

Why are the rank and files reversed when you define a move with steponly

Let me look into this.  The file offset should always come first.


Aurelian Florea wrote on Thu, Oct 13, 2022 03:17 PM UTC in reply to Greg Strong from 02:38 PM:

Thanks, I made it work!


📝Greg Strong wrote on Thu, Oct 13, 2022 03:29 PM UTC in reply to Aurelian Florea from 03:17 PM:

Why are the rank and files reversed when you define a move with steponly

You're right, the rank & file offsets are backwards when you use the <1, 2> notation.  I will have to fix this.  The file offset should come first.  For now, so that I don't break your code, instead of using the <1, 2> abbreviation, you can construct the Direction normally: Direction( 1, 2 ).  This calls the constructor directly and it takes the file offset first.

Thank you for pointing this out!


Aurelian Florea wrote on Thu, Oct 13, 2022 03:51 PM UTC in reply to Greg Strong from 03:29 PM:

You are welcome!


Aurelian Florea wrote on Thu, Oct 13, 2022 05:02 PM UTC in reply to Greg Strong from 03:29 PM:

I have stumbled on another hurdle, Greg. I need to not have more than a Joker on the board. So that means no promotion to joker unless my joker has been captured. I figured out I have to use PromoteByReplacementRule but I can't get my head around the second argument. Can you help, please?


📝Greg Strong wrote on Thu, Oct 13, 2022 05:37 PM UTC in reply to Aurelian Florea from 05:02 PM:

No problem. Use the promotion rule as normal - always allow promotion to Joker. Then, there is another rule you can use to limit the number of pieces of a given type on the board. LimitPieceTypeQuantityRule( PieceType, maxCount ). So:

AddRule( LimitPieceTypeQuantityRule( Joker, 1 ) );

 


Aurelian Florea wrote on Thu, Oct 13, 2022 05:38 PM UTC in reply to Greg Strong from 05:37 PM:

Ok, Thanks!


Aurelian Florea wrote on Thu, Oct 13, 2022 06:07 PM UTC in reply to Greg Strong from 05:37 PM:

There is probably a bug with that instruction. I have sent you an email as the error message is very long!

I feel that this rule interacts badly with the joker. I have not seen other joker bugs, as of now!

Later edit. I have tried limiting the rooks to 2. There is the same error.


📝Greg Strong wrote on Thu, Oct 13, 2022 06:42 PM UTC in reply to Aurelian Florea from 06:07 PM:

You're right, this rule is broken :(

I'll need to get that fixed.


Aurelian Florea wrote on Thu, Oct 13, 2022 06:50 PM UTC in reply to Greg Strong from 06:42 PM:

Please let me know when you solve this, as I'm using ChessV for designing my games (not the intended purpose I guess, but ChessV is very general).


📝Greg Strong wrote on Thu, Oct 13, 2022 07:10 PM UTC in reply to Aurelian Florea from 06:50 PM:

Helping to test game design is certainly an intended purpose. But do you need a new build just to correct this one issue? For test purposes, I wouldn't think allowing 2 jokers or not allowing promotion to joker at all would change very much.


Aurelian Florea wrote on Thu, Oct 13, 2022 07:13 PM UTC in reply to Greg Strong from 07:10 PM:

Indeed.


Aurelian Florea wrote on Thu, Oct 13, 2022 08:07 PM UTC in reply to Greg Strong from 07:10 PM:

But also from some point ahead, I prefer the correct rules. Anyway, for the purpose of measuring the piece values , I do not use the joker as it introduces many instabilities. By the way, in the few games I,be noticed so far there are no joker related bugs. But I do not know if I can suppress the special pawn powers when imitating a pawn. Also chessV does not use the move by move recalculation of the joker value. And these things are difficult to do. Partly this is why I'm trying my hand, at my own program !


Aurelian Florea wrote on Thu, Oct 20, 2022 02:40 PM UTC in reply to Greg Strong from Thu Oct 13 07:10 PM:

So, the games I'm creating are 10x10 and the castling type is 2R-standard (it is correctly assigned this is not the problem). The ai is quick to move to the back rank most of the time for no reason before castling, and sometimes (rarely) after castling seemingly for no reason. In the latter case I can be totally wrong though. Anyway, how do I disable this tendency of the general 10x10 ai? Would you recommend I inherit from a more general class or general 10x10 is fine?


📝Greg Strong wrote on Fri, Oct 21, 2022 01:25 AM UTC in reply to Aurelian Florea from Thu Oct 20 02:40 PM:

The piece-square-tables do encourage the king to retreat to the first row. You can see the PSTs by right-clicking on the piece, selecting Properties, and then look at the Midgame or Endgame PST tab.

We can eliminate that desire by zeroing the "forwardness" midgame PST component (which is negative for the king.)  In your AddPieceTypes function:

King.PSTMidgameForwardness = 0;

See if that helps.  There can be other factors as well, like the deveopment evaluation and king safety evaluation, although the development evaluation should be encouraging it to castle.


H. G. Muller wrote on Fri, Oct 21, 2022 07:04 AM UTC in reply to Greg Strong from 01:25 AM:

In variants where there is more than one rank behind the Pawns, and many strong pieces, castling directly behind the Pawns is often a very bad move. In general one could say that in such variants the castling rule is only added out of conservatism, but is as useless as adding a rule that at any time you can permanently remove your Queen from the board instead of making a normal move. No one in his right mind would ever do it. Even in the central files, a King on the back rank sheltering behind by a wall of Pawns plus a wall of pieces is usually a lot safer than a King directly behind the Pawns.

So the first issue to consider is whether it is really a good idea to force an engine to make poor moves just because the rules allow those. That being said, if it is really such that castling is good, the usual way is to discourage moving an uncastled King not by Piece-Square Tables, but by giving a hefty bonus for the possession of castling rights. (Which should reflect the PST and other positional score the King would get in the castled position. If they were higher the engine would never castle, because he would think it more important to preserve the rights to do so.) In KingSlayer I always evaluate the quality of the Pawn shield in the castled locations, and derive the value of each castling right from that. These are then devaluated a little depending on the number of pieces that still block the castling. And the total value of the rights is that of the best right plus a factor smaller than one times the other.


Aurelian Florea wrote on Fri, Oct 21, 2022 08:04 AM UTC in reply to H. G. Muller from 07:04 AM:

@Greg&@HG, Now there is the trouble that the ai moves the pawns ahead of the possible location of the castling king, or ahead of the castled king, again quite arbitrary. There is only one heavy piece besides the queen in the games I mention (between the value of the rook and of the queen) so deadly back rank incursion from the enemy don't seem the desirable. But there are 26 pieces /side, and some pawns need to move to bring some air into the position. So maybe some penalty from leaving pawns on one side OR the other side is welcome. This as it is needed to move some flank pawns in order to develope quickly. I agree with HG, KingSlayer approach. Maybe you can customize all of that, Greg.

There is one more issue. With a 10 files board one needs to get out three pieces before castling. In the games I had mentioned there are the bishops by the queen and king and 2 leapers. Then there are the rooks. On the other side there is also the queen. The fact that you have to take out 3 pieces hinders castling a bit. I was thinking about a "Bishop jumping rule during castling". This means the castling king may jump the bishop when castling but not to other pieces. Would this be a good idea. What do you guys think?


H. G. Muller wrote on Fri, Oct 21, 2022 08:41 AM UTC in reply to Aurelian Florea from 08:04 AM:

I would not introduce yet another form of castling. How about Kevin's 'fast castling' rule?

But normally getting out 3 pieces should not be a problem. Of course it depends on whether these pieces can jump, or otherwise get out without destroying the Pawn shield. If they had to compromise the Pawn shield (e.g. like starting a Commoner on the Knight squares of the FIDE setup) that would just count as bad design. (In the Daring Dragons army of CWdA I gave the Dragoon an initial Knight jump for that reason.)

In a Grand-Chess like setup with enough empty space on the back rank there would not be a problem to clear the 2nd rank for castling; one can just retract the pieces to the back rank.

In the KingSlayer approach moving the pieces out of the castling path is encouraged, because it makes the castling right in that direction more valuable (less discounted). And the castling right with the highest weight (because it is the best of the two) would be preferred, because it contributes most to the total. So it encourages clearing one path completely before clearing the other partially (other factors such as quality of the Pawn shield being the same). This usually leads to quick clearing of one castling path. But if the other castling is still possible, it would not immediately castle, because having a second right (even when weighted less than the best right) is worth slightly more than the difference between having the right and being in the castled position. Which is what you want: keeping the opponent in the dark as long as possible so that he doesn't know what wing to aim his pieces at during development is usually a good strategy.

Of course the quality of the Pawn shield (which also takes account of enemy Pawns, such as half-open files directed at the shield, or an approaching Pawn storm) remains part of the evaluation even after castling. (But then of course only the one in the direction you actually castled.) This prevents the engine from destroying its own Pawn shield later, while it 'liberates' the Pawns on the other wing.

All this is pretty cheap, as the shield qualities are part of the Pawn-Structure evaluation, which is rarely done, because it is stored in a Pawn hash table that has a very high hit rate. The K-side and Q-side shield qualities are just two items in the Pawn hash entry. (Together with info about half-open files, passers, edge Pawns etc.) And you can stop calculating them once all castling rights are gone, which is usually pretty early in the game.


Aurelian Florea wrote on Fri, Oct 21, 2022 09:26 AM UTC in reply to Greg Strong from 01:25 AM:

I'm not sure if I have the current build. But I'd like the following features for batch mode. 1.Add an adjudication coefficient with a default of say 10 pawns. 2.In the save file add the end add the total score.


Aurelian Florea wrote on Fri, Oct 21, 2022 09:32 AM UTC in reply to Greg Strong from 01:25 AM:

And a final thing which is rather hard. But if you can please add the customizable value for the joker. HG has proposed the ratio of the sum of squares of the piece value with the piece values. I think some coefficients are good to be in place. Something like (a1p1^2+a2p2^2+...+anpn^2)/(b1p1+b2p2+...+bnpn). where n is the number of piece types and a1,...,an and b1,...,bn are float coefficients. One utility of the coefficients is when imitating a colourbound piece as the joker is not actually colourbound. I know this takes time, so if you can... Good luck Greg!


📝Greg Strong wrote on Fri, Oct 21, 2022 01:42 PM UTC in reply to H. G. Muller from 07:04 AM:

That being said, if it is really such that castling is good, the usual way is to discourage moving an uncastled King not by Piece-Square Tables, but by giving a hefty bonus for the possession of castling rights.

This is already part of the development evaluation.  And the quality of the pawn shield is part of the king safety evaluation.  If it's not castling, it is probably because, as you say, it is not a good idea.  While the evaluation function cannot be perfect, ChessV does know what it's doing.

And a final thing which is rather hard. But if you can please add the customizable value for the joker.

I don't know about this.  The value of the piece itself cannot directly change, but it would be possible to add a new evaluation function that makes an adjustment to the final score based on the relative values of the joker(s).  I will give it some consideration.


📝Greg Strong wrote on Fri, Oct 21, 2022 01:45 PM UTC in reply to Aurelian Florea from 09:26 AM:

I'm not sure if I have the current build.

The latest is what I recently posted on the Avatar Chess page.

Add an adjudication coefficient with a default of say 10 pawns

This would definitely be useful

In the save file add the end add the total score

You mean at the end of the tournament, list the total win counts?


Aurelian Florea wrote on Fri, Oct 21, 2022 02:02 PM UTC in reply to Greg Strong from 01:45 PM:

Yes, at the end of the tournament list may you place something like: playerfoo:51 playerbar:49


Aurelian Florea wrote on Fri, Oct 21, 2022 02:13 PM UTC in reply to Greg Strong from 01:42 PM:

Thanks for taking the joker evaluation into account in your own time!


Aurelian Florea wrote on Fri, Oct 21, 2022 02:53 PM UTC:

With the:

King.PSTMidgameForwardness = 0;

instruction applied I have watched 4 games at 2 mins + 7 seconds. Only once in 8 cases the ai has not castled choosing a back rank diagonal move (so there is something about it.). Once there was the opposite sides castle going on. I am not sure exactly how to do it but the above-mentioned instruction definitely makes things more castlely.


Aurelian Florea wrote on Sat, Oct 22, 2022 05:49 AM UTC in reply to Aurelian Florea from Fri Oct 21 09:32 AM:

I think I figured out why the pawns move so quickly in the opening. It is the promotion rule. Now one can promote even at rank 7 (out of 10). So pawn pushes are more tempting. I do not know if it is the correct strategy. I'll play the opening myself, to see what is going on!


Aurelian Florea wrote on Sun, Oct 23, 2022 08:34 AM UTC in reply to Greg Strong from Fri Oct 21 01:45 PM:

How do I delete a color scheme?


Aurelian Florea wrote on Sun, Oct 23, 2022 08:55 AM UTC in reply to Greg Strong from Fri Oct 21 01:45 PM:

I have downloaded the latest build and, in the game anonymous, there is an inaccuracy in the definition of the butterfly.

The correct definition should be that:

    AddPieceType( "Butterfly", "H", 800, 800, "Butterfly" );
        Butterfly.Step( <2, 2> ).SlideAfterStep( <1, 0> );
        Butterfly.Step( <2, 2> ).SlideAfterStep( <0, 1> ).MinSteps = 2;
        Butterfly.Step( <-2, 2> ).SlideAfterStep( <-1, 0> );
        Butterfly.Step( <-2, 2> ).SlideAfterStep( <0, 1> ).MinSteps = 2;
        Butterfly.Step( <2, -2> ).SlideAfterStep( <1, 0> );
        Butterfly.Step( <2, -2> ).SlideAfterStep( <0, -1> ).MinSteps = 2;
        Butterfly.Step( <-2, -2> ).SlideAfterStep( <-1, 0> );
        Butterfly.Step( <-2, -2> ).SlideAfterStep( <0, -1> ).MinSteps = 2;

Aurelian Florea wrote on Sun, Oct 23, 2022 09:28 AM UTC:

@ Greg,

  1. Is there a possibility to have a time handicap against the computer?
  2. Is there a possibility of defining a color scheme with the script editor?

📝Greg Strong wrote on Sun, Oct 23, 2022 03:41 PM UTC in reply to Aurelian Florea from 09:28 AM:

How do I delete a color scheme?

I guess I should add an option for that.  Presently, you'd need to remove it from the registry...   Run Registry Editor, go to  Computer > HKEY_CURRENT_USER > Software > ChessV > Color Schemes.  Then delete the key for the scheme you want to delete.

Is there a possibility to have a time handicap against the computer?

Probably.  I'm dreading doing any modifications to that dialog box - it was tricky getting it to look and work correctly.  Maybe I'll add the ability to change the clocks from within the came.

Is there a possibility of defining a color scheme with the script editor?

Sort of.  You can set custom colors for a game but it won't be saved as a named scheme that you can apply to other games unless you save it.  The include file for Palace Ninja Guards sets the square and border colors.  You can also set Player1Color and Player2Color in the same way.  NOTE: This is only setting the defaults for a game.  Any game you have already played already has your color choices saved in the registry so this won't change anything.  But you can delete the registry key for the game if you want and then it will reset to the defaults specified in your include file next time you open the game.  Computer > HKEY_CURRENT_USER > Software > ChessV > Games.

 


Aurelian Florea wrote on Sun, Oct 23, 2022 03:49 PM UTC in reply to Greg Strong from 03:41 PM:

Thanks, Greg!


Aurelian Florea wrote on Wed, Oct 26, 2022 01:03 PM UTC in reply to Greg Strong from Fri Oct 21 01:42 PM:

@Greg,

And another thing I discovered about the value of the joker. It matters also how many pieces the opponent has. Imagine on a 10x10 board (where I had measured that the chancellor and gryphon are equal, and also it is known that the RN and the BWN are also equal) and endgame with king, joker, gryphon, chancellor and the BNW against king, joker and 3 chancellors. The side with the more diverse pieces has an advantage. There is a lot of consideration to be put into this I'm afraid. Good luck!


📝Greg Strong wrote on Wed, Oct 26, 2022 02:40 PM UTC in reply to Aurelian Florea from 01:03 PM:

I wouldn't get your hopes up for anything that sophisticated. It will be basic, whenever I get to it. The Joker is not something I am interested in spending a lot of time on.


Aurelian Florea wrote on Wed, Oct 26, 2022 02:57 PM UTC in reply to Greg Strong from 02:40 PM:

Ok, thanks!


Aurelian Florea wrote on Thu, Nov 10, 2022 01:45 PM UTC in reply to Greg Strong from Wed Oct 26 02:40 PM:

Hello Greg! Have you had time to include the features I asked about a few weeks ago?


Aurelian Florea wrote on Sat, Nov 12, 2022 12:23 PM UTC in reply to Aurelian Florea from Thu Nov 10 01:45 PM:

@Greg, Please notice my previous comment!


📝Greg Strong wrote on Sat, Nov 12, 2022 02:39 PM UTC in reply to Aurelian Florea from 12:23 PM:

I don't have anything to release at this time


Aurelian Florea wrote on Sat, Nov 12, 2022 04:11 PM UTC in reply to Greg Strong from 02:39 PM:

Ok! Thanks for everything!


Aurelian Florea wrote on Sun, Nov 13, 2022 07:37 AM UTC in reply to Greg Strong from Sat Nov 12 02:39 PM:

@Greg,

I'd like to make chessV play custom variants against another chessV copy where the small parameter would yield different results. May you write a small guide on how to do that?


📝Greg Strong wrote on Sun, Nov 13, 2022 03:38 PM UTC in reply to Aurelian Florea from 07:37 AM:

Unfortunately, there is no way to do this at present. ChessV can be used to test changes to its parameters by playing against another engine, but as far as I know there are no other engines capable of playing your games. You certainly could run two instances of ChessV but they won't talk to each other.

I need to separate the game representation used in thinking from the one in the GUI. This would not only allow testing of different parameters but would also make multi-threaded thinking possible.


Aurelian Florea wrote on Sun, Nov 13, 2022 03:57 PM UTC in reply to Greg Strong from 03:38 PM:

Ok, Thanks


📝Greg Strong wrote on Sat, Nov 19, 2022 02:41 AM UTC:

This is a technical follow-up to recent discussion in other threads.  Overview: there are cases where whether a move is legal depends on what other moves are available.  These follow the general pattern where a certain class of moves are only legal if there is nothing else that is legal, in which case this class of moves all become legal.

I originally raised this in response to the Golem Chess rule that "a Golem or Half-Golem may not capture an opposing Golem or Half-Golem if the opposing Golem or Half-Golem is two squares away and defended by a piece on its own side" ... UNLESS there is no other legal move.  I then realised this was similar to the Losing/Giveaway Chess rule that non-capturing moves are only legal if there are no captures.  We discussed a plan for implementation, which I have started implementing.  While doing this, I found a place in ChessV where I had already encountered this problem and "hacked" it in a less general way and forgot about it ...  That is the Jumping Chess rule that if there is a piece on an edge square that can make a capture, the player must make one of those moves (their choice) but nothing else is legal.  Having come up with these three cases already, I must assume there are more.  So, on to how these can be solved in a universal chess engine ...

Typically, moves are either legal or not.  It is true that a move generator generates so-called "pseduo-legal" moves they might turn out not to be legal when made (if, for example, they expose your King to check or leave him in check.)  But when these pseudo-legal moves that are not really legal are actually made, it is detected that they aren't actually legal and they are skipped.  Details of how this happens varies but it doesn't really matter.  This is simple and doesn't depend on any other moves.  ChessV handles it like this: whenever a move is made, a MoveBeingMade message is routed to every Rule in the Game that receives that message.  The rule can then return an IllegalMove result code to rule the move illegal.  Besides exposing your King to check, other reasons exist such as a LocationRestrictionRule stopping your King from leaving the castle or your Elephant from crossing the river, or the TradePreventionRule making Lion "iron" by preventing captures after you've captured the opponent's Lion.  (As an irrelevant aside, MoveBeingMade messages are also handled just for the purpose of updating game state - such as the EnPassantRule determing when a pawn push creates the possibility of an en passant capture.)

But now we have pseudo-legal moves who's legality depends on what other legal moves exist.  This presents a new challenge.  The general idea is this: allow the MoveBeingMade function to return a new code, which I originally called IllegalUnlessOnly but am now calling FallbackLegality.  Moves of FallbackLegality are all legal if and only if all pseudo-legal moves are either FallbackLegaltity or IllegalMove.  These moves could be temporarily set aside and tried again later if appropriate, or, if appropriate, a new node could be launched with tail recursion wherein FallbackLegality moves would be accepted.  For purposes of this discussion, the implemention details don't matter.

So now that I'm actually implementing this, of course I've found an issue - which is the reason for this post.  What we have so far is straight-forward ... until we get to Quiescent Search.  I won't define QSeach in detail since I've explained it several times before, and since this conversation is only really of interest to implementers of chess variant engines who should know this anyway.  But in qsearch we only try captures so we don't actually know what all the legal moves are.  For purposes of determining the impact of this issue, a quick revisit of the three known use cases of FallbackLegality:

1. Losing/Giveaway Chess: If a player can make a capture, he must (although he can choose which).  So all moves which are not captures are FallbackLegality.

2. Jumping Chess: If a player can make a capture with a piece that is on a boarder square, he must (although he can choose which).  So all moves which are not captures of a pice on a border square are FallbackLegality.

3. Golem Chess: a Golem or Half-Golem may not capture an opposing Golem or Half-Golem if the opposing Golem or Half-Golem is two squares away and defended unless there is no other legal move.

Impact on qsearch?  For cases 1 and 2, I think there is no impact.  These rules already consider everything that is not a capture to be of FallbackLegality.  Easy peasy.  But #3 is a problem.  Here a capture can be ruled illegal if there is a legal non-capture, which we won't know in quiescent search.  We could generate and test them all, but that would be way, way too expensive.  (Something like 90% of nodes are qsearch nodes.)  So, if we treat this case like 1 and 2 and sweep it under the rug, we can consider a golem capture of the enemy golum legal when it is not.  This could have a dramatic impact on the score.  So I think we should not consider this capture in qsearch, since the circumstances where it would be legal are quite rare.

We could rule out all FallbackLegality moves in qsearch ... That would not affect case #1 at all and it is what we want in case #3, but it would be bad in case #2.  In case #2, we want to do exactly what we normally do - generate all captures and use our normal rules for FallbackLegality.

I think this is solved by adding another Game variable.  As I have variables for things like whether Static Exchange Evaluation should be enabled, I plan to add a Game variable called "ConsiderFallbackLegalityMovesInQSearch" to control whether normal rules for FallbackLegality should be applied in qsearch or if we should just rule all these moves out.  In case #1, the setting wouldn't matter.  In case #2, we would want the setting to be true.  In case #3, we would want the setting to be false. (This will result in an incorrect evaluation on occasion, but qsearch isn't perfect.  This is the lesser of the two evils.)


H. G. Muller wrote on Sat, Nov 19, 2022 08:43 PM UTC:

I think you are making too much of this. For one, QS is never omniscient. The stand-pat assumption that the best non-capture will leave the evaluation approximately as it is, is just an assumption that is often false. There could be forks, or skewers. There could even be mate in one. Minimax turns out to be very resistant to random perturbation of a reasonably small fraction of the scores in the leaves; you must be very unlucky for such a perturbed score to affect the root score and move.

You actually defined different classes of legality, and why stop at three? Generalizing this you could have an arbitrary number of such classes. I would prefer to call these 'priority classes'. You must play a move from the highest non-empty class.

What to do is just a matter of statistics. How are the moves typically distributed over the classes, and how are the moves that typically change the evaluation distributed. In Suicide captures are class 1, small in number, non-captures class 2, large in number. The situation that there would be a class-1 move we do not want to consider in QS, which would outlaw all moves we do want to consider, because these are all class 2, never can occur. Same with Jumping Chess; the unconsidered moves are by definition class 2. Of course QS is still affected, because if there are moves to be considered, there will be no stand pat.

In Golem Chess typically all moves are class 1, and the occasional move that can be class 2 is even rare amongst captures. The logical thing to do, considering these statistics, is assume there will be class-1 moves amongst the non-captures. Unless you have reason to suspect there might be none. You would only be interested in knowing that if you did not find any class-1 captures, and when a lot of captures turned out to be illegal you could suspect that might be true for non-captures as well. (You know from the rules there cannot be any class-2 non-captures in Golem Chess.) Or you could simply know that you are in check, and that this is the reason for the large fraction of illegal moves. Especially if it is a contact check, for which the only legal non-captures can be King moves. But then you would probably extend even in QS, and the problem disappears. Otherwise you assume there will be legal non-captures, and guess their score as the current evaluation, to stand pat. It is what you always do when not in check, and the fact that there was only a capture that was discarded because it wasn't class 1 doesn't do more damage than that there occasionally is a class-1 non-capture that would score far higher than the current evaluation.

Note that the engine is very well capable of determining the distribution of moves over the various priority classes from nodes in the full-width part of the search. In particular you could make it keep track of how often there are no class-1 non-captures in the case there are no class-1 captures, and use that to decide whether to do a class-1 stand pat in QS. If there are more priority classes you would want to know what typically the highest-class non-capture is, given the highest-class capture that is available. If that is lower or equal to that of the highest-class capture, the capture can be searched, and a stand pat of the assumed highest-class non-capture can be tried only if that belongs in the same class.


📝Greg Strong wrote on Sun, Nov 20, 2022 01:38 AM UTC:

I think you are making too much of this.

That is a disctinct possibility!  And that's why I wrote out all of that... so you could tell me if I'm on the wrong track, or overlooking the obvious.  I appreciate your time.  And, while I agree with what you've written, I'm not sure it justifies me doing anything differently.

You actually defined different classes of legality, and why stop at three? Generalizing this you could have an arbitrary number of such classes. I would prefer to call these 'priority classes'. You must play a move from the highest non-empty class.

Absolutely.  It did occur to me that one could invent a chess variant where there are even more tiers of legality...  But I'm not aware of any such game.  I've only come up with 3 instances of needing a middle ground between "legal" and "illegal".  I guess one could argue that as long as I'm making the change, I should go all the way and make an expandable hierarchy of legality.  But that seems more complicated and unnecessary.  And if it's not much more complicated, then it should be easy enough to adapt this should the need arise.  (And, while I would like to support as much as I reasonably can, it is not my goal to support anything that may come along.)

In Suicide captures are class 1, small in number, non-captures class 2, large in number. The situation that there would be a class-1 move we do not want to consider in QS, which would outlaw all moves we do want to consider, because these are all class 2, never can occur. Same with Jumping Chess; the unconsidered moves are by definition class 2. Of course QS is still affected, because if there are moves to be considered, there will be no stand pat.

I do not entirely understand this, but I think you are in agreement that "fallback legality" moves should be considered in qsearch in Giveaway and Jumping.

In Golem Chess typically all moves are class 1, and the occasional move that can be class 2 is even rare amongst captures. The logical thing to do, considering these statistics, is assume there will be class-1 moves amongst the non-captures.

I interpret this to mean that you agree that "fallback legality" moves should not be considered in qsearch in Golem Chess.

Note that the engine is very well capable of determining the distribution of moves over the various priority classes from nodes in the full-width part of the search. In particular you could make it keep track of how often there are no class-1 non-captures in the case there are no class-1 captures, and use that to decide whether to do a class-1 stand pat in QS.

Ok ... so if I understand correctly, your are not disputing that qsearch needs to be treated differently in Golem vs. Giveaway, but that, rather than a configurable variable that the programmer must set, the engine can determine this for itself.  Hopefully I got that correctly.  If so, my question is how much extra complication does this involve?  Certainly, I'd rather not add another user-configurable element if it's not necessary.  Heck, even the name of this hypothetical variable, "ConsiderFallbackLegalityMovesInQSearch", makes me a little embarassed.

Let's make sure I've isolated the questions to be decided correctly:

1. Do we need to expand beyond the standard determination of pseudo-legal moves as strictly legal or strictly illegal to account for games that have these types of "illegal unless there's nothing else" type moves?

2. If the answer to #1 is yes, do we just do as I've proposed and add a middle "fallback legality" category or do we go all the way and make a structure for any number of tiers of legality?

3. If the answer to #1 is "yes", regardless of the answer to #2, we have the issue of qsearch.  Do we have programmatic variables to determine what should be considered in qsearch, or do we determine that from statistical analysis?

Do I have this right?  And, if so, what are your answers to these questions?


H. G. Muller wrote on Sun, Nov 20, 2022 06:27 AM UTC in reply to Greg Strong from 01:38 AM:

International Draughts is such a game: not only is capture mandatory, but you must capture the most chips that you can.

In Suicide only non-captures are FallBackLegality, and you never want to consider these in QS. So it is a moot point. (Note, however, that the champion Draughts program Scan does consider moves that invite capture in QS, and considers a position only quiet when there are no such moves, and no captures.) In Jumping there can be captures amongst the FallBackLegality. You must consider those in QS, but only when you actually have to fall back, of course. Always consider the highest non-empty class, and none other.

You have to assign a class to standing pat, to decide whether you can do that, and whether that would be higher class than de highest non-empty class amongst the captures. Usually this can be based on statistics. For Suicide and Jumping stand pat is always FallBackLegality. So no standing pat when there are legal captures. For Golem stand-pat will be legal. So no FallBackLegal captures.

What you want to consider in QS can very well depend on variant. Beside captures one usually considers promotions. In Shogi considering promotions for pieces already in the zone is counterproductive. Promotion is almost a certainty there, and the static eval can assume, say, 90% of the value. Most Chess programs consider non-capture check evasions.


Aurelian Florea wrote on Sun, Nov 20, 2022 12:34 PM UTC:

Hello Greg,

How can I add evaluations for the maasai pawn pushes?


100 comments displayed

EarliestEarlier Reverse Order LaterLatest

Permalink to the exact comments currently displayed.