Newsgroups: rec.arts.int-fiction
From: Andrew Plotkin <erkyr...@eblong.com>
Date: Tue, 12 Sep 2006 19:11:07 +0000 (UTC)
Local: Tues, Sep 12 2006 3:11 pm
Subject: Properties and more in I7 (part 1)
I was originally going to title this post "I7 Purged of Every Flaw". But
someone might not realize I was kidding. What I'm actually going to do is sketch out a scheme for unifies a lot of I7's disparate mechanisms: properties, adjectives, kinds. It is a uniform scheme which relieves some of the limitations of these mechanisms, while still being firmly based on the (hopefully) familiar rule model. This is a sweeping enough change that it probably isn't the same language (I will also refer to "Z-machine" mechanisms, but it could be Glulx or What I am *not* addressing in this post: natural language; relations. (Well, --------- ** Attacking the problem: the description property Way back in May, I opined that the use of description properties in I7 is a Rule for describing a thing: say "You see nothing special." (One could set up this kind of description in I7 today. It would be an When I first thought of this, my impulse was to throw away description But: if two mechanisms seem to serve the same purpose, maybe one is a Take the whole notion of an object property: The description of the sword is "It's an ancient Elvish sword." ...and assume that this *is* a rule -- simply another phrasing of Rule for describing the sword: say "It's an ancient Elvish sword." (Perhaps the "describing activity" was defined with noun form "description", (Footnote: I am skipping over the distinction between a piece of text and Note that this neatly includes the capability of "The description of a KIND What else can we (currently) do with description properties? We can change Change the description of the lamp to "It's a burned-out lamp." I don't like to write code that way, as it happens. (I'd prefer a variable Well, the naive answer is to assume there's an implicit rule: Rule for describing a thing (called T) when T has-been-changed-to X: The "has-been-changed-to" condition is an internal construct -- the language Note that this implicit rule doesn't have to affect game efficiency. In *my* (The compiler may well be able to do smarter optimizations. If the only Also note, by the way, these implicit rules aren't the only way to manage a (This scheme lets you arbitrarily redefine the "getter" of a property. ** Extend the problem: properties containing values Okay, this "properties are just rules" idea seems to be working out. What The lamp has a number called the charge. The charge of the lamp is 10. This is where I snuck around the point I mentioned earlier, the difference But we can still do that, because rules can return values. (It's awkward, What's a property? An activity for setting a value, and an activity for Rule for getting the weight of a brick: decide on 5. And changing the weight is just like changing the description. *If* the game (The question of whether an object provides a property can be handled with This is not a deep idea, but look at the nice stuff it gets us: Computed properties. You can say "Rule for getting the weight of a solid Properties of non-objects. What if I said: Rule for getting the double of a number (N): decide on 2 times N. Now, how is that any different from a computed property? N is a number as Change the double of 5 to 11. That's not *syntactically* illegal -- it's just hard to optimize! The Oh, yes, and global variables just become properties with no arguments at I've skipped over either/or properties, but they can be handled the same way Definition: A room is occupied if a person is in it. This could as well be: Rule for deciding whether a room (R) is occupied: (In fact I7 already has a definition syntax which employs rules, just like At this point you're probably standing on a chair and screaming, what the Because this is a rule-based system. One rule for deciding X computes a (Okay, not as solved as I'd like. But since I *do* want a better way for a In fact, we can make a broad generalization: run-time changes take What? You in the back? You're going to ask me when it stops, right? ... You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
| |||||||||||||
Newsgroups: rec.arts.int-fiction
From: Andrew Plotkin <erkyr...@eblong.com>
Date: Tue, 12 Sep 2006 19:12:20 +0000 (UTC)
Local: Tues, Sep 12 2006 3:12 pm
Subject: Properties and more in I7 (part 2)
** Going for broke: kinds What else have we got? Oh, yes, kinds. As we noted on the newsgroup a few days ago, kinds in I7 have limitations. The standard rules use kinds to describe groups of objects. There are rules Say we kapoof the notion of "kinds" from the language, and instead use A thing can be a door. Well, that's straightforward. It gives us the implicit rule: Rule for deciding whether a thing is a door: decide no. [Things are Create a door: The garden gate is a door. Implicit rule: Rule for deciding whether the garden gate is a door: decide yes. The rule engine easily sees that this is an exception to the general rule, Oh, sure, the compiler is going to have to optimize this. So? It had to ** Going for broker: why kinds are hard Now, kinds are different from either/or properties in two ways: they are Immutability can go honk itself. If you want to change the player into a Inheritance? It's certainly desirable to be able to say: A thing can be a person. A person can be a man. A person can be a woman. ...and have the compiler realize that Steve must also be a person. This is not merely a way to shorten your object declarations. The compiler Rule for describing a person: say "It is humanoid." ...it must deduce that the second rule is logically stricter than the first, From the top, now. The implicit rules here are: Rule for deciding whether a thing is a person: decide no. The third rule is the juicy one; it's implied by the declaration that a Here's the catch. The compiler is going to have to be able to evaluate these So when the Steve object comes along, the compiler thinks: is Steve a man? I In this way, the compiler works out the membership of every *simple Notice what I've done. A simple I7 declaration ("a man is a kind of person") I've broken this down into independent stages. The declaration sets up Heck of a lot of extra work. The payoff: at every stage, we get For example, the author could type those four implicit rules I quoted And we get "multiple inheritance" for free. It's not even complicated crazy Sure, if you have a rule for describing a man and a rule for describing a The other way to make your life harder is to have more complicated rules: Rule for deciding whether Steve is a man: This is a perfectly valid rule. But the compiler can't possibly work out (at Now, if you explicitly declared Steve to be a man but *not* a person, the (By the way, the question of whether an object provides a value property is --Z -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
| |||||||||||||
Newsgroups: rec.arts.int-fiction
From: Andrew Plotkin <erkyr...@eblong.com>
Date: Tue, 12 Sep 2006 19:13:05 +0000 (UTC)
Local: Tues, Sep 12 2006 3:13 pm
Subject: Properties and more in I7 (part 3)
** Tricky bit: circularity This plan has some disadvantages. Or rather, it loses some advantages of the I've thrown all that away. There are only rules. Some of the rules depend on Rule for deciding whether a thing is a man: decide no. Nothing stops you from writing circular dependencies: Rule for deciding whether a person is a man: decide yes. When the game tries to evaluate "if Steve is a man..." it's going to go I think the compiler is going to have to do dependency checking. (Perhaps ** Tricky bit: improper subsets Another potential pitfall: say Steve is the only person in the game. (Ignore So how can the poor compiler work out our old rule conflict? Rule for describing a person: say "It is humanoid." It can't decide which condition is logically stricter than the others. (Note that I am precisely describing the case where the compiler is This situation -- identical property sets, with conflicting rules based on I'm not sure what to make of this problem. In the case of library ** Tricky bit: iterators I've talked about how boolean properties can take the place of descriptions, (I'm mutilating Graham's discussion of sentences in the "Formal Syntax of The upshot, anyway, is that we don't just test a specific object for The naive implementation of iteration is: iterate over the world, testing (As usual, it's worthwhile for the compiler to pay attention to which ** One more tricky bit: ill-defined changes The compiler needs to do a lot of reasoning for this system to work. This A particular sore point is changes. If you write, at some point, Change the lamp to lit. ...then the compiler will know that the lamp may or not be lit during the To illuminate a thing (T): [...and then, at some point...] ...then the compiler has to assume that "lit" is a completely mutable (Yes, *in theory*, the compiler could trace the statement "Illuminate the The worst case would be if you said: To mutate a thing (T) to a property (P): At this point the compiler decides that *every property* is mutable, and the ** Not going there today: Relations Having levelled most of I7's towering skyscrapers with my death-ray, I Maybe next week. Really, this system already overlaps the role of relations. A property which However, I7 relations go to places that my properties haven't touched: ** Summary of this scheme: The following I7 mechanisms all become the same thing: properties (value, (Kinds of value are not affected by this plan. Neither are regions and The new "property" mechanism consists, formally, of a get(...) activity and (I am assuming that phrases, actions, and activities have already been A property can be constant (entirely determined at compile-time) or mutable Properties of one thing are particularly handy, because the compiler can use *Boolean* properties of one thing are treated specially. Each such property The compiler must do additional work in this scheme. It must work out Classic I6 attributes (container, supporter, closed, transparent, door, etc) (A minor side benefit of this: the library is no longer maintaining --Z -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.arts.int-fiction
From: "ChicagoDave" <david.cornel...@gmail.com>
Date: 13 Sep 2006 14:04:46 -0700
Local: Wed, Sep 13 2006 5:04 pm
Subject: Re: Properties and more in I7 (part 3)
> Andrew Plotkin wrote: So when will the beta be out? > ** Summary of this scheme: > The following I7 mechanisms all become the same thing: properties (value, > (Kinds of value are not affected by this plan. Neither are regions and David C. You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.arts.int-fiction
From: "ChicagoDave" <david.cornel...@gmail.com>
Date: 13 Sep 2006 14:17:34 -0700
Local: Wed, Sep 13 2006 5:17 pm
Subject: Re: Properties and more in I7 (part 3)
> Andrew Plotkin wrote: Okay - real response. > ** Summary of this scheme: > The following I7 mechanisms all become the same thing: properties (value, I think a pure rule-based IF system is a fantastic idea. Is it David C. You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.arts.int-fiction
From: Andrew Plotkin <erkyr...@eblong.com>
Date: Wed, 13 Sep 2006 21:46:02 +0000 (UTC)
Local: Wed, Sep 13 2006 5:46 pm
Subject: Re: Properties and more in I7 (part 3)
There are still enough pieces missing (e.g, the rule precedence stuff
that I've been talking about forever) that I don't see a way to start messing with it. --Z -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.arts.int-fiction
From: "rpresser" <rpres...@gmail.com>
Date: 13 Sep 2006 14:28:23 -0700
Local: Wed, Sep 13 2006 5:28 pm
Subject: Re: Properties and more in I7 (part 3)
Andrew Plotkin wrote: Not exactly. "Steve is a person. Steve is a man." implies a > For example, the author could type those four implicit rules I quoted > earlier -- have them as *explicit* rules in his game. They would have > exactly the same effect as "A person can be a man. Steve is a man." > Or, the author could skip around the implication, and simply say > "Steve is a person. Steve is a man." Again, same effect. The subset > relation is no longer declared anywhere in the source code, but it's > still *true*, so the compiler can still correctly assess the > precedence of "man" vs "person". multiple-inheritance relation, not a subset relation, just like "Steve is a man. Steve is a door." To get the subset relation you HAVE to have a "A person can be a man" or "All men are persons" or something equivalent; some way to know that there's a connection between men and persons. Otherwise it's all multiple inheritance relations. Am I wrong? You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.arts.int-fiction
From: "rpresser" <rpres...@gmail.com>
Date: 13 Sep 2006 14:30:52 -0700
Local: Wed, Sep 13 2006 5:30 pm
Subject: Re: Properties and more in I7 (part 3)
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.arts.int-fiction
From: Andrew Plotkin <erkyr...@eblong.com>
Date: Wed, 13 Sep 2006 21:44:51 +0000 (UTC)
Local: Wed, Sep 13 2006 5:44 pm
Subject: Re: Properties and more in I7 (part 3)
You missed a step. You get the subset relation by looking at the
complete set of objects in the game: Steve: person, man, flammable And then "man" is *observably* a subset of "person". No attempt is made (This is why I put in the caveat about improper subsets. In the above > Here's a different way to go nuts: Roger Carbol commented "Rule for determining whether something exists: > Rule for determining if a thing is Steve: decide yes. if its name is Steve, decide yes". These are both terrific ideas (at somewhat different angles), which I'm not sure have practical value. I frequently want to customize the definition of "door", "open/closed", etc. I do not find myself wanting to twiddle the existence of objects in a game, or what I (as a programmer) call them. But perhaps this is an approach to dynamically creating game objects, in a game platform which supports that? --Z --
| ||||||||||||||