AI attackers

Get help using Construct 2

Post » Wed Mar 20, 2013 3:16 am

I'm trying to make a top down game similar to this using path finding. I've sort of got it working, but is there any way to do it smoothly? Right now I get the enemies to pathfind to the players x,y every 0.5 seconds but it seems like they jitter a lot. How can I make it smoother or is there a better way to do this?
B
40
S
12
G
7
Posts: 603
Reputation: 7,656

Post » Wed Mar 20, 2013 7:41 am

My first idea would be to use a move behavior of some sort, bullet maybe? Then alter speed/acceleration every X seconds to aim towards players position.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Wed Mar 20, 2013 7:48 am

The way I do it in my space game is every 1.0 seconds instead of 0.5

I also have the enemy ships turn to face the player independent of the pathfinding, so this gives them a more 'realistic' feel because when the AI is searching for a path, the ships are still turning and firing.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Wed Mar 20, 2013 1:45 pm

@vee41 I was thinking of using bullet behavior but it still needs to slow down.
B
40
S
12
G
7
Posts: 603
Reputation: 7,656

Post » Wed Mar 20, 2013 2:37 pm

[QUOTE=EncryptedCow] @vee41 I was thinking of using bullet behavior but it still needs to slow down.[/QUOTE]

Something like this?

Bouncy enemies example

EDIT: Took a second look at that game, you can probably remove the whole 'phase' thinking and just give them high acceleration.

EDIT2: @EncryptedCow Redid it with custom movement, fits a lot better. Collision rebounds have to be done manually but that's quite simple. :)vee412013-03-20 15:56:20
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Wed Mar 20, 2013 3:18 pm

Why do you need pathfinding? It doesn't look like there are obstacles around which to navigate - you just need to accelerate towards the player location.
B
8
S
2
G
3
Posts: 83
Reputation: 2,668


Return to How do I....?

Who is online

Users browsing this forum: chcteacher, Televangelist, Yahoo [Bot] and 27 guests