a bunch of Use Cases

advertisement
Permissions:
-
-
For interaction type – subject, verb
o There is one permission:
 Can subject verb?
For interaction type – subject, verb object
o There are two permissions:
 Can subject verb given object?
 Can object be verbed given subject?
Situation 7: You belong to a faction A that dislikes faction B. There is a faction member that is spying on
faction B for faction A. You see that faction member as being part of faction B. How do you know they
are part of faction A and hence, you shouldn’t attack them?
Situation 3: You’re diving underwater to grab something from the lake floor. You’ve been diving for a
long time and your lungs start to panic and you start losing health. How does the permissions system
model this? What’s the duration that you can go underwater for?
-
If we had an interaction “player breathe”
o The player breathe permission would check to see if you could breathe and would
perform whatever state changes if necessary. The breathe interaction doesn’t have
anything to do with whether or not the player loses health. That’s up to whatever calls
breathe.
Situation 1: You can normally swing your sword to fight baddies. You’re fighting a wizard however, and
they cast a “weaken” spell on you. How does their spell affect you using the permissions system, and
how does your ability to now attack them back with a sword system get affected?
-
Like everything else, there’s a threshold to initiate the attack, checked with a permission, then
there’s the interaction itself that determine’s the effectiveness of the attack.
Situation 2: You’re building a house. How quickly does the house get built? How does the permissions
system affect this?
-
You can normally build things.
Things can normally be built by you.
The interaction is “Build Something”
o Check the permission “can subject verb given the object”
o Check the permission “can the object be verbed given subject”
o
The speed of the house being built is dependent on the subject’s strength. Perhaps
there’s a threshold required before you can start to build something, and then the rate
at which something is built is based on the strength.
Situation 4: You want to look at a faction list that normally can’t be observed unless using the proper
decoder glasses. How can this be modeled?
-
You can normally see things
o In this case, you can see it is valid
o However, can it be seen by you is not valid given you’re not wearing glasses.
 Given the item archetype that it inherits, it can normally be seen by people
 There is a permission that’s overriding it to make it a special case.
Situation 5: It’s foggy, how is this taken into account by permissions, what are the consequences?
-
You can’t see as well when it’s foggy.
Normally you can see, now it’s foggy so your sight is limited.
o What does seeing entail?
o Interaction: look
 Returns what you can see
 If you’re blinded, the interaction will stop right here
o Otherwise, look will run and will call the interaction:
o LookAt:
 Can you look, and can what you’re looking at be looked at?
 The fog affects the permission for the interaction “can you look at something
given something?”
 The fog decreases your ability to see far, therefore it should change
your ability to see something at a farther distance

Look Interaction
-
type – subject, verb
uses LookAt Interaction
-
o type – subject, verb, object
pseudo-code:
Look():
Get the items in the rooms
visibleItems = new list
For item in itemsList:
results = item.interact( LookAt, item )
if results.success:
visibleItems.add( item )
format the list of visible items
return visible items
Situation 6: You see a panther in the woods. It’s clear the panther hasn’t spotted you yet, so you decide
to hide by using the hide command. The panther comes nearer, although it still doesn’t detect you.
Using the permissions system, how does the panther detect you?
Moral of the story:
There are a couple of different types of interactions. There are interactions that either work or
they don’t, and permissions need to use a Boolean permission to determine if they work. The other
kinds of interactions may work less efficiently but at least they’ll still work. Whether the panther notices
you is boolean. How quickly you build a building doesn’t necessarily determine whether or not the
building gets built.
Download