Streets of rage style enemy AI

Get help using Construct 2

Post » Fri Apr 25, 2014 11:13 pm

heya all. im a little bit stuck !! been working on a streets of rage (SoR) style beat em up got everything working sweet and looking amazing accept 1 major thing, the enemy AI.
ive searched and searched and come up with nothing that can help me. im not looking for anyone to do the work as i enjoy the challenge. but i need a point in the right direction like what are the factors that make the enemy behave the way they do in SoR, like a break down of basicly whats happening so i can try and build something of my own.

any help would be amazing :-)
B
7
S
1
Posts: 20
Reputation: 450

Post » Sat Apr 26, 2014 12:09 am

Now that is a big question. If you have never built an enemy ai system before, this may turn out to be a bigger project than you are ready for. However, here is a very low level breakdown of the main ai mechanics of the basic beat'em up style enemies:

* Enemies try to get lined up with the player on the same y axis to attack the player
* Melee enemies try to get within x axis range while staying either above or below the player before matching the players y axis
* Single melee enemies will try to circle around behind the player to attack from the back
* Groups will try to surround the player
* Ranged enemies try to stay at a distance along the x axis but stay lined up with the players y so they have a direct shot

These 4 things are the major mechanics of the basic enemies in almost all beat'em up style games. While it doesn't include bosses or more difficult enemies, it is at least a start point. Of course, as I said, it is an extremely low level explanation and does not in any way describe how to pull it off in Construct. I want to stress again, that it would be a much easier task if you have experience with enemy ai systems. This shouldn't be the first type of ai you create.
B
40
S
12
G
11
Posts: 331
Reputation: 7,752

Post » Sat Apr 26, 2014 3:26 pm

thank you for reply thats a good start. if i could get like a breakdown of what process the ai goes through would be amazing.
my last project was a almost perfect clone of the game "eswat" for the megadrive that included a simple kind of AI for a pure X axis game style (player cant move into foreground or background).

eg line of sight of player, when to follow player, when to shoot, what side of the player enemy is facing (left right up or down) this is good but really only makes enemy get in range and shoot in player direction.

im aware of loops and their uses and arrays. if i could get like a flow chart of the process the AI goes through i could then get a better idea of what information it is looking for and how to go about building it ;-)
B
7
S
1
Posts: 20
Reputation: 450

Post » Sun Apr 27, 2014 7:03 am

Have a look at this, it was a simple example I did of the ai for double dragon. Should be a good starting point.

https://db.tt/gkpg449g
ImageImage
B
130
S
23
G
7
Posts: 1,078
Reputation: 13,280

Post » Thu May 01, 2014 4:57 pm

hey thank you for your help. that is a good start thankyou. on a quick change of subject, i cant believe the lack of information on this subject!! i really thought this would be one of the most asked questions!!!

anyway...

i have managed to pull in bits of information and ideas across the net and i think i now have somewhere to start from. i will try and put some thing together for others in my position to work from ;)

anymore help in the meantime would be greatly appreciated :)
B
7
S
1
Posts: 20
Reputation: 450

Post » Mon Jul 14, 2014 6:21 am

Sorry to bump an old thread, @bartsimpsonredux or @GenkiGenga can we get a reupload of capx? i had it when it first became available. I had to reformat last week and trying to remember what all i had for good references.

please and thank you!
B
7
S
1
Posts: 16
Reputation: 471

Post » Thu Oct 23, 2014 7:03 am

Hey cisco, sorry mate I didn't realise I had been tagged. I had cleaned out my dropbox a while ago and was only directed here from a PM. I just threw together a new example that goes over the enemy AI.

Here it is: https://db.tt/eYI8AIWd

Disclaimer - this is not a double dragon template, it is simply an example of how to handle the AI for your enemy units.
ImageImage
B
130
S
23
G
7
Posts: 1,078
Reputation: 13,280

Post » Fri Nov 07, 2014 11:53 pm

thank you for bumping this post. im still yet to pull off a fully working streets of rage style AI. wish i could a look at the streets of rage AI flow chart.

building upon the above capx i have also used mode states for:

is player attacking ( go to defend mode% )
enemy health below 30 % ( retreat mode% )

also have put two attack points on the player itself ( front and back )
If there is an enemy already attacking from the front the second will go around the back to attack.

the % of the defend and attack mode are just that. a % of successfully going into desired mode. this is because if the enemy always instantly went into defend mode and blocked the player every time the player attacked, it wouldn't be a very fair game.
B
7
S
1
Posts: 20
Reputation: 450


Return to How do I....?

Who is online

Users browsing this forum: DrKoala, irina, mindragon73, zenox98 and 22 guests