Hacker News new | past | comments | ask | show | jobs | submit login
Blunder Free Chess – visualize which squares are attacked (taonexus.com)
36 points by logicallee 62 days ago | hide | past | favorite | 51 comments



False advertisement. I played a single match and the AI very very quickly blundered their queen to my bishop, and later a bunch of other pieces. This bot way is worse than Martin (250) form chess.com.

Also, those colors are horrible to see. And it's really hard to see which piece the AI is moving each turn.


I think it's fairly obvious the name is to help the user prevent blunders, not that blunders are literally impossible by both players.


I assumed the original comment was posted in jest.


>those colors are horrible to see

After someone gave me feedback on lichess, I tried a heatmap instead (with green for white and red black), I'm not sure it's an improvement but you can see if you like it any better: https://taonexus.com/blunderfreechess2.html


I can see the board! It's a huge improvement.

One more improvement. There needs to be some way to see the move the computer made. If you blink, a piece is somewhere else, and you have no idea what happened.

I like the concept of overlaying visualizations on chess to help people understand what's going on, but it will take a lot of playing with what to show and how to show it to make it useful rather than annoying.


It is better, but still hard to make sense of. As you progress in the game, all squares are somewhat contested so everything is colored, which makes everything hard to evaluate. I like the idea of making a square brighter once it has more pieces looking at it, but having the whole board colorful like that is weird. Perhaps each square could have a number, like +1, -1 or +2 to count pieces looking at it.

Also, sometimes you see a red square around a piece, but it's not clear to me why. Is it present only when it is unprotected and an enemy piece is looking at it? That is kinda already too late, perhaps every unprotected piece could have the square around it.

And please give proper indication of what was the last move. I know most games will do this by coloring squares and you can't do this here, but having a way would be great, even if it was listing the move with chess notation below the board.

Also the pieces are a little weird to distinguish. I found myself trying to move Black's bishop twice.


Whats the range? 0 to 4 or 5 ? I would try x small dots, or even numbers. You could make black red squares, and white green circles.


Good improvement, much easier on the eyes!


There is a big problem in that the purple is much less visible when it appears on top of your own piece vs. a free square. I would suggest instead to color code it red when one of your own pieces is being attacked. There is no need to show the squares your pieces are attacking IMO (yellow heatmap)

Why not take this further to count up the simple point value of attacking/defending pieces, so e.g. a pawn that is attacked by a pawn but defended by a pawn won't show red, whereas an attacked but undefended knight would show '-3 redness'. Also if this was just briefly 'flashed' after the opponents move, or after you reopen a browser tab, it might serve as a nice reminder of the positional situation without interfering with regular/plain board visualisation, and without making the player reliant on it.


This version of chess can help beginners practice by seeing which squares are under attack (and how heavily) so you don't place your pieces on attacked squares. The size of the circles shows how heavily each square is attacked (or defended) by the respective color, yellow for white and blue for black.


I love the concept. I wouldn't prefer to play chess this way, but I've had a lot of practice, I find it visually a little distracting but I started getting used to it.

I had a situation where my queen was being attacked by a bishop, and the board showed a "safe" space to move my queen, but that queen would have still been attacked by the bishop along that diagonal. Not sure how you solve that, maybe when clicking on a piece, recalculate the board as if the piece is no longer there?

Wonder if simple fork, skewer, or attack counting threats could also be highlighted in some way. I suppose at a certain point it's just too visually busy and the tactics get way deeper than the surface level notions and end up being a distraction, but could be fun exploring an opening or previous game and seeing the "obvious" threats you might not have seen when playing


>I love the concept.

Thanks!

>I had a situation where my queen was being attacked by a bishop, and the board showed a "safe" space to move my queen, but that queen would have still been attacked by the bishop along that diagonal.

Are you sure? Can you send a screenshot? Any place the opposing bishop attacks would have a dot on it. (The green highlighting when you pick up a piece shows all legal moves, not just safe moves.)


This is presumably what they mean: https://imgur.com/bPFmcSp

The square to the bottom right of the Queen isn't "currently" visible to the bishop, but if the Queen moved into that square they'd still be killed by the bishop.


On Lichess you can visualize then confirm your move, helps a lot


This is a cool program.

What system is it using for the “play with computer”? Is it custom or one of the available chess engines?

I wonder if there is a way to alter the difficulty of the computer program.


Looks like computer moves randomly:

    /*************************************************************
     * Computer Move (random)
     *************************************************************/
    function computerMove(){
      if (gameOver) return;
      let wasWhite=whiteToMove;
      let moves=generateLegalMoves(wasWhite);
      if (moves.length===0){
        detectGameState();
        return;
      }
      let randIndex=Math.floor(Math.random()*moves.length);
      let move=moves[randIndex];
      makeMove(move);
      renderBoard();
      detectGameState();

      if (!wasWhite){
        fullmoveNumber++;
      }
    }


What could be interesting is playing against a full-strength engine, that is forced to sacrifice a piece every N moves (I initially wrote "blunder," but the top sacrificial Stockfish move would likely still be a viable strategy).


Close your eyes when you make your moves to increase difficulty


Most basic blunders maybe? In a normal game a piece will be attacked and defended by multiple other pieces, with various values, sometimes with some dependencies between them, and I would consider messing this part a relatively trivial blunder as well.


I've played hundreds of games and I'm not sure a single one hasn't been decided by a "basic blunder", and I mean very basic. I bet the only games in which I've not committed one myself (and only gone on to win if it was overlooked, which they often are) were ones in which I fool's-mated someone.

