How do I make the AI like the Osmos?

Get help using Construct 2

Post » Fri Mar 25, 2016 12:27 am

Hi, I am very interested in whether to implement the AI like in Osmos or agar.io. Well, you know, top view, the cells were strolling on the field, and devoured what I will command them. Is this possible?
B
7
S
2
Posts: 13
Reputation: 710

Post » Fri Mar 25, 2016 12:46 am

Not familiar with Osmos, but isn't everything that moves in agar.io a player?

If you're looking for some random movement, you could use the bullet behavior and have a condition every x seconds to set angle to random(360).

For some AI that heads towards the player when close, you can use the condition that checks distance between player and object, and action that set object angle towards player.

If you add another condition to check if the player or object is "larger", you can set up the inverse action/angle to run away from the player as well.
Mistakes were made.
B
55
S
28
G
115
Posts: 1,709
Reputation: 65,116

Post » Fri Mar 25, 2016 12:57 am

oosyrag wrote:Not familiar with Osmos, but isn't everything that moves in agar.io a player?

If you're looking for some random movement, you could use the bullet behavior and have a condition every x seconds to set angle to random(360).

For some AI that heads towards the player when close, you can use the condition that checks distance between player and object, and action that set object angle towards player.

If you add another condition to check if the player or object is "larger", you can set up the inverse action/angle to run away from the player as well.

Very thanks for advices. I just don't know which side to this approach. That is, if I understand correctly, the entire development of AI of this type can be carried out only through the angles and Bullet behavior?
B
7
S
2
Posts: 13
Reputation: 710

Post » Fri Mar 25, 2016 1:02 am

For movement, I think the bullet behavior will cover most your needs in a top down environment.

Then it just a matter of setting up the logic and conditions for when you want the object to act, and act by changing the direction (angle) and speed of the bullet object.
Mistakes were made.
B
55
S
28
G
115
Posts: 1,709
Reputation: 65,116


Return to How do I....?

Who is online

Users browsing this forum: tetuan and 33 guests