Help with FPS AI

We are trying to make AI for an FPS game using python + game logic, but we are not sure exactly how to do it (Eg: what methods to use).If anyone has a suggestion please comment.

UrbanMonkey Team

To risk making it overly simplified: Add a near sensor so when the player gets within so many Blender units, the AI detects it. Add a ray sensor and rotation actuators, so that the AI rotates until it is facing the player. Add a motion actuator, so that it will then run toward the player when the player is detected by the ray sensor.

That is an extremely simple AI. I intend for it to be merely a jumping off position for you to figure out the other thousand details of a good AI.

To TheBigfoot,

Thanks for your comment. Probably should of said this to begin with, but I already have done that, we are looking more for things like the enemy shooting and hiding behind cover.

Once again, thanks anyway,
UrbanMonkey Team

Does anyone know how we could make AI that shoots and finds cover?

-UrbanMonkey Team-

umm I guess you could use waypoints, or python.

You could have the cover give themselves a property like “nearest cover” when they’re within a certain distance of the enemy, then once a shot nears the enemy, it can track towards the cover with that property. Once near cover, the enemy can go to a “firing” state or something: track towards the player and return fire.
The “track to the nearest cover” part may require some python, however, as I have yet to actually do it myself using only actuators… :o
Don’t worry, though, everything else is possible, and with just actuators even!

Does anyone know a tutorial for the methods of python that would be used to make AI?

UrbanMonkey Team

You need AI rotations? like patroling a certain area?

To Kojima Pro,
In short, what we need is for the enemy object to find the nearest cover and once there shoot at the player.

UrbanMonkey Team

Dang, im looking for the same shiet. Well, let me know if you need help with a AI patroling a area.
What i can do is look around for something like that.

Hmm… That is different. And that will require a lot of python programming. (at least in my opinion)

Have a couple actuators that keep the AI rotated toward the player, have them shoot continually (as their gun type allows). Get player position. Get AI position. Get position of nearest object with property of “cover”. Send the AI to the opposite side of that object.

Note. I have not done that before, and it is merely a guess.

PS. Do not ask me to program it because 1. I don’t know python (though I know some of another language). 2. I am really busy.

Well, the “firing state” I mentioned could just be a “track to” actuator to aim at the player and an “add object” actuator for the bullets…And all that would be in another state that’s brought up when you near the cover…
I’m still working on the “track to nearest cover”…:stuck_out_tongue:

Thanks for all your replies everyone, i will try to make what has been described.

UrbanMonkey Team

You’re welcome. Although I have a feeling I wasn’t much help.

Oi, if you’re still interested, here’s a link for the “track to nearest cover”…

You guys should look into python (if you haven’t already). Also you should look at the Yo Frankie! navigation scripts. =)