XML:ONCC: Difference between revisions

1,423 bytes added ,  10 October 2021
clarified <HurtSoundConstants>
m (more copy-editing)
(clarified <HurtSoundConstants>)
Line 122: Line 122:
| <JumpDistanceSquares>
| <JumpDistanceSquares>
| int8
| int8
| Always 6
| Always 6; unused
|}
|}


Line 209: Line 209:
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
!width=120px| content type
!width=120px| Content type
! description
! Description
|-
|-
| <BasePercentage>
| <BasePercentage>
| int16
| int16
| hurt_base_percentage; always the same (35)
| Always 35; minimum chance of playing a pain sound (but the actual calculation is much more complicated; see below)
|-
|-
| <MaxPercentage>
| <MaxPercentage>
| int16
| int16
| hurt_max_percentage; always the same (90)
| Always 90; maximum chance of playing a pain sound
|-
|-
| <PercentageThreshold>
| <PercentageThreshold>
| int16
| int16
| hurt_percentage_threshold; always the same (15)
| Always 15; at least this much damage must be done to play a pain sound
|-
|-
| <Timer>
| <Timer>
| int16
| int16
| hurt_timer; always the same (120)
| Always 120; time in ticks before the damage tracker used for this AI's pain sounds resets
|-
|-
| <MinTimer>
| <MinTimer>
| int16
| int16
| hurt_min_timer; always the same (35)
| Always 35; time in ticks that must pass between pain sounds being played, no matter any other considerations
|-
|-
| <MaxLight>
| <MaxLight>
| int16
| int16
| always the same (1)
| Always 1; number of times that AI will play light pain sound before "upgrading" to a medium pain sound upon subsequent damage
|-
|-
| <MaxMedium>
| <MaxMedium>
| int16
| int16
| always the same (2)
| Always 2; number of times that AI will play medium pain sound before "upgrading" to a heavy pain sound upon subsequent damage
|-
|-
| <DeathChance>
| <DeathChance>
| int16
| int16
| always the same (100)
| Always 100; compared against a random number to determine whether to play a death sound
|-
|-
| <VolumeTreshold>
| <VolumeTreshold>
| int16
| int16
| hurt_volume_threshold; always the same (10)
| Always 10; at least this much damage must be done for the AI to play the pain sound at maximum volume
|-
|-
| <MediumTreshold>
| <MediumTreshold>
| int16
| int16
| hurt_medium_threshold; always the same (12)
| Always 12; after this much cumulative damage, a light pain sound gets upgraded to a medium pain sound
|-
|-
| <HeavyTreshold>
| <HeavyTreshold>
| int16
| int16
| hurt_heavy_threshold; always the same (22)
| Always 22; after this much cumulative damage, a medium pain sound gets upgraded to a heavy pain sound
|-
|-
| <MinVolume>
| <MinVolume>
| float
| float
| minimal sound volume
| Minimal sound volume, e.g. 0.5, used when determining the volume of the pain sound to be played (before <VolumeTreshold> damage is reached and the volume becomes 100%)
|-
|-
| <LightSound>
| <LightSound>
Line 277: Line 277:
|}
|}


If the AI is in an alerted state, has not been hurt within the last <Timer> ticks, and the damage being done is at least <PercentageThreshold>, the chance of playing a pain sound is <BasePercentage> + (damage done * (<MaxPercentage> - <BasePercentage>)) / <PercentageThreshold>. This calculated chance is then compared against a random value before Oni finally decides whether to play it. If the AI is alerted and has already received damage within the last <Timer> ticks, they will not play a hurt sound. If the AI is ''not'' in an alerted state, they will always play a hurt sound.


==<AIConstants>==
==<AIConstants>==