We're working on a game that's going to be split into three episodes, which we'll release one after another, as they get finished. I'm worried that our typical somewhat-monolithic architecture is not a good fit for this model.
The game code consists of basically three parts:
_Engine_: Renderer, physics, UI etc.
_Logic_: The concrete scenes and entities.
_Scripts_: Levels and dialogs.
_Logic_ are native code,
_Scripts_ are shipped with the game data and executed at runtime.
I think I can safely assume that:
_Engine_will be the same for all episodes.
_Logic_will be largely the same for all episodes. but have some specific parts.
_Scripts_will differ significantly for each episode.
I see three options for organising this:
- Create episode two by copying all the code from episode one, adjusting as needed. I believe this is how sequels are typically done; id Tech 4 appears to be part of the "Doom 3" code, not clearly separated.
- Keep all the shared code in one place, making it possible for each episode to override parts of it.
- Create a reusable engine, completely separating
_Scripts_, to be used by all episodes. Shared
_Logic_will either be duplicated for each episode, or generalised and moved into
_Engine_. This is how the folks behind "Penumbra" apparently did it.
The major drawback I see with the first approach is that I'll have to back-port any fixes and refactoring to episode one, manually.
The major drawbacks I see with the second approach is that it's more upfront work, and that I'll have to make changes to already released episodes, requiring me to keep testing them.
The major issue I have with the third approach is that it's a big amount of upfront work. and smells a bit like premature generalisation. I cannot fully predict what changes I'll have to make for episodes two and three; it depends on their unfinished design. On the other hand, it would probably give us more flexibility, and speed up development, later.
What is the typical way of organising the code for episodic games? Do I have options, other than the three I can think of?