Enemy AI for Side Scrolling Beat'em Up

Get help using Construct 2

Post » Mon Mar 02, 2015 7:55 pm

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.
B
6
S
1
Posts: 35
Reputation: 476

Post » Mon Mar 02, 2015 8:29 pm

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.
Frosty Elk AB
www.frostyelk.se
Have no fear, We come in peace!
B
13
S
3
G
1
Posts: 106
Reputation: 1,169

Post » Mon Mar 02, 2015 8:41 pm

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.
B
75
S
28
G
32
Posts: 480
Reputation: 19,711

Post » Tue Mar 03, 2015 10:53 am

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.
B
6
S
1
Posts: 35
Reputation: 476

Post » Tue Mar 03, 2015 11:57 am

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.
B
21
S
7
G
4
Posts: 233
Reputation: 3,474

Post » Tue Mar 03, 2015 8:17 pm

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.
B
6
S
1
Posts: 35
Reputation: 476


Return to How do I....?

Who is online

Users browsing this forum: amazingdream, Exabot [Bot], lordsas, mekonbekon, tarek2 and 57 guests