18,700
edits
m (Iritscen moved page Tricks behind Oni A.I. to AI without leaving a redirect: Consistency with Graphics and Physics.) |
m (link fixes; this is a really good case study in why we shouldn't use the article's name when creating links to sections in the same article) |
||
Line 13: | Line 13: | ||
'''Pathfinding''' is used when A.I. driven character needs to traverse in level from one place to another. Examples of pathfinding-based A.I. movement are: | '''Pathfinding''' is used when A.I. driven character needs to traverse in level from one place to another. Examples of pathfinding-based A.I. movement are: | ||
:*patrol paths - A.I. driven character moves in a pre-designed fashion, see [[PATR]] | :*patrol paths - A.I. driven character moves in a pre-designed fashion, see [[PATR]] | ||
:*alarm running - A.I. character is requested to go to given console and use it, see section [[ | :*alarm running - A.I. character is requested to go to given console and use it, see section [[#Alarm behavior - "She's everywhere!"|Alarm behavior]] | ||
:*pursuit of target - A.I. character loses direct sight of the enemy, see section [[ | :*pursuit of target - A.I. character loses direct sight of the enemy, see section [[#Pursuit of enemy alias "I will find you..."|Pursuit of enemy]] | ||
:*running to weapons in order to pick them up, see '''LINK TO COMBAT BEHAVIOR''' | :*running to weapons in order to pick them up, see '''LINK TO COMBAT BEHAVIOR''' | ||
Line 68: | Line 68: | ||
:*Gunfire (red) - causes alert rise to high level. | :*Gunfire (red) - causes alert rise to high level. | ||
:For more info about A.I. alert levels, see section [[ | :For more info about A.I. alert levels, see section [[#Reactions on stimuli a.k.a. "What was that?!"|Reaction on stimuli]]. These sound types are used by impact effects [[ONIE]] and danger sound type can be set in particle as a "danger radius". | ||
Line 135: | Line 135: | ||
:*ReturnTo Job - A.I. returns to its job | :*ReturnTo Job - A.I. returns to its job | ||
:*KeepLooking - A.I. does not return to its job but keeps using the last used pursuit behavior | :*KeepLooking - A.I. does not return to its job but keeps using the last used pursuit behavior | ||
:*FindAlarm - A.I. tries to switch to alarm behavior (see section [[ | :*FindAlarm - A.I. tries to switch to alarm behavior (see section [[#Alarm behavior - "She's everywhere!"|Alarm behavior]]), if it does not suceed, A.I. returns to its job. | ||
Line 217: | Line 217: | ||
:A couple of notes regarding A.I. character: | :A couple of notes regarding A.I. character: | ||
:*in order to register enemy and attack her/him pre-emptively, A.I. character must have "HostileThreatDefinite" timer set in ONCC file to some value over 60 (Oni runs 60 frames per second). | :*in order to register enemy and attack her/him pre-emptively, A.I. character must have "HostileThreatDefinite" timer set in ONCC file to some value over 60 (Oni runs 60 frames per second). | ||
:*"If no gun" behavior "Run for Alarm" can get glitched. "Alarm enemy attack distance" is set to some value, let's say 100. Now when A.I. character runs for alarm and enemy attacks it, then if in this [[CMBT]] profile there is not set melee override for range at least 100 (via melee override or by heving "Melee" set in corresponding combat ranges, see section [[ | :*"If no gun" behavior "Run for Alarm" can get glitched. "Alarm enemy attack distance" is set to some value, let's say 100. Now when A.I. character runs for alarm and enemy attacks it, then if in this [[CMBT]] profile there is not set melee override for range at least 100 (via melee override or by heving "Melee" set in corresponding combat ranges, see section [[#Combat behavior part 1 : "Hokey religions and ancient weapons..."|Combat behavior]]), chances are A.I. will get stuck in a loop trying to reach both enemy and console at the same time. | ||
:*Similar issue can happen with combat behavior Run For Alarm as well, but this time problems rise when this combat behavior Run For Alarm is set as Short range behavior. | :*Similar issue can happen with combat behavior Run For Alarm as well, but this time problems rise when this combat behavior Run For Alarm is set as Short range behavior. | ||
Line 259: | Line 259: | ||
:*A.I. character was hurt by the enemy, be it melee or gun damage. | :*A.I. character was hurt by the enemy, be it melee or gun damage. | ||
Once combat mode is entered, then as long as HostileThreatDefinite timer for this enemy does not reach zero, A.I. character will always know exact location of this enemy and will attempt to attack it. The moment HostileThreatDefinite timer is depleted, A.I. character loses the privilege of knowing exact location, awareness decerases from definite to strong and A.I. character either switches from combat mode with this enemy to pursuit mode with this enemy (see section [[ | Once combat mode is entered, then as long as HostileThreatDefinite timer for this enemy does not reach zero, A.I. character will always know exact location of this enemy and will attempt to attack it. The moment HostileThreatDefinite timer is depleted, A.I. character loses the privilege of knowing exact location, awareness decerases from definite to strong and A.I. character either switches from combat mode with this enemy to pursuit mode with this enemy (see section [[#Pursuit of enemy alias "I will find you..."|Pursuit of enemy]]) or, in case of other enemy being present in central vision field, picks this new enemy as a target to attack and keeps old enemy in strong (and later weak and later forgotten) awareness. | ||
:Since generally method of combat depends on distance between participants, some sort of spacing is needed. Oni uses system of three ranges around A.I., called combat ranges. See picture on right. Perimeters of these ranges can be set in [[CMBT]] profile. | :Since generally method of combat depends on distance between participants, some sort of spacing is needed. Oni uses system of three ranges around A.I., called combat ranges. See picture on right. Perimeters of these ranges can be set in [[CMBT]] profile. | ||
Line 290: | Line 290: | ||
:**This character get thrown by any throw. | :**This character get thrown by any throw. | ||
::Again, annoying '''over 550 height check''' is present. | ::Again, annoying '''over 550 height check''' is present. | ||
:*Run for alarm (RunForAlarm) - see section [[ | :*Run for alarm (RunForAlarm) - see section [[#Alarm behavior - "She's everywhere!"|Alarm behavior]]. | ||
:*Mutant Muro melee (MutantMuroMelee) - A.I. character is only allowed to melee, will not fire weapons. This behavior casts chenille (overpower effect) on the user. Of course in order to see visible effect character has to have set <HasDaodanPowers> to 1 in [[ONCC]]. This chenille mode does not grant damage overpower effect, melee attacks deal their usual damage. If ONCC has set both <HasDaodanPowers> and <HasSuperShield> to 1, the chenille mode called by this behavior grants super shield. | :*Mutant Muro melee (MutantMuroMelee) - A.I. character is only allowed to melee, will not fire weapons. This behavior casts chenille (overpower effect) on the user. Of course in order to see visible effect character has to have set <HasDaodanPowers> to 1 in [[ONCC]]. This chenille mode does not grant damage overpower effect, melee attacks deal their usual damage. If ONCC has set both <HasDaodanPowers> and <HasSuperShield> to 1, the chenille mode called by this behavior grants super shield. | ||
::Chenille mode lasts forever if it is not terminated either via BSL or by A.I. character performing a [[TRAM]] which has a DisableShield flag. After 10 seconds interval, chenille is turned back on. Another specialty of this behavior is automatic backwards evasion move when about 35 points of damage or a throw are applied on the A.I. character. Chenille mode is turned off if this A.I. character switches to some other combat behavior because the enemy moved to some other combat range. | ::Chenille mode lasts forever if it is not terminated either via BSL or by A.I. character performing a [[TRAM]] which has a DisableShield flag. After 10 seconds interval, chenille is turned back on. Another specialty of this behavior is automatic backwards evasion move when about 35 points of damage or a throw are applied on the A.I. character. Chenille mode is turned off if this A.I. character switches to some other combat behavior because the enemy moved to some other combat range. | ||
Line 306: | Line 306: | ||
:*Superninja's behaviors sound excellent for cunning enemy units, however annoying check for character's minimal allowed height from world origin and subsequent forced repositions severely impact these behaviors' usefulness. Despite the height limit, with deliberately designed level which is uplifted enough on purpose, the behavior will not cause random A.I. character repositioning. Then it can be used to its fullest. | :*Superninja's behaviors sound excellent for cunning enemy units, however annoying check for character's minimal allowed height from world origin and subsequent forced repositions severely impact these behaviors' usefulness. Despite the height limit, with deliberately designed level which is uplifted enough on purpose, the behavior will not cause random A.I. character repositioning. Then it can be used to its fullest. | ||
::One other important thing about these behaviors - if A.I. character does not have required [[TRAM]]s in her/his [[TRAC]], the A.I. character can get stuck if she/he uses these behaviors. | ::One other important thing about these behaviors - if A.I. character does not have required [[TRAM]]s in her/his [[TRAC]], the A.I. character can get stuck if she/he uses these behaviors. | ||
:*If there is no console with ALARM CONOSLE flag within Alarm sarch distance, then behavior "Run For Alarm" will make A.I. enemy just stand and stare. Set this behavior with caution and consider using a workaround where medium and short combat ranges have very close diameters with Run For Alarm being MediumRetreat behavior, so Run For Alarm behavior is executed only for a brief amount of time as A.I. practically immediately switches to LongRetreat. However even one frame is enough because if alarm is found, A.I. character is requested to perform alarm run which can override combat (see section [[ | :*If there is no console with ALARM CONOSLE flag within Alarm sarch distance, then behavior "Run For Alarm" will make A.I. enemy just stand and stare. Set this behavior with caution and consider using a workaround where medium and short combat ranges have very close diameters with Run For Alarm being MediumRetreat behavior, so Run For Alarm behavior is executed only for a brief amount of time as A.I. practically immediately switches to LongRetreat. However even one frame is enough because if alarm is found, A.I. character is requested to perform alarm run which can override combat (see section [[#Alarm behavior - "She's everywhere!"|Alarm behavior]] for more info). | ||
:*MutantMuro melee can be used to create tricky foes which have to be eliminated from distance because if player comes up close, these enemies will turn on their (super)shield and won't put it away (no TRAM with DisableShield flag). That means player has to put some distance between him and these A.I. characters in order to make them disable the shield. | :*MutantMuro melee can be used to create tricky foes which have to be eliminated from distance because if player comes up close, these enemies will turn on their (super)shield and won't put it away (no TRAM with DisableShield flag). That means player has to put some distance between him and these A.I. characters in order to make them disable the shield. | ||
:*MutantMuro thunderbolt should NEVER be assigned to Short range behavior as that will negatively affect its special attack. Set it as LongRetreat or MediumRetreat. This kind of behavior (with proper [[TRAM]]s) can be used to create foes who will perform special long range attack if player tries to keep a distance. This ranged attack does not have to be the same as Muro's tractor thunderbolt. For quick example, A.I. character can be made to fire a sort of aggressive plasma beam. | :*MutantMuro thunderbolt should NEVER be assigned to Short range behavior as that will negatively affect its special attack. Set it as LongRetreat or MediumRetreat. This kind of behavior (with proper [[TRAM]]s) can be used to create foes who will perform special long range attack if player tries to keep a distance. This ranged attack does not have to be the same as Muro's tractor thunderbolt. For quick example, A.I. character can be made to fire a sort of aggressive plasma beam. | ||
Line 336: | Line 336: | ||
:*Melee (Melee) - A.I. character attacks enemy with hand to hand combat | :*Melee (Melee) - A.I. character attacks enemy with hand to hand combat | ||
:*Retreat (Retreat) - A.I. character runs away from its enemy (a bit glitchy, but works) | :*Retreat (Retreat) - A.I. character runs away from its enemy (a bit glitchy, but works) | ||
:*Run For Alarm (RunForAlarm) - see section [[ | :*Run For Alarm (RunForAlarm) - see section [[#Alarm behavior - "She's everywhere!"|Alarm behavior]]. Remainder: this alarm calling behavior requires Melee override set as ShortRange, MediumRange or AlwaysMelee, otherwise alarm behavior gets glitched and A.I. character gets stuck. If no alarm console is found within Alarm search distance, A.I. character resorts to melee. | ||
Line 487: | Line 487: | ||
'''Miscellaneous [[ONWC]] A.I. setup''' - there are a few more parameters in ONWC which affect A.I. behavior with the weapon. They are (xml tags in brackets): | '''Miscellaneous [[ONWC]] A.I. setup''' - there are a few more parameters in ONWC which affect A.I. behavior with the weapon. They are (xml tags in brackets): | ||
:*Minimal shooting distance (MinShootingDistance) - defines how close can enemy be to the armed shooting A.I. character. If enemy comes closer than this distance, A.I. stops shooting and tends to move back a bit (vector type of movement, see [[ | :*Minimal shooting distance (MinShootingDistance) - defines how close can enemy be to the armed shooting A.I. character. If enemy comes closer than this distance, A.I. stops shooting and tends to move back a bit (vector type of movement, see [[#Pathfinding and movement - "I think I will consult a map for a while..."|HERE]]) until the distance is again equal or greater than Minimal shooting distance. Then A.I. opens fire again. To witness the effect, see some A.I. operating an SBG when its enemy is close to it. | ||
::'''IMPORTANT''' - for some unknown reason, value from this field is '''divided by 2'''. So when 100 is set, ingame A.I. starts backing when its enemy is 50 units close to it. | ::'''IMPORTANT''' - for some unknown reason, value from this field is '''divided by 2'''. So when 100 is set, ingame A.I. starts backing when its enemy is 50 units close to it. | ||
:*Maximal shooting distance (MaxShootingDistance) - contrary to the parameter described above, this limits how far can enemy be till the A.I. stops shooting and tends to come closer. See some A.I. character shooting with w2_sap at distant enemy. | :*Maximal shooting distance (MaxShootingDistance) - contrary to the parameter described above, this limits how far can enemy be till the A.I. stops shooting and tends to come closer. See some A.I. character shooting with w2_sap at distant enemy. |