Jump to content

Recommended Posts

Posted (edited)

I'm building a statistical package for positional analysis in R. One of the metrics that has proven useful at predicting the outcomes of my games is "piece mobility." For example, here's a chess game I lost:

 

https://www.chess.com/echess/game?id=111224894

 

Here's its mobility chart:

https://docs.google.com/spreadsheets/d/1xnlpOszUF9uPowNvYPSGTHx27OAYp3sT5o1vrdJPDco/edit?usp=sharing

 

And the attached image is the game's mobility broken into types of pieces. White won the game, but first it clearly won a war of options. Its mean & median total mobility was 38.30 and 39.5 respectively, compared with black's mean & median of 30.46 and 31.00.

As a disclaimer, I do not use the software package I'm writing to boost scores on chess.com. Chess is my pet project for learning data science. As Popper stated, "Science may be described as the art of systematic over-simplification." I'm just trying to simplify the game of chess.

I've used this square-counting technique while playing chess, no program, just eye-balling it, and it feels pretty potent. However when I've shared it with other chess.com players, I've been told it's a truly moronic concept. I'm curious what I'm missing from chess theory, or what my critics are missing, and I'm looking for ideas for additional scalar measurements to predict or influence the outcome of a game.

post-61510-0-84952900-1458680157_thumb.jpg

Edited by Josh M
Posted (edited)

You lost because you made plentiful senseless movements like f.e. this 19. c5... And immediately lost tower..

 

You could move King to Kg7. Whole concept of attack would be broken as it was on the left side of chessboard.

Edited by Sensei
Posted

Granted c5 on move 19 was a mistake; black Qd8 on move 25 would have just led to white Qxf7#, checkmating me one move faster.

Posted

With a bit of luck you could win this game, if you would kill tower (or force it to move), white King would have nowhere to escape as he was trapped by pawns. Just move Queen to 1st row, when there is no tower there and done..

Posted

This game already happened. I'm not trying to win it or figure out how I could have won it; I'm trying to develop metrics that aid in machine learning and game theory.

Posted

Professional players analyze games after fact to learn where they made mistake, to not repeat them in the future. "Learn from mistake" (especially other people mistake).

Posted

Ah yes, touche. I really should build a "basic blunder detector" that would raise a red flag in positions like move 19. This mobility score is very broad, sweeping, and abstract.

Posted

Have you looked at the general design of a chess engine? Typically, they evaluate things such as control of the center, pawn structure, and piece value. I'm not a chess expert by any means, but it seems that high "mobility" could be either good or bad, depending on context: being mobile because of a vigorous offense is different than being mobile because you are constantly closing holes in your defense.

 

