[96] MeleeDamage not always inherited

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
MartinHowe
Posts: 2062
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

[96] MeleeDamage not always inherited

Post by MartinHowe »

This example PWAD defines a modified HeXen ettin with a missile attack (he throws ettin maces at you, a la Heretic Knight). Start this PWAD with DOOM2 and warp to MAP01; engage degreelessness mode; using the console, summon a ButcheryEttin; wait for it to start hitting you. After a while (or even sooner, if you are unlucky) you die! You may need to do this a few times before the bug manifests, it is random (see below).

With the help of Graf Zahl, this has been tracked down to the default ettin's melee damage not being inherited by the subclassed ettin; instead the MeleeDamage property in ButcheryEttin gets initialised with some random value. If that value exceeds 999, it bypasses degreelessness mode, so you die. Explicitly defining the MeleeDamage property in the monster works-around the problem.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49227
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Stock monsters use hard coded melee functions and don't have any MeleeDamage property. But it still should be initialized to 0.

Furthermore, MeleeDamage is not a real property and does not get inherited at all. The same is true for all properties regarding the basic attack functions and A_Expliode.
User avatar
MartinHowe
Posts: 2062
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Post by MartinHowe »

Graf Zahl wrote:Stock monsters use hard coded melee functions and don't have any MeleeDamage property. But it still should be initialized to 0.

Furthermore, MeleeDamage is not a real property and does not get inherited at all. The same is true for all properties regarding the basic attack functions and A_Explode.
Right, so the problem is caused by overriding the attack function with one that needs an explicit MeleeDamage. Fair enough, but I would argue that there should not be a default; rather, I would suggest that this means that the "bug" I am actually reporting is the fact that the DECORATE logic does not abort with an error if MeleeDamage is not defined for a monster that uses an attack which requires it.

I guess that ideally, MeleeDamage should become an actual property of stock monsters and initialised to the damage parameter in the formula used by their native melee damage. If no such value simplistically exists, then some value could be used that is based on, for example, how many attacks, on average, that the stock monster would take to kill a player with 100% health if the player doesn't fight back. For example, the equivalent average MeleeDamage to "pr_ettinatk.HitDice (2)".

This would probably mean a lot of extra work for Randy. On the other hand, if a programmer needs to replicate the melee damage of a "real" ettin (or whatever), that programmer still needs to know that value. Indeed, I still need to know that value for ButcheryEttin, but I've no idea what that value should be :)

Incidentally, what does PROP_Damage(n) do in a monster? In a_ettin.cpp it is set to 3.
Post Reply

Return to “Closed Bugs [GZDoom]”