Next steps for my engine?

Discussion of chess software programming and technical issues.

Moderator: Ras

Fguy64
Posts: 814
Joined: Sat May 09, 2009 4:51 pm
Location: Toronto

Re: Next steps for my engine?

Post by Fguy64 »

nevatre wrote:in your static eval you have

return ( pStr.charAt(64) == 'w' ) ? ( bmat - wmat ) : ( wmat - bmat );

if the condition "pStr.charAt(64) == 'w'" means white is to move in that position then you should return the score from whites point of view, that is "wmat - bmat" not "bmat - wmat".
duly noted. I have really oddball way of doing things. Associated with a move is a position string representing the position and game state after the move is made. ergo if the move being evaluated is a white move, then the associated pStr says black to move.

Thanks for asking.
MattieShoes
Posts: 718
Joined: Fri Mar 20, 2009 8:59 pm

Re: Next steps for my engine?

Post by MattieShoes »

Don wrote:
Fguy64 wrote:Well Alright. Thanks to all for all the ideas, my hopes have been exceeded. It all looks helpful. Lots of food for thought to keep me busy for some time to come.

OK, I'm convinced about q-search, I can't put it off any longer. Thanks to Don for the extra pointers there.

Didn't know about Bruce Borland's page. I spent a few minutes looking it over. My initial impression is I like the layman's sort of explanations he gave. That sort of stuff is worth its weight in gold to me. I can see myself backtracking here and working through something even more basic than I have, in order to fill in the gaps in my knowledge before pressing ahead.

Some good info here in the thread that helped me visualize a package of improvements coming together sometime down the road.

Thanks again.
When I started out, I didn't have Bruce Moreland's web page. But I did have this real gem of a book called "Chess Skill in Man and Machine." In particular one chapter of that book was worth more to me than the whole rest of the book combined. It pretty much layed out how to build a chess program in simple high level terms that you could easily understand. It was an outline of how the chess 4.5 Northwestern University chess program worked. This program dominated chess for a while in the 70's and I consider it the first "modern" chess program.

Of course by todays standards, you might consider that book chapter out of date, as nobody knew about null move pruning, late move reductions, etc. But this is where I first learned about how quies search really works, the idea of taking turns standing pat, etc.

I lent that book to someone and never got it back, and I still yearn for it :-) Maybe the book chapter is online somewhere. I'll bet you would benefit from reading it. It's extremely readable.
I have that exact book! :-) I've read it cover to cover.
Fguy64
Posts: 814
Joined: Sat May 09, 2009 4:51 pm
Location: Toronto

Re: Next steps for my engine?

Post by Fguy64 »

Well, this thread has turned into more of an odyssey than I ever expected, and I thanks those who have stuck with me.

The thread has seen attempts at a few different searches, all have fallen short for one reason or another. Always I find myself engaged in some sort mental flip-flop that my brain has always struggled with. It's almost like I have some form of techno-dyslexia or something. :)

OK, all of the pseudo code examples I see involve a search function that returns an eval, as opposed to a move, so I find myself thinking "ok here's the eval, where's the move"? Always I end up starting with a non-recursive "root-search" and then applying a separate recursive search to each move in the initial list. So what I end up with is the recursion function being called 20-30 times from outside of itself, instead of just once, and i am not sure this is necessary. I feel it should work ok, but it has been suggested to me elsewhere that I am making my life a little more complicated by doing it this way. The problem is, when I don't do it this way, it seems i end up "over-objectifying" within my search function, in an OOP sense, which seems to slow things down.

Anyways, I don't have specific coding issues to deal with this morning. I've gone backwards to scratch again and written myself a basic minimax function with no pruning, and I'm gonna play with that for a while.

cheers.
Fguy64
Posts: 814
Joined: Sat May 09, 2009 4:51 pm
Location: Toronto

Re: Next steps for my engine?

Post by Fguy64 »

OK I just wanted to bring this thread to a logical conclusion. As I recall, the first post was me claiming that I had a working negamax/alphabeta, and what should I do next. It soon became clear that in fact what I had may have been negamax, but it wasn't alpha-beta, more like just alpha. So the next forty thousand pages were devoted to getting a proper alpha-beta working.

At one point I had an alphabeta that could solve checkmate, but would not find the right move based on material. After much ripping of hair, I eventually realized that my alphaBeta was returning the worst possible move. The upshot of it was that the Evaluate() I used with my old negamax did not work with the new negamax, I think the reason being that the new nexamax did not have a separate root search. Simply negating my material eval from what it was inthe old version, solved all the problems. At least, I'm pretty sure that's what did it, I tried a lot of things. Anyways, touch wood, barring any unknown MoveGen bugs, I'm pretty sure I'm squared away in terms of the correctness of my algorithms

So I'm gonna save next steps like qSearch, and iterative deepening, and hash table for another day and another thread. Thanks to all those who helped in this thread, it's been a slice.
:)