Master of Magic

Master of Magic

Not enough ratings
2D images - modding guide
By A'vee
This guide explains the steps to mod your own 2D images for spells, units, wizards and adventure events.
3
   
Award
Favorite
Favorited
Unfavorite
Introduction and General Information
This short guide aims to explain how to add your own images to the game, to either replace or extend those included in the base game. For a more comprehensive modding guide, go to 'Modding Guide' by leto.

No additional tools are necessary, but having a good XML editor (such as Notepad++) makes it easier.

All 2D images that are referenced in the XML database files can be replaced.
These XMLs are located in \ExternalAssets\Database which sits in your game folder.

The game will only accept images in .jpg and .png format.

When entering the filename in the XML database, do NOT include the extension in the filename.

Make sure that each file has a unique name - it is NOT permitted to have files with the same name even if they have a different extension (i.e. myhero.jpg and myhero.png).

Images will have various dimensions - if the ones you add have a different size, they will be stretched to match the container they need to be displayed in inside the game.

Place the images you want to add inside \AppData\LocalLow\MuHa Games\MoM\Mods\YOUR_MOD_NAME\Images folder.
Skills, enchantments, buildings, resources, artefacts
Skills images are located in DB_SKILL.xml
Enchantments are in DB_ENCHANTMENT.xml
Buildings are in DB_BUILDING.xml
Terrain resources are in DB_TERRAIN_RESOURCE.xml
Artefacts are in DB_ARTEFACT.xml

The artwork for their icons is a single square texture, recommended size is 256 x 256px.

For each of the above assets, you can change the icon by modifying the value in the Graphic entry, like in the examples below:

<ENCH-STASIS AllowDispel="TRUE" RemoveWhenParentIDChange="TRUE"> <DescriptionInfo Name="DES_STASIS" Description="DES_STASIS_DES" Graphic="customenchicon"/> ... </ENCH-STASIS>

<BUILDING-BARRACKS> <DescriptionInfo Name="DES_BUILDING_BARRACKS" Description="DES_BUILDING_BARRACKS_DES" Graphic="custombuildingicon"/> ... ... ... </BUILDING-BARRACKS>

If you decide to expand the list of available buildings, they will appear on the production options in construction manager, but it is not possible to add new icons to the town map.

Resources have a field called OptionalModel3dName. If you do not plan to provide a custom 3d model for the resource, this field can be used to enter a name of 3d model that is delivered with the base game. If this entry does not exist, the game will be looking for a 3d model with the same name as found in the Graphic field.

<RESOURCE-COAL> <DescriptionInfo Name="DES_RES_COAL" Description="DES_RES_COAL_DES" Graphic="customresicon"/> <OptionalModel3dName VALUE=""/> ... </RESOURCE-COAL>

Adding new 3d models is also possible - for more information, see the guide located in GAME_FOLDER\ExternalAssets\MoMAssetBundlesExporter\MasterofMagicAssetBundleExporter\

Spells
Spell images are referenced in DB_SPELL.xml

The icon artwork is a single square texture. It is used on the spell selection screen, spellbook, research, notifications, and during trade. Its recommended size is 256 x 256px.

Some spells also have another field called AdditionalGraphic - it is used for bigger images displayed when a global spell is being cast. These images have a recommended size of 1250 x 1500px.

For each of the above assets, you can change the value in the Graphic entry, like in the example below, to modify the icon:

<SPELL-HERB_MASTERY WorldCost="1000"> <DescriptionInfo Name="DES_HERB_MASTERY" Description="DES_HERB_MASTERY_DES" Graphic="customspellicon"/> ... <AdditionalGraphic VALUE="customspellglobalicon"/> ... </SPELL-HERB_MASTERY>

Race and Units
Race entries are located in DB_RACE.xml
Units are in DB_SUBRACE.xml

Race icon is used on the race selection screen (small icons) and city manager screen.
Big portrait for the race representation is taken from a selected unit indicated in the RepresentativeUnit field (mind that this is a reference to the DB_UNIT database, not an image file!). To modify the small icon, change the value of the Graphic field:

<RACE-GNOLLS BaseRace="TRUE" ArcanusRace="TRUE"> <DescriptionInfo Name="DES_GNOLLS" Description="DES_GNOLLS_DES" Graphic="raceicon"/> ... <RepresentativeUnit VALUE="UNIT-GNO_BOWMEN"/> </RACE-GNOLLS>

Units need three images:
- small portrait icon - displayed in various grids. Recommended size is 256 x 256 px,
- full body icon - shown on the Unit Info screen and construction manager. Recommended size is
1024 x 1024 px,
- marker - shown on the unit's banner on the battlefield. Recommended size is 128 x 128 px with transparency.
The icon name goes into the Graphic field.

IMPORTANT:
Full body icon does not have its own field - instead, the game will look for the filename specified in the Graphic field with a '_FULL' suffix. So you will need to put in two images into the Images folder, i.e. NewUnit.png and NewUnit_FULL.png

