Value Nb1?

Discussion of chess software programming and technical issues.

Moderator: Ras

Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Value Nb1?

Post by Henk »

I wonder if knight on b1 is worth less than a knight on g1.
Any statistics available ?

For instance after Nc3 and c6 or a6, e6 the knight can't do much. Only protect e4 square.
It may travel to g3 but that costs two moves.

Looks like Ng1 does have lesser problem. Opponent won't play f6. And h6 imeans a weakness. Also less difficult to play d4 for that square is easier to defend.
lkaufman
Posts: 6227
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA
Full name: Larry Kaufman

Re: Value Nb1?

Post by lkaufman »

The recent knight odds games show that in the initial position the Nb1 is actually the more important knight, because without it White's two main openings don't work well, 1.e4 due to 1...d5!, and the queen's gambit due to having no knight to block a later check on b4. But after the first few moves have been played, the king's knight is usually the more important one. Hard to measure this with statistics without introducing some bias.
Komodo rules!
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: Value Nb1?

Post by Henk »

d4 a3 still possible.
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Value Nb1?

Post by dangi12012 »

Henk wrote: Sun May 08, 2022 12:59 pm I wonder if knight on b1 is worth less than a knight on g1.
Any statistics available ?

For instance after Nc3 and c6 or a6, e6 the knight can't do much. Only protect e4 square.
It may travel to g3 but that costs two moves.

Looks like Ng1 does have lesser problem. Opponent won't play f6. And h6 imeans a weakness. Also less difficult to play d4 for that square is easier to defend.
You could do that with the open chess database standard.
Its an SQL interface and would be perfect for such a statistic.
Out of 80GB of raw game data you can write a simple query.

Pseudocode:
Average number of plies a knight resided on a square per game grouped by the winrate.
This will give you 64 numbers between -1 and 1 which will exactly tell you if a square has a positive or negative impact on the win statistic if it resides there.

Thinking of it this might even perform better than naive implementation of linear regression models like a naive Texel impl (which get stuck in local minima). This method would generate the actual value of a piece per square and not the local optimum found when starting from noise.

If you find this useful please report back with some data! :D
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Value Nb1?

Post by dangi12012 »

Detailed pseudocode

Code: Select all

foreach game:
foreach square:
  if (occ[square] == knight)
  {
     if (game.win) result[square]++
     if (game.lose) result[square]--
   }
foreach square
  results[square] /= games.size()
Now you can do that for high level games and low level games which will show you that non expert players might overlook knight mating tactics for certain common squares.
You can do that also for beginning vs end vs midgame and maybe skip games where the knight did not move at all (so the starting knight square is not the 'best' by default).

So my recommendation is all of the above and I can instantly think of some nice value graphs like these:
Y AXIS = "value of a knight on this square"
X AXIS = "ply"

These would be interesting to generate for the king where it should show that the "value of a king on this square" wanders towards the middle of the board later on.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
lkaufman
Posts: 6227
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA
Full name: Larry Kaufman

Re: Value Nb1?

Post by lkaufman »

Henk wrote: Mon May 09, 2022 11:46 am d4 a3 still possible.
If White needs to spend a move on a3 after 1d4 with the Nc3 missing, that is pretty strong evidence that the knight on b1 is the more important knight at the start of the game. A tempo is huge in the opening.
Komodo rules!
lkaufman
Posts: 6227
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA
Full name: Larry Kaufman

Re: Value Nb1?

Post by lkaufman »

dangi12012 wrote: Mon May 09, 2022 9:01 pm
Henk wrote: Sun May 08, 2022 12:59 pm I wonder if knight on b1 is worth less than a knight on g1.
Any statistics available ?

For instance after Nc3 and c6 or a6, e6 the knight can't do much. Only protect e4 square.
It may travel to g3 but that costs two moves.

Looks like Ng1 does have lesser problem. Opponent won't play f6. And h6 imeans a weakness. Also less difficult to play d4 for that square is easier to defend.
You could do that with the open chess database standard.
Its an SQL interface and would be perfect for such a statistic.
Out of 80GB of raw game data you can write a simple query.

Pseudocode:
Average number of plies a knight resided on a square per game grouped by the winrate.
This will give you 64 numbers between -1 and 1 which will exactly tell you if a square has a positive or negative impact on the win statistic if it resides there.

