Comments/Ratings for a Single Item
I am nearly finished making a Game Courier preset that enforces the rules of this game and displays legal moves. However, the Lion trading rules haven't been implemented yet because they are giving me some problems. Any ideas on how to solve this?
You can find the preset here: https://www.chessvariants.com/play/pbm/play.php?game=Chu+Shogi&settings=chu
As I understand these, a lion may not capture a protected lion, and a piece may not capture a lion if one was captured on the previous move. While the second rule applies only to non-lions, it is applicable only in a situation in which a player no longer has a lion. So, that detail of the rule can be safely ignored, and it can be applied to any piece.
A player may have 2 Lions as a Kirin may be promotted to a Lion
In an engine I solve this by making a Lion that captured a Lion (from a distance, etc.) a temporary absolute royal for one turn. Then playing Ln x protected Ln is considered exposing yourself to check. (In my Crazyhouse engine I do something similar to enforce the ban on castling through check: castling initially ends up with the Rook replaced by a second King. After move generation of the opponent (which would detect the King capture) I then replace that by the Rook it should be. After Other x Lion I make the opponent's Lion iron for one move.
All you need is the concept of 'temporary promotion', piece types that at the beginning of their own turn revert to the unpromoted form. And then have some extra types that are royal and iron.
Btw, note that the counter-strike rule on Lions does not hold when the two Lions are captured on the same square. If a Kirin captures a Lion and promotes in that same move (to Lion), it is allowed to recapture it.
Just to make perfectly clear: any piece may capture a Lion, that has captured a Lion on the previous turn. Restrictions ONLY apply after a non-Lion captures a lion. This rule has been incorrectly written in some parts of this site, which I have complained about before. And thanks for working on a new preset, Adam ^^
I will test to make sure everything else is in order
Everything should be in order apart from the restrictions against indirect trading of Lions (and the repetition rules, which i won't implement because it's way too complex). All I really did was copy the Tenjiku Shogi preset's code to this preset and modified the code to suit the needs of the Chu Shogi preset.
The preset has been posted, and everything seems to be working properly.
You can find it here: https://www.chessvariants.com/play/pbm/play.php?game=Chu+Shogi&settings=chu
Excellent, passed all my tests. Thanks again! I will be using this preset from now on.
The AI of the diagram now also has a vague notion of the Lion anti-trading rules. It isn't perfect yet, because it does not apply the rule for 'bridge capture' yet; you can just generally forbid capture of protected pieces of a certain type. It also doesn't limit it to distant captures, but I guess that only means it unjustly forbids moves that you would never want to make anyway.
@HG,
Hello,
I had just tried it and my advanced lyon defended by the DH got captured by the AI. I then tried it again. It seems to happend to player's lyon on 6th rank once the second dk pawn got moved. Maybe if you try reproducing such a position you may find the bug!...
That is not enough information to set up the position. Can you post the game that it prints below the diagram, up to the position where it happened?
And did you make sure your browser cache was refreshed, so that you are using the updated diagram script, rather than an old cached one? (BTW, counter-strike is still a problem, because the AI does not take prior moves into account. So it wouldn't know that non-Lion x Lion took place.)
The game started from regular initial position and it went like this : 1. Ng5 Cd11 2. e5 Ci11 3. j5 Nf8 4. h5 Tg10 5. Ng6 Nxg6 . I'm not sure what needs refreshing.
And by the way, talking about previous moves, is there a way they will be taken into account as I am thinking about the joker in my apothecary chess game.
Well, for me it doesn't capture the Lion, after these moves. I don't know what browser you are using, but on FireFox I can clear the cache by keeping Shift pressed during the page reload.
The diagram already supports a Betza notation for a Joker (I for Imitator). See the 'Betza sandbox' comment on Betza notation.
Wow cool thing supporting the imitator. I remember earlier versions were not able. Does the AI work also with it? This could sound silly, but random initial positions are supported?
Same with me.
1. Nf5 Cd11 2. Ne7 Ci11 3. Nxd8xe7 Ng8 4. h5 Nxe7
I had managed to clear the cache but the error still goes. I use microsoft edge.
For me it plays BT-g10 instead of Lnxe7. Your browser must be using an old cached script.
BTW, I sort of patched the counter-strike problem now, by paying more attention to what the lastest move was when invoking the AI, and making it aware of a preceding non-Lion x Lion when I set it thinking. This too isn't perfect yet. (It would miss a locust capture of the Lion by a Falcon or Eagle.) But for now it should do.
The point is that I want to replace the entire old move-entry system of the diagram, which had a move generator that directly highlighted squares, in interaction with what already had been clicked, by one based on the new move generator in the AI. The latter just generates a list of all moves, complete with all side effects. And because it can search ahead, it will be able to judge even the more complex legality conditions perfectly. The highlighting during move entry should then be based on that list, and the moves would automaticaly be in AI format, so that they can be fed back into it when it goes thinking for a reply. So it would be a bit of a waste to spend too much time patching up the old system for better interaction with the AI.
Capture bridges now also work. The anti-trading rules in Chu Shogi are so complex because they are applied to a piece capable of double capture, so that a trade could be accompanied by a sizable material gain, and they did not want to outlaw that. The same could in principle happen when several piece types of unequal value are subject to this rule. (As is the case in Tengu Dai Shogi, where Lion and Lion Dog can also not capture each other when they are protected.)
I solved it by specifying a value threshold, and when the combined gain of the capture is larger than the value of the capturer plus this threshold it can be made safely. Because the piece values are only known to the diagram, the option to specify this is tradeThreshold=N, where N is the number of the most-valuable piece that can not act as a capture bridge. So in this case I specified N=2, as the GB was defined as the second piece.
This appears to work, as can be easily tested by dragging a white Lion to i6 and a black one to g7, switch the AI on, and then drag various white pieces to h6 (and then take back 2 moves for the next try). For every piece black should then play Lnxh6xi6, except for P and GB, where it will play something else.
I thought the AI would be easy picking but it is not :)!
So, I switched to Firefox. It appears to be working better now. Still very weak AI
25 comments displayed
Permalink to the exact comments currently displayed.
No, those discussions are about the interactive diagrams.