The game begins with Sora, Donald and Goofy arrving in Castle Oblivion, where they visit recreations of the worlds they visited before. Each world is on a different floor, and as they move to higher floors, they lose their memories. They are replaced by new ones. When Sora forgets Kairi, she is replaced in his memory by a girl named Naminé. Sora encounters a group called Organization XIII. The group built Castle Oblivion to erase Sora's memories and trick him into joining them. In the end, Naminé tells Sora she erased his memories, and gives him the choice to keep his new memories or have his old ones restored. If his memory is fixed, he will forget everything that happened in Castle Oblivion. He chooses to get his old memories back and tells Naminé he could never forget her. His story ends with him being put to sleep, because it will take Naminé one year to restore his memories. After completing Sora's story, the player can play as Riku, who travels through Castle Oblivion's basement levels. Riku encounrters other members like Sora. Riku recalls what he did about Sora and resists Ansem's power.