Let's talk graphics MoM style (again).

Details about file formats, structure and contents in the original Master of Magic
User avatar
Lucern
Posts: 113
Joined: Sat Jun 02, 2007 9:13 am

Let's talk graphics MoM style (again).

Post by Lucern »

Hello everyone,

I'm trolling for hints and tips about how to add content to MOM IME when the time is right -seeing as how it's so mod-able and mod-worthy. It occurred to me that graphics will probably be the most onerous of these to implement, but it also occurred to me that this was work that could probably be done now rather than later.

So let's talk graphics. Not upgrading them. I have no interest in that, and if there were upgraded graphics, I doubt that I'd use them. MoM works. Let's talk adding graphics. The fact of the matter is that this is one of the most epic turn based games in terms of creature variety. Not many games back then would have attempted half that many races, and there they are. If I can, I'm planning to add a race or two, really, just to expand the already wealthy bestiary into some fantasy mainstays that MoM doesn't have (like goblins). Besides, as I started this whole gaming thing with Maniac Mansion, I know my way around the art of MoM's day (and well before it) - enough to know that art is not technology, and technology isn't art and that neither are entirely relevant to what makes a good game.

I know: graphics are onerous...it'll take something like 33 tasks per unit. Let's talk methodology here.

1)I know how to extract the the images into a .bmp. I do not know how to return them to a usable state that the game can read (I have yet to do any editing...so no loss if that's not how this works).

2) I am not clear either, how the names of the files generated correspond to the naming of the .bmps. I didn't see any that matched up as I poked around in the editor and my LBX/bmp huge folder.

3)How does the game tell how many figures are in a unit, and where those go? The unit images I see are always individuals, in units ranging from 1 to 7. It always just shows the one. This is obviously not only a graphics question.

4)Assuming that one edits the graphics outside of some feature in the editor I'm not seeing, does anyone recommend a graphics editor that's capable of viewing these images at a decent size while working in the pixellated SVGA form that the game uses? MS Paint obviously fits the bill in terms of the pixels, but those images aren't big enough to deal with, and anyway, it's friggen MS Paint. I'm okay with the Gimp...I'll try that I suppose once I know what I'm doing.

5) How does the game know which part of a figure is flagged for the color scheme of your wizard? Are there conventions I should know about that will keep me from misspent hours making pixel-goblins?
I don't use either? The only reference anyone made to BMPs is that is what the LBXExtract program saves off - there aren't any GIFs or BMPs used by the game, it reads 90% of the graphics straight from the original MoM LBX files (to save me pointlessly extracting and repacking graphics into a new format), and the new graphics I've had to produce I encode with my own encoding scheme (which I call .NDGBMP for want of anything else... NDG being my initials). It is non-lossy, uses a 24-bit colour palette and run length compression, so it compresses photos terribly, but does a great job on game graphics.
6) Regarding this quote from Implode from a few years back...would this encoding scheme make sense to share?

Any pieces of this puzzle anyone could help me with is appreciated. For all I know, I'm not even asking the right questions. I do know that I've just finished taking a huge round of exams, and I have a lot more free time on my hands :)
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

Re: Let's talk graphics MoM style (again).

Post by Implode »

