160 likes | 294 Views
Deceit System. This overview is meant to provide a coherent understanding of the Deceit System and Engine. The distribution of clients and servers, the fou r entities, interaction flow and quests will all be described and then demonstrated. Distributed Setup. Definitions:
E N D
Deceit System This overview is meant to provide a coherent understanding of the Deceit System and Engine. The distribution of clients and servers, the four entities, interaction flow and quests will all be described and then demonstrated.
Distributed Setup Definitions: Client – A user of the game running a program utilizing the ClientApp. Central Server – a server for initial connection management and load-balancing. Interaction Server – Servers running the Deceit Engine. The bulk of the work occurs here. Storage – anything capable of providing the requirements of IStorageAdapter.
Distributed Setup • Central Server is started. • Interaction servers are brought online and make the Central Server aware of their existence. • Clients ask the Central Server for an Interaction Server to connect to. • Clients contact to the specified Interaction Server and form a persistent connection. • Interaction Servers perform engine logic and access storage when necessary.
Network Central Server Client S T O R A G E Interaction Server Client Client Interaction Server Client Interaction Server Client Client
The Four Entities Our system has four key entities, of which you should be familiar when working with it: • GameItems - An item, object, thing, etc. • Attribute – A property of a GameItem. • Interaction – A verb, something that occurs, a host in the visitor pattern. • Permissions – Boolean-evaluate-able entities which accept or deny an Interaction from occurring and also have the power to send new Interactions.
The Four Entities The important thing to note here, and that which makes the Deceit Engine truly unique among all other systems is the fully-dynamic nature of these entities. They are all capable of being dynamically altered, or even created and added to the system at run-time. The world could begin with no items in it, they can be added with no attributes, interactions or permissions. No interactions or permissions need be written or compiled with the system. All of them may be dynamically added along with any attributes to the items you just created in the blank world.
The Four Entities: Permissions In order to create a robust system of Permissions, they have been divided up into two types: General Permissions apply to Interactions as a whole. The “Pick Up” Interaction being performed on any item at all necessarily requires some things, such as being in close proximity to the target. These Permissions are then applied to all uses of the Pick Up Interaction. Specific Permissions deal with the ability of the item which is the target or destination of the Interaction. It may require more strength to Pick Up an Apple than to Pick Up a Car. Utilizing the Visitor Pattern, we allow each GameItem to provide these Specific Permissions.
Something You Are: Game Item & Attributes Something You Can Do: Interaction & Permission Giacomo Strawberry: Eat • Hair Color: Brown • Eye Color: Blue • Height: 5’8” • Mouth: 2” • Age: 20 • Money: ¥50,000 Permission: Mouth Size > 1” Car: Eat Permission: Mouth Size > 120”
Interactions: From Click to Client • An action occurs in the real world, such as a mouse-click. • The Client’s Application Layer catches this as and interprets it as an Interaction, selecting an InteractionIdentifier to send across the Network. • The Client Networking module knows how to communicate with an Interaction Server’s Networking module.
Interactions: From Client to Server • The Server Networking module is sent the InteractionIdentifier. • This is caught and passed to the Game Engine, whose operations will be the subject of further discussion. • If the Game Engine needs to access data in Storage, it sends a request to the Storage Adapter, which knows how to communicate to whichever particular storage you use.
Interactions: From Storage and Back • Storage responds with any requests through the Storage Adapter. Game Logic proceeds. • In the case of an Interaction that sends updates or information back to the Client, the process works mostly in reverse back to the Client Application Layer. • Finally, any changes in the game world are displayed to the user.
Network • Interaction Server S T O R A G E Storage Adapter Click • Client Application Layer Game Engine Client Networking Server Networking
Interactions: Inside the Engine • An InteractionIdentifier arrives at the starting point in the Game Engine: The Interaction Dispatcher. • The Dispatcher asks Storage for the General Permission associated with that InteractionIdentifier. • The General Permission is evaluated, and in the case where it allows the Interaction to occur, the Interaction is not yet executed. • Instead, it is sent to the GameItem which, using the Visitor Pattern, provides an executable Interaction and associated Specific Permission from Storage. • If the Specific Permission allows, the Interaction occurs.
Interaction Dispatcher S T O R A G E Interaction Identifier General Permission Game Item Interaction Specific Permission
Quests Quests in Deceit arise naturally from situations produced by Interactions and Permissions being dynamically added to items, modifier and/or removed as the scenario progresses. Because of these, there is no Quest data structure, but instead a Quest Installer that adds the necessary Permissions and Interactions to the system and then installs specific instances of them to the necessary items.
Permission Permission Quest Installer Permission Permission Permission Permission Permission … … Interaction 1 Interaction 2 Interaction n Interaction 1 Interaction 2 Interaction n Interaction 3 Game Item 1 Game Item 2