Heroes of Might and Magic II Mod

The old Heroes games developed by New World Computing. Please specify which game you are referring to in your post.
dudejo
Leprechaun
Leprechaun
Posts: 45
Joined: 18 Jul 2010

Unread postby dudejo » 25 Jul 2010, 03:13

i've run some tests.

the ones i noticed were signed were speed (not 100% sure because setting it to FF returned a (null) value and i couldn't move the unit at all), attack, defense, damage and growth. not sure if i missed anything.

as to the way those values are handled...the game engine, at its core, seems to be nothing more than a calculator. it'll calculate and return a result, period.

if the creature has negative growth, the game will substract even into negative values. and if you try to purchase a negative stack, you'll GAIN resources (so yeah, i wouldn't make dragons grow at -1...lol).

if defense skill starts at -6, it'll still add and substract whatever bonuses and penalties you have and use the result to decide whether or not you get your ass handed to you.

damage, however, will NEVER go below 1. even a stack with negative damage will deal 1. so i don't think an attack spell will revive hit points.

User avatar
GreatEmerald
CH Staff
CH Staff
Posts: 3330
Joined: 24 Jul 2009
Location: Netherlands

Unread postby GreatEmerald » 25 Jul 2010, 08:07

Wow, do you lose your dragons if you try to purchase them with negative growth? :D

dudejo
Leprechaun
Leprechaun
Posts: 45
Joined: 18 Jul 2010

Unread postby dudejo » 25 Jul 2010, 11:38

if you purchase a negative quantity, it creates a separate negative stack.

if you apply that stack to an existing stack, you'll lose creatures, yes.

like i said, the game works like a calculator. if you give it data to calculate, it'll do so. no matter what the end result may be.

so far, the results of having a negative stack in combat means it'll only get one turn to do anything, can't deal damage and disappears after the fight is over.

User avatar
GreatEmerald
CH Staff
CH Staff
Posts: 3330
Joined: 24 Jul 2009
Location: Netherlands

Unread postby GreatEmerald » 25 Jul 2010, 12:19

Wow, that's awesome :D So you could create a "resource mine" creature with negative growth :D

User avatar
Kristo
Round Table Knight
Round Table Knight
Posts: 1548
Joined: 23 Nov 2005
Location: Chicago, IL

Unread postby Kristo » 26 Jul 2010, 12:26

Yep, and it sounds like you can still buy all the creatures. Given that we're just a calculator here, if we had -4 available... -4 - (-4) = 0.

More importantly, this means you can see what would happen if the Well didn't exist. Lower every creature's growth by 2 and promise yourself you'll never buy negative creatures. The first week would be a little messed up but long-term it should be ok. How would this affect game balance?
Peace. Love. Penguin.

dudejo
Leprechaun
Leprechaun
Posts: 45
Joined: 18 Jul 2010

Unread postby dudejo » 26 Jul 2010, 22:50

wouldn't that be -4 + -4 instead of -4 - -4?

from what i know, the game adds the creature's growth value to the existing dwelling stack every 7 turns.

so if the value reads -4, wouldn't it add -4 to the stack?

User avatar
Kristo
Round Table Knight
Round Table Knight
Posts: 1548
Joined: 23 Nov 2005
Location: Chicago, IL

Unread postby Kristo » 27 Jul 2010, 01:28

No, you bought -4 creatures, subtracting -4 from the -4 available, giving you 0. As far as the Well goes, you can safely assume the computer players will buy it. Some towns require it at some point, so it can't really be removed. It adds 2 to the growth of all creatures, so even those at -1 will still grow at 1.

I have this theory that the Well wasn't part of the original plan when they developed H2. The creature growth rates match H1 if you don't build it. Someone probably said, "Oh this sounds like a fun idea," and I'm convinced it threw off the game balance quite a bit.
Peace. Love. Penguin.

User avatar
Darmani
Blood Fury
Blood Fury
Posts: 479
Joined: 06 Jan 2006
Location: Cambridge, MA

Unread postby Darmani » 27 Jul 2010, 20:03

There's a whole world beyond hex editing.

I took a class last semester with an assignment where we were given a (unique) program which asked for 6 passwords, and we had to figure out the passwords, with points lost for every wrong guess. The solution was to run it inside the gdb debugger, disassemble some of the functions, step through, etc in order to figure out the expected passwords (the password checking became increasingly non-straightforward).

I'd be shocked if there isn't a debugger for Windows (maybe even a gdb port) with similar capabilities, though the Windows executable format is different from Linux ELF, and possibly last friendly to reverse-engineering (ELF has a "symbol table," containing plain-text names of all functions and their start locations). Either way, a lot of more sophisticated mods should become (relatively) easy with the proper tools. E.g.: cast a lightning bolt with the debugger running, and step through until you see something that looks like a damage calculation.

I'll probably try some of this in late August after I get Windows on my laptop. I'm mentioning this now in case anyone wants to get a head start on me.

User avatar
Kristo
Round Table Knight
Round Table Knight
Posts: 1548
Joined: 23 Nov 2005
Location: Chicago, IL

Unread postby Kristo » 27 Jul 2010, 21:13

There's a catch to that. The program has to be compiled with debugging symbols enabled. Most commercial software has them removed before release. It makes the executable smaller and makes it harder for a competitor to reverse engineer their work.

If we had access to the source code as you describe, we would have done this a LONG time ago.
Peace. Love. Penguin.

dudejo
Leprechaun
Leprechaun
Posts: 45
Joined: 18 Jul 2010

Unread postby dudejo » 27 Jul 2010, 23:54

oh my bad. i thought you were talking about creature growth, Kristo and not actually buying them.

as for the whole debugger thing, does that mean it won't even display a string of hex codes?

because if we at least had that, would we be able to turn it into assembly?

User avatar
Darmani
Blood Fury
Blood Fury
Posts: 479
Joined: 06 Jan 2006
Location: Cambridge, MA

Unread postby Darmani » 28 Jul 2010, 04:16

I'm not sure what all debugging symbols contain in Linux. I know it contains a mapping between assembly instructions and the original C code, allowing the line of C to be printed in the debugger (not sure if it's just a reference to the lines of the file, or the source code itself). The class didn't make things that easy for us though -- since part of the aim was to teach us assembly, that would defeat the point. However, even without debugging symbols, ELF does contain a symbol table with all function names and locations. And you can always get and step through the assembly, which is really all you need.

Of course, that's because ELF is a format for both executables and for linkable libraries. Windows uses different formats for the two, and thus I doubt there's a symbol table analogue.

Actually, why don't I just go look this up: http://en.wikipedia.org/wiki/Portable_E ... port_Table

Hmm, if I'm reading that right, I think I'm wrong on both of what I just said.

Only way to actually find out what all is in that exe is to crack it open and peek inside. There really isn't much to talk about until one of us actually does this.

User avatar
GreatEmerald
CH Staff
CH Staff
Posts: 3330
Joined: 24 Jul 2009
Location: Netherlands

Unread postby GreatEmerald » 28 Jul 2010, 11:15

And not all programs rely solely on EXEs, some are just launchers for a set of DLLs. Though most programs of that age do that.

User avatar
Darmani
Blood Fury
Blood Fury
Posts: 479
Joined: 06 Jan 2006
Location: Cambridge, MA

Unread postby Darmani » 28 Jul 2010, 18:12

According to my understanding, a DLL should be easier to attack than an EXE. You still have all the source code in there, except that you can't strip out the symbol table, else the dynamic linking won't work.

Of course, I know for a fact that the core of HoMM II is an EXE, and, among other things, it contains structs with data for all the creatures, which is how UHH has been making his mod.

I believe the other files are pretty much just art and the like. fheroes2 replaces the EXE of HoMM II, but requires other files from the original game.

User avatar
UndeadHalfOrc
Cyber Zombie
Cyber Zombie
Posts: 1362
Joined: 13 Mar 2007

Unread postby UndeadHalfOrc » 28 Jul 2010, 21:12

Darmani wrote:cast a lightning bolt with the debugger running, and step through until you see something that looks like a damage calculation.
I've been meaning to do exactly that for years, but I just cannot find a debugger that will do the job. I'm no stranger with playing with raw assembly, original source code is completely unnecessary.

With it, I'd also love to fix the bug in Heroes 3 where turrets inflict more damage if you have Armorer, or the Air Shield spell on.

blueskirt
Leprechaun
Leprechaun
Posts: 16
Joined: 02 Aug 2010

Unread postby blueskirt » 02 Aug 2010, 03:02

What are the long term goals for this mod? Are you only tweaking balance or are you planning to add artifacts, units, new factions and/or new campaigns?

I must say I somewhat agree with gandam, I am not really interested in the new balanced factions. For one, I spend months learning their current stats, I do not look forward to learn everything from scratch and change my tactics completely to fit the new balance. For two, each factions can be good in a specific situation. For three, if a faction is better than another, just choose the better faction, HOMM2 is not like HOMM1, where the game forces factions onto players.

If you end up creating a full blown addon, with new stuff (which would be totally rad), I hope you'll keep an option to play without the balance tweak.

dudejo
Leprechaun
Leprechaun
Posts: 45
Joined: 18 Jul 2010

Unread postby dudejo » 02 Aug 2010, 23:46

i somewhat agree about not changing things around too far but i also agree that some units could use a bit of a buff.

like the Peasant and his inability to survive a gentle breeze.

blueskirt
Leprechaun
Leprechaun
Posts: 16
Joined: 02 Aug 2010

Unread postby blueskirt » 04 Aug 2010, 02:49

That I agree, but I'd rather if the buff involved additionnal units upgrades than completely modifying every units', dwellings' and spells' current stats and costs.

dudejo
Leprechaun
Leprechaun
Posts: 45
Joined: 18 Jul 2010

Unread postby dudejo » 04 Aug 2010, 11:56

for the spells that i agree need a change :

for example, comparing Storm to Armageddon. there's a 5 MP difference between them but a 25x power difference. Armageddon is twice the power for 5 more MP. someone's gonna have to get a MP change.

also, Dimension Door lets you cover a ****load of terrain. especially with high MP reserves. moving around the map is a joke for 10 MP a shot. the slightest opening could be deadly.

then you have Chain Lightning. its average damage is almost twice as powerful as equivalent spells. granted, it's not an even distribution of damage but does it really matter when even ONE enemy stack eats 40x Spell Power damage?

then there's Holy Word that half the power but more than half the cost. yeah.

blueskirt
Leprechaun
Leprechaun
Posts: 16
Joined: 02 Aug 2010

Unread postby blueskirt » 05 Aug 2010, 00:27

I can't really say for damage spells as I rarely use them. From my experience, damage spells become less effective as the game progress. When both players have 3-4 castles, the number of soldiers added to both armies every weeks far exceed the increase in spell power. When both you and your enemy have big stacks of creatures, spells like mass bless, mass haste, mirror image, mass slow, paralyze and berserk are far more effective than damage spells.

What I'd love to see with spells is less randomness. I've seen Knight castle with animate dead and Necromancer castle with holy shout spells so often... Spells should be handled the same way secondary skills are handled for heroes: each heroes has different chances of acquiring specific skills, each castles should have different chances of acquiring specific spells. A Necromancer castle should have more chances to get death related spells and should never get holy spells, a warlock castle should be more likely to get Armageddon since it's such a big part of their tactic, etc.

User avatar
Darmani
Blood Fury
Blood Fury
Posts: 479
Joined: 06 Jan 2006
Location: Cambridge, MA

Unread postby Darmani » 06 Aug 2010, 17:42

I would very much like to ultimately be able to add new units and factions and the like. I'm not that optimistic, however. Assumptions about how many factions there are likely littered all over the compiled code, making such a project really, really time-consuming. Potentially even time-consuming enough that it would be easier to spend those man-hours doing paid work, and thereby raising enough money to buy the H2 code off Ubi.

Anyway, spell probabilities already differ by castle. Necro is way, way, way more likely to wind up with Death Ripple/Death Wave than any of the other castles. They're just not impossible to find for the others -- and for good reason. Too many times have I found myself with a hero with 5 stacks of 1 Boar against an enemy hero, thinking I could get off a Lightning bolt or two before retreating, only to be defeated by a single Death Ripple.
I've been meaning to do exactly that for years, but I just cannot find a debugger that will do the job.
I asked a systems-guru friend. He recommended IDA.


Return to “Heroes I-IV”

Who is online

Users browsing this forum: No registered users and 29 guests