That said, for any metric, the key would be to calculate its predictive power over a wide variety of games: you might have found something that, while not immediately obvious to those who know chess, nevertheless has value in evaluating a chess position (I'm thinking here of the cosine metric, whose use in evaluating the similarity of texts is decidedly non-intuitive. Is there a database of completed chess games you could analyze to see how your metric fares in different situations?

Posted (edited)

Algorithm should go through all figures white and black, and check whether they have direct hit at some opponent figure. And mention it.

It's done by virtual moving each figure to all positions they can move theoretically.

That would be a good start.

 

If you would do it recursively, unlimited times, multi-threaded, you have almost entire AI of chess player.

Without time limit such algorithm would calculate all possibilities of movements in the future, either side of game, and their results, trying to pick up the best one from these possibilities.

You move pawn, and computer know the all ways to give you checkmate, 100+ moves ahead..

Edited by Sensei
Posted (edited)

Algorithm should go through all figures white and black, and check whether they have direct hit at some opponent figure. And mention it.

It's done by virtual moving each figure to all positions they can move theoretically.

That would be a good start.

 

If you would do it recursively, unlimited times, multi-threaded, you have almost entire AI of chess player.

Without time limit such algorithm would calculate all possibilities of movements in the future, either side of game, and their results, trying to pick up the best one from these possibilities.

You move pawn, and computer know the all ways to give you checkmate, 100+ moves ahead..

 

We think of computer calculations as being infinite because we're reaching into the trillions of units of capacity, but here's what happens when you try to calculate all the moves in a chess game:

 

White 1 = 20 possibilities

Black 1 = 20 possibilities

White 2 = ~23^2 = 529 possibilities

Black 2 = ~23^2 = 529 possibilities

White 3 = 529 * 25 = 13,150 possibilities . . .

 

In many of these possibilities, bishops & rooks are freed up seven to ten moves in, and average possibilities at a given move jump to 27 or 30, so by the time you reach the average game length of 30 moves you're looking at

 

2 colors * ~ 27 average moves ^ 30 gamelength = 1.75 * 10^43 possibilities to calculate.

 

That's a really conservative estimate, and we're way beyond billions and trillions at this point.

Have you looked at the general design of a chess engine? Typically, they evaluate things such as control of the center, pawn structure, and piece value. I'm not a chess expert by any means, but it seems that high "mobility" could be either good or bad, depending on context: being mobile because of a vigorous offense is different than being mobile because you are constantly closing holes in your defense.

 

That said, for any metric, the key would be to calculate its predictive power over a wide variety of games: you might have found something that, while not immediately obvious to those who know chess, nevertheless has value in evaluating a chess position (I'm thinking here of the cosine metric, whose use in evaluating the similarity of texts is decidedly non-intuitive. Is there a database of completed chess games you could analyze to see how your metric fares in different situations?

 

I really do need to develop a whole different method of analysis just for pawns. Their distance from the end of the board, their proximity to each other, and the type of pieces protecting & threatening them matter a lot more than the number of squares to which they can move.

 

Not all positions or squares are of equal value by any means, and this metric does double-count squares. For example, a white knight on f3 has access to d4 in the center, and g1 way in the back. This metric regards both these options as equal, which most chess players would regard as erroneous. If there's a white rook on h1, g1 is counted twice because both the rook and the knight can move to it. If there's a white pawn on d4, the knight's access to d4 doesn't even show up on this metric, since pieces cannot move to squares occupied by their own color.

 

On the flip side, part of the reason squares like d4 are so powerful is simply because they have access to other squares, so measuring position by counting options already places more value on central squares. On an empty board, a bishop can access 13 squares from d4, and only seven from g1. A knight can access 8 squares from d4, and only 2 from d1.

 

Additionally, it could be argued that pieces weaken themselves by protecting other pieces. Take the aforementioned white knight on f3. Its access to the white pawn on d4 strengthens the chance that d4 will remain under white control, but if the knight's square is threatened by a pawn or bishop, d4 is not an escape route. In such a case, the weak position on g1 is more useful, simply because it is vacant.

 

So far I've avoided a focus on piece values. They're proportional to piece mobility, but don't adjust to the complications of the game. If we look at the mobility of each piece on b3 of an empty board, it's Queen = 23, Rook = 14, Bishop = 9, Knight = 6, pawn = 1. Knights reach their most valuable point on a gridlocked board, and it reflects in their mobility stabilizing at 5-8 while other pieces get stuck. Queens are most valuable as endgame players, and it reflects in their mobility score surpassing 20 as pieces disappear. If we compare their mobility scores to their point values (Queen = 9, Rook = 5, Bishop = 3, Knight = 3, Pawn = 1), it's clear points are merely an attempt to average the mobility of pieces with no considerations of the stage of the game or the usage of each piece.
I have looked up a few things about chess engines; I know many rely on internally stored master games, relying on the historical human intuition to clarify that squares like d4 are more valuable than squares like g7. Though I'm particularly interested in dissecting the theoretical reasons why such distinctions would be so relevant, I'm really interested in obtaining access to such a database, and would appreciate any materials you can reference which discuss the methodology of chess engines.
Edited by Josh M

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.