[tutorial-ish thing] Basics of M&M visual assets modification

The role-playing games (I-X) that started it all and the various spin-offs (including Dark Messiah).

Moderator: Moderators

User avatar
Echo
Scout
Scout
Posts: 193
Joined: 02 Aug 2012

[tutorial-ish thing] Basics of M&M visual assets modification

Postby Echo » Mar 12 2019, 19:20

Hi guys, this is going to be a short tutorial for those just starting out with modifying Might & Magic assets. Not in a video form right now cause I just can't squeeze out the time for it, but I hope it helps someone. I'll add/modify stuff here if I think of something and find a nice free moment.

I won't be showing you how to work with any one particular thing here, like how to make an armor fit a different race or how to reshape a hat, instead I'll do my best to explain how things work and how to achieve what you want, whatever it may be. Might & Magic 6 through 8 use a rather archaic image file system, and hopefully this will help you wrap your head around it. I'll be explaining it based on Photoshop, but it's likely relevant to any software capable of viewing, modifying, and saving palettes.

1. First order of business - indexed color.

What the devil is that?
It is the devil, is what. Basically, indexed color is an image mode like RGB or CMYK only evil. Why is it evil? Because it limits your color palette and poops on your creative visions. And if you don't do things like it wants to, it will poop on you as well.

Most of the assets in Might & Magic (with the exception of, if I remember correctly, UI bits, hireling portraits, and some other junk) operate on indexed color. When you open up an indexed color image you can view its palette by clicking on the "Color Table" (in the case of Photoshop).

Image

These are all the colors present on the image, everything else you try to paint on it will just get brought to the closest one out of these.

Image

Therefore, if you want to edit a picture in any significant way, swap the mode to RGB and then resave it as indexed color generating a new palette. It will unify a lot of the colors and produce a simplified version of your thing. If you find that a massively important color got erased from your image, you can manually add it to the palette (just click on a square of color you can live without and pick what you need). Now you can use it on your indexed picture. It doesn't happen often that a color gets... disappeared like that, but it's good to know you can have great control over your palette if need be (you can even build one square by square from nothing if that's your fancy).

Remember, if you try to paste anything on top of an indexed image, the newly pasted thing will have its color unified. Which is fine, if you're pasting from an image sharing the same (or extra similar) colors, but not so fine otherwise. Swap to RGB mode first, paste the bit, then index the full thing back. If you want to create a petrified character state or a an insane genie with colorful crap around her, you cannot just easy-paste things on top of your basic face due to the palette differences.

Image

As you can see all the red colors are missing from the original genie so if I were to paste these effects on top of original genie face they would turn out gray or blue.

2. Next. Transparency.

Might & Magic 6 through 8 use sprites surrounded by eyesore colors - either cyan, yellow or magenta, predominantly cyan. That's because nobody in their right mind would use these on items so there's very little risk they would overlap with the actual art bits. But if it made you happy, you could create assets on cow dung colored backgrounds and it would still work, provided you set up the palettes correctly. So how to work with this transparency stuff when it comes to your assets:

a) make sure the color you want to be transparent is first on the palette - it doesn't happen often if you're working on existing assets, but sometimes something gets derped. If you see a full cyan/magenta/whatever frame around your item in game it means the color is not first on the palette. Fix it here and resave. It's also extra important if you're creating assets from scratch and you have to set up your own palette. Just move the background transparency color of your choosing to the first square and you'll be good.

Image

b) seeing how just the first color will be transparent, you can end up with a lot of cyan pixels all over the place if they're anything but the first color on the palette. And I mean anything but. Change one itty bitty here and there, you can't see a difference, but the game will know. The game always knows. There are two ways to fix this.

Image

One - you go pixel by pixel with your little pencil and color everything right (use magic wand with alt-right tolerance levels [0] to check where all the sneaky pixels hide).

Image

Two - just go to the palette and change all the other cyan pixels to some other color. This is fine and efficient if there's just a few of them, but if there's a lot that means you may be losing a lot of color depth from your image. If that's the case, revert the indexing, unify the cyan in RGB mode, then save it again generating a fuller palette.

Three - anything else that works. There's plenty of ways to handle this I'm sure, as long as you know what's up you can find what's easiest for you.

As a side note, let's revisit our genie. As you can see the palette here starts with two cyan squares. One is actually the center of the gem on her forehead. Make sure it's not the exact same as the background or she will have a transparent hole in her head instead! We wouldn't want that, would we?

Image

3. Item sizes in inventory.

I was surprised when I first discovered it, but what decides how many inventory squares an item takes is actually the size of the image. I expected it to be numerical somewhere, but no. So let's say you want to resize a potion from two squares to one. Potion file is two squares high and one square wide. Fit the potion in half that. Save. Voila. All your red potions now take just one square. You can do that with anything. You can resize quest items, ingredients, even armor or swords if you wanted to.

