RolePlayingDesign: Difference between revisions
Content deleted Content added
imported>StephenIerodiaconou No edit summary |
imported>Hendrik Brummermann No edit summary |
||
| (69 intermediate revisions by 4 users not shown) | |||
Line 1:
{{Navigation for Marauroa Top|Internals}}
{{Navigation for Marauroa Developers}}
This is possibly the most complex part of all the middleware that makes up Arianne.<br>
Role Playing Design is the determining factor on how ''easy'' is to create a new game for Arianne. We had to choose easing the creation of turn time limited based games. Arianne will work better with this kind of games (also known as realtime games).
Line 62 ⟶ 66:
The whole Marauroa system is managed by two main entities, RPAction and RPObject. There are also several helper classes like Attributes, RPSlot and RPClass
==
Attributes is a collection of pairs of values in the form name-value.
We can store almost any basic type in a Attribute object:
Line 107 ⟶ 111:
For example an avatar can have:
and we can store objects in each of these slots.
Line 128 ⟶ 132:
There are optional and mandatory attributes. If a mandatory attribute is not found, the message is skipped by the RPServerManager.
Mandatory
The action_id is used to identify the action when a resulting response comes in a perception
=Perceptions=
The basic structure for sending world updates to
There are two types of perception:
* Sync perceptions
* Delta perception
Our actual Perception system is called Delta<sup>2</sup>. It is heavily attached to the Marauroa core, so I recommend you to use it :) ▼
▲Our actual Perception system is Delta<sup>2</sup>. It is heavily attached to the Marauroa core, so I recommend you to use it :)
== How Perceptions and Actions work ==
Actions are sent from the client to the server in order to make
So the action reply is stored inside each object (that executed the action ) with a set of attributes that determine the action return status and the attributes. This way of
See Actions reply in the Objects
==Delta<sup>2</sup> perception Algorithm==
The
Imagine that we have 1000 objects, and only O1 and O505 are active objects that are modified each turn.
The Traditional method:
<pre>
- Get objects that our player should see ( 1000 objects )
Line 168 ⟶ 170:
</pre>
I hope you see the problem...
The delta perception algorithm:
Line 185 ⟶ 187:
</pre>
The next step
The delta<sup>2</sup> algorithm is based on four containers:
Line 194 ⟶ 196:
* List of deleted objects
An area
To make perception works it is important to call the modify method on RPZone so this way objects modified are stored in the modified list.▼
▲To make
=Zones and Worlds=
Worlds in Marauroa can be so big, so huge, that we need to split
Each of these pieces are what we call an RPZone.
So our world is made of several RPZones that are '''independent''' of each other.
To move from one RPZone to another RPZone you have to code
==RPWorld==
As we have already said,
RPWorld provides onInit and onFinish methods that are called on server
Also it provides methods for adding and getting new RPZones:
Line 222 ⟶ 223:
* changeZone that moves one object from the old zone to the new zone and adds a proper valid id.
At last, RPWorld also contains a method called nextTurn that is called by RPManager to move from one turn to the next turn. It
==RPZone==
Objects must be stored somewhere, and we use Zones now to store them. A zone is just a container of Objects which has a name.
Each RPZone '''must''' have
In order to improve the modifiability of the Marauroa platform we have made RPZone to be an interface so that if you want you can implement it as you
But
The actual Marauroa RPZone consists of several data structures:
Line 238 ⟶ 239:
* a Perception
The idea is to have already computed, in the Zone, the perception
In order to make perceptions work, you have to manually call the modify method so that you notify the zone about changes in a character or object.▼
▲Actually the perception is the same for all the players on the Zone.
[[Category:Marauroa]]
▲In order to make perceptions work, you have to manually call modify method so that you notify the zone about changes in a character.
{{#breadcrumbs: [[Marauroa]] | [[Navigation for Marauroa Developers|Internals]] | [[RolePlayingDesign|Role Playing Design]] }}
| |||