Page 1 of 1

Use monster experience instead of HD in piety gain calc

PostPosted: Thursday, 27th June 2019, 02:15
by bel
Monster HD is a fundamental mechanic in the game. However, there is only a very loose relationship between monster HD and how dangerous it actually is. This fact is recognized by the game when it tries to calculate the XP a monster gives on death ("exper_value"). See this function.

Now, it is true that this function is, as someone else aptly described, a "bunch of hacks" stitched together. But from what I can see, it provides a much better gauge of monster difficulty than pure monster HD.

[Just a few examples. Both hobgoblins and rats have 1 HD, but hobgoblins give twice as much XP. I think we can agree that hobgoblins are tougher than rats. An adder gives 13 times as much XP as a rat, but only has twice the HD. I think we can agree that fighting 2 rats (one at a time) is easier than fighting one adder. The difficulty ratio of the two monsters is much closer to 13:1 than it is to 2:1. Worms have the same HD as orc warriors, but orc warriors give 25 times as much XP.]


Assuming we accept the above premise, I propose the following.

In god-conduct.cc, piety is largely based on monster HD. The piety gain code is hard to understand, but it would be a simple matter to replace monster HD with monster experience, with appropriate scaling.

This mechanic can also be used in determining how much HP, say, Makhleb gives on kills. Currently, the HP gain is directly proportional to HD. Make it directly proportional to (monster XP) / (player XL), or something like that.

[Btw, I'm currently trying this out in my attempt to balance DD heal rate in the implementation described in this thread. Using the original Makhleb healing code resulted in a completely broken DD.]

Re: Use monster experience instead of HD in piety gain calc

PostPosted: Wednesday, 3rd July 2019, 13:56
by byrel
Today I learned that early Okawaru is actually incredibly reliable if you've left a few worms alive you can go back and kill. That's annoying.

Re: Use monster experience instead of HD in piety gain calc

PostPosted: Saturday, 20th July 2019, 17:35
by Nekoatl
Plants have 10 HD and award 0 XP, so I guess I should make a point of chopping them down when I want piety? (They can also be polymorphed into monsters that yield significant amounts of XP, but that's arguably less abusive behavior, as those monsters actually fight back.)