General principles of Man-machine vs. chess

Source: Internet
Author: User

Chess program, the main difficulty in "Man-machine battle", that is, how clever the machine, chess level (AI) is not high. Different chess, chess board, chess piece, the rule are various. But the idea of making man-machine wars has many common features.

1. The valuation of the situation is based on the current game and "who is the next move" to estimate the current situation, to get one or a few integers (decimals also no defense). is generally 4 integers (addition) of an integer, these 4 integers are: I attack + I defense + enemy attack + enemy defense. It is harmful to the enemy to avoid being harmful to oneself in favor of the enemy . (thank throat want to drink sweet 446828992)

2. Search
2.1 Single Step search. According to the current game, figure out our most likely next step of chess several situations, and then calculate each possible after the situation valuation, which situation is most advantageous to our next step.
2.2 Multi-Step search. Deductive in memory (analog) We take a step (as the 1th Step), the enemy take a step (as in the 2nd step), we take one step further (recorded as 3rd step) ... After simulating N-step, each step takes the most advantageous step towards one's own (sometimes I am my own, sometimes the enemy), and finally calculates the 1th step which should be taken.
Search is often the core, the amount of computation is very large, so it is generally difficult to search deep. In order to speed up the search, many pruning algorithms are introduced, often alpha-beta pruning.

3. Start library game started using the opening library, if the situation hit the start library, according to the library to walk, save a lot of search, opening the library is often the accumulation of experience, good opening library can greatly improve the chess force (chess power is also called game software AI level)

4. The endgame library is usually included in the game to win the game, as long as the hit (may be a global hit or local hit, specific analysis of the situation) can be won by walking. For some chess may be difficult to apply to the mess library.

5. Start, search, and endgame relationships start using the opening library until the library is out of range. Then each time the search for the endgame library (performance optimization in the context of the case), hit by the mess library to go, Miss is searched.

6. Learning function Learning function is mainly on the endgame library, the opening of the rich, but also can be used in the situation valuation parameters of the tuning.
6.1 The wealth of the pieces of the library (the former said that every one of the endgame is a win situation)
If current from the current situation always enter the mess library, then the current situation is to win the situation, add to add the mess library. Add in real time.
6.2 Opening library of the rich
After a large number of data analysis, statistics out of the opening of the 1th step (only 1 steps) of a variety of different ways to win and win probability, so that a higher percentage of winning the first step to add into the opening library. Non-real-time Add. 6.3 Situation Valuation Parameters tuning
Before and after adjusting the parameters, two software versus 1000 innings, according to the result decide whether to adopt the new parameters. parameters, it is necessary to design a set of adjustment algorithm, as long as the time to let the machine run, run more parameters will tend to the best. This is theoretically the case. Strictly speaking, 6.2 and 6.3 do not count the learning function, regardless of the learning function, they are very meaningful. If you need to set the software's chess force (such as beginner, intermediate, advanced), it is simple to set the depth of the search, the primary search shallow, advanced depth.

Because the search is a tree, each node may have many sub-nodes, the tree node is many, so need to optimize, general optimization is pruning, also often use a variety of techniques integrated pruning, so there is a search for the same depth, different games need a lot of time. Consider that the player's waiting time should not be too long, so you need to control the time while searching. Personally think let users wait 6 seconds to 10 seconds, or more normal, two people's chess, also almost this time. Of course, sometimes it takes a very short time.

Having two software PK to each other has a significant effect on AI improvements. Two software needs to be docked, from the code docking (two copies of the code, similar to a dual-core CPU), the coupling is too high, the versatility is too low. From interface docking, coupling and versatility medium, cumbersome operation, low communication efficiency (imagine the time spent by the PK1000 Bureau). The ideal situation is network docking. A common set of protocols is required, and then any 2 software that implements the protocol can be PK. This article is based on the chat records, mainly as their own record. Of course, you are welcome to comment and correct my friends.

General principles of Man-machine vs. chess

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.