Enemy AI for Side Scrolling Beat'em Up

0 favourites
  • 6 posts
From the Asset Store
Give Sound to the enemies that are part of your game! :)
  • Hello! I'm new here and on game making and i need some help on making a simple ENEMY AI for an old school SIDE SCROLLING BEAT'EM UP game. Could someone help me with some coding ideas? Thank you.

  • There already is AI built in, at least sort of.

    Look under behaviors, there you have Line of Sight and Turret.

    But if you are looking for more complex AI then i guess you need more than just attacking the closest nmy etc.

  • Old school beat 'em ups (be it longer ones like Streets of Rage™ or 1 on 1 like Streetfighter™ or Samurai Shodown™ ) typically had very limited AI. You might not call it AI at all, they were purely pattern based.

    Those games typically had perfect enemies. That means, that an enemy would do something like approach you, hit you with a random attack or dodge one of your attacks 100% perfectly. To make it appear like a "real enemy" random delays are added, to give you a chance to dodge the attack or land a hit yourself.

    To create the simplest form of this in construct2 you would move your enemy sprite towards the player at a certain speed, and when the distance between those two is smaller than a threshold you thought out, the enemy attacks, then cools down with a timer, and attacks again.

    On top of that you add random stuff to your liking, like erratic movement, skip an attack, random delays etc.

    It's perfectly simple to do, the real work is in creating all the graphics, designing the random patterns to feel "alive" and balancing it all to make it interesting for the player.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah,that's what i thought too but being new in C2 it's a bit difficult for me to adapt it in C2 code. A short specific example would be helpful to me. Thanks a lot, anyway.

  • Try to make a variable that constantly counts the enemy's distance to player. Then make the enemy act differently depending on the distance. Usually in beat em ups enemies act defensive and stay away if you're far away. That way they give you the impression of being surrounded while others are trying to attack you. Also a limited amount of aggroing enemies is a must for a balanced game, at least in most scenarios. Make a variable that sets the limit and then randomly make enemies go aggro or back off while keeping the limit in check. Make it so that all enemies can aggro, but have less chance of doing so if they're far away. It gives the game a logical pattern while keeping it dynamic and unpredicatable. There can be some enemies that won't follow these rules, usually bosses or other special heavy hitters. Take for instance the ninjas in Streets of Rage almost constantly aggro you and if they aren't coming to attack you, they'd throw projectiles from distance while staying away from your attack range.

    That's pretty much the logic. Making it work requires lots of testing and fine tuning. It all comes down to assloads of variables, randomly called events/functions and well positioned hitboxes. Leave the eye-candy for last. It'll just confuse the whole process of creating the technical stuff.

  • Yeah, these are good ideas and that's the way i'm gonna do it but still would be very helpfull a capx or a tutorial made in C2 on this. Just a short one, pls. Thanks again.

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