Jump to content

AI: Difference between revisions

459 bytes added ,  4 June 2012
Let's misinform our dear readers once again ^_^
(Let's misinform our dear readers once again ^_^)
Line 550: Line 550:
:*Group block skill - (Group inside BlockSkill) - percentual chance of ???. Not sure, maybe of blocking more attackers?
:*Group block skill - (Group inside BlockSkill) - percentual chance of ???. Not sure, maybe of blocking more attackers?


:*Not blocked (NotBlocked) - Multiplier which affects probability of executing a technique which will not be blocked by the enemy under current circuumstances (punch combo against opponent who is running forward).
:*Not blocked (NotBlocked) - Multiplier which affects weight of techniques which will not be blocked by the enemy under current circuumstances (punch combo against opponent who is running forward).
:*Must change stance (MustChangeStance) - Multiplier which affects probability of executing a technique which makes enemy change stance in order to block itnot be blocked by the enemy under current circuumstances (leg sweep against standing opponent).
:*Must change stance (MustChangeStance) - Multiplier which affects weight of techniques which force enemy to change stance (standing, crouching) in order to block it under current circuumstances (leg sweep against standing opponent).
:*Blocked but unblockable (BlockedButUnblockable) - Multiplier which affects probability of executing a technique that has set "unblockable" flag in its attack part, see [[OBD:TRAM/raw0x14|TRAM-attack part]].
:*Blocked but unblockable (BlockedButUnblockable) - Multiplier which affects weight of techniques that have "unblockable" flag in its attack part, see [[OBD:TRAM/raw0x14|TRAM-attack part]].
:*Blocked but has stagger (BlockedButHasStagger) - Multiplier which affects probability of executing a technique that makes enemy stagger if the enemy blocks the techique. Depends on TRAM attack part settings (BlockStagger), see [[OBD:TRAM/raw0x14|TRAM-attack part]].
:*Blocked but has stagger (BlockedButHasStagger) - Multiplier which affects weight of techniques that makes enemy stagger if the enemy blocks the technique. Depends on TRAM attack part settings (BlockStagger), see [[OBD:TRAM/raw0x14|TRAM-attack part]].
:*blocked but has blockstun (BlockedButHasBlockStun) - Multiplier which affects probability of executing a technique that locks enemy in a blocking animation for longer than 20 frames. Depends on TRAM attack part settings (BlockStun), see [[OBD:TRAM/raw0x14|TRAM-attack part]].  
:*Blocked but has blockstun (BlockedButHasBlockStun) - Multiplier which affects weight of techniques that lock enemy in a blocking animation for longer than 20 frames. Depends on TRAM attack part settings (BlockStun), see [[OBD:TRAM/raw0x14|TRAM-attack part]].  
:*Blocked (Blocked) - Multiplier which affects probability of executing a technique that will be certainly blocked by the enemy under currend circuumstances and will not stagger or stun the enemy.
:*Blocked (Blocked) - Multiplier which affects weight of techniques that will be certainly blocked by the enemy under current circuumstances and will not stagger nor stun the enemy.
:*Throw Danger (ThrowDanger) - Something with throws, but only Bungie West knows what's the meaning of this field.
:*Throw Danger (ThrowDanger) - Something with throws, but only Bungie West knows what's the meaning of this field.


:There are probably two more parameters, but their meaning is a mystery up to this date.
:*DazedMinFrames, DazedMaxFrames - documented by Neo. Question is - do these two parameters actually have effect, since getup time is controlled from ONCC?




Basic melee setup is done. Now the profile branches into '''attack''' part, '''evade''' part and '''maneouver''' part. Each part has a certain number of "melee techniques". Melee technique is a compound of one or more melee moves. Melee moves are simple elements of hand to hand combat - attacks, throws, positioning, maneuvring. Maximal amount of techniques in one melee profile is 32. If this limit is exceeded, Oni crashes. Mentioned three parts of [[MELE]] profile are:
Basic melee setup is done. Now the profile branches into '''attack''' part, '''evade''' part and '''maneouver''' part. Each part has a certain number of "melee techniques". Melee technique is a compound of one or more melee moves. ''Melee move'' is a simple element of hand to hand combat - attack, throw, positioning command or some maneuver. Maximal amount of techniques in one melee profile is 32. If this limit is exceeded, Oni crashes. Let's have detailed look at all three mentioned parts of [[MELE]] profile:
:*Attack branch - Techniques from this branch are executed when A.I. is trying to attack and hurt it enemy. Attack branch contains not only attack techniques, but maneuver techniques as well (morea bout this later).
:*Attack branch - Techniques from this branch are executed when A.I. is trying to attack and hurt it enemy. Attack branch contains not only attack techniques, but also maneuver techniques as well (more about this later).
:*Evade branch - Techniques contain moves which are used to evade attack. That means escape moves (SHIFT + some direction) and/or various jumps/slides.
:*Evade branch - Techniques contain moves which are used to evade attack. That means escape moves (SHIFT + some direction) and/or various jumps/slides. These techniques are picked only when A.I. character reacts on incoming enemy's attack.
:*Maneuver branch - Techniques from this branch should be used by A.I. to move not only in a straightforward fashion towards the enemy, but also circle around, retreat or advance. Unfortunately, it seems this branch is never used and all maneouvring is done via Attack branch.
:*Maneuver branch - Techniques from this branch should be used by A.I. to maneuver around, in order to move not only in a straightforward fashion towards the enemy, but also circle around, retreat or advance. Unfortunately, this branch is probably a development relic. In order to see these techniques performed, global [[BSL]] variable '''ai2_spacing_cookies''' has to be set zero (0). That means A.I. cannot execute attacks. Only then A.I. starts performing techniques from this maneuver branch.
::The idea was probably to make the A.I. execute a certain number of attacks (each attack "eats" a cookie), then make the A.I. maneuver a bit and so on and so on. But somehow this setup was abandoned (question is whether MELE was really planned that way ^_^ ) and techniques from this branch are de-facto never used. That means all maneouvring is done via Attack branch.




Structure of a melee technique:
Structure of a melee technique:
:*Name (debugging purposes only)
:*'''Name''' (debugging purposes only)
:*Flags - possibilities are:
:*'''Flags''' - possibilities are:
::*Interruptible - This technique can "home" to some extent and if enemy gets away from its reach, technique is ended prematurely.
::*Interruptible - This technique can "home" to some extent and if enemy gets away from its reach, technique is ended prematurely.
::*GenerousDir - This technique is enlisted for possible execution even when facing of the A.I. does not match position move of this technique (technique uses CloseLeft, enemy is directly in front). If technique is used, A.I. character positions itself in order to perform the techique (in our example case, A.I. chracter turns left side towards enemy and perform the technique).
::*GenerousDir - This technique is enlisted for possible execution even when facing of the A.I. does not match position move of this technique (technique uses CloseLeft, enemy is directly in front). If technique is used, A.I. character positions itself in order to perform the techique (in our example case, A.I. chracter turns left side towards enemy and perform the technique).
:*Weight - Techniques are chosen randomly but with "weight" of technique taken into account. Techniques with higher "weight" are used more often than those with lower "weight".
::*Fearless - does this flag actually do something?
:*Unknown - only Bungie West folks know what this parameter should affect.
:*'''Weight''' - Basic weight of the technique. Techniques are chosen randomly but with "weight" of the technique taken into account. Techniques with higher "weight" are used more often than those with lower "weight".
:*RepeatDelay - In frames, how long should be the technique unavailable after its use (to prevent from predictability). For this time the technique is not enlisted in a list of performable techniques.
::Also, there are more factors which affect final weight of the technique. ''Basic weight'' of the technique is according to combat situation (position of the enemy, effect of moves in the technique) multiplied by one of MELE profile setup multipliers (NotBlocked, BlockedButHasStagger etc.), then it is also multiplied by some dimnishing value which decreases weight of the technique if it is used consencutively. And finally, weight of the technique is multiplied by some special "orange tiles" mutiplier, which downweights techniques that would make the A.I. "fall over the edge", aka dive into orange tiled area.
:*Moves, possible types of moves are:
:::The equation is PROBABLY very roughy something like this:
:::Final weight = Basic weight * corresponding MELE profile setup multiplier * dimnish multiplier * "orange tiles" multiplier
:*'''"Importance"''' - documented by Neo. Does it have any effect?
:*'''RepeatDelay''' - in frames, how long should be the technique unavailable after its use (to prevent from predictability). For this time the technique is not enlisted in a list of performable techniques.
:*'''Moves''', possible types of moves are:
::*Position - usually takes three parameters: minimal distance, maximal distance, tolerance range. Meaning of Minimal/Maximal distances is clear, tolerance range specifies extra distance (beyond chosen TRAM attack's extents) where A.I. chases the enemy till the enemy gets inside the extent range of the [[TRAM]] attack this A.I. charater wants to use. Then A.I. uses the TRAM attack ^_^.
::*Position - usually takes three parameters: minimal distance, maximal distance, tolerance range. Meaning of Minimal/Maximal distances is clear, tolerance range specifies extra distance (beyond chosen TRAM attack's extents) where A.I. chases the enemy till the enemy gets inside the extent range of the [[TRAM]] attack this A.I. charater wants to use. Then A.I. uses the TRAM attack ^_^.
:::Some position moves don't have any parameters (Crouch, StartToCrouch) and are used strictly for stance purposes - to make A.I. perform crouched or special attacks. Position moves are used to give the A.I. general sorting of available attacks, so based on the melee zone the enemy is in (see picture at the beginning of this section) only corresponding techniques are taken into account as "possible to be used" and the rest is ignored. [[OBD:BINA/OBJC/MELE/MoveList/Position|HERE is a list]] of all available position melee moves.
:::Some position moves don't have any parameters (Crouch, StartToCrouch) and are used strictly for stance purposes - to make A.I. perform crouched or special attacks. Position moves are used to give the A.I. general sorting of available attacks, so based on the melee zone the enemy is in (see picture at the beginning of this section) only corresponding techniques are taken into account as "possible to be used" and the rest is ignored. [[OBD:BINA/OBJC/MELE/MoveList/Position|HERE is a list]] of all available position melee moves.
Line 586: Line 591:




 
Also there is one special condition to executing melee techniques. When there is an edge of a platform nearby it is usually covered in pathfinding grid as a seires of special tiles from blue (border) to orange (danger). Engine seems to check if [[TRAM]] attack's extent extends into orange pathfinding tiles and according to it it decreases weight of such techniques which would make A.I. character end in orange field (i.e. going over the edge and falling down). Techniques which utilize jump position moves are excluded from weight decrease, so there is some very limited and random possibility for A.I. characters to jump aross gaps in order to reach the enemy.
And...that's all ^_^. According to technique's position move (and special moves within it), a list of available techniques is generated. Acording to enlisted techniques' weights and coefficients from MELE setup (multipliers such as Not blocked, Blocked but has stagger etc) some "Attack branch" technique is chosen and executed. In "Attack branch" can be some maneuver techniques as well, those do not (and must not) have position move as the first move in the technique, because maneuvers have their own method of checking if they can be used or not. After the technique is executed it is put off the list for a time specified in its delay, list is refreshed with respect to new combat situation (positions of A.I. character and its enemy), new melee technique is chosen and so on and so on...
 
On the other side, if enemy's attack is registered by A.I. character which is not attacking, it can either let it pass completely or block it or attempt to dodge it - then A.I. code chooses some technique from "Evade branch" according to incoming [[TRAM]] attack's extents.
 
Maneuver branch appears to be unused.
 
 
Also there is one special condition to executing melee techniques. When there is an edge of a platform nearby it is usually covered in pathfinding grid as a seires of special tiles from blue (border) to orange (danger). Engine seems to check if [[TRAM]] attack's extent extends into blue or orange pathfinding tiles and according to it it waters down such techniques which would make A.I. character end in orange field (i.e. going over the edge and falling down). If there are orange tiles and enemy is behind them, engine seems to upweight jumping techniques (given the MELE has some jumping techniques) so A.I. character has some limited possibility to jump across gaps in order to reach the enemy.
:Code behind all this must be pretty complex, hands down before Oni developers who managed to pull this off.
:Code behind all this must be pretty complex, hands down before Oni developers who managed to pull this off.


271

edits