Nothing is ever set in stone and planned ahead that far. A sequel looks at the successes and failures of the previous game and the story and gameplay are adapted accordingly. Sometimes the story even drastically changes partway through development if things aren't working.