Git Product home page Git Product logo

There is a flying dagger game on the Wildfox Go gaming platform, flying dagger is to play 2 moves at a time。can find the combination with the highest win rate from the candidate moves by exhaustive enumeration, or modify the code to realize it. about katago HOT 10 OPEN

awsjgy avatar awsjgy commented on July 16, 2024
There is a flying dagger game on the Wildfox Go gaming platform, flying dagger is to play 2 moves at a time。can find the combination with the highest win rate from the candidate moves by exhaustive enumeration, or modify the code to realize it.

from katago.

Comments (10)

awsjgy avatar awsjgy commented on July 16, 2024 1

Wildfox is the largest Go gaming platform in China, and Wildfox has two-stone-per-move Go game play. We call this 2-steps-at-a-time game Flying Dagger.The rules can be found in these links. https://www.zhihu.com/question/508919146/answer/2290819628
https://news.txwq.qq.com/news/12362.html
https://tieba.baidu.com/p/7675057681
https://www.foxwq.com/news/listid/id/12370.html
This game is played by a lot of people, Chinese, Japanese, Korean, including top professional players
I think it's fun, more randomized, but also more demanding on chess skills
I can only ask for assistance because I have a very weak programming foundation. I hope someone who is interested can try it, because it is possible to train katago with customized rules by modifying the code
This game Wildfox was originally played on a 9×9 board, now it's switched to an 11×11 board, not a 19×19 board, so the training difficulty should be relatively not so big
You'll need to download the Wildfox matchmaking platform https://www.foxwq.com/

I've played a lot of games of Flying Daggers in Wildfox, so I know the rules and techniques better, but this one requires a lot of calculations!

In a particular round, say from hand 15 to hand 40, there are 3 flying daggers on each side of the board, and flying daggers means to play 2 hands in a row. In the end, Let's see who's got more place around them., same rules as Go. If you have any questions, you can communicate here, or do you have contact info or something?

In fact, it is probably easiest to use the exhaustive method to calculate the maximum win rate by playing 2 moves in a row, but it can't achieve the effect of flying daggers, because you can only count the current 2 moves, and you don't know when he has flying daggers, as well as you have to take into account the opponent's flying daggers!

The main thing about this game, if it is to be programmed, is the rule of playing 2 moves in a row, and being able to specify that it is to be done in certain rounds, and that there are only 3 flying daggers on both sides in total, and you don't really know when those 3 are going to appear. This game, if you're going to play it, has a lot of things to take into account, such as calculations for chi, and taking into account the opponent's appearance of flying daggers, and the number of flying daggers you have left, and trying to be connected and thick, and scoring more points for the weight of the forces than for the emptiness of the enclosure

This is the entrance to the Wild Fox Flying Dagger as follows:
  Flying Knife Entrance 1

 Flying Knife Entrance 2

