Upload
grace-daniel
View
213
Download
0
Embed Size (px)
Citation preview
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
1. Central Server is started.2. Interaction servers are brought online and make
the Central Server aware of their existence.3. Clients ask the Central Server for an Interaction
Server to connect to.4. Clients contact to the specified Interaction
Server and form a persistent connection.5. Interaction Servers perform engine logic and
access storage when necessary.
STORAGE
InteractionServer
CentralServer
Client
Client
Client
Client
Client
Client
InteractionServer
InteractionServer
Network
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• Hair Color: Brown• Eye Color: Blue• Height: 5’8”• Mouth: 2”• Age: 20• Money: ¥50,000
Strawberry: Eat
Permission:Mouth Size > 1”
Car: Eat
Permission:Mouth Size > 120”
Interactions: From Click to Client
1. An action occurs in the real world, such as a mouse-click.
2. The Client’s Application Layer catches this as and interprets it as an Interaction, selecting an InteractionIdentifier to send across the Network.
3. The Client Networking module knows how to communicate with an Interaction Server’s Networking module.
Interactions: From Client to Server
4. The Server Networking module is sent the InteractionIdentifier.
5. This is caught and passed to the Game Engine, whose operations will be the subject of further discussion.
6. 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
7. Storage responds with any requests through the Storage Adapter. Game Logic proceeds.
8. 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.
9. Finally, any changes in the game world are displayed to the user.
Network
STORAGE
ApplicationLayer
ClientNetworking
Game Engine
ServerNetworking
Client
Interaction Server
Storage AdapterClick
Interactions: Inside the Engine
1. An InteractionIdentifier arrives at the starting point in the Game Engine: The Interaction Dispatcher.
2. The Dispatcher asks Storage for the General Permission associated with that InteractionIdentifier.
3. The General Permission is evaluated, and in the case where it allows the Interaction to occur, the Interaction is not yet executed.
4. Instead, it is sent to the GameItem which, using the Visitor Pattern, provides an executable Interaction and associated Specific Permission from Storage.
5. If the Specific Permission allows, the Interaction occurs.
STORAGE
GeneralPermission
SpecificPermissionInteraction
Interaction Dispatcher
Game Item
Interaction Identifier
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.
……
Game Item 1
Inte
racti
on 1
QuestInstaller
Perm
issi
on
Inte
racti
on 2
Perm
issi
on
Perm
issi
on
Game Item 2
Inte
racti
on 1
Inte
racti
on 2
Perm
issi
on
Inte
racti
on n
Perm
issi
on
Inte
racti
on 3
Perm
issi
on
Perm
issi
on
Inte
racti
on n