XML:ONCC: Difference between revisions

m
→‎LODConstants: formatting
m (copy-edit of rest of article)
m (→‎LODConstants: formatting)
 
(12 intermediate revisions by 2 users not shown)
Line 5: Line 5:
* ONCP, ONIA, OBPI and OBPM are part of '''ONCC*.oni''' files.
* ONCP, ONIA, OBPI and OBPM are part of '''ONCC*.oni''' files.
* ONCC files are global; they can be found in AE/AEInstaller/vanilla/level0_Final.dat.
* ONCC files are global; they can be found in AE/AEInstaller/vanilla/level0_Final.dat.
* Things that still need deeper explanation:
: '''<DamageFactors>'''
: <CoverConstants>
: <AutoFreezeConstants>
: <LODConstants>


==<AirConstants>==
==<AirConstants>==
Line 23: Line 18:
! Description
! Description
|-
|-
|<FallGravity>
| <FallGravity>
| float
| float
| Downwards velocity? Always 0.55. It would be roughly equivalent to the starting velocity of a fall. Although the value 0.55 seems right, the "sinking" seems to be hardcoded now.
| Always 0.55. Used as the speed of a fall when predicting if an attack will hit a target when the attacker is in midair. It seems to be a bug that this is looked at, as <JumpGravity> actually controls the character's gravity while going up <u>and</u> down.
|-
|-
| <JumpGravity>
| <JumpGravity>
| float
| float
| Downward gravity acceleration
| Always in range 0.05-0.07. The strength of gravity (as acceleration per frame) for the entire duration of a jump.
|-
|-
| <JumpStartVelocity>
| <JumpStartVelocity>
Line 41: Line 36:
| <JetpackAcceleration>
| <JetpackAcceleration>
| float
| float
| Upward acceleration (jetpack) if you hold JUMP  
| Upward acceleration for the duration of time that you hold down JUMP  
|-
|-
| <FramesFallGravity>
| <FramesFallGravity>
| int16
| int16
| Gravity timer (the time until gravity switches on)? Always 7. Seems to be hardcoded now.
| Always 7. After this many frames, <FallGravity> is used for the deceleration of a jump when predicting if an attack will hit a target when the attacker is in midair; before that many frames, <JumpGravity> is used for the prediction. It seems to be a bug that this is field is looked at, as <JumpGravity> controls a character's gravity while going up <u>and</u> down.
|-
|-
| <JetpackTimer>
| <JetpackTimer>
| int16
| int16
| Time during which you can use the jetpack. [http://mods.oni2.net/node/83 This mod] allows you to press JUMP multiple times during the time window (quite fun!).
| Standard value is 14, but ranges from 4 (Elite Striker) to 20 (Konoko). This misleadingly-named field is the number of frames for which you can continue holding down JUMP to increase the height of your jump. [http://mods.oni2.net/node/83 This mod] vastly increases the value of this field for Barabas. When shapeshifted to him, you can keep ascending by holding JUMP; pressing JUMP multiple times during the time window is also allowed.
|-
|-
| <MaxNoDamageFallingHeight>
| <MaxNoDamageFallingHeight>
| float
| float
| Maximum falling height without damage (see below)
| Maximum falling height without taking damage (see below)
|-
|-
| <MaxDamageFallingHeight>
| <MaxDamageFallingHeight>
Line 179: Line 174:


==<LODConstants>==
==<LODConstants>==
Distances from camera used to choose which [[XML:TRBS|LOD]] (level of detail) to use for a character model.
Distances from camera used to choose which [[XML:TRBS|LOD]] (level of detail) to use for a character model. The numbers are stored as squares of the distance in order to be compared quickly against the square of the current distance from the camera without having to perform any square root operations.
 
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
!width=150px| XML tag
!width=150px| XML tag
Line 187: Line 183:
| <Float>
| <Float>
| float
| float
| Always 193,600 (440^2)
| Always 193,600 (440²). Threshold for Super-Low LOD. If the camera is more than 440 world units (147ft or 44m) from a character, this LOD is selected.
|-
|-
| <Float>
| <Float>
| float
| float
| Always 48,400 (220^2)
| Always 48,400 (220²). Threshold for Low LOD. If the camera is more than 220 wu (73ft or 22m) from a character, this LOD is selected.
|-
|-
| <Float>
| <Float>
| float
| float
| Always 12,100 (110^2)  
| Always 12,100 (110²). Threshold for Medium LOD. If the camera is more than 110 wu (37ft or 11m) from a character, this LOD is selected.
|-
|-
| <Float>
| <Float>
| float
| float
| Always 0
| Always 0. This means that the High LOD will always be selected if the camera is 110 wu or less from a character.
|-
|-
| <Float>
| <Float>
| float
| float
| Always 0
| Always 0. This Super-High LOD is never reached by only looking at camera distance, but continue reading below.
|}
|}
After the above distance-from-camera filter is applied, Oni performs additional calculations which could end up raising or lowering the LOD for this character. See {{SectionLink|Graphics|LOD}} for the details of the logic.


==<HurtSoundConstants>==
==<HurtSoundConstants>==
Line 222: Line 220:
| <PercentageThreshold>
| <PercentageThreshold>
| int16
| int16
| Always 15; at least this much damage must be done to play a pain sound
| Always 15; minimum damage needed to have maximum chance of playing pain sound (see below for elaboration)
|-
|-
| <Timer>
| <Timer>
Line 242: Line 240:
| <DeathChance>
| <DeathChance>
| int16
| int16
| Always 100; compared against a random number to determine whether to play a death sound
| Always 100; chance of playing a death sound
|-
|-
| <VolumeTreshold>
| <VolumeTreshold>
Line 277: Line 275:
|}
|}


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.
If the AI is in an alerted state and has not been hurt within the last <Timer> ticks, the odds of playing a pain sound are as follows: if damage being done is at least <PercentageThreshold>, the chance of playing a pain sound is <MaxPercentage>; if less than <PercentageThreshold>, then the chance is <BasePercentage> + (damage done * (<MaxPercentage> - <BasePercentage>)) / <PercentageThreshold>. This ramps up the odds of the pain sound from <BasePercentage> to <MaxPercentage> as the damage runs from 1 HP (38% chance) to 14 HP (86% chance). If the AI is alerted but has already received damage within the last <Timer> ticks, they will not play a pain sound. If the AI was ''not'' in an alerted state before being hit, they will always play a pain sound.


==<AIConstants>==
==<AIConstants>==
Line 296: Line 294:
| <RotationSpeed>
| <RotationSpeed>
| float
| float
| AI rotation speed factor. Reference rotation speed is about 1 turn (360°) per second. The setting is only effective if the AI is in control, so it's a bit like the AI's mouse sensitivity :)
| AI rotation speed factor. Reference rotation speed is about 1 turn (360°) per second. The setting is only effective if the AI is in control, so it's a bit like the AI's mouse sensitivity :) In the vanilla data, it's set to 1 for all ONCCs except for Ninjabots, Ninjas and Mukade, who have the value 2.
|-
|-
| <DazedMinFrames>
| <DazedMinFrames>
Line 470: Line 468:
These can be viewed with e.g. '''ai2_skill_select konoko_generic w1_tap''' and then either '''ai2_skill_show''' (prints to console) or '''ai2_skill_save''' (prints to file). Sample skill settings for one ONCC are shown below.
These can be viewed with e.g. '''ai2_skill_select konoko_generic w1_tap''' and then either '''ai2_skill_show''' (prints to console) or '''ai2_skill_save''' (prints to file). Sample skill settings for one ONCC are shown below.


The first weapon (weapon 0) is not in the game anymore, whatever it was. Muro's thunderbolt is handled as animation-bound particles, although it used to be handled as a weapon (same for Mukade's Devil Star, except '''w10_sni''' is still available). Barabas' Wave Motion Cannon is a bit mixed up since the beam is made of '''w12_ba2''' particles and the grenade is a '''w11_ba1''' particle.
The first weapon (weapon 0) is not in the game anymore, whatever it was. Mutant Muro's thunderbolt is handled as animation-bound particles, although it used to be handled as a weapon (same for Mukade's Devil Star, except '''w10_sni''' is still available). Barabas' Wave Motion Cannon is a bit mixed up since the beam is made of '''w12_ba2''' particles and the grenade is a '''w11_ba1''' particle.


{| class="wikitable" style="text-align:center"
{| class="wikitable" style="text-align:center"
Line 578: Line 576:
|valign=top| <ImpactModifierName>
|valign=top| <ImpactModifierName>
|valign=top| flag
|valign=top| flag
| Used to choose the correct effect from [[XML:BINA/ONIE#List_of_tags.2C_types.2C_and_flags|ONIE]]; impact name -> material name -> modifier (<Component> probably has to be "Impact")
| Used to choose the correct effect from [[XML:BINA/ONIE#List_of_tags.2C_types.2C_and_flags|ONIE]]; impact name -> material name -> modifier (<Component> probably has to be "Impact"). This appears to have been set in the vanilla data based on the approx. mass of the character, so that Konoko and female cops have "Light", Muro and Thugs have "Medium", and Barabas, Elite Strikers and TCTF SWAT have "Heavy". However some unusual exceptions have been made, as Tankers are set to "Medium" and regular Strikers are "Heavy".
: Any
: Any
: Light
: Light
Line 665: Line 663:
|valign=top| <WeaponHand>
|valign=top| <WeaponHand>
|valign=top| flag
|valign=top| flag
| Which hand does a character use to hold their weapon? Only ninjas (including Mukade and the ninjabots) are lefthanded.
| Which hand a character uses to hold their weapon. Only ninjas (including Mukade and the ninjabots) are lefthanded.
: 0 (right)
: 0 (right)
: 1 (left)
: 1 (left)
Line 675: Line 673:
|valign=top| <HasSupershield>
|valign=top| <HasSupershield>
|valign=top| int8
|valign=top| int8
| [[Image:XML_ONCC_daodan_super_shield.jpg|thumb|200px|Super shield]]
|
Only used by Mutant Muro. When set to 1, the character has a supershield, which:
Only used by Mutant Muro. When set to 1, the character has a [[supershield]].
* is visible as a red shield when the character is overpowered
* needs the <HasDaodanPowers> flag above and over 50% overpower to be enabled (the "chenille" cheat works too)
* when enabled, blocks damage from weapons and melee (with the exception of throws)
* when impacted by a melee attack, flares up with orange instead of showing a blue "blocked" hitflash
|-
|-
| <CantTouchThis>
| <CantTouchThis>
Line 1,033: Line 1,027:


==New character balance==
==New character balance==
Is a character sufficiently balanced? To decide on this, we might compare Oni's vanilla characters against against our new custom character. Factors that could be taken into account:
To know if a character you're creating is sufficiently balanced, you should compare Oni's vanilla characters against it. Factors that could be taken into account:
* Health
* Basic:
* Attack strength (per TRAM)
** Health
* Attack speed (frame count) (per TRAM)
** Block chances (melee profile)
* Average damage of movement set
** Attack strength (per combat TRAM)
* Max attack damage per minute
** Attack speed (frame count per combat TRAM)
* Damage multipliers (<DamageFactors>)
* Advanced:
* Block chances (melee profile)
** Damage multipliers (<DamageFactors>)
** Average damage of combat animation set
** Average damage per second (DPS)


{{XML}}
{{XML}}