![Flying Dagger Rules(https://github.com/lightvector/KataGo/assets/59596750/cc8902db-0566-4007-ac7f-f521fe72408f)

from katago.

lightvector avatar lightvector commented on July 16, 2024

In principle, I think you could use the "avoidMoves" parameter documented at https://github.com/lightvector/KataGo/blob/master/docs/Analysis_Engine.md to prohibit every possible legal move for the opponent except for passing on the second ply, as well as possibly prohibiting passing for the player on the first and/or third ply in order to prevent them from making a premature game end, depending on the rules.

It may or may not work well, because the policy head is trained to suggest moves in the case that the opponent is not forced to pass, and therefore it may be hard for the search to find the best first move to produce a good two-move combination. For example, self-atari in an huge seki is usually a terrible move, it's usually not even a good ko threat for a large ko. However, if you really are guaranteed two moves in a row, it might be the best move.

An alternative way would be to invoke the analysis engine once on all the few hundred positions consisting of each possible legal move, followed by the opponent passing. Among all the top "blue" moves of each result, then pick the ultimate one that has the highest score and/or winrate.

If you have enough time or compute power, I would intuitively guess the second method to be superior.

from katago.

lightvector avatar lightvector commented on July 16, 2024

Cool. You've probably already seen the documentation at https://github.com/lightvector/KataGo/blob/master/docs/Analysis_Engine.md
but please read it more carefully, for example you tried to provide an "sgf" field but the documentation does not ever mention that field. You can only provide fields that the documentation says exist, you cannot make up your own.

And look at this for a working example:
https://github.com/lightvector/KataGo/blob/master/python/query_analysis_engine_example.py

If this is for a game where randomly sometimes you can play two moves in a row, you should be aware that even using KataGo in the way suggested will not be correct, because if randomly two moves in a row can happen in the future, and if this happens with any meaningful frequency, it will be important to create positions in a way that are less fragile when the opponent gets two moves in a row. I would guess that your approach will probably not result in a very strong bot and that the method to maximize the value of two moves is probably not very important because the values you are maximizing will be wrong anyways, because they assume the rest of the game will only be alternating moves. You could still try it, it would be just for fun and not intended or expected to be strong at this kind of variant.

from katago.

awsjgy avatar awsjgy commented on July 16, 2024

Is there any easy way to do this that is friendly to programming newbies? Trying to implement katago to play 2 moves at a time, even if it's not good enough for chess

from katago.

HackYardo avatar HackYardo commented on July 16, 2024

@awsjgy If u don't modify source code of KataGo and train a new model from zero, the most easy way would be like:

./katago gtp --config path2config --model path2model
genmove b
genmove b
play w k10
play w c3
genmove b
genmove b
...

By the way, is there a two-stone-per-move Go at WildFox? How could I find it? I'm doing a proj that intends to extend the utility of modern Go AI rather than modifying them, so I want to know it, please!

from katago.

awsjgy avatar awsjgy commented on July 16, 2024

I saw that there are chess reveal engines in China, reveal means you don't know all the pieces, but when you make a move, it shows you what your pieces are. So I think Go Flying Dagger, with 2 moves at a time, should be able to realize this function as well. But chess reveal engine, the calculation is better than human, but for opening, it's better to play manually by yourself, than ai.
Here are some ways to play reveal chess:
http://www.360sdn.com/knowledge/25058.html
https://zhuanlan.zhihu.com/p/560840411?utm_id=0
https://baijiahao.baidu.com/s?id=1598678710201118795&wfr=spider&for=pc

The following is an introduction to the mainstream Chinese Xiangqi Reveal Chess AI.:
https://bbs.125.la/forum.php?mod=viewthread&tid=14751584&extra=page%3D9&ordertype=2
http://pf.stkme.com/Blog/View/1470/data.htm
https://www.bilibili.com/video/BV1ig411L7Ae/?spm_id_from=333.337.search-card.all.click&vd_source=95275a53a36736aa8f13f73c0d0a8210
I hope that the engine for 2 moves at a time in Go can be studied by using the technology of Xiangqi Reveal.

from katago.

awsjgy avatar awsjgy commented on July 16, 2024

@awsjgy If u don't modify source code of KataGo and train a new model from zero, the most easy way would be like:

./katago gtp --config path2config --model path2model
genmove b
genmove b
play w k10
play w c3
genmove b
genmove b
...

By the way, is there a two-stone-per-move Go at WildFox? How could I find it? I'm doing a proj that intends to extend the utility of modern Go AI rather than modifying them, so I want to know it, please!
I don't know how to do this one. Can you do a drill? 11×11. Wildfox is this little chessboard.

from katago.

awsjgy avatar awsjgy commented on July 16, 2024

In principle, I think you could use the "avoidMoves" parameter documented at https://github.com/lightvector/KataGo/blob/master/docs/Analysis_Engine.md to prohibit every possible legal move for the opponent except for passing on the second ply, as well as possibly prohibiting passing for the player on the first and/or third ply in order to prevent them from making a premature game end, depending on the rules.

It may or may not work well, because the policy head is trained to suggest moves in the case that the opponent is not forced to pass, and therefore it may be hard for the search to find the best first move to produce a good two-move combination. For example, self-atari in an huge seki is usually a terrible move, it's usually not even a good ko threat for a large ko. However, if you really are guaranteed two moves in a row, it might be the best move.

An alternative way would be to invoke the analysis engine once on all the few hundred positions consisting of each possible legal move, followed by the opponent passing. Among all the top "blue" moves of each result, then pick the ultimate one that has the highest score and/or winrate.

If you have enough time or compute power, I would intuitively guess the second method to be superior.

Can you train a katago with an 11×11 board and 2 moves in a row, it's more fun, a lot of people play it on the Chinese wildfox go platform

from katago.

awsjgy avatar awsjgy commented on July 16, 2024

原则上,我认为您可以使用 https://github.com/lightvector/KataGo/blob/master/docs/Analysis_Engine.md 中记录的“avoidMoves”参数来禁止对手除第二层传球之外的所有可能的合法动作,以及可能禁止玩家在第一层和/或第三层上传球,以防止他们过早结束比赛, 取决于规则。

它可能会也可能不会很好地工作,因为策略负责人经过训练,可以在对手不被迫通过的情况下提出动作建议,因此搜索可能很难找到最佳的第一步来产生良好的两步组合。例如,在巨大的关中自我雅达利通常是一个可怕的举动,对于一个大关来说,它通常甚至不是一个好的ko威胁。但是,如果您真的可以保证连续两步,那可能是最好的举动。

另一种方法是在包括每个可能的合法动作在内的所有几百个位置上调用一次分析引擎,然后对手传球。在每个结果的所有顶级“蓝色”动作中,然后选择得分和/或胜率最高的最终动作。

如果你有足够的时间或计算能力,我会直觉地猜测第二种方法更胜一筹。

Is there a way to quickly analyze all combinations of 2 consecutive moves made by a particular side and select the combination with the greatest chance of winning by an operation similar to an exhaustive enumeration at the expense of reducing the amount of computation. Because the game of Wild Fox Flying Daggers is run on an 11 way board, there are only 121 picks in total, not including outside of the pieces that have already been landed. For example, the normal speed of the computer usually assumes 500po, if you think of 2 moves in terms of 1po, you can quickly find the combination with the largest win rate of -2 moves in a short period of time, so that you don't need to modify the katago code, but rather, by modifying the gui code, you can achieve it, right?
有没有一种方法,可以通过以降低计算量为代价,类似于穷举法的操作,快速分析某一方连下2手的所有组合,选出胜率最大的组合。因为野狐飞刀游戏是在11路棋盘上运行的,一共就121个选点,不包含已经落了的棋子外。比如电脑一般正常速度假设500po,如果以1po来想2步的话,可以在短时间内快速找到胜率最大的·2步组合,这样就不需要修改katago代码,而是通过修改gui代码就能实现吧

from katago.

awsjgy avatar awsjgy commented on July 16, 2024

@awsjgy If u don't modify source code of KataGo and train a new model from zero, the most easy way would be like:

./katago gtp --config path2config --model path2model
genmove b
genmove b
play w k10
play w c3
genmove b
genmove b
...

By the way, is there a two-stone-per-move Go at WildFox? How could I find it? I'm doing a proj that intends to extend the utility of modern Go AI rather than modifying them, so I want to know it, please!

The one you mentioned is also a method. Although it can only be used when flying daggers appear. But you should actually have to think about the effects of flying daggers before they appear. And I don't know how to alchemize katago, alchemy means training katago from 0. I don't have a tutorial for this yet!
你说的这个也是一种方法。虽然只能在出现飞刀时才用得上。但是实际上在出现飞刀以前,就应该要想到飞刀的影响。而且我不知道如何炼丹katago,炼丹的意思就是从0训练katago,这个教程我还没有

from katago.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.