I am once again asking for the quote of the month to be changed as it is now a new month - Mjmd

Create an account  

 
"how to mod" questions

(February 1st, 2014, 14:35)zitro1987 Wrote:
(July 22nd, 2012, 14:28)I like Serena Wrote: Hitpoints are handled separately at another place in the code.
ovr116:0C1D or WIZARDS.EXE:8e7ed is 2, meaning that at level 4 a regular unit (and also a hero) gains 1 hit point.
ovr116:0C24 is 4, meaning that at level 6 a regular unit (and also a hero) gains 1 hit point.

Note that the actual levels are 2 points higher than these numbers.

This is of course far from complete.
But I can see all these numbers and places in IDA.

I don't think this works. While the hit point bonuses show up on the overland map, they don't on the battle screen. Sounds weird, but it's true.

Found it!

There is a 2nd place in the code where the hit points are counted, dedicated to combat.
ovr116:0E6E or WIZARDS.EXE:8ea3e is 2, just like it is in the other section (+1 hp at level 4).
ovr116:0E75 or WIZARDS.EXE:8ea45 is 4 (+1 hp at level 6).
--I like ILSe
Reply

(February 9th, 2014, 09:56)I like Serena Wrote: Found it!

There is a 2nd place in the code where the hit points are counted, dedicated to combat.
ovr116:0E6E or WIZARDS.EXE:8ea3e is 2, just like it is in the other section (+1 hp at level 4).
ovr116:0E75 or WIZARDS.EXE:8ea45 is 4 (+1 hp at level 6).
I suspect the comment about heroes is also wrong -- heroes just gain 1 hp/level.
Reply

(February 9th, 2014, 15:27)Anthony Wrote: I suspect the comment about heroes is also wrong -- heroes just gain 1 hp/level.

The hitpoints of heroes and regular units are mixed up.
There's a set more values around this point that applies to heroes.
Change the values I mentioned and both regular units and heroes will gain their hitpoint at a different level.
--I like ILSe
Reply

(July 11th, 2013, 17:56)feanur Wrote: For example, Insecticide makes any -Save from objects work with multi-target spells (Holy word, Death spell), which is clearly overpowered in my opinion.
And I guess that this was not a bug, but an intentional feature of the original game.

Modifying some bytes in Wizards.exe or Magic.exe is not a problem.
I completed my first mod, as I said, in 1995 or 1996, with a multi-bug version of MoM (a french version), and I enjoyed it at the time, before I moved to other occupations.

But for now, I need help to know where some datas are implemented (like firewall strength).
May be the best way is elimitate the undesired features in the insecticide. What spells you desire make independent from any -Save from objects?
Reply

Hence, my question remains : I won't be able to eliminate undesired features in insecticide if I have no clue about where those datas are implemented.

For a purpose of well-balanced gameplay, it seems to me that multi-target spells shouldn't be affected by -Save from items.
It's not that hard to reach -8 Save on a hero, and then a single Death spell would destroy a whole 9 units army...

But anyway, I have no time for now to improve my mod, that works as well as I can, and that gives me almost plenty satisfaction.

Thanks for you answer - I will continue to check this forum. Good luck !
Reply

(February 9th, 2014, 15:31)I like Serena Wrote: The hitpoints of heroes and regular units are mixed up.
Hm. Looking at the section of code starting at 8ea2d I see a repeating pattern:
83 7E F8 01 7E 01 47 // hero gain at level 3?
83 7E F8 03 7E 01 47 // hero gain at level 5?
83 7E F8 02 7E 01 47 // hp at level 4
83 7E F8 04 7E 01 47 // hp at level 6
83 7E F8 05 7E 01 47 // hp at level 7
83 7E F8 06 7E 01 47 // hp at level 8
83 7E F8 07 7E 01 47 // hp at level 9; pattern ends
At a guess, there's a switch statement somewhere that leads into a jump table, as otherwise nothing distinguishes the level 3/5 gains from anything else. Presumably if you swapped the numbers around you could keep the HP hero gain normal, though it's odd that the gain at level 2 is missing.
Similarly at 8e7dc
83 7E FC 01 7E 01 47
83 7E FC 03 7E 01 47
83 7E FC 02 7E 01 47
83 7E FC 04 7E 01 47
83 7E FC 05 7E 01 47
83 7E FC 06 7E 01 47
83 7E FC 07 7E 01 47
Same lack at level 2.
Reply

Each pattern corresponds to the pseudo code:
Code:
if (level > {number}) then hitpoints = hitpoints + 1
where 'level' is a number from 0 up to 8 corresponding to levels 1 to 9.
The increment of 1 hit point is hard coded and cannot be changed.

The patterns:
83 7E F8 00 7E 01 47 (about 200 bytes earlier in the code, which you apparently did not notice yet)
83 7E FC 01 7E 01 47
83 7E FC 03 7E 01 47
are for heroes only, and give heroes a hit point at levels 2, 3, and 5.

The patterns:
83 7E FC 02 7E 01 47
83 7E FC 04 7E 01 47
are the hit point gains of regular units, which correspond to unit levels 4 and 6.
These patterns are also used by heroes for levels 4 and 6.

The patterns:
83 7E FC 05 7E 01 47
83 7E FC 06 7E 01 47
83 7E FC 07 7E 01 47
are also used by both units and heroes, although regular units can't get levels that high.
They are for the levels 7, 8, and 9.
Still, if the numbers are lowered to be within reach of regular units, they _will_ get an extra hit point.
--I like ILSe
Reply

(March 6th, 2014, 17:01)I like Serena Wrote: Each pattern corresponds to the pseudo code:
Code:
if (level > {number}) then hitpoints = hitpoints + 1
where 'level' is a number from 0 up to 8 corresponding to levels 1 to 9.
Ah. Presumably there's a "if hero" block that ends after "grant HP at level 5", and then not hero does a jump to that point.

I missed the level 2 increment.
(March 6th, 2014, 17:01)I like Serena Wrote: Still, if the numbers are lowered to be within reach of regular units, they _will_ get an extra hit point.
That does make it easier to alter bonuses for regular units without affecting heroes -- you should be able to freely reorder the HP bonuses as long as all the values 00, 01, 02, 03, 04, 05, 06, 07, and 08 appear. The first 3, whichever they are, will never affect regular units. Thus, for example:
Gain at levels 4 and 6: 00, 01, 03, 02, 04, 05, 06, 07, 08 (current order)
Gain at levels 2 and 6: 01, 02, 03, 00, 04, 05, 06, 07, 08
Gain at levels 2, 4, 6: 01, 03, 05, 00, 02, 04, 06, 07, 08
Gain at every level: 05, 06, 07, 00, 01, 02, 03, 04, 08

I can't see a way to make normal units gain fewer than 2 hp without changing how hero units gain hp. Unless you significantly reorder -- probably:
change 'if level > 0 hp++' to 'hp += level'
change 'if level > 1 hp++' to a jump statement past all of the remaining 'if' statements (80x86 assembly is not, however, my thing).
Reply

(March 6th, 2014, 20:27)Anthony Wrote: Ah. Presumably there's a "if hero" block that ends after "grant HP at level 5", and then not hero does a jump to that point.

Correct!

Quote:I missed the level 2 increment.

It's in the hero-only block.
Regular units do not get a level 2 increment.

Quote:I can't see a way to make normal units gain fewer than 2 hp without changing how hero units gain hp. Unless you significantly reorder -- probably:
change 'if level > 0 hp++' to 'hp += level'
change 'if level > 1 hp++' to a jump statement past all of the remaining 'if' statements (80x86 assembly is not, however, my thing).

Yes, that would be difficult.
It really does appear to require rearranging the code.

I'm still considering to rearrange the code like I did for the other level-benefit bonuses.
That is, if you pop up the relevant dialog in Tweaker, that it asks if you want to rearrange the code, after which you can freely adjust the bonuses.
Then it would be much easier and give complete freedom.
The more so since it has to be done in 2 places.
--I like ILSe
Reply

I apologize if this has been answered - poking around on the forum I haven't seen it.

1) Does anyone know how to mod the productivity of different squares? Specifically, I would like to mod coastal squares to produce 1 food instead of 0.5 food, and river deltas to produce 2 food like rivers. It would be nice to be able to muck about with the % production bonuses from different squares, as well.

2) Does anyone know hot to mod the mechanics of the Change Terrain spell? As in - which squares are valid targets and what it produces in those squares?

Thank you very much.
--DrP
Reply



Forum Jump: