Bug? earthquake has defeated my troops instantly

The old Heroes games developed by New World Computing. Please specify which game you are referring to in your post.
quartet4
Leprechaun
Leprechaun
Posts: 4
Joined: 08 Jun 2020

Bug? earthquake has defeated my troops instantly

Unread postby quartet4 » 08 Jun 2020, 06:22

this is the save file,
https://drive.google.com/file/d/1Mtqe-p ... sp=sharing

as soon as enemy hero casts earthquake, the battle ends and I be defeated.
Is this a bug or existing function of earthquake?

User avatar
Pol
Admin
Admin
Posts: 10258
Joined: 29 Nov 2005
Location: IN SOMNIS VERITAS
Contact:

Re: Bug? earthquake has defeated my troops instantly

Unread postby Pol » 08 Jun 2020, 06:28

I see only "request" access. What game version?
"We made it!"
The Archives | Collection of H3&WoG files | Older albeit still useful | CH Downloads
PC Specs: A10-7850K, FM2A88X+K, 16GB-1600, SSD-MLC-G3, 1TB-HDD-G3, MAYA44, SP10 500W Be Quiet

quartet4
Leprechaun
Leprechaun
Posts: 4
Joined: 08 Jun 2020

Re: Bug? earthquake has defeated my troops instantly

Unread postby quartet4 » 11 Jun 2020, 15:35

Pol wrote:I see only "request" access. What game version?
it is written as HOMM3 HD 5.0 RC90
what do you mean by request?
Last edited by quartet4 on 11 Jun 2020, 15:35, edited 1 time in total.

User avatar
iLiVeInAbOx05
Equilibris Team
Equilibris Team
Posts: 788
Joined: 21 Jul 2014

Re: Bug? earthquake has defeated my troops instantly

Unread postby iLiVeInAbOx05 » 11 Jun 2020, 16:14

He means that you need to fix the sharing permissions on your google drive file because clicking on it takes you to a page that says "You need access" in order to view the file.

RoseKavalier
Leprechaun
Leprechaun
Posts: 6
Joined: 19 Nov 2016

Re: Bug? earthquake has defeated my troops instantly

Unread postby RoseKavalier » 16 Jun 2020, 16:41

Earthquake can incorrectly target creature (at defender's index 0) instead of walls and modify their flag as war machine; if the hero only has war machines he is considered defeated.

I made a very simple fix for that without changing the way Earthquake normally works.

User avatar
Pol
Admin
Admin
Posts: 10258
Joined: 29 Nov 2005
Location: IN SOMNIS VERITAS
Contact:

Re: Bug? earthquake has defeated my troops instantly

Unread postby Pol » 17 Jun 2020, 06:23

This is great!

Code: Select all

//////////////////////////////////////////////////
	// AI bugs
	//////////////////////////////////////////////////
	pi->WriteLoHook(0x56B344, AiTpCursedCheck);	         // disallow casting Town Portal on cursed ground for AI
	pi->WriteLoHook(0x43020E, AiWaterwalkFly);	         // disallow AI from casting Fly if they don't have it (v1)
	pi->WriteLoHook(0x42DDA6, AiSplitDiv0);		         // if AI has tactics and shooters, but you have 0 creatures -> crash
	pi->WriteLoHook(0x42437D, AI_combat_div0);	         // divides by speed which shouldn't be 0
	pi->WriteLoHook(0x426FE4, AI_NecromancyFix);         // Army is deleted before Necromancy action, so skip army deletion and execute it in HH below
	pi->WriteLoHook(0x42B146, AI_DeathKnightsAmplifier); // [1.19.0] {Ben80} AI ignores Death Knights when considering to build Necromancy Amplifier
	pi->WriteHiHook(0x426EE0, SPLICE_, THISCALL_, _HH_AI_NecromancyFix);		   // this HiHook runs the skipped over code from @AI_NecromancyFix
	pi->WriteHiHook(0x426390, SPLICE_, THISCALL_, _HH_AI_QB_GetDamage);			   // don't allow negative damage in QB
	pi->WriteHiHook(0x42443B, CALL_,   THISCALL_, _HH_AI_QB_hugeArmy);			   // prevent loss to small army
	pi->WriteHiHook(0x4274D4, CALL_,   THISCALL_, _HH_AI_PreventCreatureSpawning); // flag for below hook
	pi->WriteHiHook(0x44A950, SPLICE_, THISCALL_, _HH_AI_GetArmyValue);			   // prevent endless turns for negative ai value


	//////////////////////////////////////////////////
	// turret armorer bug
	//////////////////////////////////////////////////
	H3Patcher::NakedHook5(0x41E39E, TurretBug1);
	H3Patcher::NakedHook5(0x41E4DA, TurretBug2);
	H3Patcher::NakedHook5(0x46593E, turret_bug3);

	//////////////////////////////////////////////////
	// GUI errors
	//////////////////////////////////////////////////
	pi->WriteLoHook(0x5F4C99, FaerieDialogRmb);   // right click on cast-spell icon didn't give correct text
	pi->WriteLoHook(0x5F5320, FaerieDialogHover); // same as above, but for mouse hover
	GuiFixesByIgrik();                            // various DEFs and positions
	horizontalScrollbar_init(pi);                 // horizontal scrollbar using arrows not correctly drawn
	H3Patcher::BytePatch(0x49E4ED, 0x63);         // Repair Arena Cancel button
	H3Patcher::BytePatch(0x41DBE8 + 1, 0x5C);     // if AI is teleporting and you had "Don't show enemy moves" on, it would still check if area is visible and show them

	//////////////////////////////////////////////////
	// Misc errors
	//////////////////////////////////////////////////
	pi->WriteHiHook(0x476143, CALL_, THISCALL_, _HH_FirstAidTentTargetEnemy); // [1.18.0]
	pi->WriteLoHook(0x5D52BF, ViewHeroScreenRapidly);                         // If you click fast enough in garrison exchange dialog, sourcePage is left as 0 and crash ensues
	pi->WriteLoHook(0x4AC157, VisitBankBug);                                  // after viewing hero screen during creature reward of creature bank, potential crash
	pi->WriteLoHook(0x465656, EarthquakeBug);                                 // do not kill the first creature stack while using earthquake
	pi->WriteLoHook(0x4AC5F5, PreserveMonsterNumber);                         // prevents the loss of upgraded stack creatures from the total number of wandering monsters
	pi->WriteLoHook(0x446BCD, WaitPhaseBug);                                  // do not use restore hit points ability a second time in wait phase bug function
	pi->WriteLoHook(0x447DA5, EnchantersTargetting);                          // Targetting of Enchanters spells was strictly done on first stack of each side
	pi->WriteJmp(0x464DF1, 0x464DFB);                                         // Wait Phase Bug part 1
	H3Patcher::BytePatch(0x4FD495 + 1, 0xA);                                  // error check didn't correctly redirect Hero structure calculation
	H3Patcher::WordPatch(0x4F8758, 0x63EB);                                   // disable F1 HELP button effects ~ glitched in modern OS
	static LPCSTR rogue_sound = "rogu";
	H3Patcher::DwordPatch(0x67448C, DWORD(rogue_sound));                      // Rogue Sound instead of gremlin sound
	pi->WriteLoHook(0x47CA04, DefType1);                                      // [1.19.0] {GrayFace} corrects parameter use for def-type1 on the adventure map (although unused)
	pi->WriteLoHook(0x47D69F, DefType1);                                      // [1.19.0] {GrayFace}
	H3Patcher::BytePatch(0x600530 + 1, 0);                                    // [1.19.0] {GrayFace} original instruction is an endless loop
	H3Patcher::DwordPatch(0x4C5D09 + 2, 0);                                   // [1.19.0] {GrayFace} event message length is not capped at 65,535 chars
	pi->WriteLoHook(0x41D433, FixDimensionDoorSpellCost);                     // [1.19.0] use the starting terrain for Dimension Door spell cost calculation
	pi->WriteLoHook(0x41D9D4, FixTownPortalSpellCost);                        // [1.19.0] use the starting terrain for Town Portal spell cost calculation
	//todo written as lohook for now, pondering whether I should make this optional
	// alternative is simply pi->WriteJmp(0x41DA12, 0x41DA2B);
	pi->WriteLoHook(0x41DA12, SkipOldTownPortalSpellCost);                    // [1.19.0] skip the old Town Portal spell cost procedure

	///////////////////////////////////////////
	// Hero hireability
	///////////////////////////////////////////
	pi->WriteLoHook(0x4D7BF0, FixHireables); // swap in town, hire in town, etc.
	pi->WriteLoHook(0x4A3D14, FixHireables); // prison

	////////////////////////////////////////////////////////
	// Movement updates that were missing or movement bugs
	////////////////////////////////////////////////////////
	pi->WriteLoHook(0x49E340, UpdateMaxLandMovement);                           // after landing, max movement was not always updated
	pi->WriteLoHook(0x4AA76B, RecalculateMovementAfterVisitObject);             // only for human ~ useless for AI
	pi->WriteLoHook(0x5BE69A, RecaculateMovementAfterExitingTown);              // only for human ~ useless for AI
	pi->WriteLoHook(0x4A9173, UpdateSeaMvmtLighthouse);                         // when visiting a Lighthouse, all human heroes in boats should get their movement updated
	pi->WriteLoHook(0x4E4D40, CastleLighthouseOwnerCheck);                      // castle's lighthouse only applies to its owner
	pi->WriteHiHook(0x5BED30, SPLICE_, THISCALL_, _HH_AfterBuildingLighthouse); // when building Castle Lighthouse, update max water movement
	pi->WriteHiHook(0x4A2470, SPLICE_, THISCALL_, _HH_HeroesMeeting);           // due to HDmod, you can directly switch to second hero, whose max movement is not updated

	//////////////////////////////////////////////////
	// Other
	//////////////////////////////////////////////////
	anchorbug_init(pi); // corrects anchor bug in combat
	pi->WriteLoHook(0x40B0E2, ResetTextBufferForAdventureHint); // [1.19.0]
All of that is already part of SP_Plugin?
"We made it!"
The Archives | Collection of H3&WoG files | Older albeit still useful | CH Downloads
PC Specs: A10-7850K, FM2A88X+K, 16GB-1600, SSD-MLC-G3, 1TB-HDD-G3, MAYA44, SP10 500W Be Quiet

RoseKavalier
Leprechaun
Leprechaun
Posts: 6
Joined: 19 Nov 2016

Re: Bug? earthquake has defeated my troops instantly

Unread postby RoseKavalier » 18 Jun 2020, 21:25

Yes, that's an exact copy of that part of the code from the plugin.

User avatar
Pol
Admin
Admin
Posts: 10258
Joined: 29 Nov 2005
Location: IN SOMNIS VERITAS
Contact:

Re: Bug? earthquake has defeated my troops instantly

Unread postby Pol » 19 Jun 2020, 11:01

Thanks! ;)

