GrayFace / Misc

Repository of my Delphi tools, MM patches etc.
Other
46 stars 7 forks source link

Some more MM7 bugs #14

Open Tomsod opened 3 years ago

Tomsod commented 3 years ago

Hello again! I've uncovered a bunch of new bugs in MM7 that you may be interested in. Some of them are fixed in the new release of my mod, you can look at elemental.c if you're curious.

  1. Potions of Bless, Stoneskin, and Heroism do not improve their effect with higher potion power, only duration. This makes them nearly useless, as any other source of these buffs will be stronger. This is not necessarily a bug, could be just bad design. Nevertheless, I fixed this in my mod.

  2. OnLeaveMap event doesn't trigger when using stables or a boat. I fixed this one.

  3. Faerie Pipes quest award is only given to the currently active player (gamescript bug, fixed).

  4. Archibald is only supposed to give you a blaster if you enter Eeofol with the "kill Xenofex" quest active (obvious gamescript bug, fixed).

  5. White barrels do not randomly generate (fixed).

  6. In the Wall of Mist, barrels refill on each visit. This might not be a bug, but it's very exploitable, and I fixed this.

  7. Pickpocketing an item produces a garbage message, both in English and Russian translation (fixed).

  8. If Cure Insanity or Raise Dead fail due to waiting too long, they still apply their side effects (weakness, and for the latter, HP is set to 1). Also it's theoretically possible that Raise Dead would cure death but fail to cure unconsciousness that was in effect for longer (both fixed).

  9. Resurrection claims to have reduced recovery with high skill, but it's not implemented (unfixed, suits me just fine).

  10. Enchant Item always pulls special enchantments from treasure level 3 pool, even though standard enchantment power corresponds to levels 4 and 5 on Master and GM, respectively (fixed).

  11. Also, a minor exploit: even though normally the power of "of Arms", "of Dodging" and "of the Fist" enchantments is halved, Enchant Item doesn't respect this, so it's possible to get these enchantments with abnormally high power (up to +17). I fixed this one, but it's not a big deal.

  12. Mass Distortion has two resistance checks: one, debuff-like, to avoid its effect entirely, and another to reduce the damage if the first one fails. Seems to harsh for me, so I fixed this.

  13. GM Protection from Magic can protect from being executed in castles. I think the gamescript tried to prevent this by setting "Dead" to 1 instead of 0, but the proper syntax here is Add("Dead", 0) (fixed).

  14. Archers can't shoot fire arrows due to a wrong projectile name (fixed).

  15. Sacrifice is stated to cure conditions and aging, but it doesn't (fixed).

  16. Master Healers erase all armor skills when they heal the party. A most peculiar bug, I've no idea what that code was supposed to do (fixed).

  17. Buff duration strings are a bit buggy, they can read as "x days y seconds" when it should be "x days z minutes" or even just "x days". It's because the seconds bit only checks the hours being 0, not days (fixed).

  18. Water Walk drains power every 5 minutes instead of every 20 (fixed).

  19. Slow is supposed to last 1 min/skill on Basic and 5 min/skill on Expert+, but it's actually 3 min/skill on all levels. (I reworked this entirely.)

  20. Turn Undead is 1 min/skill on Expert instead of 3 min/skill, and doesn't have reduced recovery on GM. (Also unfixed.)

  21. Control Undead has a slightly wrong description, seemingly copypasted from Enslave.

  22. "of Feather Falling" enchantment isn't generated randomly (the maximum enchantment ID is one less). Perhaps it's for the better, as it's slightly buggy, too.

  23. Alchemical explosions can occasionally break hardened items, as a wrong item is checked for breakability (fixed).

  24. Elven Chainmail is supposed to reduce recovery, but like in MM6, this bonus is nonfunctional (I removed it entirely).

  25. Ania Selving's bonus to bow skill doesn't affect damage at GM (fixed).

  26. Without a bow, ranged damage displays as "N/A", but this string isn't localized (fixed).

  27. The Body resistance well in the Maze is supposed to be usable once per day, but the script is broken (fixed).

  28. Stealing a wand from Mr. Malwick often puts garbage values in its max charges field (fixed).

  29. Falling from Celeste is supposed to choose one of six possible Bracada locations, but the script lacks Exit commands (fixed).

  30. Dwarven guards have abnormally large radius, and as such often get stuck in doorways and block passages (fixed).

  31. Peaceful monsters on the current map (e.g. the party's Golem) enable rest encounters (fixed).

  32. The weather always starts sunny until you spend a day or so in the new region. This breaks Evenmorn mist, among other things (fixed).

  33. Bracada docks teleporter is slightly off-target (fixed).

  34. Resting in dark region taverns often takes too long (24+ hours) (fixed).

  35. Clubs and wetsuits have garbage recovery values (I fixed clubs, at least).

  36. Hunter NPC and Hunter class have the same string resource. This breaks Russian translation (fixed).

  37. Castle Harmondale bookshelves check for School of Sorcery membership (fixed).

  38. In the Grand Temple of Moon, the pit trap and altar color reset after game reload (fixed).

  39. Drowning deals fire damage! I changed this to cold.

  40. Traveling on foot does not erase ground items list, so they sometimes are duplicated in the new region (fixed).

  41. In the Walls of Mist, some facets of keystone pillars aren't clickable (fixed).

  42. Dragons and titans drop too little gold due to integer overflow (fixed).

  43. Your bug: in the Russian translation, the door in Hall of the Pit is labeled as "Chest".

  44. Mace paralysis checks earth resistance for some reason (fixed).

  45. Gibbet doesn't slay dragons or demons, only undead (fixed).

  46. Troglodyte slaying, griffon slaying, and tapestry stealing quests adjust the reputation for each party member, leading to 4x gain or loss (fixed).

  47. Occasionally the game crashes when loading a save inside Lincoln's entrance room. I wasn't able to get to the bottom of this.

  48. When generating a random item, it occasionally defaults to the first item in category (Torch Light, empty potion bottle, a rusty sword etc.), even on high treasure levels. Haven't investigated this yet.

  49. Can't swap an spear equipped in two hands for a sword (unfixed).

  50. Recovery times seem to be carried across game reloads sometimes (perhaps only in turn-based mode) (unfixed).

  51. Nighon HP and SP wells restore 25 points, but the messages say 50 (unfixed).

  52. In Tatalia, kergar ore on the ground has erudine sprite. And in Erathia there's siertal that looks like phylt (unfixed).

  53. Casting a spell on the very first (ID 0) item in the inventory sometimes chooses a garbage target because the code thinks 0 is "no target" (unfixed).

  54. Clanker's quest device and altar in the Sun Temple reset after reload (unfixed).

Sorry if I'm too succinct, but there's a lot of them this time. You can ask if anything needs clarifying.

Tomsod commented 3 years ago

And I also have a request. If you're going to fix these bugs in the next patch version, could you also expose DisabledHooks in DLL exports? Or better yet, a function for adding new items to it, as it seems to be some complex Delphi class. I might need it because in my mod, I'd rather leave some of them unfixed (e.g. Resurrection recovery). Thanks!

GrayFace commented 3 years ago

For the most part, only select hooks for which I've added a way to disable them from MMExtension are applied after it's loaded. There are some hooks like D3D ones that are applied later as well. Thus, use of DisableHook would be too limited if I add it.

Tomsod commented 3 years ago

Ah, yes, you're right. Nevertheless, I think it would still be helpful as it's precisely those hooks that are applied after my DLL is loaded that are the hardest to overwrite. IIRC, I already had to concede a good hooking spot to such a hook (that I would rather toggle off) on at least one occasion.

Tomsod commented 3 years ago

Hi! I've fixed some of the above bugs in my mod, you can look if you're curious: 48, 49, 53, 54. Also one more bug: apprently "of David" enchantment doesn't work on bows.

And on the topic of hooks, do you think it would be possible to generalize mm7lang.ini and add support for drop-in *.mm7.ini files? Like with UI.txt, except those files would have lower priority than mm7.ini. This would solve my problem perfectly, as I could just distribute one such file with an appropriate DisableHooks setting. I really don't want to modify the main mm7.ini file, because it's supposed to be user-editable (and also because I currently distribute my mod as a zip archive).

GrayFace commented 2 years ago

Is there a way to reproduce "40."?

Tomsod commented 2 years ago

It's more likely to occur if the destination region has much less objects than the source. So if you collect all items from the destination beforehand (or maybe just delete them with a script), it almost always triggers. Or pick a region that naturally has few items -- in particular, traveling to Shoals very often duplicates some reagents from Avlee, as long as they weren't looted yet.

Also, I got an email with your comment on 19, but it's gone now? I'm guessing you later noticed that the 5 min duration is not actually used, and deleted it.

GrayFace commented 2 years ago

Yes, exactly :)

Not done: 4,8,9,13,15,19,20,21,22,24,32,36,38+54,42,44,50,51,52 Suggestions: 1,6,10+11,12 Won't do: 27,29,46 (especially 27! Max Body Res at least gives some protection against death condition) Probably fixed: 47

Tomsod commented 2 years ago

I'm currently reading through your v2.5 commits, and apparently you've not fixed 40 because you weren't able to reproduce it in MM6? You could've said so! This bug was in fact first found there, here's a detailed treatise on exploiting it for extra horseshoes. (Admittedly, there's not much more else to duplicate there. NB: the article states that the region mustn't have been visited before, but at least in MM7 this is not always the case.) If you want to experience it for yourself, just start a new game, travel to Castle Ironfist region, and look around the NW tavern. If you traveled by foot, there'll be two duplicated (from New Sorpigal's volcano) horseshoes there (one inside the building, the other pickable). But they won't appear if you used stables. I've just tested it with a fresh install and v2.5.5 of the patch, it worked for me.

GrayFace commented 2 years ago

I was going to fix it, but looks like I forgot to do it.

Eksekk commented 2 years ago

A bug I discovered: sometimes, when you cast a PC-targeting spell (Heal, Cure Weakness etc.) from the spellbook and then instantly press 1-4, the game will select that player instead of applying spell. In case when character has been already selected, it will open inventory. You can manage it, but when you return to game screen, you will have to again select a PC, but time won't be stopped as usual.

Tomsod commented 1 year ago

I've got to the bottom of 50: when the game is saved in TB mode, the TB flag is also saved. When it's loaded, the game exits TB mode, and PC recovery is restored from TB actor queue. But that queue is NOT saved and thus contains garbage. My solution is to unset the TB flag manually and adjust saved PC recovery: see here.

KotoriFox commented 3 weeks ago

Also one more bug: apprently "of David" enchantment doesn't work on bows.

It works, just success chance is 10%, ignoring water magic skill. (maybe it checks incorrect skill?)

Tomsod commented 2 weeks ago

I did not mean Enchant Item success chance or whatever, I meant, like, when a bow is already enchanted with David, it does not deal any additional damage to Titans, because there's no check for that in bow damage code.