damage extensions

From Wiki

Jump to: navigation, search
(wrong version)
 
(23 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
Extensions in this section govern "damage". Which boils down to a kind of sport, often a virtual blood sport in violent video games. You basically have a tit-for-tat until one side falls or loses.  
 
Extensions in this section govern "damage". Which boils down to a kind of sport, often a virtual blood sport in violent video games. You basically have a tit-for-tat until one side falls or loses.  
  
In a classical game of Sword of Moonlight the player wields weapons with different damage ratings, and monsters have built in "attacks" that are analogous to these weapons which may be mitigated by various pieces of armor worn by the player. Monsters have built in defenses. Blows are traded. Each time so-called hit points are rewarded until one side runs out of points and loses the game.
+
In a classical game of Sword of Moonlight the player wields weapons with different damage ratings, and monsters have built in "attacks" that are analogous to these weapons which may be mitigated by various pieces of armor worn by the player. Monsters have built in defenses. Blows are exchanged. Each time so-called hit points are rewarded until one side can bear no more and loses the game.
  
 
Where P is hit-points, and Q is the hit-point offset, or defense. The classical formula for calculating damage is equal to max(0,P-Q)+inf(P*P/(Q*2),0) and the new formula per [[#do_fix_damage_calculus]] is P-max(0,Q-P*P/(Q*2)). In both cases the result is clamped to the range [0,infinity]. The inf is a bug in the classical formula based on undefined behavior. The value of infinity arises when Q is 0. Becoming 0 when converted to an integer representation.  
 
Where P is hit-points, and Q is the hit-point offset, or defense. The classical formula for calculating damage is equal to max(0,P-Q)+inf(P*P/(Q*2),0) and the new formula per [[#do_fix_damage_calculus]] is P-max(0,Q-P*P/(Q*2)). In both cases the result is clamped to the range [0,infinity]. The inf is a bug in the classical formula based on undefined behavior. The value of infinity arises when Q is 0. Becoming 0 when converted to an integer representation.  
Line 13: Line 13:
 
In the example above, in the case of the player, P and Q are subject to bonuses that are a function of the player's "stats" or characteristics such as Strength that accumulate over the course of a game as the player repeatedly performs certain actions. The classical bonus formula is Strength/5. However if P is 0 the bonus is 0. For Q the bonus is not zeroed out. The new bonus formula per do_fix_damage_calculus is P or Q*(Strength/[[#player_character_weight]]).
 
In the example above, in the case of the player, P and Q are subject to bonuses that are a function of the player's "stats" or characteristics such as Strength that accumulate over the course of a game as the player repeatedly performs certain actions. The classical bonus formula is Strength/5. However if P is 0 the bonus is 0. For Q the bonus is not zeroed out. The new bonus formula per do_fix_damage_calculus is P or Q*(Strength/[[#player_character_weight]]).
  
Finally do_fix_damage_calculus also factors in the scale of the player and monster. For monsters this scale is set when placing the monster onto its game map. For players the extension [[#player_character_scale]] is consulted. So when computing P where S is the scale, and weight is 50, P becomes P*(1+Strength/50)*S.  
+
Finally do_fix_damage_calculus also factors in the scale of the player and monster. For monsters this scale is set when placing the monster onto its game map. For players the extension [[#player_character_scale]] is consulted. So when computing P where S is the scale, and weight is 50, P becomes P*(Strength/50)*S.{{dagger}}
  
====*do_not_harm_defenseless_characters====
+
{{dagger|Prior to 1.2.1.14 the formula had been P*(1+Strength/50)*S in keeping with being a strict bonus. Ever since it is geometric, so that no "strength" equates to no "damage." This change is first and foremost to let NPCs and PCs draw from the same pool of "magical" effects, since NPCs may be less efficacious.}}
  
====*hit_handicap_quantifier====
+
''Since 1.2.1.14'' most "damage" sources can have the two "stats" traditionally related to Strength and Magic. In these cases, the [[#do_fix_damage_calculus]] formula uses the value 50, that is the default of [[#player_character_weight]], only so that there is a standard scale. In order to replicate this or do otherwise [[SomEx/list_of_numbers#pc|pc]] is amended to include a [[character_identifier]].
  
====*hit_offset_quantifier...====
+
====do_not_harm_defenseless_characters====
 +
{{Ex/inival|1.1.2.2|binary statements|in the affirmative protects passive non-player characters from the attacks of aggressive non-player characters aimed at a player character. It does <u>not</u> protect the character from player character born attacks|do}}
  
====*hit_outcome_quantifier====
+
''Word of warning, because [[SOM]] segregates "enemies" and "NPCs" and "objects" scenarios might choose to make destructible elements out of NPCs. In that case, this easy fix can make progress impossible. An alternative fix is to identify said objects (by [[character identifier|ID]]) in the final damage calculus.''
  
====*hit_penalty_quantifier====
+
====hit_handicap_quantifier====
 +
{{Ex/inival|1.1.2.2|positive real numbers|quantifies the final "hit point" damage. It accepts one input parameter: the aggregated sum of [[#hit_outcome_quantifier]] per each exchange. The default behavior is to round 0 up to 1 not changing anything otherwise, or [[SomEx/list_of_numbers#not|not]](1_,1).
  
====*hit_point_mode====
+
The [[SomEx/list_of_numbers#pc|pc]] variable refers to the defender|number}}
  
====*hit_point_model====
+
'''Note: that if the output is 0 the stun animation is not triggered. In other words a 0 output exchange appears to miss its mark.'''
  
====*hit_point_quantifier...====
+
====hit_offset_quantifier...====
 +
{{anchor|hit_offset_quantifier|hit_offset_quantifier2}}
 +
''Since 1.2.1.14 '''hit_offset_quantifier''' defers to [[#hit_point_quantifier]] so it can be omitted where equivalent.''
 +
 
 +
{{Ex/inival|1.1.2.2|positive real numbers|quantifies the second input parameter of [[#hit_outcome_quantifier]]. It has three input parameters of its own: the damage rating of a character's defenses, a modifier associated with evasive maneuvers, and the affinity index of the damage rating; this number is 0 for the first rating, 1 for the second, and so on. Up to 7.
 +
 
 +
The default behavior depends on [[#do_fix_damage_calculus]]. Refer to the opening remarks of [[#Damage]] for details.
 +
 
 +
The default behavior of [[#hit_offset_quantifier2]] is to defer to hit_offset_quantifier. Its function is dependent upon [[#hit_point_mode]]. However by default it is used for secondary ratings. By default these are ratings 4 through 8; traditionally associated with "magical" elemental forces: fire, water, and so on.
 +
 
 +
The [[SomEx/list_of_numbers#pc|pc]] variable refers to the defender|number}}
 +
 
 +
====hit_outcome_quantifier====
 +
''Since 1.1.2.2 there is a bug that rendered this extension useless: it had clobbered the previous rating with each in succession.''
 +
 
 +
{{Ex/inival|1.2.1.14|real numbers|quantifies the damage done by a single damage rating. It accepts three input parameters. The first comes from [[#hit_point_quantifier]]. The second comes from [[#hit_offset_quantifier]]. And the third is the affinity index of the damage rating. Refer to hit_point_quantifier for details.
 +
 
 +
The default behavior depends on [[#do_fix_damage_calculus]]. Refer to the opening remarks of [[#Damage]] for details.
 +
 
 +
The outputs are converted to integer magnitudes{{dagger}} (absolute value) clamped to the range of [0,65535] to be summed together per damage rating. This sum is then inputted into [[#hit_handicap_quantifier]] in order to arrive at the ultimate "hit point" damage to the defending character.
 +
 
 +
{{dagger|'''Since 1.2.1.14 negative outcomes are understood to be damage (HP lost.) Outputs should be either always positive or always negative, depending on what is preferred or natural, unless they can go either way. (To be clear, positive outcomes are also HP lost; HP is never gained.)'''}}
 +
 
 +
The [[SomEx/list_of_numbers#pc|pc]] variable refers to the defender|number}}
 +
 
 +
====hit_penalty_quantifier====
 +
This extension did not make it into 1.1.2.2. It is to govern damage born of residual factors; poisons for example.
 +
 
 +
====hit_point_mode====
 +
{{Ex/inival|1.1.2.2|numerical codes|augments the behavior of [[#hit_point_quantifier]] and [[#hit_offset_quantifier]]. The default is 0. The default behavior is unspecified. Historically the default behavior is identical to 1. The behavior of 1 is to use [[#hit_point_quantifier2]] and [[#hit_offset_quantifier2]] for ratings 4 through 8. Classical Sword of Moonlight aligns these with "magical" elemental forces.
 +
 
 +
The behavior of 2{{dagger}} is to use hit_point_quantifier2 and hit_offset_quantifier2 for indirect exchanges|code}}
 +
 
 +
{{dagger|Prior to 1.2.1.14 the built-in formulas had not implemented mode 2.}}
 +
 
 +
====hit_point_model====
 +
This extension did not make it into 1.1.2.2. It is to be used to select from a menu of alternative damage models. The simplest kind of model is +1, which says to shift the the dividing line between primary and secondary, aka. physical and magical, damage ratings up by 1 so that the fourth rating is changed from secondary to primary (in this example.)
 +
 
 +
====hit_point_quantifier...====
 +
{{anchor|hit_point_quantifier|hit_point_quantifier2}}
 +
{{Ex/inival|1.1.2.2|positive real numbers|quantifies the first input parameter of [[#hit_outcome_quantifier]]. It has three input parameters of its own: the damage rating of a weapon or more broadly speaking an "attack", a modifier used by [[#hit_offset_quantifier]], and damage rating index; this number is 0 for the first rating, 1 for the second, and so on. Up to 7.
 +
 
 +
The default behavior depends on [[#do_fix_damage_calculus]]. Refer to the opening remarks of [[#Damage]] for details.
 +
 
 +
The default behavior of [[#hit_point_quantifier2]] is to defer to hit_point_quantifier. Its function is dependent upon [[#hit_point_mode]]. However by default it is used for secondary ratings. By default these are ratings 4 through 8; traditionally associated with "magical" elemental forces: fire, water, and so on.
 +
 
 +
The [[SomEx/list_of_numbers#pc|pc]] variable refers to the attacker|number}}
  
 
</onlyinclude>
 
</onlyinclude>

Latest revision as of 02:25, 16 February 2018


This section is available since 1.1.2.2.

Extensions in this section govern "damage". Which boils down to a kind of sport, often a virtual blood sport in violent video games. You basically have a tit-for-tat until one side falls or loses.

In a classical game of Sword of Moonlight the player wields weapons with different damage ratings, and monsters have built in "attacks" that are analogous to these weapons which may be mitigated by various pieces of armor worn by the player. Monsters have built in defenses. Blows are exchanged. Each time so-called hit points are rewarded until one side can bear no more and loses the game.

Where P is hit-points, and Q is the hit-point offset, or defense. The classical formula for calculating damage is equal to max(0,P-Q)+inf(P*P/(Q*2),0) and the new formula per #do_fix_damage_calculus is P-max(0,Q-P*P/(Q*2)). In both cases the result is clamped to the range [0,infinity]. The inf is a bug in the classical formula based on undefined behavior. The value of infinity arises when Q is 0. Becoming 0 when converted to an integer representation.

In the example above, in the case of the player, P and Q are subject to bonuses that are a function of the player's "stats" or characteristics such as Strength that accumulate over the course of a game as the player repeatedly performs certain actions. The classical bonus formula is Strength/5. However if P is 0 the bonus is 0. For Q the bonus is not zeroed out. The new bonus formula per do_fix_damage_calculus is P or Q*(Strength/#player_character_weight).

Finally do_fix_damage_calculus also factors in the scale of the player and monster. For monsters this scale is set when placing the monster onto its game map. For players the extension #player_character_scale is consulted. So when computing P where S is the scale, and weight is 50, P becomes P*(Strength/50)*S.+

+Prior to 1.2.1.14 the formula had been P*(1+Strength/50)*S in keeping with being a strict bonus. Ever since it is geometric, so that no "strength" equates to no "damage." This change is first and foremost to let NPCs and PCs draw from the same pool of "magical" effects, since NPCs may be less efficacious.

Since 1.2.1.14 most "damage" sources can have the two "stats" traditionally related to Strength and Magic. In these cases, the #do_fix_damage_calculus formula uses the value 50, that is the default of #player_character_weight, only so that there is a standard scale. In order to replicate this or do otherwise pc is amended to include a character_identifier.

do_not_harm_defenseless_characters[edit]

Introduced around 1.1.2.2, this extension in the affirmative protects passive non-player characters from the attacks of aggressive non-player characters aimed at a player character. It does not protect the character from player character born attacks. Values are limited to binary statements.[#]

Word of warning, because SOM segregates "enemies" and "NPCs" and "objects" scenarios might choose to make destructible elements out of NPCs. In that case, this easy fix can make progress impossible. An alternative fix is to identify said objects (by ID) in the final damage calculus.

hit_handicap_quantifier[edit]

Introduced around 1.1.2.2, this extension quantifies the final "hit point" damage. It accepts one input parameter: the aggregated sum of #hit_outcome_quantifier per each exchange. The default behavior is to round 0 up to 1 not changing anything otherwise, or not(1_,1).

The pc variable refers to the defender. Values are limited to positive real numbers.[#]

Note: that if the output is 0 the stun animation is not triggered. In other words a 0 output exchange appears to miss its mark.

hit_offset_quantifier...[edit]

Since 1.2.1.14 hit_offset_quantifier defers to #hit_point_quantifier so it can be omitted where equivalent.

Introduced around 1.1.2.2, this extension quantifies the second input parameter of #hit_outcome_quantifier. It has three input parameters of its own: the damage rating of a character's defenses, a modifier associated with evasive maneuvers, and the affinity index of the damage rating; this number is 0 for the first rating, 1 for the second, and so on. Up to 7.

The default behavior depends on #do_fix_damage_calculus. Refer to the opening remarks of #Damage for details.

The default behavior of #hit_offset_quantifier2 is to defer to hit_offset_quantifier. Its function is dependent upon #hit_point_mode. However by default it is used for secondary ratings. By default these are ratings 4 through 8; traditionally associated with "magical" elemental forces: fire, water, and so on.

The pc variable refers to the defender. Values are limited to positive real numbers.[#]

hit_outcome_quantifier[edit]

Since 1.1.2.2 there is a bug that rendered this extension useless: it had clobbered the previous rating with each in succession.

Introduced around 1.2.1.14, this extension quantifies the damage done by a single damage rating. It accepts three input parameters. The first comes from #hit_point_quantifier. The second comes from #hit_offset_quantifier. And the third is the affinity index of the damage rating. Refer to hit_point_quantifier for details.

The default behavior depends on #do_fix_damage_calculus. Refer to the opening remarks of #Damage for details.

The outputs are converted to integer magnitudes+ (absolute value) clamped to the range of [0,65535] to be summed together per damage rating. This sum is then inputted into #hit_handicap_quantifier in order to arrive at the ultimate "hit point" damage to the defending character.

+Since 1.2.1.14 negative outcomes are understood to be damage (HP lost.) Outputs should be either always positive or always negative, depending on what is preferred or natural, unless they can go either way. (To be clear, positive outcomes are also HP lost; HP is never gained.)

The pc variable refers to the defender. Values are limited to real numbers.[#]

hit_penalty_quantifier[edit]

This extension did not make it into 1.1.2.2. It is to govern damage born of residual factors; poisons for example.

hit_point_mode[edit]

Introduced around 1.1.2.2, this extension augments the behavior of #hit_point_quantifier and #hit_offset_quantifier. The default is 0. The default behavior is unspecified. Historically the default behavior is identical to 1. The behavior of 1 is to use #hit_point_quantifier2 and #hit_offset_quantifier2 for ratings 4 through 8. Classical Sword of Moonlight aligns these with "magical" elemental forces.

The behavior of 2+ is to use hit_point_quantifier2 and hit_offset_quantifier2 for indirect exchanges. Values are limited to numerical codes.[#]

+Prior to 1.2.1.14 the built-in formulas had not implemented mode 2.

hit_point_model[edit]

This extension did not make it into 1.1.2.2. It is to be used to select from a menu of alternative damage models. The simplest kind of model is +1, which says to shift the the dividing line between primary and secondary, aka. physical and magical, damage ratings up by 1 so that the fourth rating is changed from secondary to primary (in this example.)

hit_point_quantifier...[edit]

Introduced around 1.1.2.2, this extension quantifies the first input parameter of #hit_outcome_quantifier. It has three input parameters of its own: the damage rating of a weapon or more broadly speaking an "attack", a modifier used by #hit_offset_quantifier, and damage rating index; this number is 0 for the first rating, 1 for the second, and so on. Up to 7.

The default behavior depends on #do_fix_damage_calculus. Refer to the opening remarks of #Damage for details.

The default behavior of #hit_point_quantifier2 is to defer to hit_point_quantifier. Its function is dependent upon #hit_point_mode. However by default it is used for secondary ratings. By default these are ratings 4 through 8; traditionally associated with "magical" elemental forces: fire, water, and so on.

The pc variable refers to the attacker. Values are limited to positive real numbers.[#]