I'm going to study that a bit.
"We made it!"
The Archives | Collection of H3&WoG files | Older albeit still useful | CH Downloads
PC Specs: A10-7850K, FM2A88X+K, 16GB-1600, SSD-MLC-G3, 1TB-HDD-G3, MAYA44, SP10 500W Be Quiet

quartet4
Leprechaun
Leprechaun
Posts: 4
Joined: 08 Jun 2020

Re: Bug? earthquake has defeated my troops instantly

Unread postby quartet4 » 02 Jul 2020, 03:27

Pol wrote:Thanks! ;)

I'm going to study that a bit.
https://drive.google.com/file/d/1Mtqe-p ... sp=sharing

I corrected the access.
when u pass the turn, u can see that my troops are defeated altho my army is still alive. could you explain why this is happening?

quartet4
Leprechaun
Leprechaun
Posts: 4
Joined: 08 Jun 2020

Re: Bug? earthquake has defeated my troops instantly

Unread postby quartet4 » 03 Jul 2020, 01:56

RoseKavalier wrote:Earthquake can incorrectly target creature (at defender's index 0) instead of walls and modify their flag as war machine; if the hero only has war machines he is considered defeated.

I made a very simple fix for that without changing the way Earthquake normally works.
thank you for your comment! but I do not understand what you mean by 'defenders index0' 'flag' 'only has war machine'. Could you explain?

RoseKavalier
Leprechaun
Leprechaun
Posts: 6
Joined: 19 Nov 2016

Re: Bug? earthquake has defeated my troops instantly

Unread postby RoseKavalier » 03 Jul 2020, 12:31

defender - the defending hero that is behind the walls
index - the position of the stack (left to right, 0 - 6)
flag - a hex representation of various states for any creature (e.g. undead, stoned, war machine)

You could get the sod_sp plugin referenced by Pol or if you prefer the duct tape fix, split your stack into 1 unit (leftmost) and the rest (anywhere on the right). Earthquake will erroneously mark the 1 unit as a war machine and the battle can go on.


Return to “Heroes I-IV”

Who is online

Users browsing this forum: No registered users and 0 guests