Space Shooter AI

Well I am closing in on the part where I have to create opponents for the player .

I am fairly green when it comes to AI but here is what I figured:

I wish to make a simple state machine with threestates. Search,pursue and attack

In search state my entity will seek out opponents (in my 3D world)

In pursue state the entity have found the opponent and is trying to get within range

In attack state the entity attacking.

But how do make a search state?. The way I see it I can do it two ways.

  1. The entity cheats and knows it oppontns location and just tries to get a bearing(dunno how to determine that)

  2. The entity has a some kind of frustum representing its forward view and if the opponents is within this frustum they are considered "seen".

    Anyway perhaps I am going about this all wrong so please suggest alternative solutions if you know of any.

searching is some matter u have do decide on your own as you could make line-of-sight approach or enemy chosing via radar.

attach and pursue is some matter of chase and evade.

you should use your AI follow your vehicle by line-of-sight approach, that makes it look a little bit natural for the behaviour of steering forces. While fireing your AI should make use of Interception, that's making the AI fire on that point, where the fire has the chance to get your vehicle in the future, so it will fire infront of your front to intercept u.

Magic Missiles could also have some little AI on redirecting to the final positions after you have changed your steering forces; some matter which would really look unrealistic for a simple Laser Shot.

Basic Approaches can be seen in my actual wiki found in here:

i am now working on those patterns which could make AI patrolling or other things in predefined schemes, but controlling the controllers is now kind of problem

Well first of all very nicely written paper. Good understandable layout.

Second of all seems I assumed too much about AI and have much to learn. This is good and bad. Bad since I have todo more work, good because I assumed to much in my Master Paper which have a small AI part. I assume that the Ai would play on the same terms as the player and did not need to know the entire state (cheat a bit). Not quite correct


Why couldn't the AI know only what the player would from their perspective?  I think any "cheating" makes for the kind of AI people end up hating.


Well when I mean cheating I am referring to the fact that the AI has to know certain things the player does not.

First of all todo the pursue pattern it has to know the targets exact position. Futhermore to be in line of sight, this must be simulated in some way (unless one plans to make the AI render the game and do pattern matching).

Whether or not the AI knows the exact position of its enemy does affect the AI implementation only. Obviously it is easier to write an AI that simply knows everything. But this does not matter for the game experience. The important thing for the user is that it looks like AI has the same information as a player and it looks like the AI was somehow smart.

Regarding the search pattern: the AI should at least refrain from making too much use of its knowledge about the players position. I'd consider defining some patrol waypoints and diverge abit from them.

Btw. in a space game the opponent does not have to be in line of sight to know where he is: looking at the radar reveals enemys behind him . . .

pattern movement is still in build

i have made a spatial controller can move my spatial around as pattern wants it to be, but there are real problems on the absolut position.

As i wanted this controller to move my node around and turn it as wanted, it only moves and turns around from this node in it's origin.

I wanted to move my spatial around in a square and result is an X where he ever moves to the Center and then makes his next move.

That's really unwanted so i did not tell anything about it yet.

What about AI cheating ??

In fact every AI cheats, it's some decision of how much it should cheat to look quite intelligent, without being that hard to battle against, that it is impossible to win against it.

That's the true trial on AI

and remember

those textes i post on the wiki only handle the basis ideas on every section.

it is no finished model for ai yet

I think one of the true tests is how obvious the cheating is.  For example, AI agents that automatically know the position of enemies as soon as they come into a certain radius (assuming they don't have some kind of radar sensory system) is pretty easily identified as cheating.

In my opinion you should make the AI work with as close to the inputs the player has as possible.  Rendering and then interpreting images would be inefficient and insanely difficult and probably not feasable, but you could very well define a frustum that is his sight area and have him ignore/give less attention to things outside it.  Making AI move in ways not possible to the player is also something that bothers me.  I recently was playing a 2D space game where the AI would move sideways and all kinds of ways and ships moved faster than they were capable just to keep in formation and such.  I would try to avoid these types of things.  Even in Quake or Unreal the AI has no restrictions on turn rates allowing the AI to shoot in any direction at any time.

You have the entire gamestate in your control and nothing is going to stop you from using it.  The trick is to make your agents look as if they don't have all that knowledge while still being competitive.

All of this comes down as much to a question of opinion as anything else though.  Do it how you like it best :wink: