AI Instinct - ForcePowers

Instinct Arguments

With regard to unit clarification, 1 JKU is the equivalent of 1 meter, a time value of 3000.0 msec is the equivalent of 3 seconds and boolean values within are assigned by either a 0 (false) or 1 (true) value. Interestingly, both integer and floating-point numbers seem to be legal values for boolean arguments (but must be of the form 0.0 or 1.0).


Each instinct has a set number of arguments which must be set, in order for the AI character to use that instinct. The following details show examples, as well as listing each argument effect and type.

    ForcePowers      4000.0, 0.5, 5.0, 0.5, 1.5, 0.0, 0.0, 0.5, 0.8, 0.0, 5000.0, 6000.0, 0.0
Argument 1: Time interval to check for Force Power [FP] usage (msecs)
Argument 2: Minimum distance from target to use FP 1 (JKUs)
Argument 3: Maximum distance from target to use FP 1 (JKUs)
Argument 4: Minimum distance from target to use FP 2 (JKUs)
Argument 5: Maximum distance from target to use FP 2 (JKUs)
Argument 6: Minimum distance from target to use FP 3 (JKUs)
Argument 7: Maximum distance from target to use FP 3 (JKUs)
Argument 8: Percentage on a given interval to use FP 1 (%: ranges from 0=never to 1=always)
Argument 9: Percentage on a given interval to use FP 2 (%: ranges from 0=never to 1=always)
Argument 10: Percentage on a given interval to use FP 3 (%: ranges from 0=never to 1=always)
Argument 11: Recharge Time for FP 1 (msecs)
Argument 12: Recharge Time for FP 2 (msecs)
Argument 13: Recharge Time for FP 3 (msecs)


Expanded Information

This instinct allows the AI actor to use force powers in combat, specifying the frequency of which force power to use, taking into account distance ranges and "recharge" times after Force expenditure. Argument 9 is only evaluated if the previous percentage value in argument 8 has failed. Similarly, Argument 10 is only evaluated if both argument 7 and 8's percentage values have failed. The force powers that the Jedi/Dark Jedi use are defined in the actor's actual class cog, so be sure to modify this if you want your AI actor to use these powers. Also, only 3 force powers are permitted; whilst hypothetically the use of COG timers may be used to create the "illusion" of more force powers, this has not been tested, and is outside the scope of AI files.


Instinct Trigger Studies

This section details how the instinct is initiated. In some cases, a charactor's AI are dependent upon certain actions/events occurring before the instinct is triggered.

  • Instinct Dependency - Requires an accompanying actor COG that contains a the Force power effect(s)
  • Triggered by - Difficult to ascertain the trigger-source as the actor cog (including lightsaber setup) "wakes" the AI on loading of the level/thing creation
  • Upon Immediate Initialisation - Enables the (dark) Jedi to use the Force


Testing Notes

Without a doubt, one of the most difficult instincts to clearly pin down as its execution is ambiguous. According to the arguments of this instinct, it is assumed internal engine flags set a timer to:

  • Keep track of how long a delay to wait before using a force power
  • Establish the minimum+maximum distance from the target to inflict the Force power upon. If less than minimum distance and greater than maximum distance then that particular Force power isn't used
  • (a) Perform a probability check, whether to use the Force power or not
  • (b) If (a) is successful, then use the Force power
  • (c) If (a) is unsuccessful, then repeat (a) but with the next Force power (if available)
  • (d) Monitor the "recharge" time for that Force power before it is allowed to be used again

The bizarre thing about this instinct is that it is not actually required for the (dark) Jedi to use Force powers, as the accompanying actor COG actually generates the Force power effect (such as creating projectiles, calculating player distances for "Force Grip/Pull" etc).

As such, testing has revealed that as long as there is an adequate actor cog attached to the thing (eg: view any of the "darkjedi_x.cog" COGs and then add it to the Level COGs section - F7 in JED), the AI will attack the player using Force powers (via COG), without requiring, LookForTarget, SaberFighting or even ForcePowers itself!

By itself, this instinct does not necessarily seem to trigger any Force power usage. At present, it is purely speculation that somehow the arguments from the AI file are "fed" to the actor's cog (regardless of whether it be a level or class COG) via "User0" message; nothing appears to reference this message, although somehow the "forcepower" variable (that LEC use) switches to either 1 or 2, assuming that: forcepower = GetParam (1); in the "User0" message. Interestingly, LEC have blanked out almost all of the dark Jedi class cog's Force power 3 code (JK). Jerec seems to be the exception. In short, if you're intending on using a Jedi actor with Force powers, decide on the 2 powers you want and COG code them into:

    if (forcepower == 1) { ... }
    else
    if (forcepower == 2) { ... }


Whilst this may appear to be more like a cheap work-around solution than anything "concrete", if the effects cannot be replicated, it makes it difficult to provide truly accurate information.

Status:

Questionable Implementation Usage

  • Create:
This page was last modified 15:54, 2 December 2005.   This page has been accessed 300 times.