271
edits
(→Combat behavior part 3: "They see me shootin', they hatin'...": Will finish it later) |
(Guns are finished, melee is the last to be done) |
||
Line 451: | Line 451: | ||
:For each one of these weapons, there are in ONCC defined these parameters (xml tag in brackets): | :For each one of these weapons, there are in ONCC defined these parameters (xml tag in brackets): | ||
:*Recoil compensation (RecoilCompensation) - | :*Recoil compensation (RecoilCompensation) - How much the A.I. cahracter compensates the recoil of the weapon. Setting this to 0.0 mean no compensation, setting this to 1.0 means full compensation. | ||
:*Best aiming angle (BestAimingAngle) - | :*Best aiming angle (BestAimingAngle) - In radians, but question is whether it really affects aiming. | ||
:*Shoot group error - | :*Shoot group error (ShotGroupError) - Random deviation of A.I.'s aim within the target spot. Incorporated to simulate human inaccuracy. Can be set more than 1.0. | ||
:*Shoot droup decay - Random deviation of the target spot. Target spot is always loosely based on enemy's position. Can be set more than 1.0. | :*Shoot droup decay (ShotGroupDecay) - Random deviation of the target spot. Target spot is always loosely based on enemy's position. Can be set more than 1.0. | ||
:*Shooting inaccuracy multiplier (ShootingInaccuracyMultiplier) - How much can A.I. stray with its aim from the target. Not clear how much it really affects aiming. | :*Shooting inaccuracy multiplier (ShootingInaccuracyMultiplier) - How much can A.I. stray with its aim from the target. Not clear how much it really affects aiming. | ||
:*Minimal shooting delay (MinShotDelay) - | :*Minimal shooting delay (MinShotDelay) - Minimal pause between reload and the beginning of a gunfire for this A.I. character. | ||
:*Maximal hooting delay (MaxShotDelay)- | :*Maximal hooting delay (MaxShotDelay)- Minimal pause between reload and the beginning of a gunfire for this A.I. character. | ||
Line 501: | Line 501: | ||
Modding hints: | Modding hints: Phew, what a long section. Described material has plenty of modding possiblities. Still, modders should be aware of a few things: | ||
:*Don't set too | :*Don't set too strong dodge vector (DodgeWeightScale) and don't overdo it with dodge timer (DodgeTimeScale, the smallest possible value is 0.4; lower is not registered). Delay before gunfire dodging (DodgeReactFrames) should be minimal, otherwise it can happen A.I. won't start dodging till shooter's weapon is empty. | ||
::As a side note, there is a glitch in gunfire dodging. It is not a coding bug, but simple limitation of a "vector" type of movement. When A.I. starts gunfire dodge, it tries to get away from the source of danger (be it firingspread or projectile). And because vector movement works as a "desire" to go to some direction, it can happen A.I. will express a "desire" to go into wall. In such a case, character stops until the desire to move into a wall stops (in other words, until enemy stops shooting the A.I. character). When A.I. character is unarmed, she/he will try to switch between pathfinding movement (to go to enemy and attack him with melee) and vector projectile dodge movement, so it kind of looks like the A.I. still tries to dodge the gunfire. If weight of a gunfire dodge is set to be smaller than standard vector movement type weight, then A.I. even does not have to get stuck as it will run in zig-zag pattern towards the armed enemy. | |||
::In case A.I. is armed with a loaded weapon, there is no point in A.I. running towards enemy. That means if the A.I. character starts dodging and meets a wall, this A.I. character gets "stuck" until enemy's gunfire stops. In case this character has set "ShootDodge" in [[ONCC]], it will at least fire back at the enemy shooter. But in case the character has set "RunAwayDodge", then it simply stands near the wall and stares and waits till enemy's gunfire ceases. | |||
::From the text above it can be seen that gunfire dodge parameters should be set to make A.I. dodge but to not make dodge vector outweight the vector for moving towards the enemy. | |||
:*A.I.'s skills with weapons (in [[ONCC]]) can be used greatly to create sharpshooters or rookies who cannot hold a gun properly. For example by setting "ShootGroupError = 10.0" for w1_tap, we create a total amateur who's hand shakes all over the place when he fires Campbell equalizer. | |||
:*Unless really needed, do NOT alter [[ONCC]] prediction parameters. Bungie set them quite reasonably and if they are messed, A.I. character loses the ability of prediction. | :*Unless really needed, do NOT alter [[ONCC]] prediction parameters. Bungie set them quite reasonably and if they are messed, A.I. character loses the ability of prediction. | ||
:* | |||
:*In [[ONWC]], Prediction speed is used for a calculation of A.I.'s aim. The value should be exactly the same as the value of this weapon's projectile. Projectile's velocity is usually set in a emitter of a projectile particle ([[PAR3]]). That means Prediction speed and actual speed of a particle used as weapon's projectile may differ, the most significant case being w3_phr (plasma balls accelerate rapidly). | |||
::If Prediction speed is set lower than the speed of a projectile is, A.I. will tend to shoot too much in front of the moving enemy since it will assume projectile is slower than it really is. On the other side, setting this value higher means A.I. will shoot more directly at the moving enemy (and probably miss) as the A.I. will assume projectiles are fast enough to hit the target. | |||
:*Similar to Prediction speed, there are Ballistic projectile speed and Ballistic projectile gravity. When these two are set non-zero, A.I. assumes ballistic projectiles (grenades) and tries to shoot projectiles according to an ideal parabole (the solution with shorter fly time is always chosen). In order to make A.I. sucesfully hit enemy's pelvis, these two must again corespond with [[PAR3]] particles's speed and particles's gravity attraction, but they can be used for modding purposes as well. For example if projectiles's gravity attaction is 0.5 but in [[ONWC]] Ballistic projectile gravity is set as 0.3, A.I. will shoot projectiles at enemy's feet as it will assume that gravity attraction of the projectile is lower thus it does not have to aim so high in order to hit the pelvis (credits to [[user:Gumby|Gumby]]). Remember: for A.I. system, pelvis is a representation of a whole character. | |||
:*Targeting origin vector ([[ONWC]]) can be utilized to make A.I. fire not directly at pelvis, but for example higher (negative "z" component), so A.I. can score headshots. So far such a change does not have any purpose as characters don't have damage multipliers for bodyparts. But maybe in future...or with Paradox's headshot mod / material dependent damage mod ideas (see [[OBD_talk:BINA/ONIE#Extra_damage_for_head_hits|HERE]]). | |||
:*One thing purposefully left out in main talk about weapons is that there is an option for A.I. chracters to make "startle" misses - when startled, A.I. fires at some random direction. Parameters for this behavior are in [[ONCC]] and [[ONWC]], but overall this feature is so subtle it does not need any special modding attention. | |||
:*Remember: in [[ONWC]], Minimal shooting distance is '''divided by 2'''. Reason is unknown, maybe some bug in a code. | |||
:*Through modification of Minimal shooting distance in conjunction with BSL scripting, a modder can achieve pseudo-dynamic holster behavior. If enemy gets too close, A.I. start moving away, facing the enemy. Since simply backing away is almost never used by armed A.I. (it usually move to the side), it can be detected via BSL function '''chr_wait_animation''' and subsequent script makes A.I. character holster held weapon. To unholster, different animation check has to be used, for example a check for a taunt animation. In [[MELE]], modder can set up approppriate melee profile which makes A.I. character taunt only at safe distance. | |||
::Drawback of this modification is is that enemy ''will not fire the weapon at point blank range'' and also it limits Melee override in [[CMBT]] to be only None or IfPunched, otherwise instead of backing away, A.I. character goes directly into melee. |
edits