0 Favourites

Streets of rage style enemy AI

  • 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

  • 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.

  • 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

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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

  • 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

  • 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!

  • 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.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)