If I remember correctly Lucas art and Bioware gave a few basic ellements for the story to be buid upon. For example the protagonist would start as a jedi class, would NOT be amnesiac e.t.c. purelly basic stuff really. If Bioware had a sequel in mind they would have made KotOR more openended in my opinion.