Showing posts with label chess. Show all posts
Showing posts with label chess. Show all posts

Wednesday, 5 April 2023

Chess cheatsheet?


I have been playing online chess on and off for a few years now, with the occasional over-the-board game thrown in.

At the beginning, I tried to collect material for a potential "chess cheatsheet" or memory aid. The resulting text has many layers from different times. Some of this seems silly now but I'll make it online anyway. 

I've not kept a good track of where I have picked up a particular advice. I have read books from Gideon Ståhlberg, Fred Reinfeld's The Complete Chess Player, and a few glances at Max Euwe and Keres & Kotov and other books. Plus whatever I found on the internet at that time.

More recent theory I found from Ristoja & Ristoja's chess books from the 1980s and I've had a brief look at 2000s theory from Mika Karttunen. Turns out many things that were still considered iron rules in 1960s books are already in the 1980s considered far less imperative: a chess position is now considered as a dynamic situation.

Apart from what I may have read as a kid, my recent starting point for chess theory was not from a chess book. Instead it came from Dreyfus and Dreyfus' book Mind over machine: The power of human intuition and expertise in the era of the computer from 1986, a critique of artificial intelligence which uses chess as one of the examples. 

The skill model is somewhat suspect but it is great food for thought. Briefly put, the authors identified skill "levels". Whereas beginners cling to formal rules, masters of a skill are often unable to explain their skill and their moves. A chess master accesses the repertoire of knowledge almost as people would recognize faces.

I initially made the wrong conclusion from this skill model: that to become good you just "wing it" and play "intuitively".

On the contrary, the takeaway should have been that I'm a beginner and there's nothing wrong about looking for rules and principles first, and then eventually integrating this to a more daring, intuitive play. Eat the humble pie.

Still, I've liked the idea that theory can be the end result rather than a starting point. This is another simplification, but often what you find in books is a summation gained from a long career, an insight that resulted from a huge amount of playing and perhaps teaching chess. The road to this expertise is often forgotten, and hence we still have books that first show how the horsie moves and then goes straight into the subtleties of a variation of a Sicilian opening.

Put differently: it's often that a theory is helpful only after you have some grasp of the problem area for yourself. For example, instead of trying to memorize an opening, let the openings "come to you" through playing huge amounts of games and then take a look at how a common opening might be played.

After the initial rush to books, playing a lot of puzzles and gaining playing hours were the most important thing for improving. Chess skill advances as any skill does, a combination of playing a lot, doing exercises and acquiring some "theory" and perhaps some goal-setting suitable for one's skill level.

"Exercises" might mean playing huge amounts of puzzles or concentrating on some particular opening or game style, or attempt at an analysis. Also, fast games might be exercises for slower games, and vice versa.

Simplest theory are absolute things like possible endgame checkmates. Despite being "simple" there's a lot of this and it can be hard to remember on the spot or under time pressure.

Openings are also quite well understood and measured, but again this doesn't mean that knowing a bunch of opening moves will help a new player much. More about this later.

The middlegame is the ground for the most vaguest theory. There are just too many potential situations and patterns to be identified and addressed to make into iron rules.

Well, anyway, here's the stuff:


Piece movement (very early notes)

Pieces can be visualized as both the piece and the area it threatens. Rooks and Bishops form perpendicular and diagonal crosses. A Queen forms both.

In addition to the 8 directions, it may help to see the Queen as carrying a star-shaped zone. This is useful when forming certain types of checkmates.


Furthermore, the pieces can be thought to "paint" the threat areas they can reach through one move, creating a sort of secondary zone of motion/threat.

This way it would be already possible to see moves ahead without having to logically examine the repercussions of every possible move as in a decision tree.


This is more like an at-a-glance assessment of the zones threatened or defended by your or your opponent's pieces.

The knight is not really a special case, but it certainly feels like it is. This may be because it requires a little more complex visualization than above.

For example, finding safe space around the knight:



The above shows the squares the knight could threaten after 1 move (circled squares). I felt like highlighting the "more safe" squares: these are squares the knight can't threaten even in 2 moves. (There's one more, in the corner where the black king is)

It's easy remember that putting pieces next to the knight makes them safe from it, this alone can be helpful in a fast endgame where forks need to be avoided.

Instead of the one-step, two-step motion, or "L shape", the knight may be better visualized as series of 2,1 or 1,2 "vectors".

Other pieces may be visualized with the knight zone around them, to help assess how to reach that piece (often avoiding a fork).  "Safe" locations are at (2,2), (3,2) and (3,0) relative to the knight, and these are also quite easy to visualize as a box.

Just as an example, analyzing some of the "Knight laws". A lot of this is re-stating the same thing in different ways.
  • The knight always threatens squares of other colors than the square it is in.
  • Pieces on different colored squares cannot be directly forked by the knight.
  • If the knight moves, it will never threaten any of the same squares as previously.
  • If the knight moves, it will threaten the square it was in.
  • The knight takes 2 moves to threaten a directly adjacent square (not diagonally adjacent)
  • After moving the knight, a square it might threaten, can often (but not always) be threatened from an alternative square .
  • The knight threatens less squares from edge/corner, and is more susceptible to imprisonment there. Still, good ideas based on a knight at the edge ought not be dismissed.
Conversely:
  • To avoid being threatened by a knight, a piece can be positioned next to it.
  • Other easy to visualize safe spots are ±2,2 ±3,2 and ±3,0 locations relative to the knight.
  • Be mindful of positioning pieces in ±0,2 ±2,0 ±0,4 ±4,0 relation to the knight.
  • To avoid getting forked, pieces may be put to different-colored squares.
  • A bishop can quite effectively limit knight motion from the ±3,0 and ±0,3
Would it be nice if all these thoughts could be integrated in visualizing a knight, obviously the checklist is too long to to go through consciously every time you look at a piece.

And it can still get tough to avoid those damn knight forks.

Another idea I've toyed with is that pieces like the Bishops and Knights exist in another "space" within the board.

Looking the chessboard naively, it is a horizontal-vertical "rook-space", but for the Knight it opens up differently:

A slice of knight's "space" within the board.

Another slice of Knight's "space" within the board.


Later note: There's not much support for this kind of visualization in any of the books I've read, and I'm unsure about it myself. I felt it was interesting at the start, but truth be told much of this thinking isn't active during the games. It more likely develops through playing a huge amount of games and puzzles.




Openings:

There was a phase when I tried to learn some interesting-sounding openings by heart, but it turned out to be not too helpful. Again, I now think it is better to remember openings through playing a lot of games while sticking to as few openings as possible.

But, even if I always wanted to play e4 with the intent of playing Spanish/Ruy Lopez, there are various reasons why I am not allowed do that. Obviously I might be playing black and the opponent begins with d4.

But even when playing white, I could come against a number of openings, such as Sicilian, French, etc. This means that learning at least something about bunch of openings is needed. An alternative might be to stick to a less volatile opening such as the London system, but even then you can't choose to play it as black.

2023 note: I stick to e4 with white, and study the more likely openings that result from this choice. Black responses to different white openings need to be studied also.

At Lichess low level online blitz games, I soon started to recognize Italian Game and the Parham Attack and the blatant traps inherent in them. After this it becomes a good idea to find out the good moves for responding to these routine threats and building up a better defense.

I've come across an idea that beginners do not benefit from knowing named openings all that much. Any advantage gained from a correctly memorized but poorly understood opening may melt easily after a few moves anyway. Knowing that Sicilian is the best black response at master level, might lead to a poor play for the beginner player.

Perhaps knowing the openings is initially more about understanding what the opponent is trying to do, and what traps might be around the corner.

Development, simplified, is to move the pieces out of the king's row. (Pieces=not pawns) Development can be considered complete when bishops and knights are out and castling has been performed.

Instead of learning openings by rote, rules of thumb may be useful for improving the opening:

From Reinfeld:

Primary idea:
  • Create viable attack positions through acquiring control over center
  • Ensure defense and protection of all forward-moving pieces
Alternatively,
  • Refrain from defining the pawn lines too early
  • Refrain from castling too early
This is an approach that enables you to change your plan later as a reaction to the opponent's moves. I've felt these are rather abstract ideas for the beginner, though.

Pitfalls:
  • Immediate holes in defense
  • Inconsistent approach (?)
  • Too much time spent in achieving a specific tactical idea (=lost tempo)
Notes from Nimzowitsch's ideas about opening for beginners (which is not the same as his system):
  • Develop "All", ideally by moving pieces (non-pawns) only once.
  • Pawn moves are not development, ideally only 1-2 pawn moves in an opening.
    • Pawnless advance does not work either
  • Formula: Developed Pieces = Tempo.
  • Compound moves. Moves that both develop and force opponents to waste moves. ("Don't just develop, develop and threat!")
  • In a closed game (d-game) the development may be slower and with more pawn movements.
  • Flank pawns are a waste of time in an open game (e-game) 
  • Never play to win pawns when development is unfinished (exceptions...)
  • Center pawn should always be taken if not too dangerous.
  • Exchanges and gain of tempo, these are related.
    • It is a mistake to move a piece several times to exchange it for a non-moved piece.
  • Liquidation = "radical" exchanges that relieve tension in the center (if necessary).
Again, I can hardly say I've internalized much of this.

Some other ideas to observe during the opening:
  • Don't move the queen early on unless it's really called for (traps, regaining a pawn)
  • Be wary of moving the f-pawn at the very beginning (not often compatible with kingside castling, may also block the knight)
  • Knights before bishops, but also be wary of blocking your bishops.
  • Observe the potential threat from bishop to h2 (h7) pawn and devise the castling accordingly.
  • Likewise, see if the Greek Gift can be realized against the enemy King-side fort.
  • Possibilities for variations of the Fried Liver attack or other types of knight/bishop double attacks, but it's almost never worth it to lose both just to gain a rook and a pawn.
    • 2023: I almost never look into "Fried Liver"
  • Possibility of removing opponent castling through queen exchange
    • However, without queens the castling is not that meaningful
  • Preventing or postponing the opponent from castling
Some of these are flexible depending on the situation. Otherwise the opening would become too predictable. Reinfeld says that some quirkiness can be helpful. Possibly, two players playing an opening "correctly" are really doing a disservice to each other.

Especially older books sometimes suggest playing a lot of e4-games before moving to d4 games. Not sure why, but to me it's seemed that a Ruy Lopez, although very deep, results in a more "normal" chess than other openings.

The "control of the center" seems like an obvious idea but at least to me it is a difficult concept to grasp. It's easy enough to observe the opening pawn exchanges and the building tension around them, and it is clearly a bid to control the center. But what is to control the center? Having a bunch of your own pieces cluttering the center and blocking the diagonals is often not that helpful.

But I've seen that if the opponent has a well protected pawn or two at the center, and you don't, this often spells disaster. Similarly, if the center is empty, a vicious bishop-pair can decide the game. 


Middlegame:

I have little to say about middlegame. Tactics still seem to dominate this area, together with spotting opportunities, either plain unprotected material, weakly positioned pieces or overburdened defense. These are what Reinfeld calls "landmarks", a motive for planning forward. 

Steinitz said: The player with the advantage, MUST attack when the opportunity comes, it is an imperative. Attack towards the weakest side, the weakest position.

Current theory sees that these kind of "iron rules" are never too absolute. They might be considered as material for learning and reflection. (The advantage may be other than simply material.)

Keres & Kotov felt games can be characterized by castling-sides but also the openness or closedness of the center. This would give, roughly, a matrix of 12 "game variants" if non-castling is considered. Other literature has simply suggested a division between open and closed games.

True or not, there are definite ideas related opposite side castling. A pawn advance can be attempted on the opponent's kingside, as Keres & Kotov suggest. "Who has the initiative, wins!" Pieces in the way of advance can be threatened. A fianchetto/g pawn can become a weakness in the kingside. The defender should beware of moving pawns at the side under attack.

Later note: The pawn advance isn't an end in itself, the point is to open a line on the opponent's castled side.

Bishop/knight exchanges should not be done without reason. Is the board more advantageous for bishop or knight play? (Your's or opponent's) What happens to the opponent pawn structure as a result of the exchange? Seemingly innocent exchange might result in an open line for a rook.

At one point, playing an enormous amount of puzzles improved my middlegame tactics quite a lot. Recently, playing "puzzle storm" at Lichess was also helpful at activating the eyes and the brain to recognize opportunities and what to do with them.

