intfiction.org

The Interactive Fiction Community Forum
It is currently Wed Jun 19, 2013 7:06 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
PostPosted: Mon Apr 16, 2012 12:44 am 
Offline

Joined: Mon Apr 16, 2012 12:33 am
Posts: 10
I am very new to Inform and am finally giving writing IF a go. I've been tearing through tons of examples online, but I'm not sure what the recommended methods are for my three basic questions.

When I drill down into detail about a room, should I just constantly create a new item with "Is scenery" for each detail the player may want to look at. Putting aside my OCD attention to detail :), I have a room, which has a table, which when looked at has some odds and ends like "scattered plates", and the plates are stained from last nights meal. None of this is there for game play purposes or are usable items. I don't want the table to support objects or plates to be picked up. It's all just dressing if a player wanted to dig deep into details just for the fun of it.

Should I create each of these as:

A table is here. Table is scenery. "The table...."
A plate is here. Plate is scenere. "The plate...."
A stain is here. Stain is scenere. "The stain ...."
With corresponding: understand "plates" as plate.


Will that create issues having so many objects or lines of code? Should I write is as some sort of command: Instead of "x table" say "The table has four legs..."? Or is creating a multitude of scenery objects simply the price to pay for going nuts with details?


Second question, if I write a new action such as "scrub floor", how does Inform know it applies only to a specific room where scrubbing is important to the story versus a command of scrubbing that I want available no matter where the player goes?

Third question, if I want to help guide a player away from actions that I don't want, must I define the action first, then create another line of what to say in place of "That's not a verb I recognise." Two separate lines? Or is there an easier way to write one line that accomplishes 'instead of doing an action you dont understand, just say this'?

Thank you,

Tom / Hardwater


Top
 Profile Send private message  
 
PostPosted: Mon Apr 16, 2012 1:56 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 402
Location: Malmö, Sweden
Hardwater wrote:
I am very new to Inform and am finally giving writing IF a go. I've been tearing through tons of examples online, but I'm not sure what the recommended methods are for my three basic questions.

When I drill down into detail about a room, should I just constantly create a new item with "Is scenery" for each detail the player may want to look at. Putting aside my OCD attention to detail :), I have a room, which has a table, which when looked at has some odds and ends like "scattered plates", and the plates are stained from last nights meal. None of this is there for game play purposes or are usable items. I don't want the table to support objects or plates to be picked up. It's all just dressing if a player wanted to dig deep into details just for the fun of it.

