Closed TheYoBots closed 1 year ago
I forgot to mention this in the blog post. Internally we have promotion as boolean, so introducing demotion (-) as a third possible state into the mix, didn't seem worth it, especially since the +/- notation is just redundant and doesn't make much sense overall. So I used different notation, I'm converting internally between them when communicating with fairy, but for bots this is rather unfortunate. Sfen and drops are also different btw (rook is just 'R' not '+P', etc.), but converting those is simple. It's also just not that lishogi won't accept fairy notation, fairy won't like the lishogi one ('+' where it expects '-', etc.). So one needs to convert both ways. I wrote the conversion in ts and scala. I should probably also write in python, that's gonna be a bit annoying... Fairy to lishogi direction is simple - just replace '-' with '+'. The opposite is trickier, because you need to know what piece is moving (you need to know whether fairy wants it to be promotion or demotion)... I can put something together in python if you want.
Alternatively I could just convert to the fairy notation and send that to the bots, probably easier to do...
Is it fine if I add 'fairySfen' and 'fairyMoves' field to the json sent to bots? That will mean that the bots will need to read different json fields with kyotoshogi. I would like to keep exposing the current implementation as main for consistency, since it's showed in various places around the site. I will also of course make the fairy moves, accepted on the server (bot -> lishogi).
Is it fine if I add 'fairySfen' and 'fairyMoves' field to the json sent to bots? That will mean that the bots will need to read different json fields with kyotoshogi. I would like to keep exposing the current implementation as main for consistency, since it's showed in various places around the site. I will also of course make the fairy moves, accepted on the server (bot -> lishogi).
Yes, This would be great. Till that is done, could you send me the script you wrote in scala/ts to do this?
It's live, so it should be fine now. if something doesn't work please let me know. The fairy fields are added only to kyotoshogi responses.
I'll try it out soon. Thanks!
I used the API endpoint
/api/bot/game/{gameId}/move/{move}
to try an make a move for my Bot. My Bot gives the error:As shown above Fairy-Stockfish gives the move
5e4e-
at the particular position (checked it's a legal move). But Lishogi expects something else to make this move (5e4e+
I'd assume?). Both moves are to be input in the usi format, but lishogi doesn't follow the same notation fairy-stockfish does.