legal move generator

Discussion of chess software programming and technical issues.

Moderator: Ras

tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: legal move generator

Post by tpetzke »

If you think you get better code with a legal move generator, do it. Don't sacrifice clean code for a tiny speed up in move generation.

I reality the legal check is not that expensive because you don't generate all moves all the time. If you get a cut off from the hash move (you often do) you generate no moves at all. A legal check of capture moves is also not that expensive which gets you also often a cutoff.

So if you are happy with pseudo legal moves do it, but don't do it because all others seem to do it.

Thomas...
Karlo Bala
Posts: 373
Joined: Wed Mar 22, 2006 10:17 am
Location: Novi Sad, Serbia
Full name: Karlo Balla

Re: legal move generator

Post by Karlo Bala »

WinPooh wrote:
Karlo Bala wrote:IMHO, GreKo(6.5) chess has a very nice legal move generator :wink:
Yes, and after I returned back to pseudo-legal scheme the engine got stronger by 50 Elo points.
Is it due to speed or something else?

Still, I like yours move generator very much.
Best Regards,
Karlo Balla Jr.
User avatar
WinPooh
Posts: 276
Joined: Fri Mar 17, 2006 8:01 am
Location: Russia
Full name: Vladimir Medvedev

Re: legal move generator

Post by WinPooh »

Karlo Bala wrote:
WinPooh wrote:
Karlo Bala wrote:IMHO, GreKo(6.5) chess has a very nice legal move generator :wink:
Yes, and after I returned back to pseudo-legal scheme the engine got stronger by 50 Elo points.
Is it due to speed or something else?

Still, I like yours move generator very much.
Hard to say. There was a lot of refactoring changes, switching to pseudo-legal being only one of them. But the raw speed in perft test surely increased.