There's chess-people's experience of the game, then there's how every single other person, including those who play it quite a bit, experiences the game. A "normal game" in the sense of the average of all games played, maybe that features very few basic blunders, just because chess people play so very many games (though huge numbers of people play a lifetime count of like ten to one thousand games, and never move out of basic blunders being pretty common, so I wouldn't bet on that describing an average game, but maybe) but the average person's experience of the game is that it's entirely about basic blunders, like, that's the main thing on which the game turns.


Even on the highest caliber games "blunders" are often the decisive factor. It's just the higher the level, the more non-obvious the blunders are.

But even when playing with novices.kids, the aspect of double-attack/defense appears quite often. It's very basic and common consideration really.


Very nice of you to think that I am not going to blunder this way


I'm curious as to why you wrote your own chess implementation - seems like this would have been much easier to implement with chessboard.js [1] and chess.js [2].

1. https://chessboardjs.com/

2. https://github.com/jhlywa/chess.js/blob/master/README.md


They wrote their own because it's more fun to do that, and also because they really wanted me to win. The computer is really really bad


Hey now, I was proud to have won from a chess computer for once!


Glad I'm not the only one who often can't beat even the "easy" computer opponent in chess programs.

The main problem is that I only win by having my extremely-stupid blunders overlooked and then spotting my opponent's extremely-stupid blunder, so if the computer never misses my boneheaded blunders and also almost never commits any exploitable-in-one-or-rarely-two-moves blunders of their own, I can't possibly win, zero chance.


ROFL you're right that the computer is really bad, I won in 7 round which is a first for me (against a computer) and I'm bad at chess.

It reminds of a reversi I made for a school projects: users liked it because the computer was so bad that they could win..


>I'm curious as to why you wrote your own chess implementation

I was investigating whether AI can write a complete game of chess in one shot, I livestreamed that here[1] and the answer is no (conclusion: major rules are there, but buggy), but I was able to get it into a working state after many hours of back and forth.

The original implementation froze whenever a pawn got to the seventh rank, and allowed castling out of and through check (illegal), it was very buggy.

Iterating with the AI, I added tons of stuff like drag to move pieces, mobile support, and, yes, computer play. When that was finished (it is available at: https://taonexus.com/chess.html ) I had it make this blunder-free variant and it got it pretty fast.

[1] https://www.youtube.com/watch?v=AhJ07anVkYk


Surprisingly, in this context, I frequently came across interfaces that make it difficult to implement certain features using those libraries. There's not a one-size-fits-all implementation yet.


I am a bad player, but this was pretty easy to win, but i like the idea, Nice work.


This does not work in Firefox. The squares get stretched, while the area you can access stays square, so that the lower row is hidden. This makes it impossible to play.


it works in my version of Firefox, and I tested it on mobile as well. Can you send a screenshot and give information about your version of Firefox? what it looks like for me: https://imgur.com/a/ma37KtJ


I don't have a place to upload a screenshot just now, but it's Firefox 135 on Fedora linux 41.

What happens is that the squares doesn't stay square like in your screenshot, but varies in size depending on which pieces are in that row. The height of a row varies, but the width of the columns always stays the same.

Edit: It is often not the lowest row that get hidden, often e.g row 4 and 5 get so low that you can't put any pieces there.


I did not have this problem when I played a game from Firefox.


as someone who is SO BAD at chess, black moving instantly still gave me pause


I'm extremely mediocre and also found the instant-black-move a bit confusing. Would definitely be an improvement to add a "trail."


I was playing chess.com and wished that when you clicked on a piece and it highlighted which positions you could move it to, it would also show in red, which of those positions are take-able.


That'll be a little bit unfair


Makes me wonder how good players "see" the board. Like what parts are "highlighted" and is it always changing as you ponder different aspects of the game, or more static?


It's an interesting question. My opinion just from things I've read is that they're seeing chunks of the board, where the chunks get bigger as they gain more experience. A beginner looks at one piece at a time, an intermediate player might see certain blocks of pieces corresponding to the common openings/endings, and an expert might look at the entire board and think "oh yeah, this is like that one game where the line proceeded as follows..."

Disclaimer, I'm terrible at chess.


Yeah I've heard this description too, and it makes sense. But I also get the sense that the "chunks" must not just be simplifications of parts of the board, in fact the experts must "see more at once" than the newbie right? Like inside of the chunks there is somehow tons of intricate detail that the newbies can't even see, let alone assimilate into one memory or instinct or thought.

Maybe like a tourist who notices one interesting building or sign. The local doesn't notice anything, just like "cool, I remember this place," except then they notice if one small detail changes compared to the last time they visited. So in a sense they "saw" way more than the tourist.

I am also terrible at chess. Curious if this is anything like how the experts experience it.


If you mean how top players think about the game, you can watch videos of Hikara, Magnus, even GothamChess on YouTube and they go through in detail with visualizations of various positions in many games. Top players have encyclopedic knowledge of games and openings.


I have, and it's like magic to me. I have no idea how it works!


Mayura Chess did this a long time ago: http://mayura.com/chess/


When you are delivering mate in 1, the square still gets highlighted as being attacked by the king.


I'd love to be able to load a FEN or a PGN into it.


Fun, but so hard to see the pieces!


How do I castle?


By moving your king two columns at the same time, the computer will move the rook.


Drag the King to his destination square.


In the usual way, by moving your king 2 squares over.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: