It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
I have occasionally heard references to people de compiling these games to look at he source code. Or maybe that was Wizardry?
Is there any way to de-compile Might & Magic 1? How would I go about it?
I have lots of questions that I would love to look at the code to figure out:

* Is there a list of every Bartender Tip and Rumor you can get from the taverns?
* How does the game track spells that last until you rest?
* How does the game keep track of quests?
* If I have two Sorcerers and they both cast 2-6 on someone, does it stack?
* I have noticed that sometimes an event does not activate unless I have done something first, how is it tracking that?
* I just had my alignment slip when I was ambushed, why did that happen? Am I fighting Good monsters? How am I supposed to know they are good monsters? What was I supposed to do?

etc...
Post edited January 03, 2022 by DIntent
First, check the EULA you accepted when you installed the game. Most commercial games include a clause prohibiting decompilation or other reverse engineering. MM1 is so old that it might predate the lawyers adding such a clause. If there is no such clause, then proceed.

Very few games ship their source code, and most that do did so by accident. Given its age, I expect MM1 did not ship its source. It only shipped the program you run to play the game. You can still inspect that to try to learn how the game works, but it's not nearly as easy. You will most likely need to disassemble the game. You will probably spend a significant amount of time mapping irrelevant parts of the game before you build up enough knowledge to know which parts are interesting. When you start, you won't readily distinguish code that draws a monster on screen from code that computes whether your attack hit successfully. With practice, you will learn how to recognize one from another. It will still be slow, though.

That said, some of your questions might be solvable without resorting to disassembly.

* List of bartender tips - this is probably just a set of messages somewhere, either buried in the game's executable or one of its data files. They are likely stored as literal text, rather than composed on the fly by splicing together pieces of sentences. A tool to show you all the sequences of printable text longer than 6 characters could probably reveal these, unless the developers took special steps to hide them.
* Spells are probably either a flag or a counter set on some party-specific data. If they always terminate at rest, and never through simple passage of time, then there is probably special logic in the code that implements "Party has rested" that also dispels these effects. Find the code that tells you a rest succeeded and look around from there.
* Quests are usually flags, but might be more complicated if they have the ability to fail due to a time limit.
* Sorcerers: it depends on how the game remembers you have cast the spell at all. Given the extreme memory limits in effect on games of that era, I doubt the spell would be stackable unless the manual specifically promises that it is. You would need to find the code that the game runs when the spell is cast once, and inspect what it does to the game's tracking of your party's progress.
avatar
DIntent: I have occasionally heard references to people de compiling these games to look at he source code. Or maybe that was Wizardry?
Is there any way to de-compile Might & Magic 1? How would I go about it?
I have lots of questions that I would love to look at the code to figure out:

* Is there a list of every Bartender Tip and Rumor you can get from the taverns?
* How does the game track spells that last until you rest?
* How does the game keep track of quests?
* If I have two Sorcerers and they both cast 2-6 on someone, does it stack?
* I have noticed that sometimes an event does not activate unless I have done something first, how is it tracking that?
* I just had my alignment slip when I was ambushed, why did that happen? Am I fighting Good monsters? How am I supposed to know they are good monsters? What was I supposed to do?

etc...
I can answer some of these questions for Might and Magic 2, which has a similar engine to that of MM1 (but note that there will be differences):
* Spells that last until you rest are most likely tracked with flags for binary effects, like Walk on Water. For effects like Protection from Energy/Magic, there's an 8-bit value that stores the magnitude of the effect. (It has to be an 8-bit value because MM2 allows you to see it, and at level 236+ or 246+, the effect of the spell overflows and becomes small.)
* You can only have one quest at a time; hence the game only needs to store information about that one quest. Once you complete the quest (or have it removed (via quest removal elixir in MM2; MM1 appears to have the Remove Quest spell), the game no longer keeps track of it (which means you can get the quest again). (Note that, from what I have read, there's one impossible quest that will replace any other quest you have if you get it.)
* Each attribute has both a base value and a current value. Casting Sorcerer 2-6 likely increases the current value, and in MM2 (which doesn't have this specific spell) you can check your stats during battle. In MM2, the effects most similar to this spell (like Heroism) do stack. Also worth noting that, at least in MM2, Bless does not appear to stack (it appears to be a binary state), but Holy Bonus (think that's what the spell's called) stacks (but watch out for integer overflow at high levels). (In MM2, any changes to the current value last until you rest or you finish a combat (except that, if a character individually runs away, the stats aren't returned to normal. If MM1 has this loophole, try casting 2-6 on a character, having them run away, then checking to see if the Might stat in the status screen has changed.)
avatar
advowson: * Sorcerers: it depends on how the game remembers you have cast the spell at all. Given the extreme memory limits in effect on games of that era, I doubt the spell would be stackable unless the manual specifically promises that it is. You would need to find the code that the game runs when the spell is cast once, and inspect what it does to the game's tracking of your party's progress.
In games of its era (including Wizardry 1-5, Bard's Tale 1-3, and even Final Fantasy 1-3), spells of this sort tend to stack more often than not.

One approach is to use a memory viewer, either in the emulator (either a debug version of DOSBox or some other emulator with cheat/debug tools), and search for the Might stat of the target. Then, after each cast, look for a value that's higher than the previous value. Repeat until you narrow it down to one location (in which case you can see the spell stacking), or to no locations (in which case it likely doesn't stack). Also, it might help to look for all of the character's stats in order rather than just Might; that string is more likely to be unique (though expect there to still be at least 2 copies, as both the base and the current scores need to be stored somewhere).
Post edited January 03, 2022 by dtgreene
Getting the source code is not very realistic. Hex editing is a much more likely path to explore.

Quest flags are usually done with items. If you have Item A you can advance to next stage of a quest at which time you lose Item A, but then Item A may again become available where you first picked it up. So you can never (I think) lose a quest item permanently, and there's no "quest log".
Most old DOS CRPGs worked this way.

BTW, the "MM1 Trainer" may be of interest: https://www.dropbox.com/s/4j5g3quhtqrxvoz/MM1%20Trainer.jar?dl=0
I found EXACTLY what I was looking for here: www.eskimo.com/~edv/lockscroll/WhereAreWe

Plus it makes maps! A very cool tool!
Post edited January 07, 2022 by DIntent