finish encoding floating castle