Update: quests are currently implemented in server, and seem to work along the general ideas below. Thus this is kept for reference. — Nicolas 2010/09/04 02:43

(copy of a mail sent to CF — Ryo Saeba 2006/06/10 07:58)

Quests should be finite state automates. Meaning different states, with transitions between states, with conditions for those transitions, etc. Each state would specify special behaviour for NPCs, texts so the player knows the quest status and what to do (or at least some hints). Also there would be the rewards for completing that state, everything needed.

Transitions should describe what the player should do to actually change states.

My idea is to have quest files. Each quest would be one file, describing all states, transitions, including all information on what NPC's behaviour to change, rewards, and so on.

If required, a quest file could be accompanied by some special maps, archetypes, anything specific.

The quest engine would, at start time, read those files, and process them. It would then, at map loading time, add relevant hooks to NPCs, or track global events (for instance follow player movement to know if they do what is required to complete a task). It would also keep, for each player, quest status, and such.

Advantages I see:

Drawbacks, opened questions: