The design for defining constraints for objects and story elements seems to be paying off in the design.

Today I contemplated the problem of a group set and text display. A “group set” here means a collection of 0 or more elements from a “group”, where a group is a well-defined, limited number of words. For example, the transportation group can contain “car”, “airplane”, “truck”, “skateboard”, “big pig”, and “foot”, while a specific person can have a group set containing only “car”, “foot”, and “skateboard”.

Each one of those items represents verbs and a range of values or chains of events. However, because a person may have multiple of those available, how does the story “choose” which one to use in a situation?

There are several answers to this, each of which depends upon the situation.

Story Constraints

Let’s take the “Chris walks to the store” example. In that data setup, Chris only had value for transportation - “foot”. However, what if Chris also had “boat”? In this case, “boat” simply doesn’t make sense unless the store is a very specific kind of store.

So the story setup provides sets of constraints around what can be used. In this case, it is the location that has those constraints.

Practically speaking, the story would create (and the “would” part here is still being figured out) a new value that is the intersection of the location available values and the person’s available values.

This is also where the concept of group value alternates shines. A module could add a “recumbent bicycle” transportation item, and the story has no idea what that is. However, the story includes “land transportation” as its generic transportation type, and “recumbent bicycle” includes an alternate match for “bicycle”, which includes itself as a match for “land transportation”. Thus, the recumbent bicycle is added to the list of values in the new value.

However, this still leaves us with the problem of multiple values.

Player Choice

Rather than coming up with some system for choosing one of those values, we can let the player choose it, instead. There needs to be a way to declare a player choice and the corresponding value that it uses. This should probably be delayed asking the player for a value until it’s needed.

And this has all kinds of ramifications from an emergent game play perspective. Because the player chose to walk, the risks and advantages of walking can come into play without needing to add in extra story for it.

Random Choice

For things outside the player’s control, the computer needs to make choices.

Because the group values chosen are based sort of on a percentage (it’s actually a fuzzy set), the choice can be either the “top” item or a random value using those numbers as a range.