Lucern wrote:Let's talk adding graphics <snip> If I can, I'm planning to add a race or two, really, just to expand the already wealthy bestiary into some fantasy mainstays that MoM doesn't have (like goblins).
Ok to make a key point here, you're not just talking about adding graphics then, you need to define those races + new units as well.
Lucern wrote:it'll take something like 33 tasks per unit.
That's right I think, the original MoM has one picture of the unit for the overland map, then 4 frames of the unit facing in each of 8 directions for combat = 33. Mind you, it should be possible to define different combat anims in MoM IME (e.g. if you really wanted a more detailed "walk" anim) although I've never tried it.
Lucern wrote:I know how to extract the the images into a .bmp. I do not know how to return them to a usable state that the game can read
1) Give them sensible names (like "Goblins walking in direction 4 frame 2.bmp"). 2) Put them all in the same folder. 3) In regedit, find HKEY_LOCAL_MACHINE\SOFTWARE\MoM IME. There's keys for PathToOriginalLBXes and PathToNewTextures. Add a 3rd called "PathToCustomGraphics" which gives the path to your BMPs. 4) Then it should just be a case of putting in the filenames of those BMPs in the relevant places in the graphics XML file.
Lucern wrote:I am not clear either, how the names of the files generated correspond to the naming of the .bmps. I didn't see any that matched up as I poked around in the editor and my LBX/bmp huge folder.
They're named according to the image numbers in the LBX files as they were in the original MoM, but as above you want to rename them to more sensible/recognizable names anyway.
Lucern wrote:How does the game tell how many figures are in a unit, and where those go?
Server XML file. That's also where you need to define the new race, or in the case of spells, the new spell which summons the new creature. I'm hoping once you run it and have a poke about the data it should be pretty self explanatory, but ask me if you need help.
Lucern wrote:Assuming that one edits the graphics outside of some feature in the editor I'm not seeing
Whatever you favourite graphics program is. Personally I use Paint Shop Pro 7.
Lucern wrote:How does the game know which part of a figure is flagged for the color scheme of your wizard?
Combat images - none of them are, your highmen spearment look just like his. Overland images - for the unit image itself, again none of the image is. It is however drawn on top of a square which does change colour. So all you need to worry about is setting the transparency correctly on the areas of the image outside your unit. For BMPs it treats colour FF00FF as transparent.
Lucern wrote:Are there conventions I should know about that will keep me from misspent hours making pixel-goblins?
Keep the images the same size as the original and the base point (i.e. the point where it looks like the figure is standing on) in the same place. And keep testing it as you go along to ensure you're getting expected results!
Lucern wrote:Regarding this quote from Implode from a few years back...would this encoding scheme make sense to share?
I could give you the encoder, but really there's no need, its designed to work straight from BMP files too. The main reasons the .ndgbmp file format even exists are so that 1) I can distribute MoM IME with a single MomAdditionalGraphics.ndgarc file containing ALL the graphics that aren't in the original LBXes rather than hundreds of separate files and 2) It compresses images with few numbers of colours (say <256) REALLY well so its REALLY well suited for MoM-style graphics... much better than uncompressed 24 bit BMPs. (On the flipside, it compresses full colour photos REALLY badly because its lossless ;-)

Oh and one more thing. The Server XML file contains the data. The Graphics XML file tells it what BMP/LBX/NDGARC files to use for each game graphic. You'll also have to add the new race and unit names into the English language XML file or they'll just show up with the codes (e.g. instead of "Goblins" it'll call them "RC15").

Hope this helps, would love to hear how you get on :-)

Implode.
User avatar
Lucern
Posts: 113
Joined: Sat Jun 02, 2007 9:13 am

Post by Lucern »

Thanks so much for that very detailed answer Implode. :D

I have half of the graphics for a goblin spearman unit so far as a recoloration and adjustment of the halflings to get me started with a relatively easy one. After the first one and figuring out a few things with my graphics program, this is faster than I thought it would be. First one was like 45 minutes, then 2-3 for each of the others.

I also see what you mean in terms of the editor - I went straight to the graphics without looking at it, but I see now how to do virtually everything stats wise. It also reminded me that I need graphics for workers, farmers, and rebels for any race.

One more question for now: would it be foolish to make stats in the XML editor at this point? Will new releases of MOM IME negate that work, or does this not work that way?

In any case, I'll do a little to test the graphics out. I'll change the Orcs to look like goblins briefly. The first milestone will be getting a unit to show in game. The moment that happens, I'll post a link to an image here.
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

Post by Implode »

Lucern wrote:One more question for now: would it be foolish to make stats in the XML editor at this point? Will new releases of MOM IME negate that work, or does this not work that way?
Well they'll wipe over all 3 XML files for sure, so you'll need to be careful to back up what you've got and then merge it back in each time you install a new version.

One idea I was toying with was being able to create patch XML files, so the patch would contain all the necessary entries for all 3 XML files in one place, then you could run a game with a particular patch (or patches) applied rather than having to edit the core XML files supplied with the game. It'd make adding things like you're doing much simpler... I just hadn't really made any hurry on doing it until someone was interested in doing something like this and so there became an actual need for it.
Lucern wrote:The moment that happens, I'll post a link to an image here.
Please! It'd be neat to see :)

Implode.
Dyslexic Q-Thief
Posts: 8
Joined: Fri Jan 04, 2008 3:17 am

Re: Let's talk graphics MoM style (again).

Post by Dyslexic Q-Thief »

Implode wrote:Combat images - none of them are, your highmen spearment look just like his. Overland images - for the unit image itself, again none of the image is. It is however drawn on top of a square which does change colour. So all you need to worry about is setting the transparency correctly on the areas of the image outside your unit. For BMPs it treats colour FF00FF as transparent.
Excuse me for asking, but is this for all of MoMdom or just MoM IME? I recall there being color changes in the original.
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

