Master of Magic Wiki
Advertisement

Insecticide, also known as Master of Magic 1.40 is a bugfix, AI improvement and general patch developed by Kyrub. Last stable released version is 1.40n, last unstable version is 1.40o. Insecticide no longer receives updates and the developer is currently inactive. The 1.50 patch released by Seravy aims to continue this project and deal with the remaining bugs in the game. Since 1.40o was unstable and is not widely used, this page will consider the 1.40n version the final Insecticide.

The following aims to be a complete list of changes contained in this update. Since the developer did not make all of their changes public, and sometimes the changelog is inaccurate or outdated, all the information below comes from disassembling and comparing the insecticide file with the 1.31 files. The location of the change in the files is listed in parentheses, with W for Wizards.exe and M for Magic.exe, and the hexadecimal address for the first byte of changed code. Note that entries saying they fix an "unknown" bug mean the Insecticide version of the code works as intended and I do not know what the problem in the 1.31 version was. (W $BC1FF)

Also note that there is no guarantee this list is 100% complete, considering the vast amount of code, I most likely missed a few details.

Forum thread and download for the Insecticide patch

Bug fixes

  • Game recalculates town data whenever there are no units selected to make sure the income information is up to date and accurate. (W $43362)
  • Fixes Wind Walking bug, Total movement allowance of stack displayed does not always match windwalker's. (W $4A313)
  • Fixes : Wraith Form items do not grant Non-Corporeal movement. (W $51B62)
  • Archmage retort now correctly displays the +50% SP gained.
  • Fixes the bug of found items in treasure being unlimited value. ($62C11)
  • Fixes the bug of found items in treasure requiring the wizard to have enough books to be able to create the item. ($62C11, $8D9D5)
  • Fixes diplomacy bug : When proposing "Declare War on", bonus for having a Wizard's Pact is not added. ($W 6400F)
  • Fixed one of the bugs in returning ownership of a unit after confusion. (W $6B800)
  • Fixes bug : Item granted Invisibility is not considered when checking for visibility of a unit during combat AI targeting (W $6D76A)
  • Fixes bug : Not building engineers count into building capacity - might only apply to second and later map squaers in the road, not sure (W $712D5)
  • Units owned by the human player on the overland map cannot move through enemies unless that's the intended destination to avoid unintended combat. (W $724DD)
  • After strategic combat, items on heroes are no longer lost, but will be received by the winner. ($ W7318B)
  • Fixes bugs of how mana is being spent during Strategic Combat. (W $7F0C6)
  • Fixes strategic combat bug : effect of spellbooks of various realms overwrite each other instead of being added up. ($7F181)
  • Change to how "Defense rating" of unit is being calculated for Strategic combat and AI. (W $7FF5F)
  • Fixes bug : AI was able to target heroes with Possession. (W $80D8E)
  • Fixes some bug in Counter Magic (one variable was used for two different purposes it seems, W $837D6)
  • Maximal number of Icon ChaosMagic Vortices is limited to 4 to prevent memory corruption and crashing. (W $846F6)
  • Fixes bug : Dispel Evil can be cast on non-Death non-Chaos units. (W $8603D)
  • Back button on Create Artifact screen for item icons is removed, a new Exit button is added. Necessary because the back button causes crashes. (W $8C304)
  • Fixes : Some spells are missing from heroes (W $913A3)
  • Ranged Icon ToHit To Hit bonus now also applies to short-range attacks. (W $99B64)
  • Fixes bug : To DefendIcon ToBlock not only increases success chance of Defense Rolls, but also reduces chance of enemy melee Attack Rolls, thus providing over twice the expected benefit for Melee Attacks. (Prayer, Lucky bug W $99C3A)
  • Fixes bug: Weapon Immunity overrides Missile Immunity, preventing the latter from taking effect. (W $9A663) Introduces new bug: Weapon Immunity now raises Defense to Icon Defense 50 instead of Icon Defense 10 against non-melee weapon attacks (Icon Ranged Bow Missile and Icon Ranged Boulder Boulder, also Icon Thrown Thrown in v1.50) made by units with Icon Melee Normal Normal Weapons.
  • City Walls bonus in strategic combat will only be applied if the walls are built. Bonus reduced from Icon Defense 3 to Icon Defense 2. (W $9A995)
  • The defender no longer loses all its remaining movement for the turn after combat. Due to turn order, this prevented the AI from using those units for the turn at all. (W $9D152)
  • A variable during calculation of movement allowance wasn't initialized during combat (W $9F151)
  • Charismatic now properly checks for gold before presenting the hero, item and mercenary offer : When owning 50 gold, offers costing 100 gold can show up which will then have an effective cost of 50, instead of being limited to offers of 50 gold which are reduced to 25 due to the retort. (W $A225D) New bug : when buying items, this change applies even to Artificer wizards, allowing them to buy items up to twice as expensive as they can afford. If bought, this results in negative remaining gold, causing various serious problems.
  • Chaos Channels will no longer overwrite ranged/thrown attacks on units with a Breath attack. (W $A4E5D)
  • Disenchant Area will no longer dispel own spells when used by heroes. (W $A9143)
  • Dispel Magic will no longer dispel own spells when used by heroes. (W $A9911)
  • Attempts to fix Spell Lock being cast in combat having no effect against dispelling, unfortunately still has no effect. (W $A9A6A)
  • Unknown fix in Raise Dead, probably a crash bug. (W $AB094)
  • Unknown fix in Animate Dead, probably a crash bug. (W $AB53A)
  • Fixes bug in Animate Dead, if enemy unit is animated, new owner is not set on the overland unit. (W $AB71D)
  • Unknown change to dialog/warning of casting Summon Hero and Summon Champion (not sure what the bug here was, but seems functionally equivalent) (W $ABA71)
  • Attempts to fix Wrack bug (x^2 damage instead of x damage), has no effect, might corrupt memory due to wrong addressing, uses ES instead of DS. ($AE2EA)
  • Fixes unknown bug in the procedure that builds a list of the spells available for casting during combat, specifically the calculation of skill/mana available. (W $BC1FF)
  • New bug : Cities are unable to lose population if having higher population than the maximum. (W $C0F32)
  • Lo Pan has 1 fewer Sorcery books because the total picks was over 11.

AI changes

  • Changes to the preferences of building each building group both base and objective related, see : Objective for details. (W $2B4DD)
  • AI gains the ability to find items in treasure. In 1.31, they do not receive the items they found. (W $622EF)
  • Change of unknown purpose in the way AI compares the forces on its home continent for the old Military Modifier when looking for the Need for War (W $65AAF)
  • AI minimum difficulty to for various features in diplomacy changed to match changes in difficulty levels (addition of Extreme, removal of Intro)
  • AI can unintentionally walk through units of other players, initiating combat, if relation is -20 or lower instead of -60 or lower, making the AI less smart and more aggressive. AI actually prefers doing so instead of moving through other tiles if the army in question is owned by the human player. (W $724DD)
  • AI is no longer allowed to flee during the first turn of combat. (W $7B8A1)
  • New bug : Icon SorceryHaste is ignored by the AI when deciding on what to target with Icon ArcaneDispel Magic. Hasted units with no other enchantments are now invalid targets for dispelling (W $81BC7)
  • AI can use the Healing Spell ability of units in combat. Breaks the display position of AI used Doom Bolt because one additional byte was accidentally deleted. (W $889F5)
  • A rather big part of AI combat code is disabled for an unknown reason. Disabled code was used when the AI had ranged superiority and it was significantly simpler than the normal AI, most likely resulting in significantly dumber decisions. (W $898A5)
  • Fixes : AI calculated total ranged power of armies in combat incorrectly (W $ 89795, $9E533)
  • AI learns to see enemy invisible units if they have Illusions Immunity available. (W $8A2C3)
  • AI prefers to attack the more damaged enemy instead of the less damaged during combat. (W $8A6BC)
  • Removed additional upkeep discount for units received by the AI on the highest difficulty settings, as it already receives a major discount without this. ($96303)
  • Removed AI maintenance discount on building maintenance completely ($95E33)
  • During combat, AI will consider units exactly reachable in a turn as being too far, failing to prefer units that can be attacked, resulting in units walking around and ignoring enemies right next to them. (W $9BAD8)
  • AI prefers to attack more damaged units in combat if they can be reached that turn -note that the above change interferes with this improvement. ($9BAE8)
  • Fixes bug in how AI calculates total army strength in combat, used to base decisions - such as using spells or fleeing - on. (W $9EBE6)
  • Lawful wizards prefer to raze a city if Hidden Relation is equal to or less than zero instead of only when equal, meaning if they got betrayed previously. Since zero is the starting value, this should only happen is it strictly less than zero to have the intended effect. (W $9F90D)
  • AI wizards have a 10% lower chance to raze a city if was owned by another AI wizard. (W $9F968)
  • AI wizards now correctly prefer razing more if enemy forces are present in larger amount nearby, implying it's hard to keep the city, instead of the opposite, razing if own forces are superior. (W $9FA87)
  • AI will refuse offers from heroes if their ID is lower than the number of heroes they already own times 4, to preserve the slots for stronger heroes. (W $A2A40)
  • Changes to the AI table "priority of combat spell groups per combat situation" (W $B9C95)
  • Dispelling Mana Leak is not longer a must-do top priority choice. (W $B9DE8)
  • Changed AI's category for Web spell from "when at advantage" to "generic use" (W $B9ED4)
  • Changed AI's category for Iron Skin spell from "when at advantage" to "generic use" (W $B9ED4)
  • Changed AI's category for Guardian Wind and Warp Wood spell from "when at advantage" to "generic use" (W $BA3A3)
  • Changed AI's category for Creature Binding spell from "Direct damage+Creates unit" to "When at disadvantage+Creates unit" (W $BA588)
  • AI has less chance of casting Wall of Fire in combat (W $BA818)
  • Changed AI's category for Disintegrate spell from "direct damage" to "generic use" (W $BA9A1)
  • Changed AI's category for Invulnerability spell from "when at advantage" to "generic use" (W $BAC7F)
  • Changed AI's category for Black Prayer spell from "when at advantage" to "generic use" (W $BAFEB)
  • Changed AI's category for Terror spell from "what at disadvantage" to "when at advantage" (W $BB14C)
  • Changed AI's category for Wall of Darkness spell from "when at advantage" to "generic use" (W $BB1CE)
  • Changed AI's category for Wrack spell from "direct damage" to "generic use" (W $BB285)
  • AI considers Immolation a lower threat of Chaos Realm for casting protective spells in combat. (W $BBEC4)
  • AI estimated threat level of realm associated attacks in armies is cut to one quarter, reducing the chance of using protective spells greatly. (W $BC1A7)
  • AI is able to buy items from merchants. AI pays 50% of the normal price for items. (W $BE009)
  • Changes to how AI decides which unit needs to be disbanded for being obsolete (W $BF64F)
  • AI can first hire mercenaries 10 turns earlier (40 instead of 50) (W $CAAF7)
  • New AI decision procedure for hiring mercenaries (W $CAAFE)
  • Changes to how AI distributes the power base between Mana, Research and SKill (W $CB44D)
  • Changes to when and how much AI uses Alchemy. (W $CCC78)
  • Changes to how AI sets the tax rate. (W $CD0C4$)
  • AI is allowed keep 2 settlers or engineers instead of 1 past turn 200. (W $CD45A)
  • AI will not use previously chosen path for unit movement if distance is only 1 map cell (W $CE54D)
  • Changes to AI research selection (W $DC699)
  • AI will not cast expensive overland spells if it cannot afford it, instead doesn't cast a spell that turn (W $DCDAE)
  • Fixing the AI internal list of spell types known to select from (W $DDD3B)
  • Changes to preferences of various overland spells. ($DDE03)
  • When AI runs out of mana, it won't automatically cancel ALL global enchantments, only Suppress Magic and Time Stop ($E0D1C)
  • Changes how the AI selects targets for overland unit enchantments ($E1367), in general a major preference of heroes and anything at the fortress added.
  • AI will not buy production unless at least some of it is already done (W $E3FB6)
  • Fixes bug in AI decision to select Trade Goods for production. (W $E4017)
  • AI will not build settlers if population in city is 1 (W $E4163)
  • Changes AI's preferences of when to produce a unit vs a building (W $E429C)
  • Fixes other bugs and changes preferences of building production (W $E4321)
  • Neutral cities produce buildings slightly more often (W $E481D)
  • Changes to AI's production purchase decision (W $E4A3E)
  • Fixes various bugs in the AI assigning movement orders to units (W $E5226)
  • AI generally prefers keeping fewer defenders in cities and sending out larger amounts of units to build stacks, including the capital (W $E54DB defense, E9034 stack building)
  • When sending out units from the fortress to build stacks, send weakest instead of strongest but if the remainder for the current turn divided by 4 is 1, send strongest anyway. ($E90D4)
  • Changes to how AI uses settlers, contains new problems : Expansionist wizards will always prefer to settle the other plane even if they haven't settled their own, Settlers will never build if a unit of another wizard -even if ally!- is close. ($E9852)
  • When AI looks at strength of potential targets on the overland map for an attack, the human player's units are calculated at 25% of their effective strength instead of 125%, often resulting in unreasonable attacks from the AI. ($W7482)
  • AI will not immediately disband units if income is negative, unless gold or mana reserves are too low to afford the negative income for 32 turns. (W $E87D2)
  • Partial fix for AI units to board ships. (W $E6B2B)
  • AI is able to summon certain units they were unable to before on the overland map.
  • Changes to the AI's preference of spell picks at the start of the game. Also affects the default spells selected when the human player is starting the game. (M $27178)
  • The AI is allowed to pick any race on any difficulty instead of being restricted to the best races on high levels. (M $37140)
  • Fixed the guaranteed uncommon spell AI wizards get at hard or higher difficulty (was not received in Non-Nature realms if the wizard already had the Basilisk spell)
  • The two heroes with no magical ranged attack cannot get Arcane Power (M $48018)

Gameplay and interface changes

  • Unit view displays bonus To HitIcon ToHit and To DefendIcon ToBlock in the top right corner. To Hit was previously listed as an ability, and To DefendIcon ToBlock was hidden. (W : $10D4C)
  • Trireme and Galley has a transport capacityIcon Movement Ground of 8. (W : $29B3C)
  • Cost of units to be placed in lair updated, but in the wrong file, so no effect. (W : $2AD7A)
  • Floating Island loses Death Immunity and gains the flag "display race" so it shows as "Sorcery Floating Island" in the game. Probably unintended. (W $2B10E)
  • Added Extreme difficulty (+300% bonus for AI resources), removed Intro difficulty. All difficulty levels are shifted below Extreme, but not everything is moved, due to this, some hardcoded exceptions based on Difficulty appear at 1 higher level than they should, for example 100% fleeing success rate of Intro and Easy instead applies to Easy and Normal. (W $2B48E)
  • Addition and change of various hotkeys (many locations).
  • Addition of new option : Revolting Raiders
  • Addition of new option : Monsters Gone Wild
  • "X" button on city screen moves to the next city (W $3AD39)
  • Removed option "End of turn wait" and "Auto Unit Info" they are always enabled.
  • Casting Nature Awareness automatically casts Detect Magic - New bug. Was probably intended for the RVL cheat and debugging but was left in the released version. (W $45AFD)
  • Unknown purpose change of the order units get autoselected on the overland map if towers are where they are standing. (W $471ED)
  • When entering an Encounter Zone, "many" is displayed if there are 4 or more of that type of enemy inside. (W $6247B)
  • New strategic combat bug : All units have an equal chance to take damage regardless of defense, unless they have 50+ def. I assume this was intended to weight damage better but was left incomplete. (W $7ECD4)
  • Spell Save modifier works with Life Drain (W 81FD3h)
  • Change to the Spell Save procedure, for unknown purpose, I assume for easier editing through the Tweaker. (W $84DFF)
  • Change to Conjurer maintenance discount rounding - cost to pay is going to be rounded down if effective cost is x-x.50 and up for x.75 instead of always up. (W $9682E)
  • Wind Mastery doubles ship speeds and does not slow down enemy ships. (W $98698)
  • Central squares of city behind City Walls adds Icon Defense 3 as though the wall was intact there. ($W 99F2A)
  • ArcaneIcon Arcane spells appear in a more limited quantity in research options. (W $A2E49)
  • Changes to priorities of spells used when finding spells in a defeated wizard's fortress, or by the AI when trading. (W $A3148)
  • Unknown changes for storing and reloading RND seeds.
  • Population growth is not reported if city size>8. (W $BDC6E)
  • Cap of chance for finding heroes increased to 20%. (W $BE959)
  • Changes to the generation of raiders and rampaging monsters. (W $E6B2B)
  • New landmass option : Huge. (M $30CF0)
  • New Magic Power options : 0.5 to 2.5 instead of the original Weak (0.5), normal (1) and Powerful (1.5)
  • Restricted the Y coordinate of the starting location for wizard towns to avoid the area that contains too much Tundra. Various other changes on how the fortresses are placed.
  • Minimal Max Population for fortress location increased from 8 to 12. This makes it possible for the generation to fail : on less optional maps, there might not be enough suitable areas. In this case the game freezes in a loop.
  • Base encounter budget for Normal Lairs increased by 200 on Arcanus and 150 on Myrror. (M $39584, $39598)
  • Encounter budget for Weak Lairs tripled on both Planes (multiplier changed from 10 to 30). (M $3967B)
  • Colored Lairs (Abandoned Keep, Dungeon, Monster Lair, and Mysterious Cave) now feature Icon ChaosChaos monsters 50% of the time. 1.31 code is botched and yields Icon NatureNature enemies all the time (instead of its intended ratio of 40% Icon DeathDeath, 40% Icon ChaosChaos, and 20% Icon NatureNature). (M $39951, $3996C, $3A151)
  • Divisor roll maximum range for secondary monsters in Encounter Zones reduced by 1 (9-[primary count] instead of 10-[primary count]). Slight increase in average secondary monster strength at the cost of a decrease in variety. (M $39B6F)
  • New bug : There are enchanted roads under the Arcanus starting cities.
  • Greatly increased cost reduction of Spell of Mastery for 11 book wizards.
Advertisement