Transitioning from Inform 6 to Inform 7. Best Practices?

Coming from Inform 6 (tho I’ve never actually finished writing any games in it), I’m trying to learn Inform 7. I’m a bit … befuddled … as to best practices for structuring the code.
In Inform 6, I would define all the rooms and their connections in the first section, then define all the objects and put them in their proper locations, then define all the characters and put them in their proper locations.
Inform 7 doesn’t seem to have such a structured approach, and I’m not sure how to lay everything out. It doesn’t seem to have the … syntax? … to do such things.
Any tips?

You might take a look at the source code for some complete games, e.g. Bronze or Robin and Orchid. You can search on IFDB for games with source available.

Inform lets you use multiple levels of book-style headings (volume, part, book, chapter, section), so you can structure your code however makes sense to you. I usually have a volume for “geography”, where I have chapters and sections for different rooms on the map. I’ll define objects and their interactions in the section for the room they appear in, unless they’re members of a more complex kind, in which case I’ll pull them out into a separate volume for “kinds” and just put the “The Mark II is a typewriter in the Study”-type definitions with the room they go in. Depending on the complexity of other actions and plot machinery you might define, it may make sense to pull them out as well.

Creating Interactive Fiction with Inform 7 by Aaron A. Reed is an incredible textbook. I have both a hard copy and the Kindle edition. Well worth studying.

Jeff

I have indeed downloaded some source code to peruse. Hopefully I can learn something from it.
I guess part of my confusion is regarding those book-style headings. Not sure of the “proper” way to use them, or even if there IS a “proper” way to use them.
I like your idea of organizing by Volume tho. That kinda fits with how I’ve worked before in Inform 6, to a degree.
But then, do I put the rules that apply to rooms/objects/NPCs in with the “definitions” of those things? Or do I make a separate volume JUST for rules?
It seems it would be easier to find rules for specific things if they were in the section that defines those things. But then the source code would kinda look messy, I’d think, with declarations, definitions, descriptions, rules, etc all intermingled with each other.
I guess that’s largely where my confusion (and indecision) stems from.

That’s definitely on my Amazon wish list. I just don’t have the funds for it just now.

I6 forces you to define (most of) your action code as part of the action’s object. So the declaration of “lamp” and the code for “light lamp” are necessarily next to each other.

I7 doesn’t force you to do that. But you can still put them near each other if that’s what you’re comfortable with.

Okay.
Been referencing Emily Short’s source for “Bronze,” and am finding it quite informative. Moreso than any previous attempt to learn from source in other languages.
I now understand much better the use of sections (Volume, Book, etc). They have no “set use,” and are simply left for the author to use as desired. NOW I can organize my code in a sensible way.
I’m also finding it informative to look at Emily’s other materials that came with the source, such as her flow charts of how the plot and puzzles are meant to play out; from early stages of writing the game to the final stages. Makes sense, and I’ll have to try doing it that way rather than outlining it all just as a text list.

I’ve downloaded the source for Bronze from http://inform7.com/learn/eg/bronze/source.html , using the complete text option. This, by the source’s admission, is version 12. I don’t know if this version is meant to be used with the current version of Inform 7 (my version says 1.65, which I downloaded from the Mac App Store). I have tried compiling the source text, but I get a whole slew of errors.

Does anyone know of a working example of the Bronze source text that works with the latest version of Inform 7? Thanks in advance!

I believe that a 6M62-compatible version of Bronze may be found at https://github.com/I7-Standard-Examples/Bronze/blob/master/Bronze.inform/Source/story.ni.

This did the trick, thanks so much! You actually helped me in several regards;

  1. I hadn’t considered putting my stories in a GitHub repo until now, but now that I see this example I feel a bit foolish for not already considering it.

  2. Also, I realize now what the actual version number is (not the Mac OS X app version), but the build hex number displayed at the top of the IDE. smacks forehead

  3. With an actual version control history I can compare the version I was attempting to fix from the Bronze website with all of the change history to see what was actually done to keep Bronze compatible.

Inform 6L02 was probably the biggest change. Emily Short wrote a blog post on how to account for the changes, which may be a useful point of comparison.

https://emshort.blog/2014/05/08/working-notes-on-updating-extensions-for-inform-6l02/