Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
New year, New Master of Magic! v1.5 fan patch

(April 29th, 2017, 04:03)Seravy Wrote: Yes, it is in the readme.txt that comes with it.

So it is, sorry for not noticing it. I'm glad I know now, I've stupidly been trying to figure it out for ages.
Reply

Ok, I've run into a semi-reproducable, game-stopping bug.  The problem is that I'm not quite sure what exactly triggers it.

I've got RC5 installed, with the following addons:
W037FIX.TXT
W039FEAT.TXT
W128FIX.TXT
W277FEAT.TXT
W427FEAT.TXT

The bug occurrs during a city combat against a sorcery-using wizard (Jafar) and one of his magic-using heroes (Beastmaster).  I first noticed it when attacking with just Toring the Chosen, but to test I took a couple of non-Magic immune units along (Berserkers) and the same thing happened.

First round, Jafar casts Invisibility and Beastmaster cast Blur, and his units move.
I don't think it really matters what I do in this round as long as my actions don't kill the Beastmaster

Second round, Jafar casts something (usually Invisibility if I haven't cast True Sight yet, otherwise Counter Magic).  The combat will hang (ie, music continues but no more orders are given) during Jafar's turn around the time it would be the Beastmaster's turn to move.

I think it's an AI problem - somehow the AI can't choose which spell to cast with the Beastmaster.  If I kill the Beastmaster or force the AI to recall him away by bringing enough forces, the freeze doesn't occur.  Interestingly, the problem also only happens if the AI chooses the above two spells in the first round (Invisibility and Blur) - if it randomly happens to pick other spells, such as Counter Magic, it doesn't hang.

Is there any way for me to send you some sort of error log or something to help you track down the problem?
Reply

Might be this bug recently fixed in CoM :
Quote:-Fixed bug : The AI/Auto might try to cast invalid spells 215-239 in combat because the game has been coded assuming there are 40 spells in the Arcane Realm. The same bug was already fixed for the human player.

Can't see the fix for that in the patches so it probably wasn't compatible with vanilla MoM. Wish I kept the incompatible patch files, then I knew for sure.
...I don't really see anything that would cause incompatibility in the code here though. Maybe I just missed this one? Worth a try...

Please try this patch (make a backup first) and let me know if it helped :

.txt   W626FIX.TXT (Size: 733 bytes / Downloads: 2)
Reply

Unfortunately that didn't help. The freeze still occurs under the same circumstances.
Reply

Does the hero have enough MP left to actually cast a spell?
I don't think any bugs with that are left over but heroes not having enough MP to cast spells but wanting to used to be a problem (albeit I think in that case the heroes skipped their turn and did nothing, it didn't crash the game).

If it is a problem in AI spell selection itself, bad news because that part is completely incompatible with CoM (in fact CoM replaced the entire procedure).
Is there a specific spell triggering it? Try disabling the AI's spells one at a time (combat spells only) in the tweaker and see if removing any fixes the problem. If yes, I might be able to find the bug in the old procedure.
Reply

Beastmaster has 5 MP in the second round - I THINK there are a couple of spells that can be cast with such low MP? Jafar has 10 sorcery books.

I did a bit of further testing (assuming I'm using the tweaker correctly).

I tried making Jafar not know ANY spells. When I did this, the combat would hang as soon as it was the Beastmaster's turn to act (ie, if I disabled it prior to entering combat, it would hang once it was the beastmaster's turn in the first round. If I did it after the Invisibility/Blur combo in the first round, it would hang once it got to the Beastmaster in the second round)

I also tried removing all of Jafar's spells and the Beastmaster's Resist Elements spell. Same result as above.

Since it doesn't hang at the point where Jafar would normally cast his spells, this is obviously somehow a hero-related problem.

Very confusing. Should I also try disabling all the spells one at a time like suggested above or would that be a waste of time?

EDIT: Is there a way to modify the amount of mana a hero has available to them in combat? I wonder what would happen if I set it to 0 for the Beastmaster?
Reply

The tweaker can modify mana when you connect to the game. Good idea, try to see if there is a crash with 0 MP.

If yes, then the problem is movement related (the hero has no spell to cast and wants to move), if not then casting related.
Reply

(May 7th, 2017, 04:15)Seravy Wrote: The tweaker can modify mana when you connect to the game. Good idea, try to see if there is a crash with 0 MP.

If yes, then the problem is movement related (the hero has no spell to cast and wants to move), if not then casting related.

Ok, so some mid-battle testing:

With 5 mana left, Beastmaster's in-battle tactic when the game hung was "Cast Spell (108)".  This didn't occurr if I changed his mana to 0 prior to the turn in which it hangs.

If the game has already 'hung', and I change his tactic to "Ready (0)", it would revert back to "Cast Spell (108)" and remain hung.

If the game has already 'hung', I change his current mana to 0, and then change his tactic to "Ready (0)", the game recovers and continues as normal.

So it's definitely casting relating - he's trying to cast something but it just doesn't proceed for whatever reason.
Reply

More mid-battle testing.

I waited until the game hung, then gradually increased Beastmaster's available mana by 1 and put him back on 'ready' until he'd do something (this took a lot of tries as the MP reverts back to the previous figure unless you get lucky with the timing).

Once he reached 10 mana, he casts a spell.  If Torin has an enchantment on him, Beastmaster casts Dispel Magic True on Torin.  This made me curious to see what would happen if Torin didn't have an enchantment on him, so I repeated the test. Same as before, except at 10 MP Beastmaster cast Counter Magic, which for some odd reason then didn't come up at all in the battlefield spells display.

Any way to tell which spell the hero is casting (or trying to cast) in combat?
Reply

(May 7th, 2017, 05:37)Soul Reaver Wrote: More mid-battle testing.

I waited until the game hung, then gradually increased Beastmaster's available mana by 1 and put him back on 'ready' until he'd do something (this took a lot of tries as the MP reverts back to the previous figure unless you get lucky with the timing).

Once he reached 10 mana, he casts a spell.  If Torin has an enchantment on him, Beastmaster casts Dispel Magic True on Torin.  This made me curious to see what would happen if Torin didn't have an enchantment on him, so I repeated the test.  Same as before, except at 10 MP Beastmaster cast Counter Magic, which for some odd reason then didn't come up at all in the battlefield spells display.

Any way to tell which spell the hero is casting (or trying to cast) in combat?

None, that's why it's crashing. I mean, the hero queues "cast a spell", but picks the spell when the action is executed. If it finds nothing to cast, it goes back to selecting an action and this time cannot pick casting a spell - but for some reason it does again anyway.
CoM doesn't have this problem because it was modified to only queue casting a spell if the spell that would be picked has a priority of 10+ to cast, but this modification was most likely incomaptible.
At least this is what I suspect but I found one more block of code that wasn't copied over and might be related :

.txt   W627FIX.TXT (Size: 978 bytes / Downloads: 5)

If this helps, good. If not, this is a last-resort solution :


.txt   W628AI.TXT (Size: 90 bytes / Downloads: 3)

Oh, and this is also different :


.txt   W629FIX.TXT (Size: 464 bytes / Downloads: 7)

...wait, the 151RC5 file has something completely different from the original and the latest, correctly working version. This will unset the "don't pick spell again" state and cause exactly the bug you experience.
This last file should be the one solving the problem (but probably won't hurt to include the others as well)
Reply



Forum Jump: