I had a second look, and yup, you're correct. Better aggression values = less likely to give up. The higher the aim value, the better. At an aim of 6, the enemy has (almost) perfect accuracy. My main point about snipers is that when they have higher aim values (up to 6, after which point the AI breaks) they fire faster and with poorer accuracy, and when they have lower aim values (like 0), they take more time to fire, but are way more accurate. When I meant "low" aim in that context, I meant that their aim is actually poorer (I guess I should have been clearer). So in that way, snipers are actually backwards. It's supposed to, but it doesn't. For Jedi NPCs, it affects how well they're able to push you when you grip them. Aim doesn't do anything with Jedi AI, likewise I'm pretty sure this is the case with move as well (Rank has way more of an influence than anything) It doesn't quite do that. It's more hardcoded than anything. Details below. Keep in mind a few things: I'm basing this off of JK2, which may be different from JKA. (not very likely, most of JKA's stuff involved adding lots of hardcodes to specific NPC names..in fact you can use .npc files with JK2 as well)This AI system has been in use since (at least) EF, and there may be several deviations from that, even. Let's talk about rank.. Rank is funny because it's used in such a wide variety of places. Ranks: "civilian" / RANK_CIVILIAN"crewman" / RANK_CREWMAN"ensign" / RANK_ENSIGN"ltjg" / RANK_LT_JG"lt" / RANK_LT"ltcomm" / RANK_LT_COMM"commander" / RANK_COMMANDER"captain" / RANK_CAPTAINby default, the NPC will be RANK_CIVILIAN Here's things that it affects (saber users): Taunting - If a CLASS_JEDI is aligned with the player, only RANK_COMMANDER can taunt. Otherwise, the higher the rank, the more frequent the taunting (in general).Saber Styles - If a CLASS_JEDI is aligned against the player, RANK_CIVILIAN/RANK_LT_JG use only Blue, while RANK_CREWMAN/RANK_ENSIGN use only Yellow. Cultists ignore all of this.Grip - RANK_LT_COMM and above will attack gripped players and NPCs (if they're affected by grip rank 1). RANK_LT_JG and above will throw sabers at gripped players and NPCs (if they're affected by grip rank 2 or 3). RANK_LT_COMM and above will ignore their current enemy and help out gripped allies.Attacking - CLASS_JEDI: RANK_ENSIGN (and RANK_LT + above) will initiate force attacks as a starting attack (as opposed to passively counter-attacking with saber) 50% of the time, selecting from either saber throw, grip, lightning, or pull. RANK_LT + above will always throw their saber the other 50% of the time. For saber-wielding enemies, the formula is:
random(0, chanceScale * 10) < 5
For gun-wielding enemies, the formula is:
random(0, chanceScale) == 0
where chanceScale is:
- 5 for RANK_LT and above
- 2 for RANK_ENSIGN (reborn force-user)
- 1 for Desann
- 1 for any NPC named "Yoda" (JA only)
If this check succeeds:
- 1/3rd chance to pull. If this fails:
- 1/2 chance to lightning. If this fails:
- Grip. If this fails:
- Use saber throw.
Kicking: Higher-ranked enemies using staff saber tend to kick opponents less often.Katas: RANK_LT_COMM (and above) will use katas. Higher-ranked enemies will dodge katas much more often. Bosses, CLASS_SHADOWTROOPER and CLASS_ALORA will always avoid them whenever possible.DFAs: RANK_LT and above will dodge DFAs effectively. The higher the rank, the more likely they are to evade it.Acrobatics: RANK_CREWMAN (reborn acrobat) + RANK_LT (and above) will use BOTH_ARIAL_* and BOTH_CARTWHEEL_* as well as wallruns. Desann will not do these, and there's no difference in the rank.Parrying: Better ranks = better parrying in general. CLASS_JEDI with RANK_COMMANDER (Jedi Trainer), CLASS_REBORN with RANK_LT_JG (reborn fencer) and CLASS_TAVION will frequently follow-up parries with a fast Blue attack. RANK_LT_JG and above have shorter parrying delays (so they can parry faster attacks more effectively).Pain: When a Jedi AI is damaged, they have a delay in how they can parry, meaning that they can be damaged over and over by fast attacks (effectively beating them into submission). This delay is based on difficulty, but RANK_LT_JG (and above) have this delay cut in half (Desann cuts it down to 1/4th).Rollstab: CLASS_SHADOWTROOPER and CLASS_ALORA (as well as bosses) will always either backflip away or jump over a rollstab (50/50 chance). RANK_LT_COMM and above can do this as well.Wallruns: RANK_LT_JG and below will stand still when the player uses a wallrun/kickflip (probably to make it easier to kill using these)Dodging Attacks: RANK_CREWMAN and RANK_LT_JG (and above) can duck + roll to evade saber attacks intelligently.Superjump: RANK_CREWMAN and RANK_LT (and above) can use a "superjump" which goes VERY high and fast. This can either be used for evasion or in place of a normal jump.Other jumps: RANK_CREWMAN and RANK_LT (and above) are the only ones which can use the front-flip anim in a force jump.Saber Locks: The higher the rank, the more frequent that a NPC will take advantage of a won saber-lock to deliver an attack. RANK_LT_JG has a +1/15% bonus chance. Desann and Luke have a fixed 66% chance and Tavion has a fixed 33% chance.General intelligence: Lower ranks are legitimately stupid and will stand still/won't attack the back of the player. Lower rank = way more likely to do this. In fact, RANK_CIVILIAN can't attack the back of the player at all. Force Speed: Better ranking enemies will respond to the player's Force Speed use better. This never happens on Padawan difficulty (except for Tavion, who always uses it).Force Absorb: Better ranking enemies will respond to the player's dark force usage better. RANK_LT_JG and above can only use Force Absorb correctly.Force Protect: Better ranking enemies will respond to heavy damage (greater than 5-20) better by using Protect. RANK_LT_JG and above will only use Force Protect correctly.Saber Droids: Saber droids with RANK_CREWMAN (or below) will attack slower than those with higher ranks. This is based on difficulty.Non-Jedi AI: Squad AI - higher rank enemies are denoted as "leaders". The highest-ranked enemy serves as the "leader" of the group and issues commands to it. Whenever the leader dies, others will flee (as long as they're lower than RANK_ENSIGN). If the group doesn't have a commander to begin with, enemies will flee if their health is <= 10. A group has what is called a "morale rating". Higher-ranked members of the group increase the morale rating, as do members with better guns. This morale rating influences a wide variety of things, including cover AI, retreating, and even accuracy/fire rate (to a very small extent). Most (if not all) of this code does not function correctly in JA due to large chunks being commented out (works fine in JK2).Rockettroopers: rockettroopers with RANK_LT or above will always stay in the air (they won't attempt to land)Suspicion: RANK_LT (and below) ranked CLASS_STORMTROOPERs will use "interrogating" events in response to visual stimuli. Higher ranks will just open fire immediately.Saber avoidance: CLASS_REBORNs using a gun with RANK_LT_JG or above will actively evade attacks by saber-users.a lot of other things