Way I see it, there are two schools on this. The first is the most straightforward: model each of these as a scenery object and provide innocuous error messages whenever the player tries to interact beyond superficial examination (i.e "The [x] is unimportant." or "You try to push [y]). The second school employs shorthand. Here, you group the objects together so that the table, dishes, tablecloth etc actually refer to the same object, thus logically grouping related items together. For an example of this technique in action, check out The Dreamhold by zarf (specifically, the glass-fronted cabinet and its contents).

Which technique is best is a matter of taste. Some players are fine with different objects being represented by a single one, others feel it's cheap and/or boring. Your mileage may vary.


Quote:
Will that create issues having so many objects or lines of code? Should I write is as some sort of command: Instead of "x table" say "The table has four legs..."?

No. God no. Bearing in mind I'm no I7 maven, I still can't see how command substitution could possibly end well. Scenery objects are barely significant in terms of size, so you won't really gain anything by overriding the object tree model in this way.


Quote:
Or is creating a multitude of scenery objects simply the price to pay for going nuts with details?

It depends. Realistically, there's always going to be a cutoff point somewhere; for me it's when there are so many similarly named objects in the same room that the parser picks the wrong one. Barring that, you're free to go wild.


Quote:
Second question, if I write a new action such as "scrub floor", how does Inform know it applies only to a specific room where scrubbing is important to the story versus a command of scrubbing that I want available no matter where the player goes?

Generally, when you want to restrict actions, you add a check rule or an instead rule to block undesired actions, as below (I used a check rule):
Code:
A room can be dirty or clean. A room is usually clean.

Floor-scrubbing is an action applying to nothing.
Understand "scrub floor" as floor-scrubbing.

Check floor-scrubbing when the location is not dirty: say "The floor here doesn't need scrubbing." instead.

Carry out floor-scrubbing: now the location is clean.
Report floor-scrubbing: say "You scrub the floor until you can see your own reflection."

The Parlor is a room. The Porch is west of the parlor. The porch is dirty.



Quote:
Third question, if I want to help guide a player away from actions that I don't want, must I define the action first, then create another line of what to say in place of "That's not a verb I recognise." Two separate lines? Or is there an easier way to write one line that accomplishes 'instead of doing an action you dont understand, just say this'?

You can use the technique of "understanding mistakes,"
Code:
Understand "act" as a mistake ("To join the actors, you have to adopt a role in the play! Try PLAY HAMLET or similar.").

in such cases.

_________________
~Björn Paulsen


Top
 Profile Send private message  
 
PostPosted: Mon Apr 16, 2012 2:36 am 
Offline

Joined: Sat Jul 09, 2011 2:09 am
Posts: 19
Eleas wrote:
Hardwater wrote:
Second question, if I write a new action such as "scrub floor", how does Inform know it applies only to a specific room where scrubbing is important to the story versus a command of scrubbing that I want available no matter where the player goes?

Generally, when you want to restrict actions, you add a check rule or an instead rule to block undesired actions, as below (I used a check rule):

[cut for readability]
I'm just barely less new than you are, but the way I understand it, you'd use the above to create a functional but minimally useful action that could apply in any room, and then use a more specific after or instead rule to advance the story (thrown together here; not guaranteed to work):
Code:
The metal rod is an item. "Old, rusty, but important."

After floor-scrubbing when the location is the porch for the first time:
    say "As you scrub the boards of the porch, you find an old metal rod wedged into a crack.";
    now the player has the metal rod.

Also, I have the same problem when creating games. Of course, I also don't like saying that the player can't pick something up. Carrying capacity becomes important quickly. I'm not sure if that's the best way to do it (never gotten anything to the point where I could run it by anyone for testing, which might be part of the answer right there), but from what I understand, items take up a rather tiny portion of the memory, especially if you make them scenery.


Top
 Profile Send private message  
 
PostPosted: Mon Apr 16, 2012 2:52 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 402
Location: Malmö, Sweden
WovenTales wrote:
I'm just barely less new than you are, but the way I understand it, you'd use the above to create a functional but minimally useful action that could apply in any room, and then use a more specific after or instead rule to advance the story (thrown together here; not guaranteed to work):
Code:
The metal rod is an item. "Old, rusty, but important."

After floor-scrubbing when the location is the porch for the first time:
    say "As you scrub the boards of the porch, you find an old metal rod wedged into a crack.";
    now the player has the metal rod.

Either way is fine. You could also combine the two. I generally use After or Instead rules for one-time events, but it's a matter of personal taste.

_________________
~Björn Paulsen


Top
 Profile Send private message  
 
PostPosted: Mon Apr 16, 2012 3:16 am 
Offline
User avatar

Joined: Tue Nov 17, 2009 5:25 pm
Posts: 633
As a rule, when designing you should try and think general.

I would rather implement a verb "scrub" that works for anything and then catch the specific behaviour:
Code:
Scrubbing is an action applying to one visible thing. Understand "scrub [something]" as scrubbing. [also, add synonyms here <---]

Check scrubbing:
     if the noun is not the [floor]:
          say "You should stick to scrubbing floors.";
          stop the action;
     else:
          say "It's spring cleaning time!".

That saves the parser when the player (as he would surely do!) tries and scrub something that is not the floor. (The [floor] in brackets it's because I don't know how you called it. There is no "floor" pre-implemented in Inform).

Now another thing to be said: if the particular action triggers just for one object you should use the Carry out rule. Else, a more specific Instead rule should be used.
Again:
Code:
Check scrubbing:
     if the noun is not the [floor]:
          say "You should stick to scrubbing floors.";
          stop the action.

[----- if you have just one floor or a kind of things named "floor":]

Carry out scrubbing:
     say "You scrub at the floor";
     [another action here, like turning the floor to "clean" etc.].

[----- else if there are several "floors" and several different outcomes:]

Instead of scrubbing the main room floor:
     say "You scrub at the main room floor ruining its surface";
     now the main room floor is ruined;
     etc.


I'm not able to test the code atm, but it should give a general sense anyway.


Top
 Profile Send private message  
 
PostPosted: Mon Apr 16, 2012 3:58 am 
Offline
User avatar

Joined: Sun Nov 22, 2009 12:58 pm
Posts: 402
Location: Malmö, Sweden
That's true enough. I decided not to do that purely to sidestep the whole issue of adding a floor object (either backdrop or kind), since I wanted a tidy example.

Code:
Check scrubbing:
     if the noun is not the [floor]:
          say "You should stick to scrubbing floors.";
          stop the action;
     else:
          say "It's spring cleaning time!".


As an aside -- and this may be a personal preference -- I'd be wary of using check rules in this way. Unless you have something quite particular in mind, description of a successful action is generally handled by the Report rules.

Code:
Check scrubbing when the noun is not a floor: say "You should stick to scrubbing floors." instead.
Report scrubbing: say "It's spring cleaning time!"

_________________
~Björn Paulsen


Top
 Profile Send private message  
 
PostPosted: Mon Apr 16, 2012 4:11 am 
Offline
User avatar

Joined: Tue Nov 17, 2009 5:25 pm
Posts: 633
Yeah, of course. I was just typing fast while thinking to the generic issue. A report rule is better for a hundred reasons.


Top
 Profile Send private message  
 
PostPosted: Mon Apr 16, 2012 8:43 am 
Offline
User avatar

Joined: Thu Nov 04, 2010 6:30 am
Posts: 999
Location: Gothenburg, Sweden
Also, in this particular case, the Standard Rules already understands "scrub [something]" as rubbing. So, if you implement the floor as a thing, you might as well use the existing rubbing action.
Code:
The Bar is a room.
A floor is a backdrop. It is everywhere.
The Street is north of the Bar.
Instead of rubbing the floor in the Bar: say "Foo."
Test me with "scrub floor / n / scrub floor".

_________________
Man ska inte tro allt man tänker.


Top
 Profile Send private message  
 
PostPosted: Mon Apr 16, 2012 9:11 am 
Offline
User avatar

Joined: Sat May 08, 2010 9:25 pm
Posts: 1005
Location: The Seattle Massive
WovenTales wrote:
Also, I have the same problem when creating games. Of course, I also don't like saying that the player can't pick something up. Carrying capacity becomes important quickly.

Really, the carrying capacity of the player should be important seldom or never. Inventory-management puzzles are annoying and add little to a game, and a petty realism is the hobgoblin of little minds.

What is important is that when you allow a player to pick something up, you're signalling that it's likely to be useful later on. It's basically unfair to the player if you let them collect forty objects, only two of which are useful for anything.

Similarly, if you implement a big scenery object with dozens of individual details, that's likely to attract the player's attention; if the author put all this work into the table, something on it must be important, right? (How important this is will vary depending on the kind of game: if you want your game to be slow-paced, exploratory and more focused on scenery than puzzles, you can get away with a much higher level of detail.)


Top
 Profile Send private message  
 
PostPosted: Mon Apr 16, 2012 1:36 pm 
Offline

Joined: Wed Oct 13, 2010 1:42 am
Posts: 343
I think it would be OK to let the player pick up things like the plate; if it's there anyway, then you might as well allow the obvious sorts of interaction. For instance, I'd expect to be able to open and close a cabinet or turn on and off a radio, and I'd much rather perform a useless action successfully than get an arbitrary-feeling denial like "You know there's nothing interesting in the cabinet" or "You don't feel like listening to music right now."

(I might be alone in this, but I don't actually like the IF convention of not implementing something unless it's important. I like the atmosphere of a detailed, well-implemented scene and don't like the nitpicky "examine everything because there will be something important on the windowsill" mechanic of games where every single implemented thing is game-essential.)


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher and 1 guest


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