2023: Puzzles helped greatly in recognizing tactical opportunities, but they don't help much in creating the opportunities in the first place.

"Planning" largely comes into play here, but this is still a grey area to me.


Tactics

Tactical moves: Euwe says tactics is the point where you really need to plan moves "ahead" and consider alternatives. In this light Chess is not constantly about envisioning very long decision trees, but only when needed. Perhaps one reason for opening theory is not to burden the brain too much at that point of game.

Positional play: "when there are no tactics to play"

Put more pressure on already threatened squares. Are there subtle ways to improve rank and position? Defend undefended pieces or increase the defense of weakly defended squares.

Prepare for lines to open. Rooks are placed to an open line, or to defend a passed pawn. Look for possibilities to place rooks on the "7th row absolute". (No moves should not be made in isolation of what the opponent is doing.)

Pawn structure becomes especially important in the endgame. Envision the endgame pawn situation already in the middlegame.

Euwe suggests (and I'm expanding what is really a side note in the text) that Chess is about translating advantages to others. No one player can have all advantages at the same time, but only some for some of the time. These may need translating into what the situation requires.

Some examples of advantages Euwe mentions: Material, Rank, Mobility, Spatial advantage, Sustained pawn formation, Safe position for the king, Tempo, Initiative of attack, Knight on a strong square, Bishop pair...

Exaggerating Euwe's ideas, the situation in a Chess game might be seen like this:
These are just examples of opportunities of exchanging one thing for another. Sometimes, in beginner games a really fast attack might bring rewards, but when it fails, it often marks a turning point and the attacker loses. Almost everything else was exchanged in order to make that one attack possible. 

Leaving out defense and castling may help create an impressive-looking attack, but unless it is motivated by a provable future advantage or victory, it shouldn't be done.

Others that come to mind are Rook controlling the "7th row absolute", disadvantages might be "bad bishop" or overall "bad squares". Loose pieces, loose pawns, overburdened defense etc. should be interpreted more as Fred Reinfeld's "landmarks" or as disadvantages.

Controlled center and a bishop pair is apparently a good combination. A bishop pair without the center may not be such a superior strategic advantage. Be mindful of especially queen/bishops positioning directing towards/through center.

Of course, overall material value of pieces is still a good indicator of your standing, but an immobile piece is a non-piece at that point of time. Other issues can subtly undermine your pieces' apparent material value. 

The most concrete idea that results from this reading is the function of sacrificing a piece. Although the best goal is a certain checkmate, a sacrifice could have the following immediate (multiple) effects:
  • Forcing desirable opponent moves
  • Breaking the opponent's pawn line (and/or creating double pawns)
  • Opening a beneficial line, rank or diagonal for yourself
  • Creating disadvantageous squares (color, or otherwise)
  • Removing a blockade whereas creating one for the opponent
  • Removing opponent's bishop pair
  • Preventing opponent from castling
  • Breaking the castling
Euwe also makes the important point that the advantage is often temporary, and can become lost very quickly. Consider again a sacrifice that leads to a position that looks like it could lead to a checkmate, but does not. The sacrifice was for nothing. Of course, a 100% certain path towards a checkmate obviously justifies any kind of sacrifice or loss of other advantages.

To summarize, a sacrifice is not only made just to be able to win a more valuable enemy piece a few moves ahead, but different advantages can be "bought" or "borrowed" with it.

Vice versa, be very doubtful of something that looks like an offered piece.

For the beginner the problem is to recognize these advantages in the first place. So, for a long time I suppose the material advantage remains the most identifiable.

Later reflection: This Euwe idea made originally a big impression on me, as if some revelation about Chess had been opened up. I now have to accept it hasn't made a huge impact on how I play. Perhaps the biggest takeaway is that although good advice and rules exist for strategically and tactically sound game, at a given moment "you can't do everything". You often have to disregard some aspect in order to gain initiative or tempo, and pay the price later. If you don't, your opponent might.

2023: Recognizing other advantages than material, is more important at first. The "insight" that these can be exchanged or sacrificed to gain others, isn't that useful without this cognition. And it would be nice to find moves that "do everything" or at least many things at once.


Thoughts on "strategy"


Most initial learning seems to concern tactics. I can't say I understand strategy much as yet.

I come again back to Mind over Machine.
"While [computers] are perfect tacticians [...] computers lack any sense of chess strategy. Fairly good players who understand that fact can direct the game into long-range strategic channels [...]" (Dreyfus and Dreyfus, 1986, 113.)
This, at a time when computers were not especially good at chess. E.g. if a computer has a horizon of 4 moves ahead, it might miss a simple idea about promoting a pawn that even a beginner could see. The point is that strategy obviously is something that goes beyond the scope of the next few moves.

The chess literature isn't always that clear what kind of thinking belongs to strategy. To some, topics such as weak/strong squares and pawn structure is already a strategy topic rather than tactics. "Improving position in piecemeal fashion" would then be strategy.

Discussions on pawn structure are difficult to follow, and admittedly boring compared to tactics. As a basic rule, consistent chains are better than pawn lines with holes. In the past, doubled pawns were considered undesirable, but chess theory nowadays sees them as potentially weak or strong depending on the situation.

As a beginner, I easily disregarded pawns. Promotion was something of a happy accident rather than a design. This also meant if my opening resulted in a loss of few pawns, I was okay with it. Now I am paying more attention to pawns and I also see a lot of the openings build-up around pawns and threatening and defending them. Later in the game, planning might be based on simply eroding the opponent's pawns before endgame.

This just to show that the player learns to see more than what is immediately apparent on the board, so eventually the player perhaps begins to recognize strategic patterns rather than just positions with opportunities. Literature might discuss "latent energy" or "tension", where I can see nothing but the board and the pieces.

"Strategic choice should be ideally non-obvious to the other player."

More recent theory does not recommend having one major plan, but shift it according to how the game develops, dynamically. To me this makes the notion of a "plan" strange, but clearly it's not a healthy sign if you find yourself moving pieces aimlessly.

"I could checkmate only if this and that piece was here and if this and that opponent piece was removed" seems to me like an indicator of a premature checkmate plan. Instead, improve position and look for the opportunity to improve the checkmate idea or develop another one.

2023: Seeing a germ of a plan in this way, is actually a positive thing. Just try to find out what needs to be done.

Again I'm reminded of Fred Reinfeld's "landmarks", which experienced chess players learn to see at a glance:
  • Loose pieces suggest forks.
  • Loose pawns are a weak spot.
  • Overburdened defense is a weakness.
If the opponent's castle is very strong it may not make sense to have a direct checkmate plan at all. Instead erode the enemy pieces and ensure there are pawns for promotion in the endgame or a clear superiority of material. Pawns at the non-castling side are an advantage. "This is a war of attrition."

Ståhlberg: In master-level play, the one who loses a pawn with no gained advantage, will lose the game.

Ristoja: (paraphrasing only slightly): Only the beginner aims to checkmate. The mature chess player plays the opening to have a good middlegame, then plays the middlegame to have a good endgame. The threat of a mate is often a more important tool than a premature attempt to win.

Reinfeld also says: the player who is ahead materially, seeks to exchange Queens, to simplify the game. The one who is behind, relies on creating confusion, traps and complications.

Karttunen: (again, paraphrasing) After exchanging queens, the castles are not quite as meaningful. The kings might even be better at the center after the exchange has happened. The player whose castle is broken or about to be broken, might want to seek to exchange queens, despite everything else.

(Exchange of queens may be more desirable for the one who has the king in the center, as removing the queen reduces the checkmate options for the centered king.)


Endgame:

The endgame with very few pieces becomes again a terrain for more discrete knowledge, such as whether and how to checkmates with certain combinations of pieces. 

I will not list checkmate patterns and piece combinations for the endgame, however they simply need to be known as the more sophisticated games are usually decided here. When the clock is running out, it would be better to have a good grasp of how to checkmate quickly with a queen or a rook without stalemating.

The term opposition should become familiar when dissecting pawn endings.

This advice is more about the point of transition from mid-game to endgame:
  • Pawns, preferably on non-castled side are useful (already the threat of promotion is a powerful tool)
  • Two bishops are often more valuable than two knights or knight+bishop
  • Two rooks can be more valuable than a queen
  • Queen endgame: one pawn advantage is not enough. A strong, free pawn is needed.
  • Visualize the pawn square rule for promotion


Random notes

"When threatened, find the best way to do nothing"

If the castle seems to hold, why alter it? Use the tempo to develop an attack instead.

The most important rule is... "YOU BELONG HERE!"

Thursday, 13 May 2021

Kilobyte's Gambit Declined

As an addendum to the previous Kilobyte's Gambit post, I explored my copy-cat pawn approach further. At that point I declared I couldn't really guarantee a win with it. Well, neither can I guarantee it now but after 13 consecutive wins I think the system is quite reliable for me.

Warning: This has little to do with real chess playing, it's more about finding exploits in the 1K java chess engine. I'm also looking to win fast and safely.

So, this is the formation I'm looking to establish in the beginning. (I've already started moving the rook)


