Tux History



Educational games in the free software world are very important. In many places, proprietary software isn't accessible for the big majority of the population. The high cost of the software is a problem, and free software must be a alternative in this area.

As far as I know, there is no history game alternative in the Free Software world. This is a big problem that we need to solve.

The game

The idea is make a strategy game that uses the real time strategy mode like Age of Empire (all in 2d), but should be focused on a economic, cultural, military and science development of the different civilizations. Establish some civilizations and ages of development of each civilization. Each new age will provide to the culture new building, technology and units, advantages. The players must recreate the history of each civilization playing like the big ones: Alexander the Grate, the Roman Empire, the Maya or Aztek culture, etc... Of course the idea here is that we provide some campaigns, but the community should write new ones, recreating the history of each country, culture, etc... Imagine: a Nepal teacher want to teach the history of his country, but no software is available for this, so he can create a camping special for his students. The best of this campaigns can be included in the default package.

The plan

Use the existing work of ?Tux4Kids: I plan to use the building system, the main menu functions, internationalization, and sound / graphics loading.

The game need also write the “Isometric game” functions that the game need to Draw, and interact with the player. Then a a calculation system using the game rules on the object collection and the map grid. The map, with the different elements and of course a map representation system will be a XML file. The campaign file should be a tar file with a basic basic description XML file of the campaign, the map files, and the game logic, extensible with LUA[1] scripting. The XML files will be easy to parse with Mini-XML[2]. Finally the game needs a basic AI engine, this can be written in a extensible module, using lua to handle the main functions. In the future the game will need a map editor, a campaign editor, and a network mode. This will be not included in the project for this summer because of time.

I know that write a new game for a SoC project is a risky matter, but I'm sure it is possible. A big way is already done with the existing infrastructure, so I need only work on the internals of the game. Of course some important features will not be a goal at the end of the summer (visual map designer, a complete AI, etc...) and some other will need still work, but the main body of the game can be completed! I also want to reuse some code from other GPL or compatible games to improve time of development[3][4] And, as you know I'm a regular contributor to ?TuxMath so you can be sure I will maintain the game.


Create the internal routines for a isometric game type (graphic, logic and data structures).

Make a technology/buildings/unity tree for 2 civilizations.

Calculate the status of the game and the changes in it.

Write necessary routines to load the campaign and map files

Draw the “basic” sprites for the game.


April 30 – May 23: This is the pre-summer period, so I can draw the basic sprites for the game. I mean, terrain, animals, buildings and unit images. I also will search the web to find some GPL compatible art work in other games that I can use. (Done for terrain tildes, not so for buildings and units. maybe a very big challenge!)

May 24 – May 26: Set up the git repository, cloning the tuxmath source, removing the tuxmath specific files, and adding the needed libraries to the autotools files. (Done)

May 26 – June 20: Write the isometric game representation in data structures, draw functions, and interactions with the end user. (Done except the user interaction)

June 20 – June 30: Create the XML file loaders to load the maps and the campaign files. (Done except the campaigns)

July 1 – 25 July: Write the game logic internals and create their interfaces for the LUA scripting.

July 25 – 9 August: Add the needed GUI interfaces to the game.

Git Repository

You can clone a local copy git clone git+ssh://YOUR_ALIOTH_USERID@git.debian.org/git/tux4kids/tuxhistory.git

if some one want a read-only local copy git clone git://git.debian.org/git/tux4kids/tuxhistory.git

and the web version: http://git.debian.org/?p=tux4kids/tuxhistory.git


At this moment the maps in ?TuxHistory will be generated with the isometric terrain graphs of ?FreeCol. The licence issues will be included wen ?TuxHsitory is in usable stage.

Map File

The Map file is a basic XML file. You can see a simple map file with one tilde.

<?xml version="1.0"?>



You can use the next terrain argument for the terrain tags:


For Developers

Here are the most important and new global vars for the game:

// From tuxhistory.h and setup.c

th_map **map; // Is the array where TuxHisotry stores the read values from XML file
th_obj *objects; // This one is a array that contains all the objects of the game.
surface map_image; // The rendered map

And here are the respective structures:

// in map.h

typedef struct {
    int x, y; // (x,y) in the th_map array
    int type;
    int live; // 100 to 0 
    char name[30];
    int defence;
    int attack;
    int move; 

typedef struct {
    int height; //Height of this tilde
    int terrain;
    th_obj *obj;// Pointer to object

So we also have some auxiliary important variables and constants:

// map.h

int x_tildes;
int y_tildes;

// and the imagen variables
// from tuxhistory.h and fileops_media.c

extern SDL_Surface* terrain[];
extern SDL_Surface* objects[];

Interesting projects

http://foodforce2.com; http://www.freecol.org/; http://www.wesnoth.org/;


[1] http://www.lua.org [2] http://www.minixml.org/

Additional info: