I'm happy with the performance of the code, which is 4x faster than MadChess 1.x. Details at http://www.madchess.net/post/procedural-code.

Moderator: Ras

Thanks, Erik I'll follow your posts. Is there any reason that you don't want to switch to bitboard????Henk wrote:I think that if I would use bit boards only, evaluation would be slower. I also have separate lists for whitePawns .. blackKing etc where each list contains chessPieces that have a location.
So speeding up move generation doesn't help if evaluation gets much slower, but I might be wrong for my engine is not fast (actually slow).
Maybe I might be wrong for evaluation is not executed for every move generated.Henk wrote:I think that if I would use bit boards only, evaluation would be slower. I also have separate lists for whitePawns .. blackKing etc where each list contains chessPieces that have a location.
So speeding up move generation doesn't help if evaluation gets much slower, but I might be wrong for my engine is not fast (actually slow).
I like the simplicity of an array of squares. But mostly I enjoy the process of slowing increasing the sophistication of the code, from the direct and intelligible to the arcane. I'm very methodical as you can see. Perhaps I'll use bitboards for version 3.kinderchocolate wrote:Thanks, Erik I'll follow your posts. Is there any reason that you don't want to switch to bitboard????
Henk, I use bit shift operations to encode moves and castling rights. But the board is represented as an int[64].I thought Erik was using bit boards only. OK bye I'm out of this discussion, before making more mistakes and wrong assumptions.
That's what abstractions are for, so you can isolate complexity to small parts of the code to make it fast, yet present a simple interface for the rest of the program.emadsen wrote:I like the simplicity of an array of squares. But mostly I enjoy the process of slowing increasing the sophistication of the code, from the direct and intelligible to the arcane. I'm very methodical as you can see. Perhaps I'll use bitboards for version 3.kinderchocolate wrote:Thanks, Erik I'll follow your posts. Is there any reason that you don't want to switch to bitboard????
Henk, I use bit shift operations to encode moves and castling rights. But the board is represented as an int[64].I thought Erik was using bit boards only. OK bye I'm out of this discussion, before making more mistakes and wrong assumptions.
Yes, I know. I live in that world every day. I wrote MadChess 1.x to answer the question, if I write a chess engine using the business OO style code I write at work, how strong will it be? The answer is 2200 ELO, and more likely 2400 against human opposition.That's what abstractions are for, so you can isolate complexity to small parts of the code to make it fast, yet present a simple interface for the rest of the program.
I agree. The main performance penalty coming from runtime-managed memory / garbage collection versus developer-allocated / deallocated memory. Though, I thought most strong engines are written in plain C, not C++.That's why most object-oriented performance-critical programs (including chess engines) are written in C++. It's not as "clean" as C# or Java, but it allows you to do a lot of OOP with minimal/no performance penalty.
I'm not interested in reading the Stockfish source code, though I understand and respect those who do. MadChess is done purely for my own intellectual satisfaction, so I'm quite content to build it ignorant of the state of the art. I am happy to reinvent the wheel- in fact that's the whole point since writing a chess engine is pretty much a solved problem at this point. Of course, if this was a professional project, I'd read the Stockfish source and incorporate as much as possible into the project. The mental effort of devising my own solutions, while intellectually satisfying, would be a waste of time to my employer.If you look at the Stockfish source code.
Well, Stockfish is one example of a very strong chess engine written in C++emadsen wrote: Yes, I know. I live in that world every day. I wrote MadChess 1.x to answer the question, if I write a chess engine using the business OO style code I write at work, how strong will it be? The answer is 2200 ELO, and more likely 2400 against human opposition.
I agree. The main performance penalty coming from runtime-managed memory / garbage collection versus developer-allocated / deallocated memory. Though, I thought most strong engines are written in plain C, not C++.
I'm not interested in reading the Stockfish source code, though I understand and respect those who do. MadChess is done purely for my own intellectual satisfaction, so I'm quite content to build it ignorant of the state of the art. I am happy to reinvent the wheel- in fact that's the whole point since writing a chess engine is pretty much a solved problem at this point. Of course, if this was a professional project, I'd read the Stockfish source and incorporate as much as possible into the project. The mental effort of devising my own solutions, while intellectually satisfying, would be a waste of time to my employer.