Sign in to follow this  
asuskobay

What is the best algorthim to create (withdraw) as defence ?

Recommended Posts

Hi everyone!

 

I have just done learning libgdx framework(java) and Box2d Physic Engine. Now I am learning GdxAI(Artificial Intelligence).

I have created two object  (enemy and user body). Enemy body is use steering behavior which is arrive. User body is use it own input processor given by end-user. So when enemy body arrive the user body, then collision happens and it seems as shooting. But enemy body shoots continuously user body. I just want to declare a flee algorithm to do defense when gets more damage and again attack when it gets enough distance.

 

I thought path finder may help me but it not sure. So what do you suggest for my game ? Which path I have to follow ?

Edited by asuskobay

Share this post


Link to post
Share on other sites

You can just use a different steering behavior, such as "separation", to get the effect you describe.

 

If you want more complex environments with obstacles and such, you will probably want to start exploring pathfinding, but for a simple demo just steering should be OK.

Share this post


Link to post
Share on other sites

Thank you for answer.

What do you mean by separation steering behavior ?

Actually in the map , it doesnt contain obstacles except around the map.That's why i may not need to use path finder. Image a map which is as play court two object just attacking. World doesn't have gravity.   

 

Is that steering behavior like collision avoidance?

Edited by asuskobay

Share this post


Link to post
Share on other sites
The original paper on steering behaviors (available here: http://www.red3d.com/cwr/steer/) names many types of steering. The one I should have called out is "Evade" rather than "Separation" but the idea is the same.

Have a look over the paper and the different types of behavior, it should be easy to add one to your system that results in target evasion, based on the examples provided in that link.

Share this post


Link to post
Share on other sites

I have applied Evade and Flee steering Behavior. Flee behavior seems too stupid when escaping. But Evade behavior much better than it. 

When I passed Enemy(AI) to Evade behavior, Enemy body is colliding with wall  around the map. So Shall I apply obstacle avoidance or collision avoidance ? 

Which one will be better?  

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this