Advertisement

Quest Mechanism

Started by May 30, 2007 12:41 AM
-1 comments, last by wodinoneeye 17 years, 8 months ago
The following is a design which I have been working on for the last few years (and I have mentioned a few times in GameDev in similar Quest Generation topics). The following describes a mechanism for a game engine to spawn and control quests (without mentioning specifics of the content for the Quests). Much of it could be applied to MMORPG as well as single player games with an open world aspect. My own project is intended to be more a Simulation than a game but with increasing computer resources, commercial games will begin to increase their complexity and ability to utilize similar capabilities. ----------------- QUEST MECHANISM ---------------------------- KEY CONCEPTS/ASSUMPTIONS World large enough for areas that have not been explored/infrequently moved thru. Grid of Zones (regular subdivisions) ex- 4096x4096 World map of Zones World is Virtualized (only parts near players are in memory at any point in time) Procedurally Generated World, Template driven (possibly complex creation patterns) Precanned themematic mapping of World to guide on-the-fly creation Key plot locations can still be precanned (filling the huge spaces in an adaquate way is the goal). Fully Random generation is too chaotic/uncohesive, a few factors per zone can guide generation. High level entities -- factions, plotlines wound exist to drive overall coordinated game Lazy evaluation for numerous 'Quests' to minimize resource overhead Assume that many Quests never get Realized Suspended phases hold off doing heavy allocation of game resources until player is likely to need them Script based build logic for complex situations where alot of fitting and cohesion with environmnt is required. Template mechanism allows recursive generation and encapsulation/reuseability etc.. AI system to run 'intelligent' objects behavior once placed(adaptive mechanisms to gave them self-fit some) (AI capabilities will be expanding for commercial games -- eventually...) Templates allow recombining into multitudes of different situations (and in MMORPG can be incrementally added) MASTER TRIGGERING Seed - attachment to Zone (preplaced for plotline in World or placed by another Quest or by High-Level entity) Possibly exists on a 'Quest' object and activated by reading/decoding (center being current location) May be pre-qualified for quest creation (but not nesssessary or even completely) Quest template will do its own validation Player entering 'Area' intiates 'Quest' seed (window of active Zones around player ex - 15x15) Seed contains enough information as to what Quest is ( a template and 'parameters') and center position Center position is just a reference point - the real placements will be determined by Search phase Template script has multiple phases as follows: SEARCH (and Validation) Interpretation of Seed parameters (criteria details are in template modified by optional parameters) Possible to have Multiple candidates for Quest flavor (ie- D&D style encounter table -- selected template is really a list of candidate templates) Vicinity search (expanding from center) for World Terrain matching requirements/criteria Water patterns (ie - needs site along major river) Terrain types (ie- needs to be in moutains) Flora/Fauna (ie- needs swamp environment) Resources (ie- need game mechanism specific feature to be present) Some criteria reject placement too near other feature placemnets Possible multiple components placement (in relation to each other) Possible for scenario to cover many areas/'Zones' All criteria must be satisfied for all components, or match fails (each component contains its own criteria) Preference for Unexplored/Unused Areas (simpler to modify if no other quest related stuff) Set General Parameters for the candidate scenario locations(zone coords) of all planned high-level components (buildings, surrounding terrain) Accept/Reject (end execution if no valid match for requirements -- abort quest) (if there are several candidate scenarios then Search will begin to try to match for next one) Accepted Result instance will be a set of templates with location specific parameters SETUP (PreStaging of Instance, General Decision & Definition, Reservation) Create the Quest Object -- Allocate storage for quest data General Parameters are used to control templates (mostly dealing with where scenario takes place) Defining instance Specifics - building set of more detailed parameters parameterized templates in a Build script- script logic and template calls + parameters Local Defaults based on world location and preexisting factors Randomization within specified limits (sub-components templates can have own randomizers) Variant selections from options lists, etc... Combinatorics and situational fitting should make less repetition. Reserve World Areas/Zones specified, and mark usage (to prevent interference by other quests) Gross modifcation/adjustment of world (abstract factors that drive 'on-the-fly' creation) Water patterns, Terrain types, Flora/Fauna, Resources Place boundry of Proxmity Triggers at sufficient distance (setup trigger objects in surrounding zones) Place appropriate hints/clues in adjacent areas (will serve to guide player to site) hints/clues can be 'seeds' that cause placement of actual props when Zone is realized *Optional* place Chain seeds for subsequent expansion (allows chained multipart quests) Result is basicly 'procedural generation' parameter data (fairly small block of data) Quest is put into Wait mode WAIT (Abstract/parameterized form) Trigger maintenence Zone Trigger markers activate when player 'touches' area (lod 3 2 1...) Quest shifts to Deploy mode Quest scenarios can timeout or be canceled with little cost (and reserves placements released) DEPLOY (Realization of all Specific details in game engine) Cleanup Trigger Objects (optional cleanup of hints/clues...) Force system to Realize (generate ful detail of) required Zones/Areas Execute Build script -- Templates + Parameters Build any add-on zones not part of World Grid (Tunnels/Stuctures) Mutate Zone's default content (adjust heightmap mesh, add/remove scenery objects) (ex- clear/flatten space on Zone for buildings) Place all 'Props' (static objects) in proper relation to each other Create 'Contoller AI' to coordinate actions of NPC population Spawn population for Quest Site (NPC group templates) Specific details for 'community' interrelations Roles and Relations defined/assigned Link up to Controller AI Deployment is to be complete before player gets in range to see changes (in a MMORPG its location would have be chosen away from other players seeing) AI WARMUP (Adaption/Stabalization phase for NPCs) AI startup - AI system resource allocation (Controller & NPC) NPCs may add their own 'Props' (they are templates also...) NPC's adjust static Zone's objects (ie- Blacksmith takes up residence in a building) Timeline adjustment to put NPCs in appropriate places/states (match time of day, tasks in progress) Time of day schedules for appropriate behavior Quests without complex AI have a minimal Warmup phase ACTIVE (Running as Simulation) NPCs run following inheritted behaviors (following roles and reacting to current situation) Controller AI coordinates NPCs (schedules, group activities, etc..) Quest Monitor watches for Quest Conditions to transition to Epilog Timeout for time limited scenarios Abstract Rollout/Rollin (switching between Realized and Abstract Modes while 'Active') If player moves away, the Scenario/Site will be frozen and possibly rolled out of memory It can be run in a simplified Abstract until the player returns to vicinity NPCs may continue to run in Realized mode for as long as they are in proximity of player (if they follow player outside of the areas they were created) Some Quests move (are attached to NPCs instead of a fixed location, ie- band of thieves) EPILOG (Cleanup) Plotline bookkeeping (runonce, intervals to prevent repetition, flags to the macro plot mechanism, etc..) Quest Object deallocation Possible Dissolution/Dispersion of the Site Remnants may be left to execute normally (to interact following normal AI execution) Remaining components of scenario become permanant part of World (persistant) and will entrophy naturally. Zones will eventually Rollout to disk and may later be reconstituted (Rollin) if player returns to area Subsequent/CAscading Quests may be initiated (Chained Quests...) High level (Controller) entity can continue to run as part of Macro simulation and influence game. Areas where a Quest scenario was run are now 'explored' and have limited reuse for less invasive Quests The objects placed on the map can initiate related quests/missions (ie- a village located by the first quest can spawn local quests related to a 'village' and the village's current World situation) ------------------------------------------------------------------------------------------------------------------------ Template Structure (script) Search phase : placement match validation logic, calls to sub-template.validation Setup phase : scenario definition logic, calls to sub-template.setup Deploy phase : Deployment Instructions, calls to sub-template.deployment Active phase : Plotline Monitoring Logic Abstract phase : Abstract running logic Epilog phase : Cleanup Instructions ------------------------------------------------------------------------------------------------------------------------ Quest Object structure (data) Instance ID main template ID list of reserved Zones list of placed Triggers list of sub-components (each with Template ID and optional subcomponent list) ------------------------------------------------------------------------------------------------------------------------ Interesting Ideas: The overall mechanism can be used to have 'inhabitants' of a World expand by intelligently placing new assets (ex- "The Quest for the New Farm" ) and thus mutate the environment with minimal ($$$) Gamemaster time. Nothing says that this whole system has to operate Without human intervention. Its likely that adoption by MMORPG companies will be half the above solution, with alot of guidance/manual intervention by GameMasters who will place self-expanding scenarios to match a desired plot sequence. The templates would remove/lessen alot of the manual editing of the multitudes of details that make World changes prohibitive today.
--------------------------------------------[size="1"]Ratings are Opinion, not Fact

This topic is closed to new replies.

Advertisement