Post by Implode »

Dyslexic Q-Thief wrote:
Implode wrote:Combat images - none of them are, your highmen spearment look just like his. Overland images - for the unit image itself, again none of the image is. It is however drawn on top of a square which does change colour. So all you need to worry about is setting the transparency correctly on the areas of the image outside your unit. For BMPs it treats colour FF00FF as transparent.
Excuse me for asking, but is this for all of MoMdom or just MoM IME? I recall there being color changes in the original.
The only colour changes I'm aware of are from certain spells, e.g. warp creature makes your units turn purple. I've never seen units change colour according to which wizard owns them, either overland or in combat. If anyone finds otherwise, can you post a screenshot?
Dyslexic Q-Thief
Posts: 8
Joined: Fri Jan 04, 2008 3:17 am

Post by Dyslexic Q-Thief »

Implode wrote:
Dyslexic Q-Thief wrote:
Implode wrote:Combat images - none of them are, your highmen spearment look just like his. Overland images - for the unit image itself, again none of the image is. It is however drawn on top of a square which does change colour. So all you need to worry about is setting the transparency correctly on the areas of the image outside your unit. For BMPs it treats colour FF00FF as transparent.
Excuse me for asking, but is this for all of MoMdom or just MoM IME? I recall there being color changes in the original.
The only colour changes I'm aware of are from certain spells, e.g. warp creature makes your units turn purple. I've never seen units change colour according to which wizard owns them, either overland or in combat. If anyone finds otherwise, can you post a screenshot?
I checked the original. Just start building a settlers, its little flag changes depending on what color you are. It's easy to miss.
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

Post by Implode »

Dyslexic Q-Thief wrote:I checked the original. Just start building a settlers, its little flag changes depending on what color you are. It's easy to miss.
Heh, you're right, I never knew that. You get a coloured flag both in combat and there's a 3 pixel coloured flag on their overland picture too.

Its in a green colour - same colour as the city flags which change colour for the owner. I of course spotted those and had to write something special to make the city flags change colour (it draws a coloured flag over the top of the green flag on the city picture) and that code doesn't exist for units... so I bet they all come out green in MoM IME.

Can anyone spot any other units this happens on besides settlers? Heroes' flags?

Thanks,

Implode.
User avatar
Lucern
Posts: 113
Joined: Sat Jun 02, 2007 9:13 am

Post by Lucern »

A bit more than that - check out my screenies.

In the original MoM, some, but not all races seem to want to cater to your wizard's colors. The Highmen are all over it. The orcs do it more subtly. Heroes carry your flag. From what I just checked, the swordmen/spearmen don't change for the high elves, gnolls, halflings, barbarians, klaxon, nomads, or the lizardmen. I misremembered much more coloration of units, actually, thinking that the bright red nomad swordsmen shields were dependent upon their side's color. Nope, just red.


Blue High men combat
http://i282.photobucket.com/albums/kk24 ... ic_053.png
Blue High Men overland
http://i282.photobucket.com/albums/kk24 ... ic_052.png

Gold High Men combat
http://i282.photobucket.com/albums/kk24 ... ic_057.png
Gold High Men Overland
http://i282.photobucket.com/albums/kk24 ... ic_056.png

Heroes gold (and halflings who like pink despite your objections)
http://i282.photobucket.com/albums/kk24 ... ic_046.png
Heroes purple and barbarians who don't have any kind of shirt.
http://i282.photobucket.com/albums/kk24 ... ic_017.png

It's not always all that obvious either. Check out these two orcs. One example is the blue side, the other gold. (you'll probably have to save to your machine and zoom in to catch this one.)

http://i282.photobucket.com/albums/kk24 ... c_054a.png
http://i282.photobucket.com/albums/kk24 ... c_053a.png
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

Post by Implode »

Lucern wrote:It's not always all that obvious either. Check out these two orcs. One example is the blue side, the other gold. (you'll probably have to save to your machine and zoom in to catch this one.)
Lol, they wear underwear which matches your wizard colour, fantastic ;-)

I'd really never noticed this! I'd seen High Men were always green in MoM IME but never realised they changed colour in the original! Thanks for pointing it out!
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

Post by Implode »

