It’s now three and a half years ago I asked speculatively about potential ways to divide up a large source. (Splitting the story into multiple files)
I didn’t need them then. The WIP was much smaller and I said ‘I’ll have to keep pining for that newer computer.’
I got the newer computer, and one of its processors alone was maybe 5 times faster at compiling than my whole old computer? Then I found Inform cannot make use of the multiple processors to compile, so no more improvement is coming.
WIP is now 250k words with 900 things, so I expect at least 500k words when done. Compile time’s now 20 seconds. That may not sound bad, but due to size and complexity of game, it’s starting to feel painful given how often I have to rebuild, including attempts that fail, and how much I will have to, before the end.
The source is very readable at the moment. Each chapter is its own volume. I keep the introduction of variables and mechanisms in the source pretty much right at the spot when I first realised I needed them. This gives a logic (prior to the definition, that thing wasn’t needed) and history and organisation.
After all the chapters is a huge action block with more master code for actions, or hacks to those actions for this game. This block references things from all chapters.
For these reasons, it’s hard to break up. My dream would be to keep the full readability but just be able to turn individual chapters off at compile time. I can’t imagine a way that’s possible. I’d have to make sure no chapter referenced anything outside itself, and the huge action block at the end would basically be impossible to keep.
The closest practical way I can think of achieving a division is to move all thing definition lines to one volume, then turn all chapters into extensions. The process of doing this feels fraught (possible bringing bugs in that I might not notice) but second, it would make me grumpy that those thing definitions would not be in the chapters where the things are. I suppose everything after the definition line, which is the bulk of the description of the thing, would still be in the chapter. Readability would go down, that’s for sure.
Anyway, I’m considering trying what I just described, as an experiment. Because the compile time is getting to me, and I also just watched the 30 years of Doom Romero-Carmack Twitch recording, in which Romero mentioned, ‘Anything you can do to get your core iteration time down is worth doing.’
So my questions are – can you think of any other approach or technique? Or observations on what I’ve suggested to myself? My idea will reduce readability, but still maximise it versus, say, putting all of each type of anything in its own block. I think the total division approach guarantees a source that’s not very readable, and useless as a practical history of thought process. This is extra important in a game that’s very novel-like.
Thanks.
-Wade