intfiction.org

The Interactive Fiction Community Forum
It is currently Sat May 18, 2013 10:21 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Alternatives to NSEW
PostPosted: Wed Jul 18, 2012 10:52 am 
Online

Joined: Mon Dec 07, 2009 5:14 am
Posts: 896
Check out Reed's "keyword" extension. The way it works is, you map it out like a regular game, then in the room description you tag a certain word (like "around the back" in my example) as representing a direction (hilighting it and making it available for single-word use). I disremember the exact details, but the main thing is, you build the world according to regular compass rules, but what the player will see is highlighted exits (they don't have to be hilghlighted, but I think that'd make it pretty user-unfriendly) that are very descriptive.

If you wanted to disallow compass movement, you'd have to go the extra mile. For a project of mine, I did a simple check: if the player typed "n/north/s/south" or "go n/north/s/south" and so on, then I'd cut him off with an error message. Like every piece of code I ever wrote, it's cumbersome and inelegant and probably the long way around, and it works.


Top
 Profile Send private message  
 
 Post subject: Re: Alternatives to NSEW
PostPosted: Wed Jul 18, 2012 11:22 am 
Offline

Joined: Thu May 20, 2010 9:33 pm
Posts: 479
If you want "go to [room name]" to work in Inform, you can do this (adapted from code from Emily Short's Bronze):
Code:
Going by name is an action applying to one thing.

Understand "go to [any room]" as going by name. Understand "go [any room]" as going by name. Understand "[any room]" as going by name. Understand "[door]" as entering.

Check going by name:
   if the noun is the location, say "You're already in [the location]." instead.

Carry out going by name:
   while the player is not in the noun:
      let heading be the best route from the location to the noun, using even locked doors;
      if heading is not a direction, say "You can't think how to get there from here." instead;
      let destination be the room heading from the location;
      say "(heading [heading])[command clarification break]";
      try going heading;
      if the player is not in the destination, rule fails.


Note that this will only work (from a gameplay perspective) if the player already knows all of the names of the rooms, or at least there are distinctive names for the doors. "You're standing in the kitchen; doors lead to the entry hall and dining room. There's also a small wooden door next to the refrigerator" works fine, but "You're in a vast marble hall with unknown corridors in every direction" is going to need NSEW as well.


Top
 Profile Send private message  
 
 Post subject: Re: Alternatives to NSEW
PostPosted: Wed Jul 18, 2012 2:13 pm 
Offline

Joined: Sun Dec 05, 2010 11:07 am
Posts: 321
Location: ኢትዮጵያ
arithine wrote:
any advice on bow to accomplish that in inform? it seems to be heavily dependent on directions


A quick and dirty replacement of directional movement with room-keywords:

Code:
Book 1 - World

Front of House is a room. "You are at the front of the house. You could go [around the back], or deeper into the [forest]." The accessible rooms are {Around the Back, Forest}.

A mailbox is a fixed in place, openable, closed container, here. "You see a mailbox."

After opening the mailbox for the first time, say "You see nothing inside. Someone else has taken that crucial leaflet. Damn."

Around the Back is a room. "You are at the back of the house. Someone's left a window wide open. If you ask me, I think someone's already in there." The accessible rooms are {Front}.

Forest is a room. The accessible rooms are {Front}.

Book 2 - Name-going to

Understand the command "go" as something new. Understand "[a direction]" and "go [a direction]" as a mistake ("You forgot your compass, oh dearie me.")

Every room has a list of rooms called the accessible rooms.

Before printing the name of a room, say bold type.
After printing the name of a room, say roman type.

Definition: a room is accessible rather than inaccessible if it is listed in the accessible rooms of the location.

Name-going to is an action applying to one thing. Understand "[any room]" and "go [any room]" and "go to [any room]" as name-going to.

Check name-going to an inaccessible room:
   issue miscellaneous library message number 27 instead.
   
Check name-going to the location:
   say "You're already there!" instead.

Carry out name-going to:
   move the player to the noun.


Top
 Profile Send private message  
 
 Post subject: Re: Alternatives to NSEW
PostPosted: Mon Jul 23, 2012 4:06 pm 
Offline

Joined: Sun Apr 29, 2012 6:19 pm
Posts: 6
My Cover Stories entry (Home Sweetie-Bot Home) promulgates its own intentionally ridiculous movement commands (AMBULATE and ROTATE), for "feel" reasons.

The game itself understands left/right/forward, clockwise/counterclockwise, north/south/east/west, and a few variations on "go to [room]" and "go to [item]", either by themselves or in combination with AMBULATE or ROTATE, which behave in subtly different ways -- for instance if you're in the living room facing north with the kitchen off to the east and a closed door to the west, ROTATE EAST and AMBULATE EAST do different things but ROTATE WEST and AMBULATE WEST do the same thing. Because, you know, intentional silliness. It isn't written in Inform, but it uses compass directions at the lowest level, with relative directions implemented in terms of those, and a pathfinder on top of that.

However, the game never mentions any compass direction in its output -- I think it only ever suggests AMBULATE, ROTATE (which defaults to clockwise/right), ROTATE LEFT, and ROTATE/AMBULATE TO [room/item].

After the initial release, I showed the game to someone unfamiliar with IF convention, and at some point I was trying to justify why "e" was an abbreviation for EAST instead of ENUMERATE, despite the fact that the game itself mentions the latter but never the former, and I brought up the fact that it's sort of a standard convention in IF that all navigation happens through compass directions. The reaction to that statement was extremely amusing! At least to me. Along the lines of, "zOMG WTF, you can't possibly be serious."


Top
 Profile Send private message  
 
 Post subject: Re: Alternatives to NSEW
PostPosted: Mon Jul 23, 2012 5:06 pm 
Offline

Joined: Wed Feb 29, 2012 2:00 pm
Posts: 672
ChrisC wrote:
arithine wrote:
any advice on bow to accomplish that in inform? it seems to be heavily dependent on directions


A quick and dirty replacement of directional movement with room-keywords:

Spoiler: show
Code:
Book 1 - World

Front of House is a room. "You are at the front of the house. You could go [around the back], or deeper into the [forest]." The accessible rooms are {Around the Back, Forest}.

A mailbox is a fixed in place, openable, closed container, here. "You see a mailbox."

After opening the mailbox for the first time, say "You see nothing inside. Someone else has taken that crucial leaflet. Damn."

Around the Back is a room. "You are at the back of the house. Someone's left a window wide open. If you ask me, I think someone's already in there." The accessible rooms are {Front}.

Forest is a room. The accessible rooms are {Front}.

Book 2 - Name-going to

Understand the command "go" as something new. Understand "[a direction]" and "go [a direction]" as a mistake ("You forgot your compass, oh dearie me.")

Every room has a list of rooms called the accessible rooms.

Before printing the name of a room, say bold type.
After printing the name of a room, say roman type.

Definition: a room is accessible rather than inaccessible if it is listed in the accessible rooms of the location.

Name-going to is an action applying to one thing. Understand "[any room]" and "go [any room]" and "go to [any room]" as name-going to.

Check name-going to an inaccessible room:
   issue miscellaneous library message number 27 instead.
   
Check name-going to the location:
   say "You're already there!" instead.

Carry out name-going to:
   move the player to the noun.


While this does work, it would probably be better to keep directional mapping in the source code but block directional commands so the the player isn't aware of the directions otherwise the index map becomes almost useless and "best route from (object) to (object)" won't work at all.

Code:
Carry out name-going to:
   move the player to the noun.


This gets the spacing wrong for going.

Code:
Understand the command "go" as something new.


This isn't enough to remove the grammar for the going action. For that, you need to do this.

Code:
Understand the commands "go", "walk" and "run" as something new.

Include (- -) instead of "Parser Letter B" in "Parser.i6t".


However, it's a lot simpler to do add a check going rule that blocks directional movement. Try this.

Code:
"Test"

Going by name to is an action applying to one thing. Understand "Go to [any adjacent room]", "Enter [any adjacent room]" and "[any adjacent room]" as going by name to.

Carry out going by name to (this is the standard carry out going by name to rule):
move the player to the noun, without printing a room description.

Report going by name to (this is the standard report going by name to rule):
produce a room description with going spacing conventions.

A first check going rule (this is the reject directional travel rule):
say "You forgot your compass, oh dearie me." instead.

The Front of the House is A Room. The description of the front of the house is "You are at the front of the house. You could go [around the back], or deeper into the [forest].".

A mailbox is fixed in place, openable, closed and a container in the front of the house. The initial appearance of the mailbox is "You see a mailbox.".

After opening the mailbox for the first time, say "You see nothing inside. Someone else has taken that crucial leaflet. Damn.".

The Around the Back is south of The Front of the House. The description of the around the back is "You are at the back of the house. Someone's left a window wide open. If you ask me, I think someone's already in there.".

The Forest is north of The Front of the House. The description of the forest is "Here you have a very foresty forest.".

Test me with "mailbox / open mailbox / s / around the back / n / front of the house / n / forest".


Here the player will have no idea what direction to go in and will have to use the room name. A slight variation on this would be to allow compass movement when the player picks up their compass. Try this.

Code:
"Test"

Going by name to is an action applying to one thing. Understand "Go to [any adjacent room]", "Enter [any adjacent room]" and "[any adjacent room]" as going by name to.

Carry out going by name to (this is the standard carry out going by name to rule):
move the player to the noun, without printing a room description.

Report going by name to (this is the standard report going by name to rule):
produce a room description with going spacing conventions.

A first check going rule (this is the reject directional travel when not carrying the compass rule):
if the player is not holding the compass, say "You forgot your compass, oh dearie me." instead.

The Front of the House is A Room. The description of the front of the house is "You are at the front of the house. You could go [around the back], or deeper into the [forest].".

A mailbox is fixed in place, openable, closed and a container in the front of the house. The initial appearance of the mailbox is "You see a mailbox.".

After opening the mailbox for the first time, say "You see nothing inside. Someone else has taken that crucial leaflet. Damn.".

The Around the Back is south of The Front of the House. The description of the around the back is "You are at the back of the house. Someone's left a window wide open. If you ask me, I think someone's already in there.".

The Forest is north of The Front of the House. The description of the forest is "Here you have a very foresty forest.".

The compass is in the forest. The description of the compass is "Bog standard, very useful.".

Test me with "mailbox / open mailbox / s / around the back / n / front of the house / n / forest / take compass / s / s".


Here the player can only use directional movement when holding the compass.

Hope this helps.

_________________
"Will you stop breaking the fourth wall? It's costing me an absolute fortune to replace it!"


Top
 Profile Send private message  
 
 Post subject: Re: Alternatives to NSEW
PostPosted: Mon Jul 23, 2012 11:22 pm 
Offline

Joined: Tue Jul 17, 2012 2:39 pm
Posts: 33
Thanks for all the great replies! I'm using the keyword extension now as well as taking some of your guys other advice (such as disabling compass movement, I was confused about how to accomlish that), I think it's working out quiet well. I was originally hesitant to use keyword because I just equate the style to Blue Lacuna and I was worried it would come a bit rip off-ish, but with a list type conversation system and a unique story I dont think that'll be much of a problem.


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] 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