Message-ID: <3B792620.B9927972@csi.com>
Date: Tue, 14 Aug 2001 09:22:40 -0400
From: John Colagioia <JColagioia@csi.com>
Organization: No Conspiracy Here...
X-Mailer: Mozilla 4.77 [en] (Win98; U)
X-Accept-Language: en,fr,ru,es,it,ga,de,ja,gd,eu
MIME-Version: 1.0
Newsgroups: rec.arts.int-fiction
Subject: Re: [Inform] Any reason not to replace "player" with "actor"?
References: <dhyd7.113209$%7.893211@news6.giganews.com> <792c6202.0108121300.9bafcc6@posting.google.com> <3b772aae_1@excalibur.gbmtech.net> <3b786673.4819284@news.bright.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 208.34.37.104
X-Original-NNTP-Posting-Host: 208.34.37.104
X-Trace: excalibur.gbmtech.net 997794876 208.34.37.104 (14 Aug 2001 09:14:36 EST)
Lines: 95
X-Authenticated-User: jnc
X-Original-NNTP-Posting-Host: 127.0.0.1
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.online.be!zur.uu.net!ash.uu.net!excalibur.gbmtech.net
Xref: news.duke.edu rec.arts.int-fiction:91101

Jonadab the Unsightly One wrote:

> "John Colagioia" <JColagioia@csi.com> wrote:
> > I've been playing around with a similar idea, actually.  The biggest
> > stumbling block (which I mentioned recently in an unrelated thread) is that
> > verb routines never "fail."  That is, if you have your NPC execute a "Go
> > North" action, and there's no exit to the north, the action fails, but
> > there's no way to let the NPC know this, except through the excessive coding
> > (to check "error conditions") which need to be written for each
> > verb--precisely the situation you don't want to be in.
> My syntax may be a tad off here, since I'm rusty, but...
> [ NPCAction npc verbsub do io;
>   int saveactor=actor; actor=npc;
>   if (verbsub(do io))
>   {
>      ! Insert error-message code here, to the effect that
>      ! if actor and player are in the same location, a
>      ! message is printed indicating the actor's failure;
>      ! if (actor==player) it's printed in second person.
>   }
>   actor=saveactor;
> ];
> This is totally totally untested, but in theory something
> like it should work as long as verbsub doesn't have to
> test scope, in which case you probably have to overhaul
> that verbsub.

Oh, no.  That part's fine (although, as an aside, I'm starting to drift towards a
routine to print all messages, which will test actor and location and such).  The
problem is that a well-written NPC should be reacting to his own actions, which
requires that the character know whether or not the action failed.  For example:

] DAVE, TAKE THE BALL THEN PUT IT ON THE TABLE
That's not available.
Dave isn't holding the ball.

If "Dave" is going to be a reasonably realistic NPC, the "sequencing code" needs
to be able to check the error status of each verb as it executes, so that future
actions can be aborted if a "necessary precursor action" has failed.


> Although, you *will* have to test scope when you issue
> the call to NPCAction().  Each time.  It would probably
> help to write a function for testing whether an object
> is in scope to an NPC.  Or you could add the scope
> test to NPCAction.

Actually, ObjectIsUntouchable() handles all that automatically, if you change
"player" to "actor."  It's probably one of the best-designed parts of the library,
in my opinion.


> Oh, and if your grammar has any scope-testing tokens,
> they have to be overhauled.

This is very true.


> > >You might get messages such as "You can't go that way." when NPC Fred
> > >tries to go someplace that's closed off,
> > That just means that English.H needs a parallel overhaul, though.
> Indeed.  And, of course, the game itself has to do everything
> a bit more generally.

Well, yes, but I figured that anyone doing this wouldn't be doing it in the middle
of a game.  You're right, though, that someone may decide mid-stream that "active
NPCs" are needed.


> > I tend to rewrite most of the messages in English.H whenever I
> > start a game, anyway,
> Probably a good thing.

Yeah, even in testing, there are only so many times I can look at the same library
messages.


> > Hmmm...Perhaps that tendancy is related to the fact that, after five years
> > of programming in Inform, I have yet to release anything resembling a
> > game...
> Heh.  I'm with you there.  With me, it was deciding that anything
> an NPC talks about has to include eight or ten different statements,
> whether they give the player necessary information or not, just to
> make the characters seem less like broken records.  That, and
> deciding to implement all kinds of "atmosphere" objects.

Yep.  And, of course, no direction should ever be met with something as prosaic as
"You can't go that way," so every exit will have to be unique...

Is it any wonder that I have about a dozen 20+kB files named some variant of
test.inf, none of which remotely approach what one would call a "game"?

Well, at least I know I'm not the only one doing this.


