Skip to content

Marfullsen/AoE2-minimap-generator

Repository files navigation

AoE2 Minimap Generator

Python Pillow Mgz

Screenshot Walls

Description

Minimap generator for Age of Empires 2 savegames.

Features

Vesion 1.1

  • The bugs with some map sizes were fixed.
  • Walls are now displayed on the minimap.
  • All code was unified to a single 'main.py' file.
  • New screenshots added to the readme.
  • The code was tidied up, funcions are now more readable.

version 1.0.

  • Generate minimap from a saved game (.mgl, .mgx, .mgz and .aoe2record files).
  • Rotate the map and add transparency to the background.
  • Display the location of each player.
  • Display the piles of gold and stone resources.
  • Display the food resorces (berry bushes, animals like sheeps, fishes, boars, etc.)
  • Display Relics on the minimap

Dependencies

  • mgz (Also via pip: pip install mgz)
  • Pillow. (also via pip: pip install Pillow)

Usage

First, make sure you have Python3 installed on your machine.

Place the saved games in the same path as the Python script, then after having installed the necessary dependencies run the Python script "main.py", voilà, minimap images will be generated, displayed and saved in the same directory.

You could also move the python script called 'main.py' to your folder with the savesgames, run the script and it should work.

Installing Dependencies

Try these commands until you find one that works for you (this is because each linux distro is very picky), one of them should be suitable for you. source: this question on Stack Overflow

Linux

sudo pip3 install pillow
sudo python3 -m pip install pillow

Windows

pip install Pillow

The code inside of the Main script file.

Just scroll to the end of the file, this is the master function

Main script

Tiles colors available.

Extracted from recage/examples/map/terrainColors.json.

colors

TODOs.

✔️ Add new TODOs.

✔️ Fix bugs with some map sizes.

✔️ Add walls when fortress (or whenever).

✔️ Unify all code to a single 'main.py' file.

🔲 Create a .exe file to non-python users.

🔲 Add more tests, with more maps & more sizes.

✔️ Tidy up all the mess with the files and screenshots.

Development Screenshots

White walls

White Walls

Final without resources

No Resources

Square without resources

square_no_resources

Square with resources

square_with_resources

Square with resources and players

square_with_resources_and_players

Extra Large Player Points

Extra-Large PP

Contributing

All contributions are welcome! Feel free to open a pull request.

Credits

Thanks to aoc-mgz by @HappyLeavesAoC for the extract functions.