Game AI that fits in a Sidescrolling shooting game
Hi guys! Could you please suggest some AI theories/concepts, techniques or patterns that would fit for a sidescrolling shooting(shoot'em up) game? Thanks!
We should never stop learning...
The shmup games I played didn't feature much AI, the enemies just moved in predefined patterns.
I suggest define different "path" classes which are defined by series of coordinates such as "zigzag", "spline", "teleport"
then you can have a state machine which the sprites follow - each state has its path and you can change states based on player input.
you can either load from file predefined paths (and you can also load enemy hps, speed, etc...)
or you can generate pathes in run-time (which could be the AI you want I guess).
or some combination of the two (see example-)
example-
you load a predefined "path" of some two spiral pathes and generate 20 enemy sprites to follow the path (with some distance between each sprite). Each sprite watches out for a player shot, and if it detects one coming his way there is 50% that he will alter its path to some zigzag and then 10 seconds later go back to its original path.
I suggest define different "path" classes which are defined by series of coordinates such as "zigzag", "spline", "teleport"
then you can have a state machine which the sprites follow - each state has its path and you can change states based on player input.
you can either load from file predefined paths (and you can also load enemy hps, speed, etc...)
or you can generate pathes in run-time (which could be the AI you want I guess).
or some combination of the two (see example-)
example-
you load a predefined "path" of some two spiral pathes and generate 20 enemy sprites to follow the path (with some distance between each sprite). Each sprite watches out for a player shot, and if it detects one coming his way there is 50% that he will alter its path to some zigzag and then 10 seconds later go back to its original path.
As far as the shooting goes I'd give some of the units an angle or position offset when aiming at the player. So instead of everything shooting at a single point they shoot in small waves which appears a lot more intelligent.
Quote: Original post by AlrecenkIf you want intelligent behavior, just define a circle around a player and divide it into an equal number of parts based on the number of shooters. Then, adjust each target point by the velocity of the player and the distance from the shooter to the target.
As far as the shooting goes I'd give some of the units an angle or position offset when aiming at the player. So instead of everything shooting at a single point they shoot in small waves which appears a lot more intelligent.
Four enemy ships would shoot a diamond that would meet the player perfectly if the player doesn't change velocity, and if he does there is still a good chance one or more of the shots will hit.
Honestly, though, shooters generally have predefined patterns that the AI always follows reguardless of the player's actions because otherwise they become impossibly difficult. People seem to like shooters when the challenge comes from dodging millions of bullets rather than trying to deal with intelligent opponents.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Thats the real question: what kind of behaviors do you want to see in that game?
What I want is for my enemies to move a little, throw some stuff on the player then go somewhere else(retreat, charge, etc).
If I had for example pre-defined paths in a file... Like:
moveLeft, moveRight, Shoot, Shoot, Shoot, moveRight, moveRight, moveRight
is this what you guys mean?
If I had for example pre-defined paths in a file... Like:
moveLeft, moveRight, Shoot, Shoot, Shoot, moveRight, moveRight, moveRight
is this what you guys mean?
We should never stop learning...
Quote: Original post by armond
What I want is for my enemies to move a little, throw some stuff on the player then go somewhere else(retreat, charge, etc).
In that case, I think a very, very simple state machine will do the trick.
Quote: Original post by SteadtlerQuote: Original post by armond
What I want is for my enemies to move a little, throw some stuff on the player then go somewhere else(retreat, charge, etc).
In that case, I think a very, very simple state machine will do the trick.
I think you need a state machine aswell.
If you really want more complex AI you could try
**Phase 1
*randomising position to throw something from, then test where it lands.
*giving each throw position a score.
**Phase 2
*trying to get to the launch position
Maybe even score higher the closer they are to where they are so more chance of getting there.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement