Seamless Link Spec Oracle

From HEWIKI
Jump to: navigation, search



Contents

This page discusses the spec oracle (definition system) for creating links in the Seamless World 1.0 system.

Overview

The construction of Seamless Area Links is a complicated process that generally occurs in conjunction with the introduction of one or more area assets via the Asset Library. Due to the complexity, the MMO Foundation Framework includes a Spec Oracle whose specifications act as instructions to the engine for the construction of a seamless area link. Since it is improbable we have accounted for everything a game might want a seamless area link to do, the implementation is sufficiently generic and extensible that any game-specific behavior is possible through the extension of the Seamless Link Spec Oracle with new base or decorator classes.

SeamlessLinkCreationFlow.gif

Included in the Seamless Area Link Spec Oracle is a default specification called the Standard S-Curve Asset which is capable of handling the general case for a seamless area link whereby a special asset (Transition Topology) is placed in both source and destination areas and treated as being coincident in space.

Concepts

Factory for Seamless area links

The specifications of the seamless link spec oracle serve as a set of instructions (a factory) that turns instances of assets created (generally) via the Asset Library into seamless area links. During the factory process, the decorators of the seamless area link spec are afforded the opportunity to execute any custom logic necessary to construct a functional seamless link including any custom game specific behaviors.

Usage

Viewing Seamless Area Link Specs

DisplaySeamlessLinkSpecOracle.gif
Using the utilities interface, select the Tools tab and scroll down to the Spec Oracles section. Click on the link named Seamless Link to open up the list of seamless area link specs. The MMO Foundation Framework includes at least one default spec.


Adding New Base Classes

For the most common situation, it generally is not necessary to add a new base class as most of the functionality is deferred to the decorators used to modify a specification. However, adding a new base class allow full control over the entire process from the point that the library has issued a command supporting any custom behavior necessary.

The only requirement for a new base class is that it is a child of the class _seamlessAreaLinkSpec which defines the expected interface for a spec in this system.

method HE_getValidBaseClasses(classes references List of String) as Boolean
//  Add additional game specific base classes to the classes list
//  Return true to indicate you've handled all classes, or false to let the SpecOracle add its own classes as well.
 
  add back "myBaseClass" to classes
 
  return false  // returning false to allow the MMO Foundation Framework classes to be included
.

Adding New Decorators

The addition of new decorators allows for the extension of the system that creates seamless area links to provide new or customize existing behavior for the seamless area link.

method HE_getSpecDecoratorClasses(classes references List of String) as Boolean
//  Add additional game specific decorator classes to the classes list
//  Return true to indicate you've handled all classes, or false to let the SpecOracle add its own classes as well.
 
  add back "myDecoratorClass" to classes
 
  return false  // returning false to allow the MMO Foundation Framework classes to be included
.

Your decorator should implement the shared function _OnLibraryInstantiationFromSpec() which is called by the _seamlessAreaLinkSpecClassMethods script during the instantiation of a seamless area link from a library command.

shared function _OnLibraryInstantiationFromSpec( spec as NodeRef of Class baseSpec, derivedObject as NodeRef of Class SpecDerivedObject, librarycmd as String )
.

Parsing Library Commands

The seamless area link specs parse library commands using a command pattern similar to other MMO Foundation Framework systems such as $GLOM, $ASSOCIATIONS, and State System's command parsing. Tokens are parsed from the string passed in following the following rules:

Sample Command

 /heseamlesslink LIBRARY #spec='1' ?GUIDS='$GUIDS' ?link='library index|FQN' ?trigger='library index|FQN'

In HSL, parsing is implemented in the baseSpecClassMethods script and may be called from any of the decorators to pull out tokens relevant to the decorator during the _OnLibraryInstantiationFromSpec callback during instantiation of a seamless area link from the library.

tokens as lookuplist indexed by string of string = spec._parseTokensFromLibraryCmd( inputString )

Required Tokens

The seamless area link spec oracle expects the following tokens to be included in the /heseamlesslink command issued by the library. Failure to include them will fail to create a fully functional seamless area link.


MMO Foundation Framework Decorators

The MMO Foundation Framework of the Seamless Link Spec Oracle includes a number of decorators which area intended to be used together in the construction of a seamless link spec.


_seamlessAreaLinkSingleConnectionDec

The _seamlessAreaLinkSingleConnectionDec decorator handles the mechanics of factorying up a seamless area link for a single destination. During instantiation from the library, the decorator GLOMs on the class _seamlessAreaLinkSingleConnection to the primary object of the seamless area link. This helper class supports functionality for tracking whether or not a destination has been spun up for the link and if so storing the unique area instance as the destination for the link.

_seamlessAreaLinkSASLaunchInstanceDec

The _seamlessAreaLinkSASLaunchInstanceDec decorator handles the mechanics of factorying up a seamless area link capable of launching a destination area. During instantiation from the library, the decorator GLOMs on the class _seamlessAreaLinkSASLaunchInstance to the primary object of the seamless area link. This helper class supports functionality for the addition of a spatial entity representing the launch awareness range, updating the entity position during editing changes, and launching a destination area when a player enters awareness range with the destination area specified by the connection decorator.

The _seamlessAreaLinkSASLaunchInstanceDec decorator supports some additional (optional) tokens for use with the Asset Library to customize the awareness used for the launch entity.

_seamlessAreaLinkSASPreloadDec

The _seamlessAreaLinkSASPreloadDec decorator handles the mechanics of factorying up a seamless area link capable of initiation of preloading of a destination area. During instantiation from the library, the decorator GLOMs on the class _seamlessAreaLinkSASPreload to the primary object of the seamless area link. This helper class supports functionality for the addition of a spatial entity representing the preload awareness range, updating the entity position during editing changes, and initiation of preloading for the destination (provided by the connection helper) area when a player enters awareness range.

The _seamlessAreaLinkSASPreloadDec decorator supports some additional (optional) tokens for use with the Asset Library to customize the awareness used for the launch entity.

_seamlessAreaLinkSASProxyDec

The _seamlessAreaLinkSASProxyDec decorator handles the mechanics of factorying up a seamless area link capable of initiation of proxying characters and npcs to a destination area. During instantiation from the library, the decorator GLOMs on the class _seamlessAreaLinkSASProxy to the primary object of the seamless area link. This helper class supports functionality for the addition of a spatial entity representing the proxy awareness range, updating the entity position during editing changes, and initiation of proxying of characters and/or npcs to the destination (provided by the connection helper) area when an entity enters awareness range of the link.

The _seamlessAreaLinkSASProxyDec decorator supports some additional (optional) tokens for use with the Asset Library to customize the awareness used for the launch entity.

It is important to note that your game mechanics must have been scripted to work with Proxied Nodes, specifically calling ProxyForward or ProxyLocal methods.

_seamlessAreaLinkTriggerDec

The _seamlessAreaLinkTriggerDec decorator handles the mechanics of factorying up a seamless area link that utilizes a trigger to initiate the transition to the destination area. During instantiation from the library, the decorator GLOMs on the class _seamlessAreaLinkTrigger to a secondary object (the trigger) specified by the ?trigger token. This helper class supports functionality for initiating seamless area transition to a destination area specified by the connection.

The _seamlessAreaLinkTriggerDec decorator supports some additional tokens for use with the Asset Library to customize the awareness used for the launch entity.

Reference

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox