How a real human-ape friendship inspired The Kingdom of the Planet of the Apes