Engine Brining out Queen Early

Discussion of chess software programming and technical issues.

Moderator: Ras

tcusr
Posts: 325
Joined: Tue Aug 31, 2021 10:32 pm
Full name: tcusr

Re: Engine Brining out Queen Early

Post by tcusr »

msarchet wrote: Fri Oct 01, 2021 6:50 pm
dangi12012 wrote: Thu Sep 30, 2021 2:02 pm You have this code a lot: bitboard queens = c == WHITE ? board.GetWhiteQueens() : board.GetBlackQueens();
If you move WHITE to a template parameter - and have a constexpr function like this:

Code: Select all

template<bool IsWhite>
static constexpr map Queens(const Board& brd)
{
	if constexpr (IsWhite) return brd.WQueen;
	return brd.BQueen;
}
So the answer is: Adding soft negative moveterm to the queenmove (-0.5?) that depends on the movecount and approaches zero on move 12.
:D Still working on upping some of my C++ skills so this is very helpful. There are a lot of things I still need to learn and implement to clean up my code. In terms of my overall eval speed, it's okay. I've been using valgrind to profile and my eval time is quite a bit of my search time (which makes sense?). I'm not super worried about search times right now so this hasn't been my focus. I'm doing fixed depth search for the time being since it lets me better compare a change to my code against the prior version.
Mergi wrote: Thu Sep 30, 2021 6:13 pm You have mid and end game tables but they are both exactly the same, and they both prefer queen in the middle of the board. Why don't you try changing that? I'm confused ... what exactly is the issue here? Bringing out queen early is what you coded into your queen PST.

https://github.com/msarchet/panzer/blob ... res.h#L173
Yeah I've assumed this was part of the case, I made use of the PST from the CPW for starting out (which I think is commented in my code).

I'm still trying to get through all of the eval bits I would like to implement. After that I need to do some work on properly understanding Static Exchange Eval. I've been slowly going through the CPW Eval code and some of the deeper suggestions on the wiki. I recently have been exploring some of the code sample in here as well

Code: Select all

https://hxim.github.io/Stockfish-Evaluation-Guide/
. Which is helpful for me understanding what the heck I am doing.

----

Eval is definitely a very difficult problem, and I'm finding that I probably need to implement it more completely before I start trying to parse why certain things are happening. Really appreciating these suggestions.
thank you for the stockfish evaluation link
btw, do you know what the << 0 are for? they don't change anything

Code: Select all

function main_evaluation(pos) {
  var mg = middle_game_evaluation(pos);
  var eg = end_game_evaluation(pos);
  var p = phase(pos), rule50 = rule50(pos);
  eg = eg * scale_factor(pos, eg) / 64;
  var v = (((mg * p + ((eg * (128 - p)) << 0)) / 128) << 0);
  if (arguments.length == 1) v = ((v / 16) << 0) * 16;
  v += tempo(pos);
  v = (v * (100 - rule50) / 100) << 0;
  return v;
}
msarchet
Posts: 13
Joined: Tue Sep 21, 2021 4:07 am
Full name: Michael Sarchet

Re: Engine Brining out Queen Early

Post by msarchet »

Since it's Javascript it forces them to an int.
Panzer (still very in progress) - C++ bitboard engine https://github.com/msarchet/panzer
tcusr
Posts: 325
Joined: Tue Aug 31, 2021 10:32 pm
Full name: tcusr

Re: Engine Brining out Queen Early

Post by tcusr »

msarchet wrote: Sun Oct 03, 2021 7:29 pm Since it's Javascript it forces them to an int.
thanks, i didn't know
btw you misspelled panzer in the link below your posts
msarchet
Posts: 13
Joined: Tue Sep 21, 2021 4:07 am
Full name: Michael Sarchet

Re: Engine Brining out Queen Early

Post by msarchet »

tcusr wrote: Sun Oct 03, 2021 8:40 pm
msarchet wrote: Sun Oct 03, 2021 7:29 pm Since it's Javascript it forces them to an int.
thanks, i didn't know
btw you misspelled panzer in the link below your posts
thanks!
Panzer (still very in progress) - C++ bitboard engine https://github.com/msarchet/panzer