King Safety area

Code, algorithms, languages, construction...
Post Reply
vladstamate
Posts: 8
Joined: Wed Jun 16, 2010 6:37 pm
Real Name: Vlad Stamate
Contact:

King Safety area

Post by vladstamate » Fri Jun 18, 2010 11:36 pm

Hi all,

I am retouching a bit the king safety area for my engine. This is the area that is inspected for enemy attacks and own defenses. It is a small area around the king.

Until now I had a 3x3 square area around the king. But I changed that slightly so that if the king is in a castled position, I take the 3 squares in the rank of the king and 3 squares ahead, and 3 squares ahead again. So for example for a White king castled short the king safety area is:

00000000
00000000
00000000
00000000
00000000
00000111
00000111
00000111

So f1, g1, h1, f2, g2, h2, f3, g3, and h3.

Similar for the other castled positions. If the King is not castled then I use the old 3x3 area around the king.

Is this correct? Can there be a better area that I can look at? What areas other engines use?

Regards,
Vlad.

Pawel Koziol
Posts: 20
Joined: Fri Jun 11, 2010 7:19 am
Real Name: Pawel Koziol

Re: King Safety area

Post by Pawel Koziol » Sat Jun 19, 2010 5:38 am

Stockfish uses 3x3 area, Rebel uses area sumilar to Yours, only the additional squares have different weights and are subject to some additional conditions. In Glass, which is no good exmple, we use algorithm almost like Yours. "Almost" means adding a couple of squares on "f" file when the king is on h1.

Post Reply