External Variables With Inform

G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

Anyone ever find a way to load external variables with inform? My
ultimate goal here is to have my inform game keep time with actual
clock time. I have found some routines that keep variables changing in
real time (not moves based) but I still need a way to set up the
initial time of day.

Thanks,

Chad Elliott
cewebdev@aol.com

p.s. Don't rtfm or flame me too bad, I really searched the heck out of
the internet and the inform designers guide before making this post.
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

cewebdev@aol.com wrote:

> Anyone ever find a way to load external variables with inform? My
> ultimate goal here is to have my inform game keep time with actual
> clock time. I have found some routines that keep variables changing in
> real time (not moves based) but I still need a way to set up the
> initial time of day.

There is a way to load an arbitrary data file in inform. I think it
might be with @load or something similar, but I've never actually done
it so I don't know the specific command structure.

Getting the initial time would be more difficult--there's no direct
support for it within Z-Code/Glulx, but if you're willing to use a
system dependent script to load it you might be able to get something to
work.

But as a player, I can't imagine why I'd care to have game time match
real time anyway.

Michael
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

I'm hosting a competition for students to solve a work of interactive
fiction. To level the playing field a bit, I'de like to set hours for
which students can play the game.

The game is running on a web servuer using Zplet, and I have written
some php scripts to protect the source file by checking the user agent
/ etc to make sure that only java can request the file, not a student
typing the URL.

There are always ways arround these safeguards, but I want every
student (even those who work after school) to have a fair shot.

Chad Elliott
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

Chad Elliott wrote:
> I'm hosting a competition for students to solve a work of interactive
> fiction. To level the playing field a bit, I'de like to set hours for
> which students can play the game.
>
> The game is running on a web servuer using Zplet, and I have written
> some php scripts to protect the source file by checking the user agent
> / etc to make sure that only java can request the file, not a student
> typing the URL.
>
> There are always ways arround these safeguards, but I want every
> student (even those who work after school) to have a fair shot.
>
> Chad Elliott

Ah. I'm not sure how/if Zplet implements file access, but if it does it
the standard way you might be able to set it to query a file
periodically updated by the server with local time.