The following picture shows the alternative position that sometimes happens. It might be just as good, but it happens less often so I have less proof. You'd be looking for a breakthrough at the h-file rather than g-file but otherwise it's not that different.


The starting move is e4. (King's pawn two steps forward) If Beth copies your move from the very beginning, you need to choose which pawn to move. I've found the c3 move to be safe. Then continue copying the moves, seeking to complete the above formation.

If Beth moves the queen to b6, just keep calm and move your pawn to b3, which will be protected. This is usually always followed with a bishop to g4. Just follow up with a pawn to f2 and the bishop will be scared away.

By the way, Stockfish engine at Lichess.org evaluates the pawn formation as even for black and white. The following moves are in no way condoned by Stockfish, but will result in a strong enough position.

I believe it's now useful to put your bishop to h3, after which Beth either exchanges it or you will have to exchange it (which is often better as this usually results in a king move).


If the bishop is not taken future rook moves may be dangerous.

If the bishop is blocked it may help to wiggle a piece back and forth until the exchange becomes available.

Now it's time to pile up your material to the right side, and usually you can take your time as Beth moves pieces around aimlessly behind the wall. This is really the key to winning here as you can exploit the given time in any way you want.

The more you can do at this stage, the better. It's a good idea to keep the rook at h3 protected with the knight, and to have some room to move the queen at the second file in case you need to back up the rook at g.

It's possible a knight may attempt to slip in through b4 or d4, in which case you need to take care and seek to exchange it with a bishop. This sometimes leads to a less secure game.

As there's all the time in the world, the white should also develop a knight near the top, to the d5 square. It's not immediately useful but an opportunity for exchange will usually present itself and it can be crucial for an easy win.


The remaining bishop points to the right edge, backed up by the queen. Then you can move forward with your g-pawn, and begin to advance with your rooks and other pieces, looking to line up your rooks and the queen and exchanging away knights and bishops.

At this point, I have now checked that Stockfish evaluates this (or roughly similar) position quite strong as +3.2, pretty nice considering there's no material difference!

Yet it can be a precarious situation and things can still go wrong. Sometimes a knight or bishop may need to be sacrificed in order to get a good skewer (winning the black queen).

The below shows what could happen. I sacrificed a rook to get in a situation where I wiggled the rook and queen back and forth until I skewered the opponent's queen. Although I only have a queen and a knight against a rook pair it won't be too hard to win.


Breaking the pawn formation in the middle is to be avoided, as your king's defenses are not that good there and the approach really relies in the idea of smuggling your pieces up using the g- and h-files.

If the engine starts to do weird moves such as a pawn breakthrough in the middle, or crazy sacrifices, you'll know it is sensing defeat or massive material loss and simply trying to postpone or compensate it. Take the opportunities as they come.

Exchanging queens is not often the best idea, unless you can win significant amount of material. It's usually better to have the queen and a good position even if it means you have slightly less material.


The above situation is not exactly the best outcome, but something like this can easily happen. Not much of a material advantage to speak of and you have to take care the queen doesn't slip through or take that knight. Here exchanging the queen may be necessary as it would get rid of the danger and help get that pawn at f6, working towards promoting the h-pawn.

Here it lead to endgame with knights and pawns, in which I got rid of the opponent's pawns altogether.

Towards the end, if you can't see a way to directly mate the opponent, be on the lookout for exchanging all pieces this way just to ensure pawn promotion, because Beth is really poor at handling those. 

Knights can be dangerous at the end game if you're looking to win fast.

The last thing to take care is to avoid a stalemate, which Beth will try to arrange if possible.

So, although some chess skills are needed to handle some of the more tricky situations, to me it appears the engine is far more easy to win with this approach than with conventional openings. 

Maybe I'm finally through with this strangely addictive chess engine :)

https://vole.wtf/kilobytes-gambit/


Sunday, 25 April 2021

The Kilobyte's Gambit


Recently, I've been playing The Kilobyte's Gambit. This is an older Javascript 1K chess engine that has been put together with CGA/MS-DOS -style visuals, referring the series The Queen's Gambit. Here you play against a pixellated caricature of Beth Harmon the chess master from the show.

After winning the first game ever against it, I got emboldened and thought it was a simplistic opponent. However, later games revealed I can hardly guarantee a win and have probably lost more games against it than I've won. True, I try to play fast but even when I play slow and careful a victory is not always secured.

I was also curious if the small engine would reveal its limitations to me.

A low level player like me is pleased when the early game follows some known opening pattern, and then a comfortable middle game follows. Yet, when opening theory is discarded as anarchistically as Beth does here, then I'm faced with a difficulty: What to do when the opponent does a move I know to be "wrong" but I cannot exploit this knowledge in any way? 

Beth's approach resembles some of those dreaded "pawn-pushers" at Lichess.org. I try to play normally and soon my defences are overcome with pawns far too close to comfort. Yet I somehow know it's not a good approach.

As much as I hoped for a "silver bullet" solution that would break the computer and win every time, this doesn't seem to be the case.

At some point I tried copying the pawn movements. After creating an near-immobile wall between you and the opponent, the computer gets confused and simply moves pieces back and forth.


This gives time to pile up your rooks and material to the right edge and push through. After a couple of successes with this approach I begun to be confident that this is it. Yet as the wall is broken you are not always the one to benefit from it! Also, "Beth" may choose an opening where this isn't even really possible.

Still, are there any observations beside "play well and carefully?" One clue is in the instructions: Beth sees four moves ahead. This is enough so it won't fall for a simplest traps or discovered attacks, and unlike a beginner Beth won't be hanging pieces.

The 4-move horizon is broad enough to produce moves that can break a castling and lead to a mate. These can even appear diabolically clever.

Frustratingly, Beth never castles, which seems like another bad practice, but the engine does rather well despite of this. It knows the castling move, though, but as much as I've observed it's only done to avoid a mate.

The non-castling is one piece of knowledge that can be exploited. Checking occasionally provokes the king to move around, if there is no adequate or useful piece for blocking the attack. Furthermore the king may be lured to territory where it can be mated.

(The castling rules appear to be off: You can't castle if the involved rook is under threat, and this is wrong.) 

If Beth appears to sacrifice something, be very careful. Often this is just a prelude to a fairly useless exchange, but something worse might happen. One idea I've tried to observe is not to be too responsive to the black moves. If Beth seems eager to exchange a piece, try to come up with something else.

The engine is quite bad with end games with pawn promotions, as it might simply not see that five-six moves ahead the player can have a new queen. This suggests a strategy where the black pawns are reduced and all pieces exchanged. To make this happen is of course easier said than done.

Early in the game, Beth might even "give away" pawns as part of piece exchanges. These are not usually too dangerous to take, but the moves afterward have to be done carefully.


In the above position, the center pawn can be taken with the knight. Black takes knight and then White takes knight with the queen (check). Some threatening situations arise but as the computer doesn't see that far here these could be resolved without loss.

In the same vein there can be opportunities for forks. I cannot really fathom how the engine allows these. I suspect it might see a mate or worse in the near future, something that's not easy for the player to see, and the only way to avoid it is to permit the fork.

Clearing the field of black pawns entirely should not done lightly, as the engine seems to thrive on an open field. I guess as the decision tree becomes broader, a human can't handle it easily but it's no problem for the computer. Semi-closed positions are better as there a person can more easily see ideas beyond the 4-move limit.


Lessons learned?

I'm wondering whether it's a good idea to concentrate on this game. Does it improve chess skills at all?

I compared the engine to Stockfish levels 1-4 in Lichess, and Level 4 ("1700") was able to win it with certainty, whereas I suspect Level 3 might win it with luck. At this time, it didn't. The thing is the Lichess Stockfish easy levels sometimes do random mistakes and blunders that the 1K engine doesn't do at all.

It's a good idea to have some exercise against "bad" openings too, as there are those non-castling pawn-pushers in online play too. (I've started to suspect some of them are testing their own engines) Many chess engines don't really offer this option.

The graphics are quite unclear, which makes the game somewhat more difficult. Many times I've blundered because I couldn't tell the king and queen apart, especially when the king may move about more than the queen.

When going back to Lichess after an 1K gambit session, the graphics there look blissfully clear and spacious. Possibly, just possibly, this CGA-ordeal helps in reading the board.

Wednesday, 5 February 2020

Orion Millennium chess computer 6 in 1


From 2004, the box has a still young-ish Karpov's face on it. I'm wondering if he is recommending the product or the game of chess in general!

As far as actual chess-playing goes, this kind of cheap chess computer is now mostly superseded by mobile phones at the low end, and digital boards towards the higher end. As a design object, a more vintage device would have been prettier, but it's not the ugliest I've seen.

It's not just a chess computer, the featured six games are Chess, Checkers, Othello/Reversi, 4-in-a-row, Halma and Nim. Incidentally, Nim was probably one of the first electronically implemented "digital" games. I'm only looking at the chess variant here.

The machine operates with 4 AA batteries, and there is no connector for a power supply.

First a small disappointment: The chessmen were missing from the box, only the generic button-like pieces for the other games were left. As this cost me only 4 euros I don't mind that much. The instructions were in place. Even in good complete condition, I'm not seeing people asking more than 20 euros for this.

I used my magnetic pieces from a tiny travel set. They are a bit too small and a bit hard to tell apart, but at least I could test the board.


The board feel is sturdy and weighty enough, the footprint is less than A4, squares are 21mm giving about 168mm board size. Given the chessmen are not large to begin with, it's a pity there is no storage for them in the case itself, it wouldn't have made the computer much larger.

After inserting the batteries, the computer gave a friendly beep. It works!

The moves are activated by pushing the board at the starting position and then the ending position. This can be done with the pieces. It's not highly convenient but at least simple to understand. I felt I had to press the squares quite hard. Typing in the moves might have been more effective, but there's no option for that.

At the start it felt needlessly complicated that I had to perform the pushing of opponent's moves too. But it is understandable, as it prevents mistakes from happening.

In castling, you need to perform both the king and the rook moves.

As the computer is initially in a tutor mode, some moves were greeted with 'bad move' sounds. The step has to be passed with 'next move' key. I felt sometimes pressing this also switched the player sides. Hmm. Well, the tutor can be turned off by pressing first what looks like the "Cancer" horoscope symbol, and then the tutor key.


Playing

I played one game from start to finish against the computer, at the default level, which must be really easy. In this opening (Ruy Lopez), it seems the opening library ended after 4 moves (4 white, 4 black pieces moved) as then the computer started using time for thinking. Thinking took about 10 seconds on this default level.

Me vs. Millennium Orion 1-0:

1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Nxe4
5. Bxc6 dxc6 6. Nxe5 Be6 7. h3 Bc5 8. d3 Nf6
9. Bg5 O-O 10. Nd2 Qd4 11. Bxf6 gxf6 12. Nef3 Qxb2
13. Nh4 Bxa2 14. Qg4+ Kh8 15. Rfc1 a5 16. Ne4 Bd4
17. Nf5 Qxa1 18. Qg7#

My move 15. Rfc1 was made by the computer too, as I had managed to mess the turn order because of the tutor mode. After that, I turned off the tutor.

Looking at the game in Stockfish, I made a mess out of it at the very start but the computer did not follow through in this level. (That 15. Rfc1 move was a mistake, too).

It does look like two noobs playing. The game ended with the computer allowing me to checkmate even though it could have been prevented.


The manual indicates there are many combinations of difficulty/time options to make the computer play a harder game. It's just not easy to figure out what the levels are and what level of human play they might correspond to. But I suspect the thinking time will increase drastically on the higher levels.

It's also possible to adjust the play style between passive and aggressive (5 levels, normal giving the best play). Perhaps I'll try to challenge a more difficult level some time.

The computer includes a library of "classic" chess games, including Fischer, Karpov, Kasparov and the Kasparov/Deep Blue games, a total of 320 games. These are listed in the manual but they are not dated. It is unclear if the AI is able to draw any wisdom out of these games, probably not.

(This also means there are more Kasparov than Karpov games stored inside!)

Friday, 29 November 2019

Crafting chesspieces


Barleycorn is a common name for a highly ornamented, tall red and white chessmen, elevated on an urn-like pedestal.

One might think the name 'barleycorn' has something to do with the tallness or shape of the pieces, but apparently it refers to the decorative barleycorn leaf motif found on them. So whether a set without the decoration is truly a barleycorn chess set I can't say. But it's a handy keyword for searching a certain type and I'll use the word here loosely to describe mine.

I've longed for something like this, but barleycorns are quite expensive (200 EUR easily for a modest, complete set) so I started thinking whether I somehow could build my own, even if it wouldn't be as decorative.

I don't have a lathe. The main idea was that the pieces could be created by fitting ready-made parts around a central stick, like beads in a string. Visiting a few hobby shops, I looked for ready-made wooden parts that could help in this.


First phase

After I discovered a part that would work as the base for all pieces, I was already more optimistic. I felt a larger set would be more forgiving for inaccuracies, so I chose a 35mm base. As barleycorns tend to be placed much more tightly than any FIDE regulations now say,  a 50mm squared board should be good for these.

I didn't give much consideration to finding larger bases for the King and the Queen although it is clearly a feature of the barleycorns and most chess sets.

Is it a chesspiece or a sci-fi rocket? Here the barrel is cut and filed out of a cube.
I bought a bunch of the ready-made wooden parts I could find from hobby shops, trying to figure out how they might be used together.

After having a pool of parts, it was time to scavenge more definite images of barleycorn-type chessmen from the internet. I did not seek to replicate any one set in particular, instead I picked features from different sets that I liked.

Of course it was important that the details could be recreated with my parts pool. It was a relief to find out not all barleycorns are especially decorative and I could take that as a guideline.

I needed to ensure the 16 pawns would not require much manual work. I'm happy to note this stage was quite successful, as the pawns are the simplest part of a barleycorn set in any case.

Left: a nearly complete queen, Right: demonstrating the stick-system 
Each pawn and piece has a narrow stick as a central axis. This meant drilling parts that didn't yet have holes in them. Especially the pedestal part required some care as it's not easy to drill into a convex end.

All the collars needed drilling too, finding the dead center was a bit tricky. The small brittle pieces break easily when drilling. For the tiniest collars I just had to patiently drill 1-millimeter pilot holes before making the 2,5 mm holes.

Sample of the parts pool. Note the absence of holes in many of the parts.
In the beginning I made many mistakes, often compounding so that some pawns were unacceptable and had to be remade. Poorly supported parts may move as a result of the glue drying process, which I also forgot to check.

I built a drilling jig out of a wooden block which helped in getting the holes more accurate. This became necessary as I noted I really have only so many bases and 32 perfectly drilled bases are needed.

One trouble I had that there really were no parts for inverted curves (e.g. the "scotia" in antique pillars). I emulated these by using a combination of different collar pieces.

With all the easy labor behind me, I begun work on the knight horse-heads. Here wood putty was somewhat useful as the shapes could not be cut very precisely. I was not overtly happy with the knights, but I needed to make progress on this most difficult part before my enthusiasm runs out.

And run out it did. After I finished the four knights and whittled one bishop head, it took a better part of a year before I could find it in me to continue with the set.

Carving the bishop-heads. The white colour is from gesso primer.

Second phase

With renewed zeal, I sat down and whittled the 3 missing bishop heads and started planning the rooks. Here I drew more accurate sketches, because I had lost the sense of the project and the proportions. The rook designs had been previously unsolved, but I had decided they ought to be elevated. (Less common in barleycorn sets but it has been done).

The drawings were useful in finding the proportions for the rook although in the end I improvised some choices.

The tall rooks ought to go without pedestal really.
Instead of forming the rooks out of solid wooden blocks (my first plan) it struck me that with a proper cutting tool I could create the rooks out of 4mm plywood circular plates.

I had seen such a tool a while ago and now I bought it. It's meant for cutting holes into drywalls and the like, so the cut-out is not really the intended product. But it worked well enough with the power drill and the 4mm plywood. The resulting edges were somewhat torn, but filing and sanding them together I got them quite smooth in the end.

I tested each plate size to find out what my options are and then redrew a rook design on a millimeter paper using this knowledge. Only the center part would be cut out of the solid blocks. Cutting dozens of plates was a bit boring, but likeable procedure.

Measuring plates. The leaflet only supplies the hole inside dimensions!
With this tool the central drill was 6mm fixed diameter. This was helpful for gluing the plates together around a 6mm drill bit, but as the 6mm hole was not suitable for the narrow central stick, I also needed "converter" parts. I won't explain this in more detail.

I used the plate-approach for creating the royal pieces too. I was unhappy with my earliest ideas (see the first picture) and chose to do a simple straight barrel that probably looks better.


The outcome

There is something cartoonish about the designs, especially the rooks are very huge, much larger than the base they are standing on. This is not something I've seen in any set, as the rooks usually are not elevated, and when they are they certainly do not exceed the base dimensions.


So I could also make some original choices. Possibly I also felt this cartoon approach gives the set more character than a failed attempt at copying some existing design.

I did not plan the whole set before looking at it all together so it was fortunate the pieces work together as well as they do. But even during the process I could match certain pieces to work together, so it was not all done blindly.

The set is not especially heavy. The king and queen are sufficiently weighty, but the pawns and other pieces are somewhat light and unbalanced. I could help that little with leveling the base bottoms a bit.

Board supplied by Marq, a nice fit.
Small amounts of pieces in plastic bags turned out to be quite expensive in total, so it's very likely I could have instead bought a somewhat battered antique barleycorn set off eBay with the sums! Well, it's more interesting to try to make your own.

There is still some painting to do, and I'll do more close-ups when the finishing has been done.

Sunday, 23 December 2018

Chessboard modification


I received a 30cm chessboard box that was in a slightly poor condition. I have a better box in better shape (pictured above) so this was an opportunity to modify the damaged one.

The set is nostalgic for me as I played with similar pieces a lot during my childhood and youth in the 1980s-1990s. I believe these sets and likely the design itself originated somewhere in what was then the Soviet Union, and come in numerous variants and varying build quality. I have no idea how typical these might have been over there.

I am especially fond of the bishops, with no distracting "mitre" or knobs on them.

Admittedly the board is a bit dense for playing, although it looks visually pleasing to me and given the history I'm hardwired to accept this as a normal chessboard.

A board with slightly larger squares could still come handy. The goal at first was to increase the size of the playing squares, but I also became quite interested in the surface treatment.

Half board removed. The amount of dust is spectacular.
The box is 300 x 300 sized, with the original borders it makes the effective play area about 280 x 280 with 35 x 35 mm squares.

To fit this more with my blog theme, I used a Commodore 64 BASIC loop to calculate the measures. So, without the borders the square size becomes 300/8=37.5


The box is slightly deeper than it is wide, so I used 151.5/4 to get the other square dimension for each half-board, which was 37.875. Although this kind of precision is somewhat pointless for my handiwork, it is important for adding up the cumulative measures.

Sanding away the existing squares was the most boring work stage, although the actual sanding likely didn't take much more than 30 minutes altogether. The staining and lacquer treatment requires the surface to be well finished, and I used 80, 120, 240 and 320 grit sanding paper to get there.


Woodstaining

The measure marks were made to all edges of the board, then I used a paper knife along a ruler to pull grooves across and along the plywood. This means that when I brush in the dye, it won't be absorbed over the square edges.

Carefully testing the board, the pieces don't touch the stained parts yet
Still, the brushwork needs to be careful. It was better to allow the liquid to flood towards the edge instead of trying to brush directly along the grooves. Firstly, the absorption effect is quite forceful, and secondly, the brush could also easily touch the other square which would be "goodbye, board" to me.

The cuts across need to be quite deep whereas the cuts along can be shallow.


Lacquer

After letting the staining dry overnight, I applied urethane alkyd lacquer on the surface. One layer of the lacquer was nearly enough to make the kind of smooth surface I looked for. After 24h drying I made a light in-between sanding with the 320 grit paper, wiped out the dust with a moist rag, waited a bit and added another layer.

But after half an hour I dared to test the whole set. (This is still without the lacquer)
Afterwards I'm quite happy with the surface. I did get those tiniest bubbles for both layers. This might be unacceptable in a continuous table surface, but with this kind of checkered board it is not too visible. If you look for them they are there.

Can the bubbles be avoided? It turns out I had not heeded the instructions: the first layer ought to be thinned by 20% and multiple thin layers would be better than 1-2 thick layers. Also, a proper brush might have helped reduce the "bubbles".

Comparing the new width squares with the old.
The paper knife technique has the weakness that the grooves will remain visible. More often than not paints and lacquers tend to highlight scratches, dirt and unevenness, than smooth them out. Still, I don't think these grooves are ugly.

An alternative approach might have been to make a new board layer entirely from plywood and glue it on top of the existing one, this way I could have avoided the sanding. But it would have been a different project.



Monday, 30 April 2018

Adding weights to chess pieces


A proper Retrogaming mod: I added weight to my cheap chess set.

This required a lot of boring stuff with a power drill and a crap selection of drill bits.

First I removed the felt, evened the surface a bit and punched entry point markers using a drill tip. Already removing the unevenness and the poor felt the pieces kept more firmly upright.

I then drilled all pilot holes with a thin 2-3mm drill. It would be good to get these straight, but as I did not want to build a setup for this I had to accept some deviation.

Then, 6mm holes. This was maybe the easiest part of the whole drilling process, as the 6mm drill cuts the material pretty easily. The drill needs a tape marker or a limiting piece to avoid drilling too far. I did think I could "feel" my way but after a couple of mistakes I had to attach the tape. A very simple measure that avoids a lot of hassle.

Not to scale
I drilled all 10mm holes using a two-piece jig to hold the piece more firmly, then inserted the screw.

The simple jig only half-does the job, I had to secure the pieces with my other hand. Luckily the piece bottoms are all the same size, not really how it ought to be, but at least this way they all fit the same jig.

The 10mm drilling was quite tough and kludgy to do, I found it useful to switch between reverse and forward gear while drilling.

It would have been much better to drill the 10mm holes before the 6mm ones to preserve the function of the pilot holes. But the 10mm is already a bit tricky with a power drill and the drill head is not the best quality. So I reasoned the 6mm holes could be done first to remove material and make it a bit easier for the 10mm.

The jig hole is covered with furniture pads, so I did not really need to unclamp the thing.
I used longer screws for the Kings and Queens so they have a teeny bit more weight to them than the other pieces.

The light bolts do not radically add weight, but it's enough to give a bit of a feel to them. For a while I thought about using some kind of lead pellets, but the screws have less work stages to consider and I already had enough of them. Even if the machine screws do not properly attach to the wood they still stay firmly enough on their own.

I also made some changes to the appearance of the pieces, I'll get back at that when the set is more finished.



Sunday, 25 February 2018

Chess memories

Although we played chess as kids, it was initially nothing more but another diversion among Monopoly, Rubik's Cube and the Finnish evergreen board game Africa's Star. But the longevity and richness of chess became evident quite soon. For some time in the early 1980s, we loaned chess books from the library, my father built chess sets, we played chess against friends, family and against the computer.

Some memories about children playing chess:

-We played a few games with the assumption that a player can 'eat' the enemy king if the other player does not notice it is under threat, winning the game.

-Castling was initially unknown, and even then it was quite long misunderstood. We probably used it as a means to escape with a threatened king, which is not a legal move.

-The en passant move was unknown to us. Also, for a long while a misinterpretation of a book illustration made me think the move is only doable on the edge of the board.

-The checkmate was pretty difficult to plan so it usually involved locking the king with two towers or the queen after the board had become suitably empty.

-The endgame was pretty often reached by bashing together all the high ranking pieces on some contested square, turn by turn, until the forces were exhausted.

-There was a sadistic tendency to eliminate all enemy pieces and pawns before attempting checkmate, something that was prone to result in a stalemate instead!

-Sometimes it was fashionable to build a "cannon" by lining the two towers and the queen, then "launched" against the enemy lines. This was possible because both players were trying to do the same thing with little regard to what was happening on the other side.

-Similarly, one of the earliest notions of a fixed opening defensive strategy was to lay out all pawns in an annoying zig-zag pattern. Combined with the other quirk of mirroring other player's movements, this could lead to some very silly openings:

Now, the proper game can begin.
Later I nurtured a misperception that I might be a good chess player, despite never really winning more than low level computer opponents. When I got my ass handed to me by a human player I could never beat even by accident, I realized in a concrete way there were skill levels far above my play.

Recently I've benefited from annotated chess puzzles and reading more about chess strategies, such as the reasoning behind evaluating board conditions - it's not only about counting your piece values. Sacrifices are no longer just exchanges in a desperate bid towards a checkmate, but justifiable from different angles, such as improving positions, breaking the enemy lines, and gaining 'tempo'. Still, it seems my ability is fluctuating quite a lot, possibly depending on time of day, tiredness, stress level etc. 

I've also read a tiny bit of the history and the development of the openings and play styles. I'm glad to see there are varieties and schools of thought, so I might not have been too wrong in not concentrating overtly on classical openings or failing to grab the board center.


Chess connections

Although I never became a proper chess player it somehow connects to many things:

PSION's Chess on the ZX Spectrum
Retro-computing: Chess was among the first games I played on a ZX Spectrum computer. Chess computer devices were also one item among the early electric landscape of hand-held games, video games, pong TV games and toys etc. I never had a chess computer, though, as we leaped directly from non-electronic games to computer and video games. An old chess video game has a certain retro appeal, but the CPU thinks so slowly it's not too interesting to play against them. Later, the visuals in Amiga Battlechess was one memorable moment, but not as interesting as a game. I also played a version of Chessmaster on the PC for a while.

Making stuff: From craft and design point of view, it is fun to see how the appearance of chessmen have changed over times, depending on times and culture, eventually narrowing down to the Staunton and variants. A good set takes into account readability (color contrast and piece separation), handlability (those grooves and ridges), balance (weighted won't tip over) and sturdiness (so the chess pieces won't break when they fall).

There are also other constraints, such as the needs of a travelling set or a low-res computer display. Devising a chess set might be interesting too, but so far I've only doodled and worked on a PETSCII chess set with Marq.

Could get a bit confusing in a real game.
Games: Chess is a prototypical example of a game. Although it is themed as a war-game, the war theme is more of a learning device for showing the purpose of the game, the individual chessmen and how they move. Notably the later chess pieces became styled after the royal court rather than a battlefield as such, so the chess board might be also seen as a metaphor for political plotting and subterfuge.

Films and popular culture: Chess is shown in films and stories often as a kind of indicator of super intelligence, such as with Mr. Spock's 3D variant in Star Trek, or the few moves mentioned in Blade Runner.  More points if the players can play without the actual board, such as Holmes - Moriarty in Sherlock Holmes : A Game of Shadows. The "chess played with live chessmen" cliché goes also at least as back as Alice through the Looking Glass and variants come up regularly, as seen in Harry Potter, Twin Peaks and Kurt Vonnegut's All the King's Horses.


Recent computer versions

For a while I played some version of chess on an Apple iPad, but sadly I can't remember the title. As the novelty of touchscreens wore off for me I barely bother with installing 'apps', even though board games work rather well on them. Chess on Android is pretty ok, I've tried to beat level 7 without success.

Recently, I also installed gnome-chess on Linux which has extremely clear graphics, and excellent for reviewing pgn files. But apparently the difficulty level cannot be trusted to be equal across different computer setups. Edit: I now understand this depends on what kind of chess-engines have been installed on your computer, and this may vary depending on the install. HoiChess was easier than GnuChess, although it is not obvious why GnuChess is so damn hard on "easy".

Further edit: At end of March, the Android 8th level was beaten, and also GnuChess "easy" was beaten. But it did raise questions about the stability of the gnu engine play level.

Online, lichess is good for on-line head-to-head games and for editing the board. I also tried betterthanchess.com, but it seems to have all kinds of superfluous and confusing things on top of the actual game.