Live data from Hacker News

How to build a chess engine

chessengines.org

1–10 of 58 posts

Re: How to build a chess engine

#2
By "chess engine" the author refers to the AI/Machine Player, not the base of how to position the pieces, valid moves, turn taking, etc. which is what I thought "engine" would mean here (my thought was similar to a game engine vs AI/characters). For the "game engine" they're importing Chess.js. Totally fine, just a heads up since I did expect to see a truly from-0 since it says "how to build a Chess engine from scratch" and was confused when they imported a fully working "engine".

Maybe "How to build a Chess Automaton/AI Player" would be a better title? Unless in the Chess industry the "chess engine" refers to the machine player, which I do not know.

PS, this website also hijacks the "down key" and the "space key", making keyboard navigation harsh...

Re: How to build a chess engine

#3

By "chess engine" the author refers to the AI/Machine Player, not the base of how to position the pieces, valid moves, turn taking, etc. which is what I thought "engine" would mean here (my thought was similar to a game engine vs AI/characters). For the "game engine" they're importing Chess.js. Totally fine, just a heads up since I did expect to see a truly from-0 since it says "how to build a Chess engine from scrat…

>PS, this website also hijacks the "down key" and the "space key", making keyboard navigation harsh...

Why would they do that? It's not like they made the keys do something else instead. :(

Re: How to build a chess engine

#4

By "chess engine" the author refers to the AI/Machine Player, not the base of how to position the pieces, valid moves, turn taking, etc. which is what I thought "engine" would mean here (my thought was similar to a game engine vs AI/characters). For the "game engine" they're importing Chess.js. Totally fine, just a heads up since I did expect to see a truly from-0 since it says "how to build a Chess engine from scrat…

I see what you're getting at but for whatever reason "chess engine" in fact usually refers to what you're calling the AI player -- https://en.m.wikipedia.org/wiki/Chess_engine

Re: How to build a chess engine

#5

By "chess engine" the author refers to the AI/Machine Player, not the base of how to position the pieces, valid moves, turn taking, etc. which is what I thought "engine" would mean here (my thought was similar to a game engine vs AI/characters). For the "game engine" they're importing Chess.js. Totally fine, just a heads up since I did expect to see a truly from-0 since it says "how to build a Chess engine from scrat…

I see what you're getting at but for whatever reason "chess engine" in fact usually refers to what you're calling the AI player -- https://en.m.wikipedia.org/wiki/Chess_engine

Exactly, that's why I noted "Unless in the Chess industry ...", the details of which I don't know. I only know a bit about general game making (I've tried Godot and GameMaker, some friends make games and we talk) so this was my opinion from a more general game point of view.

But still, from that Wikipedia description "a chess engine is a computer program that analyzes chess or chess variant positions, and generates a move or list of moves that it regards as strongest" that's what I mean, the chess.js package does all of this except the last step (analyzing the strongest). So it seems in the industry it's a mix between the "logic gameplay" and "AI", and this article is still only about the "AI/Automaton".

Re: How to build a chess engine

#6
Several years ago I built a chess engine in C, based on various ideas gleaned from the chessprogramming wiki [1]. I haven't looked at in a while, but that wiki was an extraordinarily useful resource.

I didn't write a better stockfish or anything, but I was surprised that it didn't take too long to write a chess engine that could routinely beat me at chess.

I'll also note that chess protocals are very standardized, and it was straightforward to attach the engine to one of the many chess GUIs out there (I used Chess Arena and scid). This was a great project and I highly recommend it.

[1]: https://www.chessprogramming.org/Main_Page

Re: How to build a chess engine

#7

Several years ago I built a chess engine in C, based on various ideas gleaned from the chessprogramming wiki [1]. I haven't looked at in a while, but that wiki was an extraordinarily useful resource. I didn't write a better stockfish or anything, but I was surprised that it didn't take too long to write a chess engine that could routinely beat me at chess. I'll also note that chess protocals are very standardized, an…

For sure, ChessProgramming.org is one of the best resources out there.

Wrote this just trying to be a bit more of a straightforward guide to how to really get started - hard to sort through how many strategies there are out there when building an engine :)

Re: How to build a chess engine

#9
post #3

By "chess engine" the author refers to the AI/Machine Player, not the base of how to position the pieces, valid moves, turn taking, etc. which is what I thought "engine" would mean here (my thought was similar to a game engine vs AI/characters). For the "game engine" they're importing Chess.js. Totally fine, just a heads up since I did expect to see a truly from-0 since it says "how to build a Chess engine from scrat…

>PS, this website also hijacks the "down key" and the "space key", making keyboard navigation harsh... Why would they do that? It's not like they made the keys do something else instead. :(

Some of that hijacking is done by various front end JS libs, I've seen sites/projects where that kind of thing was happening and none of the devs weren't even aware it was part of some "batteries included" toolkit.

Re: How to build a chess engine

#10

By "chess engine" the author refers to the AI/Machine Player, not the base of how to position the pieces, valid moves, turn taking, etc. which is what I thought "engine" would mean here (my thought was similar to a game engine vs AI/characters). For the "game engine" they're importing Chess.js. Totally fine, just a heads up since I did expect to see a truly from-0 since it says "how to build a Chess engine from scrat…

Engine is the common term in chess for the program that analyzes a game.
Post reply on HN