Castling and player detection