HowToWriteAdventureGamesUsingArianne: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>MiguelAngelBlanchLardin |
imported>Hendrik Brummermann No edit summary |
||
| (150 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 154: | Line 161: | ||
However, this simple system is powerful enough to code nearly all games easily: both real-time and turn based games. |
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. |
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. |
||
| Line 165: | Line 172: | ||
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. |
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. |
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. |
||
| Line 173: | Line 180: | ||
The whole game area will look like: |
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> |
It is split into 5 different areas to use the multizones feature of Arianne.<br> |
||
| Line 197: | Line 204: | ||
http://arianne.sourceforge.net/wiki_images/plains.jpg |
http://arianne.sourceforge.net/wiki_images/plains.jpg |
||
| ⚫ | |||
| ⚫ | |||
==Entities design== |
==Entities design== |
||
| Line 293: | Line 302: | ||
====Sheep's user case==== |
====Sheep's user case==== |
||
Sheep is our key game concept. |
Sheep is our key game concept. The player must shepherd their lambs, protecting them wolves and such until they are worth selling. |
||
<pre> |
<pre> |
||
Sheep is in Farm |
Sheep is in Farm |
||
| Line 310: | Line 319: | ||
====Wolf's user case==== |
====Wolf's user case==== |
||
Wolf is the |
Wolf is the competitive entity on Stendhal. They join to attack sheep and often also players. They can kill a sheep quickly. |
||
<pre> |
<pre> |
||
Wolf moves |
Wolf moves |
||
| Line 473: | Line 482: | ||
* <b>experience</b> - this is the amount of experience gained at the current level |
* <b>experience</b> - this is the amount of experience gained at the current level |
||
====Entity Attribute values==== |
|||
The hardest part of any RP is to give balance to the values different entities has. |
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: |
We need to give RP(atk, def and hp) values to: |
||
====Player==== |
|||
Let's make our starting player to be: |
Let's make our starting player to be: |
||
* <b>ATK</b> - 2 |
* <b>ATK</b> - 2 |
||
| Line 485: | Line 493: | ||
These values have been set randomly. |
These values have been set randomly. |
||
====Sheep==== |
|||
A sheep can't attack, so it has to be weaker than player. |
A sheep can't attack, so it has to be weaker than player. |
||
* <b>ATK</b> - 0 |
* <b>ATK</b> - 0 |
||
| Line 494: | Line 502: | ||
Killing a sheep won't report you any experience. |
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. |
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>ATK</b> - 3 |
||
| Line 502: | Line 510: | ||
To set these values we have run a simulation until we have get the right look in the graphs.<br> |
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. |
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>ATK</b> - 6 |
||
| Line 512: | Line 520: | ||
To set these values we have run a simulation until we have get the right look in the graphs.<br> |
To set these values we have run a simulation until we have get the right look in the graphs.<br> |
||
[[Image:Caverat Fight.gif]] |
|||
http://arianne.sourceforge.net/wiki_images/caverat.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. |
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>ATK</b> - 6 |
||
| Line 522: | Line 530: | ||
To set these values we have run a simulation until we have get the right look in the graphs.<br> |
To set these values we have run a simulation until we have get the right look in the graphs.<br> |
||
[[Image:Wolf Fight.gif]] |
|||
http://arianne.sourceforge.net/wiki_images/wolf.gif |
|||
=== Experience and levels === |
=== Experience and levels === |
||
| Line 627: | Line 635: | ||
The key on making Stendhal moving is to add actions. |
The key on making Stendhal moving is to add actions. |
||
As we have seen each entity has a list of actions that can do. Let's see them and study they interact. |
As we have seen each entity has a list of actions that can do. Let's see them and study they interact. |
||
| ⚫ | |||
Our main entity is Player, it is gamer's avatar in stendhal world and as such, it is able to do the next set of actions: |
|||
===Move=== |
|||
Move action can be understand as two actions: |
Move action can be understand as two actions: |
||
Move to left,right,up or down while key is down<br> |
Move to left,right,up or down while key is down<br> |
||
This action allows controlling gamer's avatar using our keyboard that is the arcade/adventure game style like Nintendo Zelda. |
|||
This action should have the next set of attributes: |
This action should have the next set of attributes: |
||
* ''' |
* '''dir''' direction in which the avatar will move. |
||
* ''' |
* '''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 |
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. |
|||
| ⚫ | |||
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 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. |
||
| Line 652: | Line 664: | ||
If avatar collides with something while moving, dx and dy will become 0. |
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. |
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 is the base of any social game like a MORPG. |
||
| Line 663: | Line 675: | ||
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. |
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. |
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. |
||
| Line 671: | Line 683: | ||
* Can't attack NPC |
* Can't attack NPC |
||
We want to preserve a nice game experience so we have removed player vs player combat. |
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'''. |
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'''. |
||
| Line 681: | Line 693: | ||
The attack action has the implicit meaning of following the target. |
The attack action has the implicit meaning of following the target. |
||
==AI Logic design== |
|||
=Implementation= |
|||
==Server== |
|||
===Getting ready=== |
|||
===Server: Game rules logic=== |
|||
===Server: Game world implementation=== |
|||
===Server: Game AI implementation=== |
|||
==Client== |
|||
===Client: Game logic=== |
|||
===Client: Game presentation=== |
|||
=Evaluation= |
=Evaluation= |
||
==Download the files from Sourceforge== |
==Download the files from Sourceforge== |
||
| Line 698: | Line 699: | ||
==Client== |
==Client== |
||
==Server== |
==Server== |
||
[[Category:Marauroa]] |
|||
{{#breadcrumbs: [[Marauroa]] | [[Navigation for Marauroa Users|Using]] | [[HowToWriteAdventureGamesUsingArianne|How to write games]]}} |
|||