quote:Original post by MikeD
Now recursively follow these two steps.
a) Check if the area is free based on your own algorithm for radius checking. If it is free, you're there.
b) If it is not free, calculate a repulsion vector from every collidable object in the world.
Damn Mike... that was my first idea... except that I only considered computing the repulsion vector to the nearest unit's circle... which could be found by expanding out concentric circles from the guess point. If you get to the radius of the object you want to place, your home free... otherwise move away from the first object you intersect (by the difference in achieved radius to target radius) and try again.
I disregarded this idea because there seemed no guarantee to be able to place the unit within a bounding volume... but I believe your method will find a location, if it exists, within the bounding volume enclosing all current units with less iterations than checking only one unit... unless the starting point lies outside this volume of course.
fup, you really must have too much time on your hands! If you do, I can suggest a little project for you... that is in line with your GA-ANN bot work!
Cheers,
Timkin
[edited by - Timkin on June 2, 2002 1:05:38 AM]