if ( !isset( $creatureLocation[ $creature->locationx ] ) { 
        $creatureLocation[ $creature->locationx ] = array();
    }

etc.