If you do not plan to add a custom 3d model. the field OptionalModel3dName should be used to enter a name of 3d model that is delivered with the base game. If this entry does not exist, the game will be looking for a 3d model with the same name as found in the Graphic field.

<UNIT-CATAPULT Figures="1" ConstructionCost="100"> <DescriptionInfo Name="DES_CATAPULT" Description="DES_CATAPULT_DES" Graphic="customunitimage"/> <OptionalModel3dName VALUE="Catapult"/> <Marker VALUE="custommarkericon"/> ... </UNIT-CATAPULT>

Adding new 3d models is possible - details are described in the guide located in GAME_FOLDER\ExternalAssets\MoMAssetBundlesExporter\MasterofMagicAssetBundleExporter\
Wizards
Wizard images are referenced in DB_WIZARD.xml

Artwork for wizards requires two images:
- small (Icon) - used for wizard portrait icons, diplomacy, wizard information screen and cutscenes (640 x 640px),
- big (Background) - used on the wizard selection and loading screens (14089 x 3456px, to handle 4k and ultra-wide resolutions).

Change the values in Graphic, Icon and Background entries to the desired ones, like in the example below:

<WIZARD-MERLIN> <DescriptionInfo Name="DES_MERLIN" Description="DES_MERLIN_DES" Graphic="customwizardportrait"/> ... <Icon VALUE="customwizardportrait" /> <Background VALUE="customwizardbackground" /> ... </WIZARD-MERLIN>


Events (Adventures)
Adventure images are taken from a different folder than the rest: \ExternalAssets\AdventureGraphics
There is no need to modify any databases - simply add your custom .jpg or .png image into that folder and they will be listed when you are selecting an image for your node in the Editor.
The recommended size of the artwork is 1250 x 1500 px.



15 Comments
djpowell3 19 Mar, 2023 @ 6:04pm 
thank you!
A'vee  [author] 10 Mar, 2023 @ 12:36am 
I'd suggest Photoshop or another image editing program, which would allow you to change the canvas size without stretching the image and then paint the missing pixels yourself.
djpowell3 9 Mar, 2023 @ 6:46pm 
Say I wanted to make Svarog's portrait from thea 2 into a wizard. any suggestions how to adjust the pixel size?
SevenBlueSeven 27 Feb, 2023 @ 3:22pm 
It would be so NICE if we could import the graphics from the original game as an option for visual appearances!!!
Godwin 14 Jan, 2023 @ 4:27pm 
Thanks!
Predator42 14 Jan, 2023 @ 3:18pm 
Update for noob modders like me:

Like I suspect many have, I'd been altering the base game files in order to add my custom wizards. Every time a patch hit, or if one was to say recheck file integrity on Steam, which will detect changed files and replace with the "good" ones, also erasing everything done - I would have to re-mod my stuff.

Apparently, MoM scans the Database folder EVERY TIME the game launches, and uses all XMLs in it, because just to test I dumped in a custom wizard Xenoreaver linked for me on another thread, and voila she appeared in game. Took my own customizations, and made separate XMLs out of them, and BAM! All my honeys are back.

Every other modded game I'd played - Skyrim, Fallout 4, Sims 4, Civ 4 (We The People is a GREAT mod for old Colonization fans, for any who dont know) needed you to invoke the mod somehow, or activate. Not MoM. Just dump your XML files in Master-Of-Magic\ExternalAssets\Database folder with all the others, and you are good to go.
Godwin 10 Jan, 2023 @ 12:36pm 
Thanks Predator42.
Predator42 10 Jan, 2023 @ 11:54am 
Update - after signing up for the new patch beta, which as expected broke my modding due to replacing the wizards DB, localisation, etc... I can now confirm that the filename extensions are back to no longer being needed, as that was the only edit necessary to restore my custom portraits.
Predator42 27 Dec, 2022 @ 7:35pm 
A’vee, thank you for taking time to try to help. I found a post on the Discord modding section by Xenoreaver that finally solved why nothing was showing up - apparently filename extensions ARE still needed in the DB_Wizards file, once I added them voila! all went well.

When it comes to the “serious error” the game threw up on my failed attempts to add my own wizard, I’m betting I goofed some syntax or something; Xenoreaver also linked a sample from his adding a custom wizard that I was able to download and study and I’m thinking I missed something syntax wise. I have enough programming to know a) why I’m not a programmer because b) one period, comma, space, slash etc in the wrong place and the whole thing goes blooey.

With your help and Xeno’s samples, I plan to give a custom wizard another go. I really appreciate your time and help, i was so happy to see this game released, and moddable, and many little things so far fixed or made even better than the original.
A'vee  [author] 27 Dec, 2022 @ 2:00pm 
Making a custom wizard is possible too, just copy another wizard's entry and replace the image names with names of files you have added to AdditionalImages folder. To change name and description, you will need to add strings to the language database (DB_LOCALIZATION_DES.xml). As for the traits and books - as long as their total cost adds up to 11 you should be fine.