Thinking of it this might even perform better than naive implementation of linear regression models like a naive Texel impl (which get stuck in local minima). This method would generate the actual value of a piece per square and not the local optimum found when starting from noise.

If you find this useful please report back with some data! :D
This is a quite interesting idea, but it is not relevant to the question posed. I don't think he is interested in the value of the knight remaining on b1 or g1 for a long time, that would be very rare and not very interesting, I think he meant the value of the knight that starts on g1 vs the knight that starts on b1. I suppose you could compare the value of a knight on the kingside squares with the knight on the queenside squares for a rough guess, but of course it is not unusual for a knight to switch flanks during the game.
Komodo rules!
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Value Nb1?

Post by dangi12012 »

lkaufman wrote: Mon May 09, 2022 10:31 pm
dangi12012 wrote: Mon May 09, 2022 9:01 pm
Henk wrote: Sun May 08, 2022 12:59 pm I wonder if knight on b1 is worth less than a knight on g1.
Any statistics available ?

For instance after Nc3 and c6 or a6, e6 the knight can't do much. Only protect e4 square.
It may travel to g3 but that costs two moves.

Looks like Ng1 does have lesser problem. Opponent won't play f6. And h6 imeans a weakness. Also less difficult to play d4 for that square is easier to defend.
You could do that with the open chess database standard.
Its an SQL interface and would be perfect for such a statistic.
Out of 80GB of raw game data you can write a simple query.

Pseudocode:
Average number of plies a knight resided on a square per game grouped by the winrate.
This will give you 64 numbers between -1 and 1 which will exactly tell you if a square has a positive or negative impact on the win statistic if it resides there.

Thinking of it this might even perform better than naive implementation of linear regression models like a naive Texel impl (which get stuck in local minima). This method would generate the actual value of a piece per square and not the local optimum found when starting from noise.

If you find this useful please report back with some data! :D
This is a quite interesting idea, but it is not relevant to the question posed. I don't think he is interested in the value of the knight remaining on b1 or g1 for a long time, that would be very rare and not very interesting, I think he meant the value of the knight that starts on g1 vs the knight that starts on b1. I suppose you could compare the value of a knight on the kingside squares with the knight on the queenside squares for a rough guess, but of course it is not unusual for a knight to switch flanks during the game.
I see. The solution still is the same tho. OP has to track the knights but now has to correlate the winrate in games where one knight was taken.
This is also possible with the open chess db standard and some code.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
lholmes135
Posts: 4
Joined: Thu May 05, 2022 4:24 am
Full name: Levi Holmes

Re: Value Nb1?

Post by lholmes135 »

I don't know much about the statistics of this, but as a chess player I would much rather start with my g1 knight than b1. When knight odds are offered, it's traditionally the b1 knight that you start without, not the g1 knight. When missing a knight, your only hope is an early attack. You can't really get an attack without the king's knight on the board. That doesn't necessarily translate though into the king's knight being objectively better, especially since if you have both the pressing need to attack is gone anyways.
lkaufman
Posts: 6227
Joined: Sun Jan 10, 2010 6:15 am
Location: Maryland USA
Full name: Larry Kaufman

Re: Value Nb1?

Post by lkaufman »

lholmes135 wrote: Wed May 11, 2022 7:23 am I don't know much about the statistics of this, but as a chess player I would much rather start with my g1 knight than b1. When knight odds are offered, it's traditionally the b1 knight that you start without, not the g1 knight. When missing a knight, your only hope is an early attack. You can't really get an attack without the king's knight on the board. That doesn't necessarily translate though into the king's knight being objectively better, especially since if you have both the pressing need to attack is gone anyways.
This seems logical, but the 34 recent knight odds games by Komodo Dragon against GMs in Rapid and against players ranging from 2000 to 2400 with Classical time limits leave no doubt that it is easier to give the g1 knight. It seems that to attack, you really need to start with 1.e4, but the b1 knight is absolutely essential for dealing with ...d5 (either 1...d5, or the French). Also, with g1 missing it is often practical to castle long and pawn storm the kingside without the need to figure out what to do with the king's knight. White's results in those 34 games showed a performance rating difference of 300 elo between giving g1 knight odds and b1 knight odds, in favor of g1 odds! Quite shocking, I admit.
Komodo rules!