Comments/Ratings for a Single Item
Since when did the AI stop using Pocket Knight in such a stupid way? I noticed that now the AI doesn't drop it as quickly as possible.
Regarding all that, two advantages of a drop/mU are that the piece's presence in a particular spot can block attacks; and its location can be the launching point for a potential capture, which drops normally cannot do (my Anvil being that rare and probably unique exception). So, an mU (or @) should be given greater weight for any given turn on the basis of those two things.
And any initial move, drop or otherwise, should have a lowered effect on the piece's net value (if it doesn't already). After all, you only get one shot at it.
Perhaps I should treat U as a special case, and give a significant penalty (like nearly one Pawn) for moving a piece that has such a move. Even if it was not an initial move. Because it will always be a wasted move; after it you cannot reach any square that you couldn't reach already. So there must be some tactical reason before considering it.
There is the issue of captures, though, in case of mU. In particular when you are in a location where you have zero captures, like the Shogi hand. My first Shogi engine initially had that flaw: it kept hoarding pieces in hand, because these were worth more there, but this eroded its board control so much that his defenses easily collapsed under attack. So I added a non-linear term that discouraged holding too much material in hand.
All that's worth considering, and if I were better (more practiced) at programming I'd offer to lend a hand.
I'll just hope that you and I both live long enough that I can one day drop an Anvil into a game. :)
(Though the icU ikcU solution is still possible!)
If the Interactive Diagrams had a rule that pieces could move out of the "hand" with an iU move (or perhaps an atom specifically designated for the purpose), that might be a more generalized solution.
This is one of the things that has been on the to-do list for very long: an atom to indicate dropping. The plan was to use @ for this as if it were a capital. Of course directional and some other modifiers and ranges would be meaningless in this case, so the corresponding lower-case letters could be recycled for drop-specific meanings. Like j meaning that you cannot drop on first rank (somewhat similar to its use for ski-pieces, if you imagine the dropped piece to come from behind the baseline), and a range behind the @ indicating the maximum rank you can drop. The f (for 'file') could mean that only a single piece of the type can be in a file (and ff two pieces), while the s could limit you to a single piece per square shade, and b for the entire board.
The problem is that it doesn't bring very much as long as the AI doesn't know how to use the drops, and currently it doesn't search deep enough to see the advantage of drops, and will be overwhelmed by the large number of drops that would in general be possible. Limitations on what you can drop in the same file or shade are by definition a legality matter, and since the Diagram highlights all pseudo-legal moves you would not see that even in manual play. Limitations on the ranks you can drop can now be specified by a morph parameter (exempting the normal moves), so for that you won't need it either.
And then there is the issue of evaluation. The AI uses the Pocket Knight in a pretty stupid way, dropping it as quickly as possible. While the best use is of course to keep in in your pocket as long as possible. This behavior comes from the built-in drive to centralize pieces, and in the representation here the Pocket Knight is furthest from the center. So it gets an enormous bonus for brining it into play.
This exposes a flaw that might have a general fix: in a sense pieces that have an initial move are not the same pieces as those that no longer have it. Basically the first move always is a demotion. Now the value of a one-time move is of course not nearly as large as when you can use it forever. But it would contribute some, and especially when it is an extremely powerful move like U, even the small fraction it contributes can be significant compared to positional bonuses like centralization. So moving pieces with initial moves should incur a penalty, the magnitude of which could be calculated by repeating the value guestimate with the initial move enabled.
I also was thinking about how clever that solution is. I now have a way to represent the Anvil (icU)!
Addendum: If the Interactive Diagrams had a rule that pieces could move out of the "hand" with an iU move (or perhaps an atom specifically designated for the purpose), that might be a more generalized solution.
Clever solution to the drop problem!
It never occurred to me to use the Universal Leaper move for mimicking drops. An alternative over defining it as an initial move would be to define a captureMatrix that has the Pocket Knight promote to Knight whenever it moves (captureMatrix=/////N). The Pocket Knight can then be simply mU, and you would not need so many inaccessible ranks to isolate it from the board.
Edit: King is now KilO2jirO2 so that it can't castle with Pocket Knight. Thx HGM!
9 comments displayed
Permalink to the exact comments currently displayed.
I suppose I implemented the idea I described earlier in this thread, to give U moves a penalty in the positional range. I don't remember when I did that. (Or in fact that I did it at all.)
BTW: K-side castling is done with the pocketed Knight, instead of the Rook! Better move the pocket squares to 2nd rank.