Image

The only problem is some bug in Might & Magic that makes it impossible to fill a character's inventory with 1 square items entirely. A few of them will be dead squares. Why? I don't know, but if you ever wanted to make a gem display you know what I mean. Sad stuff.

4. Items displayed on paperdolls.

Now this is a bit more tricky. While you can move a sword or a wand a bit left, right, up or down to match the paperdoll's hand, it won't always cut it. Yes, in many cases it will work - you can even try adding some empty space (covered in trasparency color) to add some wiggle room and knock an item to the side/up/down, or - for instance - make room for leg armor. But it's a very limited strategy.

Image

So here's what you do if you need to whip out the big guns. You to items.txt, you find the item you want to modify, and you play around the coordinates boxes. They will tell the game where the itemshould be. I can't tell you exactly what to put here cause I don't remember. Trial and error will get you there though, that's how I did it for the few items I modified. Find an item with a somewhat similar placement and start from there.

Image

5. And now textures.

Things like inventory items, potraits, paperdolls go into icons.lod file. Textures for the world, on the other hand, belong in the bitmaps.lod. The main difference is that you can put whatever you please in the icons.lod. Just shove it in and pat yourself on the back. Bitmaps.lod isn't as kind. It wants palettes. But that's not a problem for us anymore since we know what these puppies are and how they work.

So let's say you find grass textures in the game to be outdated. Grass in 2019 just looks better and you want it in your Might & Magic.

Image

You have to make a few files. A long time ago I made the files and used a palette utility for Might & Magic to generate me palettes then shoved it all in the bitmaps.lod folder. And sure, it worked, but that's a really crappy way to do it. You end up with too many palettes and at some point, I wager, the game is gonna barf. And that's no bueno.

So here's what you do. You get your grass picture with a bit of dirt. That's all the colors you need. You index it and grab the palette. Then you save all your other grass pictures using this same palette. Done. You have all these files and just one palette. Clean, efficient, elegant. You can do that for any texture set in the game.

You can choose [previous] when saving a new indexed image. It will apply your last used palette. Cute.
Image

One palette to rule them all!

Image

6. Disclaimer

Most of what I covered here I discovered by poking around and making dumb mistakes. I am pretty sure I got it right, but I wouldn't bet my cats on it. If I made a mistake somewhere, by all means clear it out! Feel free to maul it, post it wherever you want, and include it in trackers or whatever else. All good by me.

Also, I don't know what's up with texture sizes. When I was making my ground textures I made them significantly bigger than they were and they work just fine. But I've read a few people saying the engine can't handle it. It may just work for the ground or something. I don't know. All I can say is experimentation can yield nice results. So go forth and break your games. For science.

Kidding. Backup your files first, kids. Then break your games.

Cheers.
Last edited by Echo on Mar 12 2019, 19:24, edited 1 time in total.

User avatar
unknownone
Pixie
Pixie
Posts: 106
Joined: 10 Mar 2011
Location: Italy

Re: [tutorial-ish thing] Basics of M&M visual assets modification

Postby unknownone » Mar 12 2019, 23:37

Great tutorial, thank you for sharing this info!
I've played and enjoyed many RPGs:
MM6,MM7,MM8,MM9, Fallout 1&2, Planescape Torment, Torment: ToN, TES3, TES4

User avatar
Echo
Scout
Scout
Posts: 193
Joined: 02 Aug 2012

Re: [tutorial-ish thing] Basics of M&M visual assets modification

Postby Echo » Mar 12 2019, 23:57

My pleasure, hope it helps. If something's unclear or just needs a wider explanation, let me know. I tried to go in some logical order, but it always looks different from the perspective of someone who's not familiar with these things. And I've never made tutorials before so it's very likely I wrote something confusing :)

Also, if someone wants to do some specific thing and hits a brick wall when trying to make assets for the amazing merge I could try to clarify stuff for them as well. Ask away.

User avatar
Erisian
Leprechaun
Leprechaun
Posts: 21
Joined: 15 Mar 2019
Location: Gothenburg Sweden

Re: [tutorial-ish thing] Basics of M&M visual assets modification

Postby Erisian » Mar 15 2019, 9:36

Nice tutorial Echo - thank you.

User avatar
DaveHer
Peasant
Peasant
Posts: 54
Joined: 13 Mar 2019

Re: [tutorial-ish thing] Basics of M&M visual assets modification

Postby DaveHer » Apr 15 2019, 0:56

