intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Oct 19, 2018 9:43 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Aug 21, 2018 5:39 pm 
Offline

Joined: Fri Feb 04, 2011 3:20 pm
Posts: 38
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?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Aug 21, 2018 6:52 pm 
Offline

Joined: Fri May 31, 2013 3:54 pm
Posts: 107
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.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Aug 21, 2018 7:42 pm 
Offline
User avatar

Joined: Sat Sep 09, 2017 5:57 pm
Posts: 93
Location: Under the rainbow
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


Last edited by fos1 on Tue Aug 21, 2018 10:12 pm, edited 1 time in total.

Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Aug 21, 2018 8:23 pm 
Offline

Joined: Fri Feb 04, 2011 3:20 pm
Posts: 38
prevtenet wrote:
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.


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.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Aug 21, 2018 8:24 pm 
Offline

Joined: Fri Feb 04, 2011 3:20 pm
Posts: 38
fos1 wrote:
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 work studying.

Jeff

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


Top
 Profile Send private message  
Reply with quote  
PostPosted: Tue Aug 21, 2018 9:04 pm 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5770
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.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed Aug 22, 2018 5:22 pm 
Offline

Joined: Fri Feb 04, 2011 3:20 pm
Posts: 38
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.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Sep 14, 2018 6:43 pm 
Offline

Joined: Fri Sep 14, 2018 6:13 pm
Posts: 2
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!


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Sep 16, 2018 10:57 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5384
Location: Burlington, VT
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.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon Sep 17, 2018 11:51 am 
Offline

Joined: Fri Sep 14, 2018 6:13 pm
Posts: 2
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.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: VictorGijsbers and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group