Join for FREE | Take the Tour Lost Password?
[x]

deviantART

 

Autonomous Steering - Pursue by @summaro:iconsummaro:


Creative Commons License
Some rights reserved. This work is licensed under a
Creative Commons Attribution 3.0 License.
:iconsummaro:

Artist's Comments

Autonomous pursuit and evade.

The two bots start at identical positions with identical velocities, and the target is a moving bot with a constant velocity.
The pursue bot alters it's velocity to head towards the target, the fleeing bot away from the target. A cross hair shows where the pursue bot is currently aiming, as it estimates the intersection of the pursuit bot/target bot velocity vectors.
Bots implement rudimentary inertia and torque.

The demonstration will reset itself when the seeker hits the target. Behaviors are modular and can be added to any bot with no specialized code modifications.

This one is a little buggy, and if the bots disappear, you'll need to reload the page.

Steering algorithms outlined and adapted from [link]

Raw code dump can be found at [link] . Designed to be compiled using the mxmlc compiler, though you could easily integrate it into your .fla files. One day I'll write up a tutorial.

Critiques


Thank you for your Critique

You are not logged in.

Comments


love 0 0 joy 0 0 wow 0 0 mad 0 0 sad 0 0 fear 0 0 neutral 0 0
:iconhomedoggieo:
I'm too dumb for this stuff :slow:

--
:clap::spotlight-left:=alder-sketch:spotlight-right::clap:

98% of deviantART posters use a quote like this. If you're one of the 2% that doesn't, copy and paste this into your signature.

Go visit *vanlubeck and say, "Hi!" :wave:
:iconsummaro:
Nah, just some 2D geometry, nothing too hard.

--
In order to understand recursion, you must first understand recursion.
:iconhomedoggieo:
2D whatnow?

I think you're making up words :noes:

--
:clap::spotlight-left:=alder-sketch:spotlight-right::clap:

98% of deviantART posters use a quote like this. If you're one of the 2% that doesn't, copy and paste this into your signature.

Go visit *vanlubeck and say, "Hi!" :wave:
:iconskwerllygait:
very kewl. AS3?

--
My blog--> [link]

Life is a Tale, Told by and Idiot, Full of Sound and Fury, Signifying Nothing.
---Shakespeare
:iconsummaro:
Yeah, the code's all in a zip linked at the bottom of the description if you want it. :)

--
In order to understand recursion, you must first understand recursion.
:iconskwerllygait:
thanx.

--
My blog--> [link]

Life is a Tale, Told by and Idiot, Full of Sound and Fury, Signifying Nothing.
---Shakespeare
:iconthecheshirecatalyst:
You're developing an orbit if you will. Since in this there is something moving seeking something moving, the Pursuer get's 5 pixels away, not enough to trigger it, then the Evaders animation cycle moves it whatever ammount. Pursuer check for hit again, none, so it continues on a velocity that in one cycle over shoots the Evading shuttle past the error margin wherein the evader then makes it's move, then the pursuer "turns around" and over shoots it. and so on and so on. It's never checking for it's hit when it's in range, only when it's slightly out of it. Try trimming you top speed for the Pursuer, or implement a granular simulation, wherin the move function just increments position[0] and position[1] by 1. and just call the move function in a loop that is terminated when the number of times move is called = the velocity. i could write out some pseudo code. but that's your problem. It's a situation that will happen a lot, when a simple hit detection algorithm is used. That's what i get anyway from looking at your code.

--
Courtesy of The Cheshire Catalyst
:iconthe-h-man:
Awesome, thanks very much for the link to that steering behaviors page. Ive been working on a game for a while now and that link will help my AI alot!

--
This guy likes Julie
:iconsummaro:
No problemo :)

--
In order to understand recursion, you must first understand recursion.

Details

December 29, 2008
16.7 KB
3.6 KB
328×289

Statistics

9
2 [who?]
682 (1 today)
14 (0 today)

Site Map