Alternatively, why not just block access to Zplet too outside of the
okay hours (unless you're talking relative hours instead of absolute
hours, in which case you wouldn't need to know the actual time in any case).

Michael
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

yeah, i'd pretty much figured I was going to have to do it that way,
but didn't want to learn java :)

I'm sure it can't be too difficult, but I will have to delve into the
interpreter to make it only allow the "SAVE" and "QUIT" commands after
the specified time period.
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

Chad Elliott wrote:

> yeah, i'd pretty much figured I was going to have to do it that way,
> but didn't want to learn java :)
>
> I'm sure it can't be too difficult, but I will have to delve into the
> interpreter to make it only allow the "SAVE" and "QUIT" commands after
> the specified time period.

SAVE shouldn't be too hard--just add a check to return a fail code
(similar to what's done in the part for a file I/O error) if the time is
bad, I'd guess.

QUIT would probably be more difficult (or impossible) because the @quit
opcode is assumed to always be successful. As an aside, being told "You
can't quit yet." would be annoying; I'd just close the browser/applet if
it tried that. ;-)

Michael
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

Here, cewebdev@aol.com wrote:
> Anyone ever find a way to load external variables with inform? My
> ultimate goal here is to have my inform game keep time with actual
> clock time.

There is no way to get the clock time in Inform.

I've thought about adding it, in Glulx, but nobody has ever cared.

--Z

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*
I'm still thinking about what to put in this space.
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

Michael Roy wrote:
> Chad Elliott wrote:

> > I will have to delve into the
> > interpreter to make it only allow the "SAVE" and "QUIT" commands
after
> > the specified time period.
>
> SAVE shouldn't be too hard--just add a check to return a fail code
> (similar to what's done in the part for a file I/O error) if the time
is
> bad, I'd guess.
>
> QUIT would probably be more difficult (or impossible) because the
@quit
> opcode is assumed to always be successful. As an aside, being told
"You
> can't quit yet." would be annoying; I'd just close the browser/applet
if
> it tried that. ;-)

Ah! Chad's sentence was ambiguous. I think he meant "After the time
period, only SAVE and QUIT should be allowed", not "SAVE and QUIT
should only be allowed after the time period".
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

Here, Chad Elliott <cewebdev@aol.com> wrote:
> I'm hosting a competition for students to solve a work of interactive
> fiction. To level the playing field a bit, I'de like to set hours for
> which students can play the game.
>
> The game is running on a web servuer using Zplet, and I have written
> some php scripts to protect the source file by checking the user agent
> / etc to make sure that only java can request the file, not a student
> typing the URL.

For this, you'd definitely want to perform the clock check in the web
server or the interpreter, not in the Z-code file. If a student got
hold of the Z-code, he could just change the system date on his
computer anyhow.

--Z

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*
I'm still thinking about what to put in this space.
 

samwyse

Distinguished
Feb 9, 2002
166
0
18,680
Archived from groups: rec.games.int-fiction (More info?)

On or about 3/7/2005 8:30 PM, Chad Elliott did proclaim:

> I'm hosting a competition for students to solve a work of interactive
> fiction. To level the playing field a bit, I'de like to set hours for
> which students can play the game.
>
> The game is running on a web servuer using Zplet, and I have written
> some php scripts to protect the source file by checking the user agent
> / etc to make sure that only java can request the file, not a student
> typing the URL.
>
> There are always ways arround these safeguards, but I want every
> student (even those who work after school) to have a fair shot.

IIRC, Java has some encryption/decryption functions, so write a program
that encrypts the storyfile (should take less than a screen's worth of
code), then hack Zplet to (a) descrypt the file (ditto), and (b) only
work at certain times. I'd guestimate this at one to three hours of
work for someone who knows Java.

Keep your php scripts since, as Zarf points out, someone could reset
their PCs clock, but having checks at both the server and client side
should keep people honest.
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

"Chad Elliott" <cewebdev@aol.com> writes:

> I'm sure it can't be too difficult, but I will have to delve into the
> interpreter to make it only allow the "SAVE" and "QUIT" commands after
> the specified time period.

What possible good could it do to disallow QUIT? The player can just
stop playing even if the game is still running.

--
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

everyone is misunderstanding, I want to dissallow all other commands
aside from save and quit after the time is up. so you can't play any
further, but can still save your progress.
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

Tommy Herbert wrote:
> Michael Roy wrote:
>
>>Chad Elliott wrote:
>
>
>>>I will have to delve into the
>>>interpreter to make it only allow the "SAVE" and "QUIT" commands
>
> after
>
>>>the specified time period.

> Ah! Chad's sentence was ambiguous. I think he meant "After the time
> period, only SAVE and QUIT should be allowed", not "SAVE and QUIT
> should only be allowed after the time period".

Next thing I know I'm going to be failing a Turing test. :)

Michael
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

cewebdev@aol.com wrote:
> Anyone ever find a way to load external variables with inform? My
> ultimate goal here is to have my inform game keep time with actual
> clock time. I have found some routines that keep variables changing in
> real time (not moves based) but I still need a way to set up the
> initial time of day.

There are two variants of Sokoban written in Inform. At least one keeps a
high-score list in the form of an .aux file. That might be useful.

--
David Griffith
dgriffi@cs.csbuak.edu <-- Switch the 'b' and 'u'
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

Here was the final solution (or so I think)

1. I Use a php page as a proxy between the Z5 story file and the ZPLET
java applet. This PHP page uses some http header checking to try to
prevent the Z5 file from being downloaded directly, as well only
serving it between the specified competition hours.

2. I modified the ZPLET application to give several warnings over a
period of 15 minutes or so when it is time to save your game and quit.
after several warnings (In Bold Yellow Text) The interpreter says
"Good Bye" and stops functioning.

3.The interpreter monitors the system clock changes for time revarsal
and sets off the "please save and exit" process

hopefully the game can still remain fun after all of this. I really
hate to do it, but there has to be a way to give everyone a fair shake.
I'm hoping to be able to leave the weekends freeform and let everyone
play as much as they'de like.

Chad Elliott
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

Chad Elliott <cewebdev@aol.com> wrote:
> everyone is misunderstanding, I want to dissallow all other commands
> aside from save and quit after the time is up. so you can't play any
> further, but can still save your progress.

Ah. To expand on my suggestion to look at Sokoban: Have your game check
for some value (current time, if true then no more play, etc) in an .aux
file every turn. The php script should then keep track of time and alter
that .aux file appropriately.


--
David Griffith
dgriffi@cs.csbuak.edu <-- Switch the 'b' and 'u'
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

Andrew Plotkin wrote:
> Here, cewebdev@aol.com wrote:
> > Anyone ever find a way to load external variables with inform? My
> > ultimate goal here is to have my inform game keep time with actual
> > clock time.
>
> There is no way to get the clock time in Inform.
>
> I've thought about adding it, in Glulx, but nobody has ever cared.

I care! I haven't yet ported ZDungeon to Glulx (it has a _few_
Z-machine specific issues that will have to be addressed), but
if Glulx supported a way to get clock time, I would *love* to
use it... the original 36-bit Zork gave you an actual time spent
playing the game instead of a snappy, static comment when you
typed "TIME". It would be great to reproduce that.

The other thing that Inform can't get for you is the username
of the process that fired up the game. That's used by the 36-bit
version of Zork to hash ones 'incantation'. I'd love for a call
to get that from Glulx, too.

-ethan
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

On 13 Mar 2005 21:43:45 -0800, "ethan.dicks@gmail.com"
<ethan.dicks@gmail.com> wrote:

>Andrew Plotkin wrote:
>> Here, cewebdev@aol.com wrote:
>> > Anyone ever find a way to load external variables with inform? My
>> > ultimate goal here is to have my inform game keep time with actual
>> > clock time.
>>
>> There is no way to get the clock time in Inform.
>>
>> I've thought about adding it, in Glulx, but nobody has ever cared.
>
>I care! I haven't yet ported ZDungeon to Glulx (it has a _few_
>Z-machine specific issues that will have to be addressed), but
>if Glulx supported a way to get clock time, I would *love* to
>use it... the original 36-bit Zork gave you an actual time spent
>playing the game instead of a snappy, static comment when you
>typed "TIME". It would be great to reproduce that.
>
>The other thing that Inform can't get for you is the username
>of the process that fired up the game. That's used by the 36-bit
>version of Zork to hash ones 'incantation'. I'd love for a call
>to get that from Glulx, too.
>
>-ethan

I may be misremembering some source I once saw, but didn't one version only
let you play for a limited number of moves if you started during the day
(possibly unless a bunch of front-panel switches were in a specific
position)?


Regards,
Graham Holden (g-holden AT dircon DOT co DOT uk)
--
There are 10 types of people in the world;
those that understand binary and those that don't.
 

samwyse

Distinguished
Feb 9, 2002
166
0
18,680
Archived from groups: rec.games.int-fiction (More info?)

On or about 3/13/2005 11:43 PM, ethan.dicks@gmail.com did proclaim:
> Andrew Plotkin wrote:
>>Here, cewebdev@aol.com wrote:
>>
>>>Anyone ever find a way to load external variables with inform? My
>>>ultimate goal here is to have my inform game keep time with actual
>>>clock time.
>>
>>There is no way to get the clock time in Inform.
>>
>>I've thought about adding it, in Glulx, but nobody has ever cared.
>
> I care! I haven't yet ported ZDungeon to Glulx (it has a _few_
> Z-machine specific issues that will have to be addressed), but
> if Glulx supported a way to get clock time, I would *love* to
> use it... the original 36-bit Zork gave you an actual time spent
> playing the game instead of a snappy, static comment when you
> typed "TIME". It would be great to reproduce that.

Sorry for not speaking up sooner, but a year ago I polled people for the
opcodes that they would most like to see added to the Z-machine.
Someone (Oh, I guess that's *you*) wanted a 'time' opcode:

http://groups-beta.google.com/group/rec.arts.int-fiction/messages/a6dcb8f6fde9153c

A search of Google Groups indicates that other people ask about
wall-clock time once every year or two. I think that if such an opcode
got added to the Z-machine 1.2 specs, it should take an argument to
define a 'format' and return a signed integer representing either (a)
the local time of day in minutes (-1 if the interpreter can't provide
the info), or (b) the number of seconds of wall-clock time since the
interpreter started (clamped at 0x7FFF if it's been over nine hours, six
minutes).

> The other thing that Inform can't get for you is the username
> of the process that fired up the game. That's used by the 36-bit
> version of Zork to hash ones 'incantation'. I'd love for a call
> to get that from Glulx, too.

Actually, maybe a single opcode for 'interpreter environment' would be
best, returning various pieces of process-related data for various
values of an argument.
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

Here, ethan.dicks@gmail.com <ethan.dicks@gmail.com> wrote:
> Andrew Plotkin wrote:
> > Here, cewebdev@aol.com wrote:
> > > Anyone ever find a way to load external variables with inform? My
> > > ultimate goal here is to have my inform game keep time with actual
> > > clock time.
> >
> > There is no way to get the clock time in Inform.
> >
> > I've thought about adding it, in Glulx, but nobody has ever cared.
>
> I care!

I should have remembered about you. :) Actually, I did think about the
real-time aspect of Dungeon, since we've talked about it some in
email.

So, "few people have cared". On the other hand, it's an easy addition
to the spec. So it's probably high up the list of things to do, except
that all of Glk development is pretty much hung on Mac and Windows
developers. If I can't get Unicode out the door, it's not worth trying
for lesser features.

> The other thing that Inform can't get for you is the username
> of the process that fired up the game. That's used by the 36-bit
> version of Zork to hash ones 'incantation'. I'd love for a call
> to get that from Glulx, too.

Yeah, that's a little... overspecific for my taste. :)

--Z

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
*
I'm still thinking about what to put in this space.
 
G

Guest

Guest
Archived from groups: rec.games.int-fiction (More info?)

samwyse <dejanews@email.com> wrote:

> On or about 3/13/2005 11:43 PM, ethan.dicks@gmail.com did proclaim:
> > I care! I haven't yet ported ZDungeon to Glulx (it has a _few_
> > Z-machine specific issues that will have to be addressed), but
> > if Glulx supported a way to get clock time, I would *love* to
> > use it... the original 36-bit Zork gave you an actual time spent
> > playing the game instead of a snappy, static comment when you
> > typed "TIME". It would be great to reproduce that.
>
> Sorry for not speaking up sooner, but a year ago I polled people for the
> opcodes that they would most like to see added to the Z-machine.
> Someone (Oh, I guess that's *you*) wanted a 'time' opcode:
>
> http://groups-beta.google.com/group/rec.arts.int-fiction/messages/a6dcb8f6fde9153c

I'd like one, too, though for an entirely different reason. Basically,
I'd like to be able to use wall time to seed a different RNG from the
'terp one. IIRC this wasn't on my wish list back then, but it is now
(though hardly something I lose sleep over).

Richard