MG/Processing game mods

< MG

275pages on
this wiki
Add New Page
Talk0 Share

Those informations are/may be very outdated, please go to: new wiki

It can be somewhat tedious to add new game mods (maps, tilesets, techtrees) to the game mod database so here's some documentation on the internal process of adding game mod data to the database.


What to request from contributorsEdit

  • Map file, example filename: mapfile.mgm, the filename shoould be all lowercase.
  • 800x600 pixel preview image in JPEG format, the filename should be exactly the same as that of the map file, with an extra '.jpg' extension, example filename: mapfile.mgm.jpg
  • Description text, example: 3 vs. 3 player map, use tileset 'desert2', Author: newbie

Internal processingEdit

  • Place the maps in ~/.megaglest/maps and test them
  • Generate CRCs (you may use the Linux shell script below)
  • Upload files to the web server using FTP or, if available, SSH access. Place all files in the mods/maps/ directory.
  • Run SQL query against the database (using PHPMyAdmin web interface or, if available, the mysql command line / console) to add references to the new maps; see the example SQL query below


Shell script to generate checksums for all custom mapsEdit

Place this script in your MegaGlest installation (probably ~/megaglest/) or build directory and make it executable (chmod +x filename). Mine is called

# Print all CRC checksums for all maps in ~/.megaglest/maps

for filepath in ~/.megaglest/maps/*.gbm ~/.megaglest/maps/*.mgm 
  filename=$(basename "$filepath"|sed 's/\(\..*\)$//')
  ./megaglest --show-map-crc="$filename" | grep '^CRC value for map'
done | sort -k 5

Example SQL query to add maps to databaseEdit

This example SQL code would add three new maps. It was rewrapped for better readability, and while it works as such, could also be a one-liner.

INSERT INTO `glestmaps` 
  (`updatetime`, `glestversion`, `mapname`, `playercount`, `crc`, `description`, `url`, `imageUrl`, `disabled`) 
  (CURRENT_TIMESTAMP, '', 'no_masters.mgm', 6, -147021482, 'Small to medium map for 2-6 players or 1-3 vs. CPU\nDo NOT use with tilesets Karningul, Pine Peat or Swamp\n\nMap author: atze', '', '', '0'), 
  (CURRENT_TIMESTAMP, '', 'renkontre.mgm', 6, 42644594, 'Small to medium map for 2-6 players or 1-3 vs. CPU\n\nMap author: atze', '', '', '0'),
  (CURRENT_TIMESTAMP, '', 'tour_de_force.mgm', 6, -95475776, 'Small to medium map for 2-6 players or 1-3 vs. CPU\n\nMap author: atze', '', '', '0');

You will probably not add exactly three new entries, so make sure you do not mix up , on the one hand (which separates entries to make as well as fields) and ; on the other hand (which separates SQL statements, i.e. you probably only want one and only in the very end).

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.