An interesting issue raised by "letmeshowyou" on the "What do non programmer
types want in an IF language ?" thread:
<letmes...@gmail.com> wrote in message
news:1116462608....@z14g2000cwz.googlegroups.com...
>
> Here's a common senario I see with first time players.
>
> Library
>
> You in a library, you she shelfves of books here.
>>GO TO SHELVES
>
> They are already here!
>
> Any thoughts? I thing one idea would be to pass "go to" to
> "examine" in this case.. where a person will percieve an
> objected as a "sub location".
I wonder what they are thinking (ie. what is in their mental model of the
game) when they "go to shelves" ...
What do you believe they are wanting to do "at the shelves" that they can't
do where they are in the room already ? If they think you have to go over to
the shelves before being able to read the books, etc. then just treating "go
to shelves" the same way as "examine" sounds good.
General problem - what to do with large, expansive geographies ...
The following are from
http://www.ifwiki.org/index.php/Past_raif_topics%3A_Game_Mechanics#Compass_directions_.2F_navigation
Large geographies / zoned areas (May 2001)
http://groups-beta.google.com/group/rec.arts.int-fiction/browse_frm/thread/9baa7106909d83f8/7628e62f2918e27b
Modelling outdoor areas (Jun 2001)
http://groups-beta.google.com/group/rec.arts.int-fiction/browse_frm/thread/4b5b832d50e5ab10/02f4bc6b372cb2ff
Handling big rooms (Sep 2004)
http://groups-beta.google.com/group/rec.arts.int-fiction/browse_frm/thread/240abf0983441483/7ba893b8eb4e23d3
David Fisher
Seems like I need to restart my "how do I" page abandoned here...
Each room holds a variable of "sub locations"
The biggest issues with entering an object currently is losing the
scope of the rest of the room and/or handling "reachability".
Cool ...
The http://www.ifwiki.org/index.php/Past_raif_topics page doesn't include
much "code for making an X" stuff (mainly interesting discussions), so
there's a need for something like that. I bet there's a lot of great stuff
scattered around people's IF pages ...
David "..." Fisher
I've thought about doing this before, but it would involve a level of
room design that I probably wouldn't want to deal with; would be
difficult to communicate to the player; and wouldn't likely add that
much to the average game. Still, it would make for an interesting
challenge.
>I'm a bit thread-happy today ...
>
>An interesting issue raised by "letmeshowyou" on the "What do non programmer
>types want in an IF language ?" thread:
>
><letmes...@gmail.com> wrote in message
>news:1116462608....@z14g2000cwz.googlegroups.com...
>>
>> Here's a common senario I see with first time players.
>>
>> Library
>>
>> You in a library, you she shelfves of books here.
>>>GO TO SHELVES
>>
>> They are already here!
>>
>> Any thoughts? I thing one idea would be to pass "go to" to
>> "examine" in this case.. where a person will percieve an
>> objected as a "sub location".
>
>I wonder what they are thinking (ie. what is in their mental model of the
>game) when they "go to shelves" ...
>
>What do you believe they are wanting to do "at the shelves" that they can't
>do where they are in the room already ? If they think you have to go over to
>the shelves before being able to read the books, etc. then just treating "go
>to shelves" the same way as "examine" sounds good.
I suspect most players who would type this won't be thinking (at least
explicitly) that there's something they can do "at the shelves" that they
can't do from "here" (wherever "here" is -- see below); it's just a natural
reflection of what they would do in "real life": to examine the shelves
more closely, they would approach them.
The "concept" they're "missing" (i.e. not yet aware of) is that in _most_
IF, "here" is anywhere/everywhere in the whole room, and _not_ stood at one
particular spot.
In that case, _just_ turing GO TO SHELVES into EXAMINE SHELVES would (a)
possibly confuse the player even more, and (b) not educate them in the
"conventions" of IF. Unless you are writing another "Shade", then having
"GO TO xxx" _also_ printing a "Oh by the way, you don't need to move TO an
object to examine it" message might be the way to go.
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.
If you want examples, have a look at _Shade_, which IMO does the
sub-location handling very well, and _Piece of Mind_, which,
again IMO, makes the bedroom at the beginning much more complicated
than necessary with dividing it in several locations.
--
Sophie Frühling
"El arte no viste pantalones."
-- Rubén Darío
Shant we enjoy breaking convention? :-o
The object reacts to the model world in various ways but to change or
add behavoir, one can put a script into the object.
Lets say we write a script to make it change change color when touched.
Write the script and drop it in.
If you wanted to make it jump away you could simply rewrite the script,
but you can also add a second script inside the object.
Thus you'd have..
Object
-Color script
-Jump script
While you could seperate these, having this together allows for more
mixing of behavoirs.
How, in existing languages, or heck in new ones... could this be done?
I have been checking out the way ALAN works, and this sounds like an ALAN
"rule" ... the online manual at http://www.welcome.to/alan-if says:
"A rule is an arbitrary expression, which, when true, results in execution
of the given statements. Rules can be used to make things happen when
certain situations arise, such as starting an actor when the hero enters the
cave.
WHEN hero AT cave AND monster NOT active =>
USE SCRIPT 3 FOR monster."
Does this sound anything like what you are thinking ?
The equivalent in TADS/Inform I guess would be a daemon that checks each
object on every turn to see if a "doRules" member is defined, and if so, run
it ... very inefficent, though. I think in Inform you can have a daemon for
each individual object ?
The tricky part is handling the interactions between lots of rules, since
the order they are run in can make a big difference (eg. if the state after
rule A would cause rule B to run, then they will happen on the same turn if
rule A is checked first; but if rule B is checked first, B will take effect
on the next turn after A).
David Fisher
In the game I mentioned rules are run simultaniously on many threads.
Since Inform/Tads/etc may not only not be multi threaded, but very
dependant on when an action is interfered with, I feel that behaviors
may be dependant of current "before" "after" during" points.
Here we are breaking towards real-time parsing with live active objects
rather than descreet turns.
Usually other more efficent forms are choosen, but it may become so as
you can not have a world model anywhere near that complex without
having some form of "each turn" for every object in the game!
But this is 2005... I'd like to think that the limitations of of
memory and power could be driven forward. I'm glad games like inform
run on so many platforms including palm.. but once we talk of loftier
ideas of interaction, we may find ourself starting from scratch.
As I am not that level of programer, I'm limted to what I can be done
in current systems.
Rather than check every object... or have every object check itself,
could a proper set of "Event" triggers be set into all objects?
and object class coudl be made to contain all events and allow new
ones.
If two separate rules are equally applicable, how does the system choose
which one to run ? Is there a priority system, or is the whole thing "non
deterministic" ?
And ... are there still "turns" in this kind of environment, or can things
happen while it is waiting for your input (which means you could have to be
a fast typist to jump out of the way of something before it hits you, etc) ?
David Fisher
This is worth going over in detail.
Ideally no two events could happen simultatiously and the order of
precidence would come in the order of the events.
Lets say two events "in dark" and.. "grabbed"
in SL (second life) there is a touch_start, touch_end, and touched..
equvilant to before after and during.
So a senario.. though "in dark" is an odd thing in Inform.
Any examples to go forward on?
It is possible to make a more efficient rule base system than just "check
the rule every turn" - the rules could be intelligently related to each
other so that a rule is only checked if a part of its condition has changed,
eg. if the condition is "if X = 3 and Y > 5", it only needs to be checked in
situations where either X or Y changes. Keeping track of "what has changed"
is tricky, though ... if the whole system is *all* rule based, then you can
just say "recheck this rule only after these other rules have been
activated" - but if there are other ways of X and Y being set than another
rule (eg. normal "non rule" code), then things are much harder.
I like the idea of a rule based system, but I know that it is easy to get
into a big mess with anything complex (such as "modelling the universe"
:-) ) ... for example, a situation where rule 1 fires rule 2 which fires
rule 3 which fires rule 1 again, and so on. Concrete example:
when (Fred is happy) => Fred smiles
when (Fred smiles) => Mary is grumpy
when (Mary is grumpy) => Fred is not happy
when (Fred is not happy) => Fred frowns
when (Fred frowns) => Mary is happy
when (Mary is happy) => Fred is happy
.. which implies that when Fred is happy, he is not happy - unless these are
sequential "events", in which case Fred constantly flips between smiling and
frowning.
A possible solution is to disallow circular rules, but this might be too
limiting in practice.
David Fisher
There is still the problem of which rule to initially activate if both are
equally applicable ... and which rule to activate next, if one rule results
in a state when two other rules now apply ...
> Lets say two events "in dark" and.. "grabbed"
>
> in SL (second life) there is a touch_start, touch_end, and touched..
> equvilant to before after and during.
>
> So a senario.. though "in dark" is an odd thing in Inform.
>
> Any examples to go forward on?
Do you have any code written in SL to use as an example ?
(You seem to be in a similar time zone, by the way ... where are you ? I'm
in Sydney, Australia).
David Fisher
I'm not saying conventions shouldn't be broken, but the original thread,
IIRC, was coming from the point of "helping" a newcomer; whether "being
conventional" is a good thing to be or not, the majority of IF _doesn't_
model a player's location within a room, so they'll have a better
experience if they're aware of the conventions.
Noting the "smiley", that was probably too serious an answer, so for
another take: if you want to break convention, you've first of all got to
indoctrinate players in the "one true path" (tm) before unleashing your
"convention-breaker from the dark-side" (tm) on them, otherwise they won't
realise conventions are being broken!
Regards,
Graham Holden (g-holden AT dircon DOT co DOT uk)
More details at: http://en.wikipedia.org/wiki/Halting_problem
BrettW
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
There is a piece of IF called "Haunt" written in OPS5, a "production system"
(rule-based) AI language. I am not sure but believe it is typical for
production systems to detect and use relationships among rules: although it's
conceptually "try rule 1, try rule 2, ..." it can use things like common
subexpressions in separate patterns. Depending on the vocabulary for changing
state, it may be able to precompute which actions might lead to a change in
the applicability of a rule.
My memory for all this stuff is quite vague, and 25 years old. To find more
about such rule-based systems you might need to check out various Artificial
Intelligence communities.
--
"Yo' ideas need to be thinked befo' they are say'd" - Ian Lamb, age 3.5
http://www.cs.queensu.ca/~dalamb/ qucis->cs to reply (it's a long story...)
These rules are simply asking for conflict.. In OOP you usually write
a "variable changer" instead of effecting the variable direction. That
way new functionality can be interrupted at the object level instead of
at each individual instance.
It is there that conflicts could be resolved... at the "variable
changer"
These all need to be resolved into "right sided" equations... IE where
the emotions OR the causes are all on the right side. But even after
you do that you can't have feedback loops and expect any interpreter to
handle them well... else have a "fluxing" between each turn or a single
unending loop.
Note that some compare emotions to causes or states... and in a mixed
bag
>when (Fred is happy) => Fred smiles
>when (Fred smiles) => Mary is grumpy
put another way
when (Fred is this) => Fred does this
when (Fred does this) => Mary is this
Get this "is"s on one side and the "does's" on the other and you
resolve a lot of this.
when (Fred is happy) => Fred smiles
when (Mary is grumpy) => Fred smiles
when (Mary is grumpy) => Fred is not happy
when (Fred is not happy) => Fred frowns
when (Mary is happy) => Fred frowns
when (Mary is happy) => Fred is happy
you can see at this point how much conflict is built right into these
rules!
it's like saying
when X==5 then Y==2...
Change the "is emotion" to a sliding scale and....
when (Fred is happy) => Fred happy + 1 (note object would take care of
"MAX HAPPY")
when (Mary is grumpy) => Fred happy + 1
when (Mary is grumpy) => Fred happy - 1
when (Fred is not happy) => Fred frowns <---- this rule falls below
when (Mary is happy) => (Fred happy -1)
when (Mary is happy) => (Fred happy +1)
Then "levels" of happies could average things out
When (fred.happy 1 or less) => Fred Frowns
When (fred.happy 5 or more) =>Fred Smiles
Even without a scale.. having the actions "raiser or lower" per turn
could be averaged to hit or miss. Mary does two things that make him
happy but one thing that doesn't... average.. makes fred happy.
But that's where programing breaks down.. DON'T EDIT THOSE VARIABLES
DIRECTLY. Don't let any object "make" another object anything. Just
send a message... "doing something that makes you unhappy and the
object can resolve it.
Layers folk... layers. If you think in efficiency.. you will be
efficient.
The real world is very inefficient.
However... we did go from two word parsers to sentences to ray-cast 3D
(wolfenstine), to full *but curvless 3D (Quake), to the modern engine
of Unreal and the like which where once thought impossible.
I always regretted though... never being able to get into the ghost's
"home" in pac man :-(
(p name122
(x 30)
(location ^name kitchen)
(object ^name cube ^place held)
(input eat cube)
-->
(remove 3)
(remove 4)
(write (crlf) |That was sweet.|)
(write (crlf) |This kitchen is real deary. A bad place to take
acid.|)
(write (crlf) |You have to get out of here!!|)
(write (crlf) |You feel on fire, you need water to cool off.|)
Hmmm ... following a few links took me to
http://ai.eecs.umich.edu/people/laird/gamesresearch.html, which has papers
on various AI techniques but doesn't go into rule based systems much. An
intepreter for "Haunt" doesn't seem to be available either. Oh, well ...
Thanks for the reference,
David Fisher
[analysis & techniques for avoiding this kind of problem snipped]
Hmm, bad example ... the main thing is that interactions among rules can get
very messy, and it can be tricky to avoid loops.
I cam across this quote in the RAIF archives (David Rush, 1998):
"A few years ago I began to learn a little bit about knowledge
engineering and expert systems. All my mentors asserted that
programmers were generally insufficiently logical to develop
good expert systems (due to rule-base size and the paralellism
implicit in them). I didn't believe them until I actually got around
to writing some moderately-sized rule-based programs myself.
"Logic *is* aways the hard part. And the bigger the domain,
the harder the logic becomes. Given that the domain of fiction
is "anything imaginable" I would expect that coding the logic
for the behaviors you imagine would ultimately be the biggest
bit of work."
I still love the idea of a rule-based IF system, though ...
David Fisher
I think the player is lucky if "go to shelves" is understood at all.
The error I provide for this is "You're already as close as possible
to that." I don't blame the player for thinking they might be too
distant to interact with something.
If the object is really a location, then I may flip around what you
suggest, and redirect "examine" to "go to."
Kevin Venzke
Technically, realtime 3D is still curveless. They've merely gotten the
polycounts up high enough to provide a reasonable facsimile of curves.
Even the engines that claim to use bezier patches or NURBS only do so at
the editor level; to draw on the screen, they convert the curved patches
to a triangle mesh.
Truely curved surfaces are only possible by raytracing, which computers
are still not fast enough to do in realtime, even at postage-stamp
resolutions.
> I always regretted though... never being able to get into the ghost's
> "home" in pac man :-(
>
I think it's interesting to note that most games today, no matter how
sophisticated the graphics, or physics engines, or control options,
still use the exact same gameplay as Pac-Man: navigate a maze while
collecting power-ups and avoiding baddies. Maybe video games haven't
come as far as we think...
--
Ryukage
>I think it's interesting to note that most games today, no matter how
>sophisticated the graphics, or physics engines, or control options,
>still use the exact same gameplay as Pac-Man: navigate a maze while
>collecting power-ups and avoiding baddies. Maybe video games haven't
>come as far as we think...
Or maybe, among those who frequent r*if at least, we DO realise how far
many video games haven't come, and that's why we still interested in IF!
I recall Laird saying writing and extending Haunt was fairly easy, but he was
an expert. It was "the world's largest production system" at the time. I
know that other large production systems had significant troubles with
maintenance, and Haunt didn't really need much "maintenance" -- just extension
as Laird thought of new things to add.