Thanks for the tutorial, but what program are you using. I have corel draw that I use for painting icon bitmaps they do not require a pal file. The bitmaps in the bitmaps.lod do require the file. I assume that the program you are using will supply this file. Yes or no? If no how do you do that file. Thanks. Ignore this message the program is photoshop.
Last edited by DaveHer on Apr 15 2019, 10:03, edited 1 time in total.

User avatar
GrayFace
Wraith
Wraith
Posts: 1273
Joined: 29 Nov 2005

Re: [tutorial-ish thing] Basics of M&M visual assets modification

Postby GrayFace » Apr 15 2019, 5:27

Echo wrote:Most of the assets in Might & Magic (with the exception of, if I remember correctly, UI bits, hireling portraits, and some other junk) operate on indexed color.

Only some chunks of UI, like bottom and right panels, are saved as PCX without the limitation of palettes.

Echo wrote:3. Item sizes in inventory.

Items can have up to 13 pixels of "overhang". So, an item of width 32+13 would still occupy 1 square horizontally. Same with height.

Echo wrote:Fit the potion in half that. Save. Voila. All your red potions now take just one square.

But loading a save that had old potion sizes and operating on potions would lead to inventory corruption. So, one way to deal with it is to drop the potions, save, then apply new graphics, then pick the potions up. Same problem with chests.

Echo wrote:Also, I don't know what's up with texture sizes. When I was making my ground textures I made them significantly bigger than they were and they work just fine. But I've read a few people saying the engine can't handle it. It may just work for the ground or something. I don't know. All I can say is experimentation can yield nice results.

Ground textures work in D3D, but in Software mode you won't get the result you wanted. Should work for sky texture as well. Other textures can't be made bigger for now. I'm planning to add support for that for D3D mode.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

User avatar
DaveHer
Peasant
Peasant
Posts: 54
Joined: 13 Mar 2019

Re: [tutorial-ish thing] Basics of M&M visual assets modification

Postby DaveHer » Apr 15 2019, 9:34

GrayFace wrote:
Echo wrote:Most of the assets in Might & Magic (with the exception of, if I remember correctly, UI bits, hireling portraits, and some other junk) operate on indexed color.

Only some chunks of UI, like bottom and right panels, are saved as PCX without the limitation of palettes.

Echo wrote:3. Item sizes in inventory.

Items can have up to 13 pixels of "overhang". So, an item of width 32+13 would still occupy 1 square horizontally. Same with height.

Echo wrote:Fit the potion in half that. Save. Voila. All your red potions now take just one square.

But loading a save that had old potion sizes and operating on potions would lead to inventory corruption. So, one way to deal with it is to drop the potions, save, then apply new graphics, then pick the potions up. Same problem with chests.

Echo wrote:Also, I don't know what's up with texture sizes. When I was making my ground textures I made them significantly bigger than they were and they work just fine. But I've read a few people saying the engine can't handle it. It may just work for the ground or something. I don't know. All I can say is experimentation can yield nice results.

Ground textures work in D3D, but in Software mode you won't get the result you wanted. Should work for sky texture as well. Other textures can't be made bigger for now. I'm planning to add support for that for D3D mode.

@GrayFace,
Hi, I like the work you are doing for us fans of MM6-8. I am making some Quests for The Chaos Conspiracy mod and using the examples you give at the guild for MMExtention 2.2. the quests works fine, except for one little problem "KeepQuestItem = true" I do not want to keep quest item. I tried it with = false and I got and error message form the console. Something about the inventory. I tried other commands. Same thing about the inventory. There must be some command so as to not to keep the quest item. Also I use your script for Decompiling evt files. Some of the quests are in the globle.lua. I need to convert it back to Globle.evt. There must be a program or a Script to do this. Thanks. P.S. I felt that Sutter's Bay and Ellesia did not have enough Quests. I do not intend to upload the mod without the own's permission. What happen to the owner? I studied the console error and changes would have to be made to LocalizationAndQuests in Structs\After line 319 and EventsList in Core line 63, which will allow removal of items from inventories in MM6 and mm7. Your example quests do work with mm6 except removing items from inventories.
Last edited by DaveHer on Apr 16 2019, 2:31, edited 1 time in total.

User avatar
DaveHer
Peasant
Peasant
Posts: 54
Joined: 13 Mar 2019

Re: [tutorial-ish thing] Basics of M&M visual assets modification

Postby DaveHer » May 7 2019, 0:21

@Echo
you mentioned "a palette utility for Might & Magic to generate me palettes" What is that utility and where can I get it.
I never used photoshop before. So I did not know that it saved palattes as act. Ignore this post. Thanks David
Last edited by DaveHer on May 15 2019, 20:19, edited 1 time in total.


Return to “Might and Magic”

Who is online

Users browsing this forum: No registered users and 7 guests