DesignOverview

From Arianne
Jump to: navigation, search

Note: The content on this page is very old and is likely outdated. You may want to check on the irc channel #arianne.

Contents

Introduction

The following text is not complete. Please add network protocol TCP instead of UDP, Client no more in C if necessary.


What is Arianne?

Arianne is a multi player online game framework and engine to develop turn based and real time games. It is designed so you can easily create your games on our portable, robust server architecture. The server is written in Java and Python is used for writing game rules. A mySQL backend powers the server and the server communicates with players using a UDP transport channel. Our reference clients are coded using Java and C in order to achieve maximum portability. Arianne's server is totally client agnostic making it very modifiable.

Arianne has been in development since 1999. It has evolved from a tiny application written in pseudo-C++ to a powerful, expandable server framework running on the Java platform and a portable client framework written in bare C to allow total portability of Arianne's clients. However, since 1999, the key concept of Arianne has always been KISS: Keep it simple, stupid. Our goals are: simple, small, and fast.

Arianne has always been an Open source project and always will be. Each version has been written and released as GNU GPL software. We believe the right way is to give you the power to change, edit and configure whatever you want, both on clients and the server. Arianne always welcomes your contributions and modifications to the code to make this the open source reference platform for game content providers.

Arianne is playable. Arianne now supports several test games:

You can read more about them on our main page http://arianne.sourceforge.net.
Please note that the games are out of date at the moment and do not run. Please be patient until we can fix them.

What is Marauroa?

Marauroa is our portable, robust, and multithreaded server architecture. The server is written in Java and uses Python for writing your games rules. A mySQL persistence engine powers the server and allows it to communicate with dozens of players using a UDP transport channel.

Marauroa is based on a philosophy we call Action/Perception. Each turn clients can ask the server to do any action on their behalf using action requests. A Perception is then sent to the clients explaining to them what they perceive of the world around them, and hence the result of their action. Marauroa is totally game agnostic and makes very little assumptions about what you are trying to do, allowing great freedom to create whatever type of game you want.

Bugs are a fact of life, they just happen. However, Arianne is fully tested using Test Units with JUnit and cppunit. All modules are tested for most common cases, allowing better quality software to be deployed. Your cooperation in reporting problems is simply invaluable: You are our best developer and we want to hear from you.

Marauroa is based on very simple principles:

Basic Design of Marauroa

Marauroa is an arianne server application with an UDP transport.

Marauroa server is and it is built using threads. marauroad has the following set of threads:

To denote the active behavior of the thread classes their names include the word Manager. So marauroad has:

NetworkManager is the active thread that handles messages that come from the clients and converts them from a stream of bytes to a real Message object. See the Message Types document to understand what each message is for.

The pseudo code behind NetworkManager is:

forever
  {
  Read stream from network
  Convert to a Message
  store in our queue
  }

One level (conceptually) over NetworkManager is the GameManager, this is the part of the server that handles everything so that we can make the server work. Its main task is to process messages from clients and modify the state on the server to reflect the reply to that action, mainly related to:

See GameManager for a deeper understanding about what it does exactly. The hardest part of the Manager is to consider all the special cases and all the exceptions that can happen. The main pseudo code of the GameManager, if we skip exceptions, is:

forever
  {
  Wait for Message to be available

  if(Message is Login)
    {
    check player.
    ask for character
    }

  if(Message is Choose Character)
    {
    check character
    add to game
    }

  if(Message is Action)
    {
    add action to game
    }
  
  if(Message is Transfer Request ACK)
    {
    send client the content requested
    }

  if(Message is Logout)
    {
    remove from game
    }
  }

And finally RPManager is the active thread that keeps executing actions. Marauroa is, as you know, turn based, so actions when received are queued for the next turn, and when that turn is reached all the actions pending on that turn are executed.

The idea in RPManager is to split up complexity as much as possible: we have 2 entities to help it: Scheduler and RuleManager.

forever
  {
  for each action scheduled for this turn
    {
    run action in RuleManager
    }

  Send Perceptions

  wait until turn is completed
  next turn
  }

Scheduler handles the actions as they are sent by the GameManager. RuleManager is a class that encapsulates all the implementation related to rules.

Basic Design of ariannexp

Ariannexp is arianne client. It doesn't matter if you use Java, C or Python, you have an interface for connecting to an Arianne server.

The basic interface allow you to create a client like:

  connect to Server

  login with username and password

  Show available characters
  choose Character

  while game keeps running
    {
    Get perception
    apply perception to world    
    
    render world

    get inputs
    send actions
    }

  logout
Personal tools
Namespaces
Variants
Actions
Navigation
stendhal for players
portal
resources
Toolbox