Jump to content

XML:ONCC: Difference between revisions

89 bytes removed ,  11 October 2021
clarified <AIConstants>, caught big oops with "friendly" timers
(clarified <HurtSoundConstants>)
(clarified <AIConstants>, caught big oops with "friendly" timers)
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.
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>. 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>==
{| 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
|-
|-
|valign=top| <Flags>
|valign=top| <Flags>
Line 291: Line 291:
: EnableMeleeFireDodge
: EnableMeleeFireDodge
: ShootDodge (requires EnableMeleeFireDodge; AI tries to face shooter and shoot back while dodging)
: ShootDodge (requires EnableMeleeFireDodge; AI tries to face shooter and shoot back while dodging)
: RunAwayDodge (requires EnableMeleeFireDodge; overrides ShootDodge; firingspread/projectile dodge enabled for weapons; AI isn't shooting, it just tends to run away, not facing shooter)
: RunAwayDodge (requires EnableMeleeFireDodge; overrides ShootDodge; firing spread/projectile dodge enabled for weapons; AI isn't shooting, it just tends to run away, not facing shooter)
: NotUsed
: NotUsed
|-
|-
Line 300: Line 300:
| <DazedMinFrames>
| <DazedMinFrames>
| int16
| int16
| minimal fallen time; number of frames for which AI remains in *fallen* position when it is knockdowned
| Minimum number of frames for which AI remains in fallen position when it is knocked down
|-
|-
| <DazedMaxFrames>
| <DazedMaxFrames>
| int16
| int16
| maximal fallen time; number of frames for which AI remains in *fallen* position when it is knockdowned
| Maximum number of frames for which AI remains in fallen position when it is knocked down
|-
|-
| <DodgeReactFrames>
| <DodgeReactFrames>
| uint32
| uint32
| number of frames after which AI realizes that it is in the firing spread and it starts dodging
| Number of frames after which AI realizes that it is inside a firing spread and starts dodging
|-
|-
|valign=top| <DodgeTimeScale>
|valign=top| <DodgeTimeScale>
|valign=top| float
|valign=top| float
| minimal firingspread dodge amount; IMO similar to maneouvre variable, it tells AI how long it should perform dodging/hiding in response to some time spent inside firing spread (so setting this very high means that once enemy starts dodging/hiding, he will perform it even after firing spread disappears)
| Minimum firing spread dodge amount; similar to the maneuver variable, it tells the AI how long it should continue dodging/hiding in response to being inside a firing spread (so setting this very high means that once the enemy starts dodging/hiding, it will continue even after the firing spread disappears)
|-
|-
| <DodgeWeightScale>
| <DodgeWeightScale>
| float
| float
| maximal firingspread dodge amount; IMO similar to maneouvre variable
| Dampens dodging of firing spread/projectile; the higher it is, the lower priority the AI gives to dodging
|-
|-
| <Targeting>
| <Targeting>
|
|
| see [[#<Targeting>|HERE]]
| See [[#<Targeting>|HERE]]
|-
|-
| <WeaponSkills>
| <WeaponSkills>
|
|
| see [[#<WeaponSkills>|HERE]]
| See [[#<WeaponSkills>|HERE]]
|-
|-
| <DeadMakeSureDelay>
| <DeadMakeSureDelay>
| int32
| int32
| always the same (90), AI waits at the corpse for some time?
| Always 90; how long AI will continue shooting a dead body to make sure it's dead
|-
|-
| <InvestigateBodyDelay>
| <InvestigateBodyDelay>
| int32
| int32
| always the same (240), unused ?
| Always 240; how long AI will stand over dead body before returning to last job
|-
|-
| <LostContactDelay>
| <LostContactDelay>
| int32
| int32
| always the same (180)
| Always 180; how long after losing sight of target until AI engages pursuit mode
|-
|-
| <DeadTauntChance>
| <DeadTauntChance>
| int32
| int32
| chance of AI doing a taunt when player or AI's of another team dies
| Chance of AI taunting a dead body
|-
|-
| <GoForGunChance>
| <GoForGunChance>
| int32
| int32
| determines possibility that AI will run to some weapon and take it; can be checked in devmode by *debug_gun_behavior* command  
| Chance of AI running to some weapon to pick it up; can be checked in Dev Mode with the '''debug_gun_behavior''' command  
|-
|-
| <RunPickupChance>
| <RunPickupChance>
| int32
| int32
| this value is possibility of AI running weapon pickup (acrobatics, slides) instead of normal "stop->pickup"; this is calculated AFTER engine decides that AI should run for weapon
| Chance of AI performing a running weapon pickup (including acrobatics moves, slides) instead of the normal "stop and pick up"; this is calculated ''after'' the engine decides that the AI will go for a gun
|-
|-
| <CombatId>
| <CombatId>
| int16
| int16
| [[XML:BINA/OBJC/CMBT|combat profile ID]]
| [[XML:BINA/OBJC/CMBT|Combat profile ID]]
|-
|-
| <MeleeId>
| <MeleeId>
| int16
| int16
| [[XML:BINA/OBJC/MELE|melee profile ID]]
| [[XML:BINA/OBJC/MELE|Melee profile ID]]
|-
|-
| <SoundConstants>
| <SoundConstants>
|
|
| see [[XML:SNDD#Step_1:_Preparing_the_TRAM|HERE]]
| See [[XML:SNDD#Step_1:_Preparing_the_TRAM|HERE]]
|-
|-
|valign=top| <HostileThreatDefiniteTimer>
|valign=top| <HostileThreatDefiniteTimer>
|valign=top| int32
|valign=top| int32
| how long will AI know exactly where its enemy is even if it can't see him with central vision-field; AI attacks him; can be checked by *ai2_report_verbose* command (this command causes random crashes, beware)
| How long an AI will know exactly where its enemy is even if it can't see him with its central vision field, and attempt to attack him
|-
|-
|valign=top| <HostileThreatStrongTimer>
|valign=top| <HostileThreatStrongTimer>
|valign=top| int32
|valign=top| int32
| how long will AI remain in strong feeling that there is the enemy, but will not attack him but investigate; can be checked by *ai2_report_verbose* command
| How long an AI will remain strongly convinced that there is an enemy, but will investigate his presence rather than attempt to attack him
|-
|-
|valign=top| <HostileThreatWeakTimer>
|valign=top| <HostileThreatWeakTimer>
|valign=top| int32
|valign=top| int32
| how long will AI remain in weak feeling of an enemy, just looking around aimlessly (Glance pursue mode); can be checked by *ai2_report_verbose* command
| How long an AI will remain weakly convinced of an enemy's presence, looking around aimlessly to find him (Glance pursuit mode)
|-
|-
|valign=top| <FriendlyThreatDefiniteTimer>
|valign=top| <FriendlyThreatDefiniteTimer>
|valign=top| int32
|valign=top| int32
| how long will AI know exactly where its ally (Syndicate saw Syndicate for example) is even if it can't see him with central vision-field; AI simply knows there is someone else nearby; maybe has further possibilities; can be checked by *ai2_report_verbose* command (this command causes random crashes, beware)
| This field is mislabeled, as it is actually the decay time for dropping back from high alert to medium alert and does not concern friendly AIs
|-
|-
|valign=top| <FriendlyThreatStrongTimer>
|valign=top| <FriendlyThreatStrongTimer>
|valign=top| int32
|valign=top| int32
| how long will AI remain in strong feeling that there is someone else, but will not try to find him or look at him; can be checked by *ai2_report_verbose* command
| This field is mislabeled, as it is actually the decay time for dropping back from medium alert to low alert and does not concern friendly AIs
|-
|-
|valign=top| <FriendlyThreatWeakTimer>
|valign=top| <FriendlyThreatWeakTimer>
|valign=top| int32  
|valign=top| int32  
| how long will AI remain in weak feeling of ally, doing its usual job; can be checked by *ai2_report_verbose* command
| This field is mislabeled, as it is actually the decay time for dropping back from low alert to no alert status and does not concern friendly AIs
|-
|-
| <EarshotRadius>
| <EarshotRadius>
| float
| float
| earshot radius; defines size of the sound-collision sphere around AI
| Hearing radius; defines the size of the sound-detection sphere around an AI
|}
|}


You can observe the running of the various timers above by using the '''ai2_report_verbose''' command in the dev console (beware, this command causes random crashes).


===<Targeting>===
===<Targeting>===