Jump to content



Irregular shaped obstacles repulsion fields

  • You cannot reply to this topic
4 replies to this topic

#1 lucky6969b   Members   -  Reputation: 100

Like
0Likes
Like

Posted 15 February 2012 - 01:36 PM

How do I setup a repulsion field from obstacles that have irregular shapes?
My first thought was to use a bounding box and use its half-radius to calculate.
What is your comment?
Thanks
Jack

Ad:

#2 alvaro   Members   -  Reputation: 1695

Like
0Likes
Like

Posted 15 February 2012 - 01:57 PM

You can define the repulsion field as a potential based on distance to the obstacle, regardless of its shape.

#3 jefferytitan   Members   -  Reputation: 184

Like
0Likes
Like

Posted 15 February 2012 - 09:01 PM

Do you just want A repulsion field, or one that matches the shape of the object? If just any old field would work, a bounding box or spherical field would be fine.

For something that matches the shape of the object more, maybe have a minimal bounding box to prevent clipping, but also do a few raycasts on the geometry to estimate the closest point. Then repulse based on the closer of the raycasts minus the minimum approach distance or the minimal bounding box. This means the repulsion field of certain bits of the geometry may stick out beyond the bounding box.

#4 IADaveMark   Moderators   -  Reputation: 1247

Like
0Likes
Like

Posted 16 February 2012 - 08:28 AM

I would agree that it might be more efficient to use a distance-based, per-agent approach (i.e. with collision raycasts) than to calculate and pre-bake a repulsion field.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC

Professional consultant on game AI, mathematical modeling, simulation modeling
Co-advisor of the GDC AI Summit
Co-founder of the AI Game Programmers Guild
Author of the book, Behavioral Mathematics for Game AI


Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

#5 Bear Soul   Members   -  Reputation: 129

Like
0Likes
Like

Posted 18 February 2012 - 05:46 PM

One trick I've found useful at times for creating collisions or physics effects on irregular objects without turning on per triangle collisions was to just child several small collision boxes to the main object. As long as this object is not being affected by it's own irregular shape this works very well and is usually efficient code wise.

If the object has to react physically because of it's irregular shape (for example our repulsion field is attached to half bum bell like shape and has to roll/bounce down a hill while repulsing) then the only clean solution is to create a collision mesh.

Is your fields repulsion strength based on distance or simply on collision? If on distance, you might want to create two or more repulsion nodes that add up each others repulsion vector. That way a peanut shaped repulsion field will not be weaker if you bump into the ends compared to the middle.






We are working on generating results for this topic
PARTNERS