Difference between revisions of "Programming"

From FreeOrionWiki
Jump to: navigation, search
m
(High-Level Structure of FreeOrion Code)
Line 8: Line 8:
 
* [[Code Standards]]
 
* [[Code Standards]]
 
* [[Adding and removing source-files]]
 
* [[Adding and removing source-files]]
 +
 +
==High-Level Structure of FreeOrion Code==
 +
 +
There are three FreeOrion modules: the human client, the server and the AI client. The server creates the game, and sends it out to the clients. Clients issue orders, which the server executes before updating the gamestate each turn and sending the new gamestate to the clients.
 +
 +
The gamestate comprises a Universe and a set of Empires. The Universe contains various UniverseObject subclasses: Buildings, Planets, Systems, Ships. Empire keeps track of individual empires: research and production status, homeworld, explored systems.
 +
 +
Various bits of game content are stored in manager classes, like TechManager. Techs, Buildings, Specials, etc. are defined in text files, which are parsed when the game starts up. The manager classes provide access to this info from anywhere that needs it.
 +
 +
Each screen in the UI has its own class, in which all the windows and widgets are objects. Most UI screens are objects contained within the MapWnd object. Generally UI classes communicate with classes they contain by calling public methods, and classes that contain them by emitting signals which the containing object has connected to various functions.

Revision as of 16:53, 4 June 2008

FreeOrion is being coded with C++, Boost, Python, OpenGL and GiGi. The programming lead is Tzlaine.

If you want to contribute, please speak to Geoff the Medio or Tzlaine.

A list of programming tasks to be completed can be found in Programming Work.

For information on procedures, code standards, etc:

High-Level Structure of FreeOrion Code

There are three FreeOrion modules: the human client, the server and the AI client. The server creates the game, and sends it out to the clients. Clients issue orders, which the server executes before updating the gamestate each turn and sending the new gamestate to the clients.

The gamestate comprises a Universe and a set of Empires. The Universe contains various UniverseObject subclasses: Buildings, Planets, Systems, Ships. Empire keeps track of individual empires: research and production status, homeworld, explored systems.

Various bits of game content are stored in manager classes, like TechManager. Techs, Buildings, Specials, etc. are defined in text files, which are parsed when the game starts up. The manager classes provide access to this info from anywhere that needs it.

Each screen in the UI has its own class, in which all the windows and widgets are objects. Most UI screens are objects contained within the MapWnd object. Generally UI classes communicate with classes they contain by calling public methods, and classes that contain them by emitting signals which the containing object has connected to various functions.