key-lock key-lock loading
is there any definite way to tell when endgame starts? (i can tell when I play, but I want it for my engine)
i'm using the StockFish piece values, which change depending on endgame or middlegame/opening:

midgame values:
pawn=126
knight=781
bishop=825
rook=1276
queen=2538

endgame value:
pawn=208
knight=854
bishop=915
rook=1380
queen=2682

also, how do you decide on these values? I know centipawns is a common unit.
another method I tried was calculating the mobility of each piece (how many squares it can move to from the middle of the board):
queen=27
rook=14
bishop=13
knight=8
pawn=3
using this method, the king would be 8, but since you have to cancel out moves that get you checked, king=16(3)+4(8)+4(13)+4(14)+18(27)=674