All sentient-presenting mobiles can have goals, and can figure out how to achieve them.
Some of these goals might be due to the mobiles job (eg. wanting to catch criminals, needing raw materials). Some are due to interruptions from the emotional system because of the current state of the world (eg. screeching cats keep the mobile awake at nights, the mobiles life is in danger). Some are more general consequences of its emotional make-up (eg. a raging hatred of spell-casters, a crush on the gorgeous pouting babe dwarf who just moved in next door). Others are simply random quirks, perhaps sprinkled around by members of the design team (eg. a hobby of collecting antiques, an interest in genealogy). Some will be for different reasons entirely.
Goals are represented by sets of statements about the world. There are two types: verifiable goals, that the computer can check have succeeded; unverifiable goals, that it cant. An example of the former might be, The triptych of the ancients is once again in the temple sanctum; an example of the latter might be, The elves of the south are avenged.
Suppose that a mobiles goal was to have power. There might be four actions with have power as an effect: acquire military power; acquire political power; acquire religious power; acquire economic power. These would constitute the mobiles initial consideration set. Lets say the mobile randomly selected acquire religious power to try first. There might be two actions that achieved this: lead an existing religion; form your own religion. Again selecting randomly, the mobile considers lead an existing religion. To achieve this, it can attempt its general assume position in organisation action, which has three preconditions: be in a lower position in the organisation; be the best candidate; theres a vacancy for the target position. Taking these in order, the mobile discovers that the action join a religion puts it in a lower position than that occupied by the religions leader. The mobiles plan at this point is therefore:
[join a religion, be the best candidate for leader of the religion, await a vacancy for leader of the religion, assume the position of leader of the religion]
Doing this will give the mobile religious power, thereby satisfying its original goal. Note that although the overall goal is unverifiable, not all the sub-goals are: the game can check when there is a vacancy for leader of a religion and when the player has filled it, for example; it might even be able to measure the best candidate, given a reasonable set of criteria. Although the second step of the plan needs a great deal more work to bring to fruition (applying the generic assume position in organisation action repeatedly to rise the mobile up through the ranks), the first step can be expanded into something the mobile can actually do: go to the temple of the ancients; sign up.
Aside: the term expanding an (unexecutable) action means substituting it with other actions that achieve its preconditions. This can be done by backward chaining, as usual, or (in more sophisticated planners) by using plan fragments that the mobile has generated before to do similar tasks (or has had directly programmed into it).
The Key Point
All a mobiles verifiable goals can be used as quests.
If a player (or, indeed, a mobile) goes up to a sentient-presenting mobile and presses its quest button, that mobile can consult its current plan (or generate one, if currently planless) and look for a goal that the player is capable of achieving given the current situation. In the above example, this might mean something fairly easy for newbies (sign me up at the temple of the ancients) or more complex for higher-level players (Im going to sign up at the temple of the ancients. I want you to make me the best candidate for a more senior position, should one arise).
From the players point of view, the situation gets suddenly more interesting when they achieve the task set out for them. Having made their mobile be the best candidate for temple head, for example, it naturally follows that the player could then be asked to create a vacancy for temple head. If the player declined this task, the mobile could expand that part of its plan itself perhaps by bribery or blackmail. It could then offer a seemingly unrelated task to the player (deliver this sealed envelope to the temple head) that was actually part of its grander scheme (as a curious player would doubtless discover upon unsealing the envelope...).
There are many advantages to this approach, but the main ones are:
- Goals can themselves be sub-goals of some greater goal, which gives them a purpose. I want you to rescue my cat from the tree because its wearing my ring of teleporting orcs away on a chain round its neck!.
- Goals can, within reason, be measured in terms of how difficult they are to achieve. Characters can therefore be given quests appropriate to their experience. I did mention the tree was guarded by a dryad, didnt I?
- Most mobiles that represent intelligent creatures can immediately be called upon to generate some goal that a player could strive to achieve, even if the reward isnt going to be up to much.
- Mobiles can have multiple goals. If you dont like one, you can ask for another. If you wont help me avenge the death of my brother, perhaps youll help me hit on his widow?.
- Detecting the success (or failure after a time limit) of a verifiable goal doesnt unduly burden the system. You dont have to check continually whether a goal has been achieved or not: you only have to do it when the player returns.
- Original quests can be churned out in vast numbers without using up horrendous quantities of computational oomph.
The primary disadvantages are:
- There have to be many goals and ways of achieving them. Its not a good idea to have one in four mobiles trying to head up a religion.
- Actions have to be programmed consistently, using a common formalism. If someone makes a programming error, the results could appear bizarre. Using the wrong variable name could mean a mobile asks you to murder her boyfriend instead of his stand-in-the-way-of-marriage parents.
Next time, well start to look under the hood a bit more, and see whats there.