I've updated the LBXExtract program (on the downloads page) so that it spots the 3 special colours that change to the wizard colour and saves these out as separate BMPs. The special colours (which are shades of green) are also used as genuine green colours, and so it thinks some are "wizard colours" when they're not - there's simply no way of knowing which are treated like and which aren't.

There's a lot more colour variation on the overland units than I thought because some of it is really subtle. Many of the races have slight colour changes, its easier to list those that DON'T change colour much: Halflings, High Elves, Klackons, Lizardmen, Nomads, Trolls

And that would explain why I'd never really noticed it - because I normally play Halflings or High Elves. The summoned creates are some of the funniest - I had to go try these in the original MoM to prove it really did change these colours and it does. I have to wonder if these are intentional, and if the artists didn't draw these green intending them to stay green, not realising the game would make the colours change to the colour of the wizard:

Giant Spiders, Shadow Demons and Hydras' eyes change colour (and Hydras have a lot of eyes!)

but the best one of all is that Demon Lords' underwear are green when you summon them (on the anim where they rise out of the cauldron), then they change to match your wizard colour :? This to me is a fine example where I suspect they are supposed to simply be green and not change colour.

I'll look at implementing this when I can :)

Implode.
User avatar
Lucern
Posts: 113
Joined: Sat Jun 02, 2007 9:13 am

Post by Lucern »

Thanks Implode,

lol about the demon spawn. I suppose it's a matter of figuring out which shades of green MoM picks up to recolor. I guess that can be done by opening up a hero and looking at the flag. I'm assuming the greens it uses are 3 shades (light, med, dark) so as to avoid rigid colorations of color-respondent units.

For now I'm thinking that maybe my goblins don't care what color you are, in the tradition of other fine bestial races lol. They'll always be (light yellowish) green. 33 edits per unit is enough.

Edit: and a question: MoM IME games can employ more than 5 wizards. Would there need to be an expanded (and standardized) set of wizard colors for flags and such?
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

Post by Implode »

Lucern wrote:MoM IME games can employ more than 5 wizards. Would there need to be an expanded (and standardized) set of wizard colors for flags and such?
There's standard colour flags defined for each of the wizards, e.g. Ariel is always beige, Tauron is always red. I figured that made them easier to identify...
Lucern wrote:I'm assuming the greens it uses are 3 shades (light, med, dark)
Yes, try out the new LBXExtract, it does it correctly (for units at least, it produces some spurious results on other LBX files).
User avatar
Lucern
Posts: 113
Joined: Sat Jun 02, 2007 9:13 am

Re: Let's talk graphics MoM style (again).

Post by Lucern »

I have another question...I've got .bmps for a new unit, and I've added the registry string value detailed above, but I've looked several times and cannot see where one adds them to a unit within the graphics .xml editor. I'm assuming you use the "Default Master of Magic Graphics.xml for the path"

As a test, I was going to replace halfling spearman graphics with goblin spearman graphics, and I see the frames for the halflings, but I do not see where to actually change those.

Any help is greatly appreciated.

Lucern
User avatar
Implode
Site Admin
Posts: 433
Joined: Fri Feb 24, 2006 3:35 am
Location: Newfoundland, Canada
Contact:

Re: Let's talk graphics MoM style (again).

Post by Implode »

Lucern wrote:As a test, I was going to replace halfling spearman graphics with goblin spearman graphics, and I see the frames for the halflings, but I do not see where to actually change those.
To change the unit image on the overland map, in the graphics XML editor, pick Edit -> Units -> Units on the menu, wait for it to load. Find the row for Halfling Spearmen (UN090) and double click it, and change the values to e.g.:
Image

Images for units in combat are a little more involved because some of them are single images and some are animations. If you click the 'Combat Actions >>' button, you get a list of STAND, RANGED, WALK, FLY (you might cast Flight on them :D ), MELEE. So pick for example STAND and click 'Combat Images >>'. You get at the images for the unit standing still facing in each of 8 directions, and can replace these in the same way, e.g.:
Image

RANGED is also a single image (the frame of a unit firing a ranged attack). The other 3 are all animations, so if you look for example at WALK and double click one of the entries, you can see it has an animation of UN090_D1_WALKFLY. To get at the animations, pick Edit -> Animations. So if you scroll down to the UN090 entries, you can pick for example the first one (UN090_D1_WALKFLY) and click 'Frames >>' and can then replace the image for each frame, e.g.
Image

So by the time there's 16 animations with each of 4 frames (a lot are repeated though) there's quite a lot to go through! Best of luck with it!
Post Reply