HowToWriteAdventureGamesUsingArianne: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>MiguelAngelBlanchLardin |
imported>MiguelAngelBlanchLardin |
||
| Line 123: | Line 123: | ||
=Design= |
=Design= |
||
==Technology used== |
==Technology used== |
||
To implement mapacman we are going to use Arianne, our multiplayer online game engine. So before designing the game we must understand the main concepts and ideas of Arianne. We need to make the design fit some simple rules to get the easiest design with the best possible performance. |
|||
Arianne uses the UDP transport protocol, which is the fastest, lowest ping transport available. However, it comes at the cost of the application not being able to detect lost packets. If your connection is really bad you will often become out of sync with the server as so much data sent will be lost. However, there is no transport method will help you with this type of connection! |
|||
Arianne's system is based on a Perception/Action/Perception scheme. This involves the server sending the clients a Perception, which is a list of RPObjects (the objects in Arianne are of type RPObject) with the modifications, additions and removals that happened in that turn. The clients take the Perception and process it to update their view of the game environment and then if they want to perform an action they send an RPAction (actions in Arianne as of type RPAction) back to the server. On the next turn the server sends a new perception message that will contain the result of the action (i.e. the changes to the objects affected by the action). |
|||
This scheme has several advantages: |
|||
* Works perfectly with turn based and real time based games |
|||
* There is a coherent state of the game at each point in time |
|||
* Players with a low ping time don't get an insane advantage |
|||
* Turn time can be modified to improve bandwidth/performance |
|||
* Support for several orders of magnitude more players than other systems. |
|||
On the other hand it suffers from an obvious set of disadvantages: |
|||
* Results are only made valid when the turn actually happens (i.e. an actions result will only appear in the next turn) |
|||
* Not the best/easiest way to make a First Person Shooter type game |
|||
However, this simple system is powerful enough to code nearly all games easily: both real-time and turn based games. |
|||
http://arianne.sourceforge.net/wiki_images/PerceptionActionPerception.png |
|||
One of the main issues in the game design is choosing a turn time for the server. It should be based on the type of game we are making. For example, a real time strategy game will need turn times of around 300 ms, while a turn based strategy game will work fine with 1000-1500 ms of turn time. Turn based games save a lot of bandwidth compared to non-turn based however note that the lower the turn time, the higher the bandwidth usage. Also remember that, the lower the turn time, the higher the CPU usage. |
|||
Perceptions are made up of a list of RPObjects. An RPObject is built up of several Attributes that are of the form: <br> |
|||
attribute=value |
|||
The attributes allow the storage of strings, ints and floats in the object. |
|||
An RPObject is also built up of Slots. A Slot is a container of objects, much like a pocket, a bag, a box or a hand. The point is that if our objects need to have objects inside them, or attached to them, you need to use Slots. |
|||
http://arianne.sourceforge.net/wiki_images/RPObjectER.png |
|||
All the dynamic changes to the world are made using Actions. An RPAction is also made up of attributes. You must redefine the default attributes of the action object so that the action becomes specific to your game. |
|||
Every player is stored in a relational database using the MySQL database system. You don't need to know how this is done but you can trust me that it works! Everything is stored in the database thus making the whole world permanent. It is up to you to decide to which degree things need be stored in the database and when and how often they should be committed (stored). The database is the main bottleneck of Arianne at the time of writing. |
|||
==World design== |
==World design== |
||
/** Copy from StendhalDesign */ |
|||
==Entities design== |
==Entities design== |
||
/** Copy from StendhalDesign */ |
|||
==Logic design== |
==Logic design== |
||
==AI Logic design== |
==AI Logic design== |
||
=Implementation= |
=Implementation= |
||
==Server== |
==Server== |
||