Beat Em' Up - Setting Up AI

Get help using Construct 2

Post » Wed Oct 28, 2015 10:31 pm

Message: YoHoho can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
https://www.youtube.com/watch?v=fvNsSqfsJsM

www(dot)youtube.com/watch?v=fvNsSqfsJsM

I followed this tutorial which hasn't been concluded :(, so I'm going to try and complete the basic gameplay system using my limited knowledge and help from the forums.

I figure I can setup an AI enemy with the same behaviors (default control OFF) along with their attack animations. After that, what would be the best choice of setting up the AI enemy to start moving towards my player? I haven't used the Line Of Sight behavior yet so I'm not sure of its workings. Any ideas for this would be appreciated.
B
207
S
116
G
8
Posts: 140
Reputation: 20,926

Post » Thu Oct 29, 2015 12:19 am

use the system event compare 2 values

then distance(enemy.x,en.y,player.x,play.y) < 300

how you choose to move the AI is up to you, i like bullet behavior caus you can set the angle towards the player and give it a speed.

maybe use los so the enemy knows when to play the attack animation.
B
9
S
3
Posts: 102
Reputation: 987

Post » Thu Oct 29, 2015 11:34 pm

Funny enough, I just d/l the beatemup.capx from the tutorial (luckily still available) and the developer implemented a way for the AI enemy to find the player using compare values x,y. So clearly this is the way to go as the game build preview ran very well. I do like the idea of using the bullet behavior for other sorts of enemies.

I also want to know how I would handle a jumping animation/event. Considering that the player's shadown/box isn't supposed to go higher than a certain point on the Y axis, how would I implement jumping? You can always jump in a beat 'em up even if you can't go any higher on the stage. Hopefully I'll get to try this out sometime.
B
207
S
116
G
8
Posts: 140
Reputation: 20,926

Post » Mon Nov 02, 2015 12:23 am

Well, I have my Player and my Enemy moving towards each other. And that's about it.

The tutorial developer's .capx file includes having an instance variable on the Enemy for the STATE of "walking" but I wasn't able to even change it in the events tab. Not sure what the issue with it it.

I'm not sure how to go about figuring out when the Enemy should even detect the player (collision with object OR comparing X,Y variables). I tried the X,Y and it's just awful mixed results (not getting the Enemy to return to walking, not sure of distance). Anyone has any clues as to what to use, I could use some help.

[url]Well, I have my Player and my Enemy moving towards each other. And that's about it.

The tutorial developer's .capx file includes having an instance variable on the Enemy for the STATE of "walking" but I wasn't able to even change it in the events tab. Not sure what the issue with it it.

I'm not sure how to go about figuring out when the Enemy should even detect the player (collision with object OR comparing X,Y variables). I tried the X,Y and it's just awful mixed results (not getting the Enemy to return to walking, not sure of distance). Anyone has any clues as to what to use, I could use some help.

https://www.dropbox.com/s/x2peztm94xwfl ... .capx?dl=0[/url]
B
207
S
116
G
8
Posts: 140
Reputation: 20,926

Post » Mon Nov 02, 2015 8:24 pm

You could use the path-finding. Set the target a few pixels away from the player sprite so it goes in front or behind the player.

This will make so they will navigate around obstacle too.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Tue Nov 03, 2015 12:44 am

I'll have to look over a path-finding tutorial since I haven't used it yet. Hopefully this can produce the results that I want. I also really just want some sort of great example of a beat em up made in Construct 2 already.
B
207
S
116
G
8
Posts: 140
Reputation: 20,926

Post » Sun Mar 06, 2016 7:51 am

Image
B
57
S
13
G
6
Posts: 271
Reputation: 12,103

Post » Sun Mar 06, 2016 9:26 pm



Dude, I've watched your videos! I literally just finished your Tetris tutorial!

But now, I can't figure out how to add the other Tetris block shapes (square, 4 pixel line). How do you create those shapes and have them work properly? I couldn't ever have figured out how to accomplish making Tetris in C2 without your videos; way too much work trying to figure out the array setup.

As for the beat em' up, I'll look into it a long ways from now; probably will just purchase a template that works and try to make adjustments. Hope you create more videos!
B
207
S
116
G
8
Posts: 140
Reputation: 20,926

Post » Mon Mar 07, 2016 3:32 pm

just add new shapes for the blocks, the code should automatically make them work.
Image
B
57
S
13
G
6
Posts: 271
Reputation: 12,103


Return to How do I....?

Who is online

Users browsing this forum: Bootfit, dop2000 and 24 guests