"Realistic" AI aiming

Hey guys,

Right, so I am trying to make the AI system for I guess you could call it realistic gun play with the player. Essentially, there are two issues I am having, and I would like some input from you guys on how to go about them.

  1. How to get an appropriate Z movement for my AIs aiming. I have an animation setup aiming the gun from having it pointed at the ground to having it pointed straight up, broken up into 10 frames, and then using mouse movement detection, I can easily adjust the aiming for my player. But I am not to sure how to replicate this process for a character that is not following the mouses movement. Any tips on how you guys achieve this? Using the trackTo option for the Edit Object actuator I can already get it to follow the player it sees in the X and Y axis. I was thinking of instead of using the animation, some kind of trackTo to my hand bones tracking the target player, but I am not sure if it is possible to use trackTo in BGE with bones.

  2. How to get a more realistic lock on effect for enemy aiming. Obviously, it is no fun if the enemy AI can lock onto your chest for example, and will always directly hit you in your chest in the same spot every time. Especially if a limb damage system is implemented where you could take damage in your legs to effect movement or something like that. What would be a good way to approach this spread of aiming? I was thinking some kind of shooting animation for the bullets, then using a random actuator to have them hit in different areas based on which frame was selected from the actuator. But… that would have me change up my whole aiming system, which is just rayCast based, to more animation based, so I was wondering what you guys think on it.

Thoughts?

-KB

there are equations to aim ahead of a moving target based on velocity,

have it apply a random to the velocity, then apply a offset from that point up and down that is random, then use AlignAxisToVect(that point,.5)

An interesting and useful formula, but it’s not really the problem I am dealing with? This seems more to handle movement and bullet drag, rather than what I was talking about. Unless I am just not seeing the connection?

you add your random value to the speed value, this will aim ahead or behind a bit,

then select a point above or below that point,

this will hit random sections,and allow for a “aiming ability score” to be set (your random deviation size)

How to get a more realistic lock on effect for enemy aiming. Obviously, it is no fun if the enemy AI can lock onto your chest for example, and will always directly hit you in your chest in the same spot every time.

The way I’ve always done it is to use the “add object” “track to” actuator, and add 20 or 30 to the actuators time. That should slow things down enough to give your player a chance to strafe out of the way.