AI Football

Get help using Construct 2

Post » Sat Aug 11, 2012 8:36 am

I've never attempted to do any AI behaviour before, I have a 2 player game which is a little bit like football but with two opposing spaceships. I'm thinking of attempting a single player version of this but I don't really know where to start.

Can anyone point me in the direction of where I can learn any of this stuff. I think I need an AI that can navigate the level (avoiding obstacles), and also attacking the ball when it's free, defending the goal when it is being attacked, plus picking up and using power-ups.

I could work out how to tell something to go to pick up the ball and defend but it's just the navigation I don't know, would you set up a series of waypoint paths for the AI to travel across around the level?
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Sat Aug 11, 2012 1:15 pm

You can't create actual AI behaviors in C2 yet.
But you can fake the AI by giving the object a series of logical things to do in response to what.

Things that will be useful in making your AI navigate and avoid obstacles would be the distance() function. Just check if the object is within too close proximity from the obstacle, if it is, make it dodge it or jump etc.
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Sun Aug 12, 2012 8:41 am

Interesting, I did not know about the distance function. Thanks!
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Sun Aug 12, 2012 9:04 am

No problem, hope you manage to get what you want :)
B
36
S
10
G
6
Posts: 948
Reputation: 11,101


Return to How do I....?

Who is online

Users browsing this forum: Vegamon007 and 15 guests