Jump to content

AI: Difference between revisions

5,660 bytes added ,  20 September 2011
no edit summary
No edit summary
Line 398: Line 398:


:* Don't overextend "Check body" and "Dead make sure" timers. It looks silly and on top of that it makes A.I. characters easy targets of a surprise rear throw.
:* Don't overextend "Check body" and "Dead make sure" timers. It looks silly and on top of that it makes A.I. characters easy targets of a surprise rear throw.
==Combat behavior part 3: "They see me shootin', they hatin'..."==
Back in 2001 Oni was highly praised for its mixture of shooting and hand to hand combat. Now what could A.I. designers of Oni possibly do to make A.I. characters aim, pull a trigger or to make them avoid being hit by enemy? In this section, [[ONWC]], together with [[ONCC]] and [[PAR3]] will tell the story.
:First let's look into [[ONCC]] file. In XML file, under <AIConstants>, there's a tag named <Flags>. In binary file it is a bitset, so more than one flag can be written into it. XML strings for flags are:
:*noStartleAnim - Disables startle animation when A.I. sees the enemy for the first time.
:*EnableMeleeDodge - Enables firingspread/projectile dodging when A.I. is in pathfinding mode or combat melee mode
:*RunAwayDodge - Enables firingspread/projectile dodging even when A.I. itself is shooting a gun. A.I. character stops shooting and tries to move away from the danger area.
:*ShootDodge -  Enables firingspread/projectile dodging even when A.I. itself is shooting a gun. A.I. character keeps shooting its enemy while at the same time attempts to move away from the danger area.
:*NotUsed - Some ONCC character have this bit set, however it looks like it does nothing.
[[File:Firingspread.PNG|thumb|right|alt=Example of a firingspread.|Example of a firingspread.]]
[[File:Projectile.PNG|thumb|right|alt=Example of a particle with A.I. projectile dodge radius.|Example of a projectile with A.I. dodge radius (blue sphere).]]
'''Gunfire dodging mechanics'''. Gunfire dodging mechanics is a quite interesting part of Oni A.I. system. Interesting because the retail version features little to no such a behavior displayed which is sad because it gives a feeling of challenge to a gunplay. In order to make A.I. character perform dodge mechanics, this A.I. must be in combat mode with some enemy. Without combat mode and some enemy, A.I. character won't dodge. Next, A.I. characters perform dodge when the character intersects with:
:*Firingspread - can be seen by '''ai2_showfiringspreads=1'''. Firing spread is an invisible prism (dimensions set in [[ONWC]]) which can be created when a weapon is fired. Not every gun has a firingspread as for some guns firingspread is useless (SCRAM cannon, SuperBall gun). If A.I. character can dodge gunfire and intersects with a firingspread, this A.I. character starts gunfire dodging mechanics.
:*Projectile - epic win of Oni modders, can be seen with '''ai2_showprojectiles=1'''. In retail version of Oni, projectile dodging '''is defunct''' due to a couple of bugs in a projectile dodging code. Since the engine hackers/modders '''fixed this issue''', A.I. characters can execute gunfire dodge mechanics versus [[PAR3]] particle, if these A.I.s are in combat mode with some enemy and the particle has set <AIDodgeRadius> to a positive non-zero value.
:A.I. parameters regarding gunfire dodging are set in [[ONCC]] (xml tags in brackets):
:*Dodge reaction delay (DodgeReactFrames) - a delay in number of frames. This delay makes A.I character wait a bit inside danger zone before this A.I. character starts its reaction on firingspred/projectile.
:*Dodge timescale (DodgeTimeScale) - how long should the A.I. character's gunfire dodge reaction last.
:*Dodge weight (DodgeWeightScale) - how strong is the desire (???length of vector???) of this A.I. character to dodge a gunfire. Dodge can add together with other "vector" movements and a sum of all vectors is the direction in which A.I. character will try to move.
:Parameters of firingspread in [[ONWC]] are (xml tags in brakets):
:*Firingspread length (FireSpreadLength)
:*Firingspread width (FireSpreadWidth)
:*Firingspread skew (FireSpreadSkew)
:Parameter of projectile dodging in particle system [[PAR3]] is A.I. dodge radius (AIDodgeRadius).
'''A.I. character's prowess with guns'''. Still in [[ONCC]], there are data how "skillful" this A.I. character should be with each weapon in the game. Weapons are indexed (starting from zero) as follows:
:*w0_sec (0) - Only Bungie West emplyees know what this weapon was supposed to be.
:*w1_tap (1) - TCTF automatic pistol
:*w2_sap (2) - Syndicate submachinegun
:*w3_phr (3) - plasma rifle
:*w4_psm (4) - phase stream projector
:*w5_sbg (5) - grenade launcher alias SuperBall Gun
:*w6_vdg (6) - stun gun ('''V'''an '''D'''e '''G'''raaf gun)
:*w7_scc (7) - scram cannon (swarm of small homing rockets)
:*w8_mbo (8) - Freddie Mercury bow
:*w9_scr (9) - Screaming cannon
:*w10_sni (10) - Mukade's Devil star (annoying red ball) as a holdable weapon; probably a relic from game development
:*w10_ba1 (11) - Barabus's gun
:*w11_ba2 (12) - Barabus's gun; primary fire mode of his cannon. This "gun" cannot be shot and was probably added so developers could tweak separately Barabus's skill with primary and secondary fire modes of his cannon.
:For each one of these weapons, there are in ONCC defined these parameters (xml tag in brackets):
:*Recoil compensation (RecoilCompensation) - how much should A.I. compensate the recoil of the weapon. Setting this to 0 mean no compensation, setting this to 1 means full compensation.
:*Best aiming angle (BestAimingAngle) - in radians
:*Shot group error - no idea what it is
:*Shot droup decay - again no idea
:*Shooting inaccuracy multiplier (ShootingInaccuracyMultiplier) - How much can A.I. stray with its aim from the target
:*Minimal shooting delay (MinShotDelay) - minimal pauses between shots for this gun an this A.I. character.
:*Maximal hooting delay (MaxShotDelay)- maximal pause between shots.
:Next in [[ONCC]], there is targeting and predicition of enemy's position.
271

edits