Your bump of this thread gave me an opportunity to see the naivety of 2020 me’s dreams of a new computer solving my problems.
In January 2024 I spent a month reconfiguring my WIP’s main source so I could run individual chapters without compiling the others. If I hadn’t, it would be 30 seconds (and continuing to grow with each chapter) to rerun the game while testing, instead of a pretty fixed 3-5 seconds.
EDIT - Oops, I grossly understated current compile time. It’s now up to 3 and a half minutes for the 525k word WIP on a 2021 iMac. So 3-5 seconds compared to that is good beyond belief.
10.1 has a facility for multiple source files but the only thing keeping it from being formally deprecated is that it was never precated to begin with. The current development version of Inform includes a different way to do it, so it’ll be in the 11.0 release (for which there isn’t a schedule).
Well, it can “build” anything, it’s really just a fancy preprocessor which joins files together. The question is if the Inform build pipeline supports it for story files, although if you use Inform 10.2 / 11 to build on the command line it’s probably easy to invoke it.
But Inweb is already invoked to build extensions, even in Inform 10.1 (ie. the current IDE version), if the extension is a web (like Standard Rules is). So the scaffolding is already there.
That might in fact be the facility @Zed mentioned, though. If it is, I hope it is never deprecated, since I love Inweb but judging by the proposals for how to structure multi-file extensions and multi-file documentation, I’m not sure if Graham loves it, since he’s proposed different solutions for the same problem Inweb solves (which I’ve counter-proposed: Jira).
I’m interested in the pragmatics of this. Do you have a single story.ni file with bits you can comment/uncomment depending on which chapter you want to create? Or do you have several different story.ni files, one for each chapter (and another for ‘the whole game’)?
(I guess I have the same question for @zarf ; if the ‘everything in one room’ version of Hadean Lands a separate story.ni file, or a different way to comment/uncomment the main source file?)
It was a separate project with a separate story.ni file. It included the extensions that defined alchemy and recipes and objects, but only defined one room to put the objects in.
Cool; thanks. Was that file able to find the extensions in the other project’s ‘X.materials/Extensions/’ folder, or did all the extensions live in the global extensions folder?
It was 6G60; the idea of materials/Extensions hadn’t been invented yet.
I put the extensions in a local ./lib directory (so that I could manage them with source control). Then I symlinked them into the global extensions folder.
Each chapter is an extension. Then in the main source, I comment/uncomment their inclusion. Since almost all are commented out most of the time, to test a single chapter, I usually am just changing two things in the main source – the number in the line about which chapter to include, and the variable which says which chapter number to boot into.
Like I say, getting to this from how it was before was a month of hard slog, with two attempts that didn’t work (they weren’t ambitious enough) but now it is like this, I find it difficult to fully recall all the difficulties
I originally had a ton of verb-centric code (i.e. organised by verb/action, but referring to things that were all over the game) in the main source. I had to change that mindset and break things up a lot more using rules. Then those rules were able to live in their own chapters along with all the things they referred to. That was the core thing.
I’m always moving backdrops during play, and if you want to move them without flagging all the target rooms, the easiest way is to just move them to a region. Sometimes the region is only one room. All regions are created in the main source, so sometimes I have to create regions like ‘just-the-c10-chapel’, then the line that places the chapel in it is in the chapter 10 extension along with the chapel.
There was another trick I learned from @mathbrush who had to divide up the Never Gives Up Her Dead source similarly, of which I forget the exact details. Maybe using adjectives to identify lone chapter-specific things in the main source without having to name them?
The last thing is I want to be able to compile with or without the graphic component as easily as possible (i.e. just by including the graphics extension or not). The main source has to be able to run a lot of graphics commands. They are defined with code that just says ‘do nothing’ in the main source, then is replaced by the real code when the graphics extension is included.
As the game gets longer, I’m starting to have some map areas revisited, so then I split the shared bit of a chapter into another extension that’s included by both relevant chapters.