Modifying MegaGlest

From MegaGlest
Revision as of 07:33, 24 March 2011 by Hofmic (talk) (Use of {{Main}} instead of the messy way)
Jump to: navigation, search

Glest is a highly moddable game, with nearly every aspect from the menus to the factions, [[techtrees], maps, tilesets, and scenarios being modifiable. This includes the creation of entirely new files or modifications of existing ones.

Components

XML files

Glest uses XML files and folders to organize and instruct the engine how to play mods. Techtrees, factions, tilesets, and scenarios all use XML files as a means of holding data. These XML files can be edited in any plain-text editor.

G3D files

Main article: G3D

Glest uses its own 3d format for 3d models, called G3D. Models can be exported from Blender or 3DSMax.

Textures, the graphics that tell how the model's surface should look, are stored as separate files. In regular Glest, they must be either an uncompressed TGA or BMP. GAE and MegaGlest add support for JPG and PNG as well.

Image files

Textures are the main use of image files, as well as icons in game, and surfaces in tilesets. They are also used in the menu core data. Regular Glest only supports uncompressed TGA and BMP, though GAE and MegaGlest add support for JPG and PNG as well. This applies to all instances of images, with PNG being the most versatile format.

Techtrees

Main article: Techtrees

Techtrees are methods of storing factions. In addition to the factions they contain, they define the resources and damage multipliers in their respective folders and XMLs.

Factions

Main article: Factions

A sub-unit of techtrees (but often made standalone to go in pre-existing techtrees), factions define the units, upgrades, and starting units of a faction.

Tilesets

Main article: Tilesets

Tilesets are a collection of surface images and object models, combined with an XML file controlling the settings of how each map should look. The object models, for example, can instruct Glest what model to use for trees on maps, or how the surfaces of the map will look. They do not actually change the map itself, just how it looks.

Maps

Main article: Maps

Maps are small binary files made with the map editor. They control the heights, placement of objects and resources, player positions, map size, etc. All those settings are defined in the map editor, rather than using any form of XML. They cannot change how the objects in the map, such as the trees, will look though (that can only be done by tilesets), but can change the positioning of them only.

Scenarios

Main article: Scenarios

Scenarios, which includes tutorials, are XML files which tell the game which predetermined settings (such as which map) to use. They are generally combined with Lua scripting to allow added depth and to allow them to do things not normally possible in the game, such as telling a story, having a campaign, enforcing the AI, or otherwise creating novelty in the game.

Core Files

The core files, which are the files seen without choosing something in the custom game or scenario screens, are those such as menu buttons, the background model, etc. These are the files found in the data/core folder of Glest, and are sometimes modified for full conversion mods. GAE moves these files a few directories up and into a gae folder to allow addon support.

Addon Format

The addons format is a method of formating the folders in a distributed mod to ensure it is easiest to install (GAE users can simply copy the archive to their addons folder, while Glest and MegaGlest users need to only extract the archive into the installation directory). It is done by having all folders relative to the share/glestae folder (in GAE) or the installation directory (in Glest/MegaGlest). The name of the archive can be any unique name (preferably including version numbers and the name of the mod) while the folder structure must always be constant. Think of it as having the archive merged with the installation directory (or share/glestae directory in GAE).

Examples

Packaging a techtree named "my_techtree" would have the folder structure:

archive_name.7z/techs/my_techtree/[..]

Or if you had a mod pack that was distributing various maps, a techtree, and a tileset:

archive_name.7z/techs/my_techtree/[..]
               /tilesets/my_tileset/[..]
               /maps/[..]

In short, you can pretend the archive was the installation directory or share/glestae directory.

Scenarios

GAE and Glest/MegaGlest store scenarios in different folders. This is great for preventing engine specific code from getting mixed up, but if your mod uses scenarios that are compatible with both engines, then you will have to have two instances of the scenario. In GAE, scenarios are stored in gae/scenarios whereas in MegaGlest, they are stored in scenarios and tutorials. As well, GAE has a further folder after scenarios which is the category to place the scenario in (default categories are "glest_classic" and "glest_tutorials"). Because the non-supporting engines will ignore the extra folder, you can use both locations. For example:

Having "my_scenario" work in all engines:

archive_name.7z/gae/scenarios/[category]/my_scenario/[..]
               /scenarios/my_scenario/[..]

Having it work in just GAE:

archive_name.7z/gae/scenarios/[category]/my_scenario/[..]

Or in just Glest/MegaGlest:

archive_name.7z/scenarios/my_scenario/[..]

See Also

External Sites