HowToWriteAdventureGamesUsingArianne: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>MiguelAngelBlanchLardin |
imported>Hendrik Brummermann No edit summary |
||
| (167 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
{{Navigation for Marauroa Top|Using}} |
|||
=Howto write Adventures games using arianne= |
|||
{{Navigation for Marauroa Users}} |
|||
'''NOTE:''' This tutorial describes the early steps in creating an adventure game. [[Stendhal]] is now a couple of years old and a lot has happened since then. This document, however, is still an interesting read if you are planning to start your own adventure game. |
|||
=Introduction= |
=Introduction= |
||
| Line 11: | Line 20: | ||
* Deployment |
* Deployment |
||
Arianne is a multiplayer online games framework and engine to develop turn based and real time games. It provides a simple way of creating games on a portable and robust server architecture. Marauroa, the server, is coded in Java and |
Arianne is a multiplayer online games framework and engine to develop turn based and real time games. It provides a simple way of creating games on a portable and robust server architecture. Marauroa, the server, is coded in Java and can use Java or Python for your game description. It also provides a SQL backend and uses a TCP transport channel to communicate with the clients. |
||
Our reference clients are coded using Java |
Our reference clients are coded using Java (C in the past) in order to achieve maximum portability. |
||
The Arianne engine is designed so that you can concentrate on designing the actual game and ignore all the detailed implementation aspects of a complex system, such as those in the multiplayer online game content server. You therefore need not be concerned with issues of Thread, Database and Network handling. |
The Arianne engine is designed so that you can concentrate on designing the actual game and ignore all the detailed implementation aspects of a complex system, such as those in the multiplayer online game content server. You therefore need not be concerned with issues of Thread, Database and Network handling. |
||
Arianne has been in development since 1999 and has evolved from a tiny application written in pseudo-C++ to a powerful, expandable but simple server framework, running on the Java platform, and a client framework, written in bare C to allow total portability of arianne's clients. Arianne's server is totally client agnostic for maximum flexibility. |
|||
Since the beginning, the key concept at the heart of Arianne's development has been KISS: Keep it simple, stupid! |
Since the beginning, the key concept at the heart of Arianne's development has been KISS: Keep it simple, stupid! |
||
| Line 22: | Line 29: | ||
Arianne has always been an Open source project, written and released under the GNU GPL license. We believe the right way is the Open Source way and we want you to have the power to change, edit and configure whatever you want, both in the clients and server. Arianne always welcomes your contributions and modifications to the code to create the best possible open source reference platform for game content providers. |
Arianne has always been an Open source project, written and released under the GNU GPL license. We believe the right way is the Open Source way and we want you to have the power to change, edit and configure whatever you want, both in the clients and server. Arianne always welcomes your contributions and modifications to the code to create the best possible open source reference platform for game content providers. |
||
All our efforts are supported by Arianne's |
All our efforts are supported by Arianne's engine: Marauroa. Marauroa is written completely in Java using a multithreaded server architecture with a TCP oriented network protocol, a SQL based persistence engine and a flexible game system. Marauroa is totally game agnostic and makes very little assumptions about what you are trying to make thus allowing great freedom when creating games. The game system is totally expandable and modifiable to suit your game's needs. It is able to run Python scripts defining the game's rules hence providing a simple way of specifying your games behavior. |
||
Marauroa is based on a design philosophy we called Action/Perception. A Perception is a collection of data sent each turn to the clients explaining to them what they currently perceive in the game environment. Actions are sent from clients to the server and are used to ask the server to perform an action for them. |
Marauroa is based on a design philosophy we called Action/Perception. A Perception is a collection of data sent each turn to the clients explaining to them what they currently perceive in the game environment. Actions are sent from clients to the server and are used to ask the server to perform an action for them. |
||
| Line 64: | Line 71: | ||
A first draft of the game world looks like this: |
A first draft of the game world looks like this: |
||
[[Image:Stendhal_Map.jpg]] |
|||
| Line 100: | Line 107: | ||
==Details== |
==Details== |
||
We need to think about what happens or appears in the game and build a few detailed 'Use cases' to point entities and actions existing in the game. |
We need to think about what happens or appears in the game and build a few detailed 'Use cases' to point entities and actions existing in the game. |
||
''TODO: Rip from Stendhal Design once it is more stable'' |
|||
Once we know what will appear in the game we can make seperate, detailed descriptions of each entity of the game. If this sounds to you like OOP methodologies, then pat yourself on the back, as you are right! Arianne uses an Object based design approach. |
Once we know what will appear in the game we can make seperate, detailed descriptions of each entity of the game. If this sounds to you like OOP methodologies, then pat yourself on the back, as you are right! Arianne uses an Object based design approach. |
||
In the game we have the following entities: |
In the game we have the following entities: |
||
* Zones |
|||
## City |
|||
## Village |
|||
## Plains |
|||
## Forest |
|||
## Dungeons |
|||
* Creatures |
|||
## Sheep |
|||
## Rat |
|||
## Cave rat |
|||
## Wolf |
|||
* Players |
|||
* NPC |
|||
* Quests |
|||
==Goal== |
==Goal== |
||
| Line 123: | Line 142: | ||
=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. |
|||
[[Image: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. |
|||
[[Image: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== |
||
The whole game area will look like: |
|||
[[Image:Stendhal_Map.jpg]] |
|||
It is split into 5 different areas to use the multizones feature of Arianne.<br> |
|||
Players need to change zone in order to accomplish their task and progress in the game. |
|||
=== City === |
|||
The city is build of two zones: one above where the sheep buyer works and one down full of rats to win XP easily. |
|||
http://arianne.sourceforge.net/wiki_images/city.jpg |
|||
http://arianne.sourceforge.net/wiki_images/city_underground.jpg |
|||
You can move using the hole near the tree from one to the other. |
|||
Also this zone has some buyer's sheeps and a few NPC like: Carmen, the welcomer and Diogenes, a misterious beggar. |
|||
=== Village === |
|||
In the village lives the Sheeps' seller: Nagashi, he will sell you sheeps to grow them up. |
|||
http://arianne.sourceforge.net/wiki_images/village.jpg |
|||
=== Plains === |
|||
Where can you find a better place for growing sheeps? But sheeps is food of wolves. This zone contains several wolves and rats. |
|||
http://arianne.sourceforge.net/wiki_images/plains.jpg |
|||
=== Forest === |
|||
http://arianne.sourceforge.net/wiki_images/forest.png |
|||
==Entities design== |
==Entities design== |
||
To make this world appear to be live we have added the next entities. |
|||
* Sheep |
|||
* Sheep seller |
|||
* Sheep buyer |
|||
* Wolf |
|||
* Rat |
|||
* Cave rat |
|||
* Player |
|||
* Food |
|||
* Armor |
|||
* Weapon |
|||
* Healing potion |
|||
===User cases=== |
|||
These user case describe the behaviour of the entities. This help us in the coding stage by making clear the goals to achieve. |
|||
====Player's user case==== |
|||
Player is an entity that play the game, it can move, chat, attack, heal. |
|||
<pre> |
|||
Player enter village in entry point |
|||
Player moves to Farm zone |
|||
Player talks with Sheep seller |
|||
Player: Hi |
|||
Seller: Greetings! How may I help you? |
|||
Player: buy Sheep |
|||
Seller: Do you want to buy a Sheep for 50 coins? |
|||
Player: yes |
|||
Seller: Thank you! Bye |
|||
Player moves. Sheep follows Player. |
|||
Player moves to plains |
|||
Player moves around looking for food |
|||
Player protect Sheep of wolves attacks |
|||
When Sheep is big enough Player moves to Village |
|||
Player talks with Sheep buyer |
|||
Player: Hi |
|||
Buyer: Greetings! How may I help you? |
|||
Player: sell Sheep |
|||
Buyer: Do you want to sell this Sheep for 73 coins? |
|||
Player: yes |
|||
Buyer: Thank you! Bye |
|||
Player spend money in new Sheep and equipment |
|||
* Armor |
|||
* Weapon |
|||
* Healing potions |
|||
</pre> |
|||
====Sheep seller's user case==== |
|||
This seller is a NPC entity that will sell us a sheep to grow it up and make money. |
|||
<pre> |
|||
FOREVER do: |
|||
Listen to Player |
|||
If listen "Hi": |
|||
Seller says "Greetings <Player>!" |
|||
If listen "Buy Sheep" from Player: |
|||
Seller says "Do you want to buy a Sheep for 50 coins?" |
|||
If listen "yes" from Player: |
|||
If Player money - 50 > 0: |
|||
set Player money=Player money - 50 |
|||
Duplicate Sheep |
|||
Make Sheep follows Player |
|||
Say bye to Player |
|||
DONE |
|||
</pre> |
|||
====Sheep buyer's user case==== |
|||
This buyer is a NPC entity that will buy us our sheep. |
|||
<pre> |
|||
FOREVER do: |
|||
Listen to Player |
|||
If listen "Hi": |
|||
Seller says "Greetings <Player>!" |
|||
If listen "Sell Sheep" from Player: |
|||
Estimate Sheep value related to Sheep weight |
|||
Seller says "Do you want to sell your Sheep for <estimated price> coins?" |
|||
If listen "yes" from Player: |
|||
set Player money=Player money + <estimated price> |
|||
set Player XP=Player XP + 100 * Sheep Weight / 100 |
|||
Destroy Sheep |
|||
Say bye to Player |
|||
DONE |
|||
</pre> |
|||
====Sheep's user case==== |
|||
Sheep is our key game concept. The player must shepherd their lambs, protecting them wolves and such until they are worth selling. |
|||
<pre> |
|||
Sheep is in Farm |
|||
Player buys Sheep |
|||
Sheep seller duplicates Sheep |
|||
Sheep follows Player |
|||
If Sheep finds food: |
|||
Sheep moves to food |
|||
Sheep eats food |
|||
Sheep gains weight |
|||
Player sells Sheep |
|||
Sheep dissappear |
|||
</pre> |
|||
====Wolf's user case==== |
|||
Wolf is the competitive entity on Stendhal. They join to attack sheep and often also players. They can kill a sheep quickly. |
|||
<pre> |
|||
Wolf moves |
|||
If Wolf sees Sheep: |
|||
Wolf attacks Sheep |
|||
If Wolf is attacked: |
|||
Wolf attacks Attacker |
|||
</pre> |
|||
====Rat's user case==== |
|||
Rat and Cave rats are creatures that will attack player to make it harder to grow the sheep up. |
|||
<pre> |
|||
Rat moves |
|||
If Rat sees Player: |
|||
Rat attacks Player |
|||
If Rat is attacked: |
|||
Rat attacks Attacker |
|||
</pre> |
|||
Let's describe each entity and its attributes and actions. |
|||
=== Sheep === |
|||
A sheep has the following set of attributes: |
|||
* <b>x</b> is the x-position of the sheep |
|||
* <b>y</b> is the y-position of the sheep |
|||
* <b>dx</b> is the x-speed of the sheep |
|||
* <b>dy</b> is the y-speed of the sheep |
|||
* <b>hp</b> is the life indicator of the sheep, when it reach 0 the sheep dies. |
|||
* <b>atk</b> is the RP attack value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>def</b> is the RP defense value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>xp</b> is the RP experience value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>weight</b> is the weight indicator of the sheep, the more weight, the more expensive it is. |
|||
Sheep tasks should be: |
|||
* <b>follow</b> |
|||
* <b>eat</b> |
|||
The sheeps behaviour is mainly to follow its owner and look for food.<br> |
|||
If the Sheep finds food, it will eat.<br> |
|||
Sheep will runaway if attacked.<br> |
|||
=== Creatures: Wolf, rat and Cave rat === |
|||
Wolves, rats and cave rats have the following set of attributes: |
|||
* <b>x</b> is the x-position of the wolf |
|||
* <b>y</b> is the y-position of the wolf |
|||
* <b>dx</b> is the x-speed of the wolf |
|||
* <b>dy</b> is the y-speed of the wolf |
|||
* <b>hp</b> is the life indicator of the wolf, when it reach 0 the wolf dies. |
|||
* <b>atk</b> is the RP attack value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>def</b> is the RP defense value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>xp</b> is the RP experience value. See [[StendhalDesign#RP|RP rules]] |
|||
Wolf ( and rat and cave rat ) tasks should be: |
|||
* <b>follow</b> means that wolf follows an object using the shortest way to reach it. |
|||
* <b>attack</b> means that wolf will try to damage the attacked object until its hp reach 0<br>Another action will cancel attack task. |
|||
* <b>patrol</b> means that wolf will move around a specified path. |
|||
* <b>chat</b> means that wolf will start to shout 'auuuuuuu!'. Wolves will often understand this as a call. |
|||
Wolf ( and rat and cave rat ) behaviour consists of patrolling some assigned areas.<br> |
|||
If the Wolf finds a Sheep, it will attack Sheep.<br> |
|||
If the Wolf finds a Player, it will attack player.<br> |
|||
If the Wolf is attacked, the Wolf returns the attacks.<br> |
|||
If the Wolf is severly injured, the Wolf will runaway.<br> |
|||
=== Sheep seller, Sheep buyer, Beggar === |
|||
The buyer and seller have the following set of attributes: |
|||
* <b>x</b> is the x-position of the NPC |
|||
* <b>y</b> is the y-position of the NPC |
|||
* <b>dx</b> is the x-speed of the NPC |
|||
* <b>dy</b> is the y-speed of the NPC |
|||
* <b>hp</b> is the life indicator of the NPC, when it reach 0 it is reset back to full. |
|||
* <b>atk</b> is the RP attack value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>def</b> is the RP defense value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>xp</b> is the RP experience value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>attending</b> is the object_id of the player that is actually attending. |
|||
seller, buyer and beggar tasks would be: |
|||
* <b>patrol</b> means that NPC will move around a specified path. |
|||
NPC behaviour consists of listening to people near them.<br> |
|||
If person says "Hi", NPC faces person and generates conversation.<br> |
|||
=== Player=== |
|||
The player has the following set of attributes: |
|||
* <b>x</b> is the x-position of the player |
|||
* <b>y</b> is the y-position of the player |
|||
* <b>dx</b> is the x-speed of the player |
|||
* <b>dy</b> is the y-speed of the player |
|||
* <b>hp</b> is the life indicator of the Player, when it reach 0 the player dies. See [[StendhalDesign#Dead|Dead]] |
|||
* <b>atk</b> is the RP attack value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>def</b> is the RP defense value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>xp</b> is the RP experience value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>money</b> is the quantity of money the player has. |
|||
It has three slots: |
|||
* armor |
|||
* left hand |
|||
* right hand |
|||
* backpack |
|||
Player tasks should be: |
|||
* <b>move</b> means that player will change its dx, dy params to move. |
|||
* <b>attack</b> means that player will try to damage the attacked object until its hp reach 0.<br>Another action will cancel attack task. |
|||
* <b>chat</b> means that player writes text to other players or NPCs |
|||
=== Food === |
|||
Food has the following set of attributes: |
|||
* <b>x</b> is the x-position of the player |
|||
* <b>y</b> is the y-position of the player |
|||
* <b>quantity</b> is the amount of food available |
|||
Food will be regenerated every X units of time.<br> |
|||
=== Armor === |
|||
Armor is an item that player can ''wear'': |
|||
* <b>x</b> is the x-position of the armor when player doesn't wear it. |
|||
* <b>y</b> is the y-position of the armor when player doesn't wear it. |
|||
* <b>def</b> is the RP defense value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>weight</b> is the weight of the armor. |
|||
=== Shield === |
|||
Shield is an item that player can ''wear'': |
|||
* <b>x</b> is the x-position of the shield when player doesn't wear it. |
|||
* <b>y</b> is the y-position of the shield when player doesn't wear it. |
|||
* <b>def</b> is the RP defense value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>weight</b> is the weight of the shield. |
|||
=== Weapon === |
|||
Weapon is an item that player can ''wear'': |
|||
* <b>x</b> is the x-position of the weapon when player doesn't wear it. |
|||
* <b>y</b> is the y-position of the weapon when player doesn't wear it. |
|||
* <b>atk</b> is the RP attack value. See [[StendhalDesign#RP|RP rules]] |
|||
* <b>weight</b> is the weight of the weapon. |
|||
=== Healing potion === |
|||
Healing potion is an item that player can ''wear'' inside the backpack: |
|||
* <b>x</b> is the x-position of the potion when player doesn't wear it. |
|||
* <b>y</b> is the y-position of the potion when player doesn't wear it. |
|||
* <b>heal</b> is the amount of HP the potion will heal. |
|||
==RP design== |
|||
Role playing games are based in a set of rules. There are many set of rules: AD&D, GURPS, Warhammer,...<br> |
|||
Stendhal defines a new ''typical'' set of rules, that has in common simplicity and ease of computing. |
|||
The system is based around 3 ideas: |
|||
* Randomness using 1D6 |
|||
* Risk evaluation |
|||
* Creativity |
|||
Risk evaluation gives the DM the power to weight up an action that a player wishes to perform against things like how experienced the player is in that type of action and the situation the player is in. |
|||
DM stands for ''Dungeon Master''. In Stendhal our task is to design the DM, as it rules the game. |
|||
=== Attributes === |
|||
Each player has a set of attributes that are: |
|||
* <b>attack</b> - this value is used to resolve attack situations. |
|||
* <b>defense</b> - this value is used to resolve situations where the player is attacked. |
|||
* <b>hp</b> - this value stored the live points available. |
|||
* <b>level</b> - this starts off as zero when the character is created and will increase related to experience |
|||
* <b>experience</b> - this is the amount of experience gained at the current level |
|||
The hardest part of any RP is to give balance to the values different entities has. |
|||
We need to give RP(atk, def and hp) values to: |
|||
====Player==== |
|||
Let's make our starting player to be: |
|||
* <b>ATK</b> - 2 |
|||
* <b>DEF</b> - 2 |
|||
* <b>HP</b> - 100 |
|||
These values have been set randomly. |
|||
====Sheep==== |
|||
A sheep can't attack, so it has to be weaker than player. |
|||
* <b>ATK</b> - 0 |
|||
* <b>DEF</b> - 1 |
|||
* <b>HP</b> - 30 |
|||
These values have alse been set randomly according to player values. |
|||
Killing a sheep won't report you any experience. |
|||
====Rat==== |
|||
A rat is the simplest enemy you can find in Stendhal, so it has to be simple enought for a Level 1 player to kill. |
|||
* <b>ATK</b> - 3 |
|||
* <b>DEF</b> - 2 |
|||
* <b>XP</b> - 5 |
|||
* <b>HP</b> - 10 |
|||
To set these values we have run a simulation until we have get the right look in the graphs.<br> |
|||
[[Image:Rat Fight.gif]] |
|||
====Cave Rat==== |
|||
A cave rat is a stronger version of a rat, so it has to be simple enought for a Level 2-3 player to kill. |
|||
* <b>ATK</b> - 6 |
|||
* <b>DEF</b> - 2 |
|||
* <b>XP</b> - 10 |
|||
* <b>HP</b> - 20 |
|||
To set these values we have run a simulation until we have get the right look in the graphs.<br> |
|||
[[Image:Caverat Fight.gif]] |
|||
====Wolf==== |
|||
A wolf is a common creature on plains and forest, it has to be simple enought for a Level 4-5 player to kill. |
|||
* <b>ATK</b> - 6 |
|||
* <b>DEF</b> - 4 |
|||
* <b>XP</b> - 18 |
|||
* <b>HP</b> - 35 |
|||
To set these values we have run a simulation until we have get the right look in the graphs.<br> |
|||
[[Image:Wolf Fight.gif]] |
|||
=== Experience and levels === |
|||
All of the attributes can be increased during the game through gaining experience and levels. |
|||
Experience is awarded by DM for several reasons: |
|||
* good roleplaying |
|||
* use of skills |
|||
* combats |
|||
Experience can't be gained by training. |
|||
When you gain a level you can increase one of the attributes. |
|||
To reach a level you need to reach the next experience points: |
|||
<table border=1 align=center> |
|||
<tr bgcolor=black><td><font color=white>Level</font></td><td><font color=white>Experience needed</font></td><td>HP value</td></tr> |
|||
<tr><td>0</td><td>0</td><td>100</td></tr> |
|||
<tr><td>1</td><td>100</td><td>110</td></tr> |
|||
<tr><td>2</td><td>128</td><td>120</td></tr> |
|||
<tr><td>3</td><td>384</td><td>130</td></tr> |
|||
<tr><td>4</td><td>768</td><td>140</td></tr> |
|||
<tr><td>5</td><td>1408</td><td>150</td></tr> |
|||
<tr><td>6</td><td>2432</td><td>160</td></tr> |
|||
<tr><td>7</td><td>3712</td><td>170</td></tr> |
|||
<tr><td>8</td><td>5504</td><td>180</td></tr> |
|||
<tr><td>9</td><td>7808</td><td>190</td></tr> |
|||
<tr><td>10</td><td>10624</td><td>200</td></tr> |
|||
</table> |
|||
As you can deduce the HP grows at a rate of 10 per level, and ATK and DEF values are increased one on each new level. |
|||
The formula to calculate XP is: |
|||
exp = (10*level+5*level^2+10*level^3+80) |
|||
=== Combat === |
|||
Combat is a fight between two or more players. |
|||
The combat is round based. Each round takes 5 turns. |
|||
The risk to strike a player can be written as: |
|||
<pre> |
|||
Attacker.attack VS Defender.defense/6 + 1D6 |
|||
</pre> |
|||
If player is hit we need to compute the wound that has been done: |
|||
<pre> |
|||
result = Attacker.attack/6 + 1D6 VS Defender.defense |
|||
if result > 0: |
|||
Defender.hp = Defender.hp - result |
|||
end if |
|||
</pre> |
|||
Death happens when hp reachs 0. |
|||
A critical hit happens when both die rolls are 6. And the damage is equal to Attacker.attack |
|||
====Shields==== |
|||
The shield rating adds to your defense skill: |
|||
<table border=1 align=center> |
|||
<tr bgcolor=black><td><font color=white>Shield</font></td><td><font color=white>Rating</font></td></tr> |
|||
<tr><td>Buckler shield</td><td>+1</td></tr> |
|||
<tr><td>Small shield</td><td>+2</td></tr> |
|||
<tr><td>Medium shield</td><td>+3</td></tr> |
|||
<tr><td>Tower shield</td><td>+5</td></tr> |
|||
</table> |
|||
====Armour==== |
|||
Armour helps you absorb damage. |
|||
<table border=1 align=center> |
|||
<tr bgcolor=black><td><font color=white>Armour</font></td><td><font color=white>Rating</font></td></tr> |
|||
<tr><td>Leather armour</td><td>+1</td></tr> |
|||
<tr><td>Studded leather armour</td><td>+2</td></tr> |
|||
<tr><td>Scale mail armour</td><td>+3</td></tr> |
|||
<tr><td>Chain mail armour</td><td>+4</td></tr> |
|||
<tr><td>Plate mail armour</td><td>+5</td></tr> |
|||
<tr><td>Field plate armour</td><td>+6</td></tr> |
|||
<tr><td>Full plate armour</td><td>+7</td></tr> |
|||
</table> |
|||
====Weapon==== |
|||
Weapon helps you to kill :) |
|||
<table border=1 align=center> |
|||
<tr bgcolor=black><td><font color=white>Weapon</font></td><td><font color=white>Rating</font></td></tr> |
|||
<tr><td>Knife</td><td>+2</td></tr> |
|||
<tr><td>Club</td><td>+3</td></tr> |
|||
<tr><td>Spear</td><td>+4</td></tr> |
|||
<tr><td>Axe</td><td>+5</td></tr> |
|||
<tr><td>Long sword</td><td>+6</td></tr> |
|||
<tr><td>Two hand sword</td><td>+7</td></tr> |
|||
</table> |
|||
=== Dead === |
|||
The result of combat is usually dead. |
|||
When you kill a creature a corpse will appear. If you open it, you will be able to get whatever it has inside, usually food, gold, weapons, shields or armors.<br> |
|||
Each time you kill a monster you are rewarded XP. |
|||
When you are killed you reappear on city and you lose your sheep if you have one.<br> |
|||
Also to penalize dead, you are remove 10% of exp points and if it is the case you are removed HP, ATK and DEF increases because of level up. |
|||
==Logic design== |
==Logic design== |
||
The key on making Stendhal moving is to add actions. |
|||
==AI Logic design== |
|||
As we have seen each entity has a list of actions that can do. Let's see them and study they interact. |
|||
=Implementation= |
|||
==Server== |
|||
=== |
===Move=== |
||
Move action can be understand as two actions: |
|||
===Server: Game rules logic=== |
|||
Move to left,right,up or down while key is down<br> |
|||
===Server: Game world implementation=== |
|||
This action allows controlling gamer's avatar using our keyboard that is the arcade/adventure game style like Nintendo Zelda. |
|||
===Server: Game AI implementation=== |
|||
==Client== |
|||
This action should have the next set of attributes: |
|||
===Client: Game logic=== |
|||
* '''dir''' direction in which the avatar will move. |
|||
===Client: Game presentation=== |
|||
* '''speed''' speed of the avatar |
|||
We can have as many as we want of this action. The last action executed will be the only one that alters really direction and speed. |
|||
We will have our avatar moving on the world at complete units, and client will smooth it to make it appear that avatar moved just a bit. Also we want our avatar to move only N,W,S and E direction so we disable diagonal movement. |
|||
Our world will have objects, and if player collide with an object it will stop.<br> |
|||
Players, creatures and other objects in general aren't trespasable. |
|||
===Move to a position=== |
|||
This action allows controlling game's avatar using a mouse, so we can click ( or double click ) to move to the position where the mouse clicked. This mode is great for a more relaxed adventure game style like Bioware Baldur's Gate. |
|||
This action should have the next set of attributes: |
|||
* '''x''' desired x coordinate of the avatar |
|||
* '''y''' desired y coordinate of the avatar |
|||
We can only have ONE action of this type and only the latest one will be considered valid. This action is cancelled by any other action like Move, Attack, Face, ... |
|||
Both move actions will have at each end of turn, moving the avatar if it is possible dx units in the x axis and dy units in the y axis. |
|||
If avatar collides with something while moving, dx and dy will become 0. |
|||
===Face=== |
|||
This action is useful as a extra for the social side of the game; when you are talking it is often good to ''face'' the person you are talking too. So face action allows our character to look at the direction we tell it: left, right, up or down. |
|||
===Chat=== |
|||
This action is the base of any social game like a MORPG. |
|||
This action should have the next set of attributes: |
|||
* '''text''' text that the player is going to say |
|||
Due to Arianne framework it is not possible to create a yell or whisper action, when you talk, you talk for everybody in the area, that is why area design is *VERY* important to achieve a good gameplay. |
|||
===Attack=== |
|||
This action is the core of the gameplay for lots of gamers to consider the game fun. All the combat is ruled by the RP game system explained in the RP section of this page. |
|||
There are some limitations for combat right now: |
|||
* No PvP ( Player versus Player ) |
|||
* Can't attack yourself |
|||
* Can't attack NPC |
|||
We want to preserve a nice game experience so we have removed player vs player combat.<br> |
|||
We can have only ONE attack action, so choose wisely your target, and this action is cancelled by any other action but '''Chat''' and '''Heal'''. |
|||
This action should have the next set of attributes: |
|||
* '''target''' the object.ID of the player that we are attacking. |
|||
This action require that the target of the action is ''near'' our avatar. Near means that target's avatar have to be colliding with our avatar. |
|||
The attack action has the implicit meaning of following the target. |
|||
=Evaluation= |
=Evaluation= |
||
==Download the files from Sourceforge== |
==Download the files from Sourceforge== |
||
| Line 142: | Line 699: | ||
==Client== |
==Client== |
||
==Server== |
==Server== |
||
[[Category:Marauroa]] |
|||
{{#breadcrumbs: [[Marauroa]] | [[Navigation for Marauroa Users|Using]] | [[HowToWriteAdventureGamesUsingArianne|How to write games]]}} |
|||