# playMaker

### Author Topic: challenging collision problem  (Read 1871 times)

#### santelia

• Junior Playmaker
• Posts: 78
##### challenging collision problem
« on: July 20, 2012, 02:59:51 AM »
I'm facing a little challenge with one of the situations in a RTS project.
The player - among other things - can move long ships. Given a target, they start moving, and if the target is not on the bow direction (straight forward), during their way to the target they follow an arc and rotate on their Y axis. It's a little more complex, but let's make it easy. Now, during the rotation it's possible that part of the ship (e.g. the stern, or the side) collides against something in the scene (a coast, a dock, another ship, etc).
When the ship is moving straight forward, it would be easy to stop her if an obstacle was near her bow. And then use some kind of pathfinding. But when we talk about the stern moving along an arc, as a consequence of the changing bow direction, really it's a completely different kettle of fish.
Not to risk too complex behaviors, the ships simply don't have any rigidbody. And they're obviously made of many parts (including ones with independent behaviors like gun towers). And the moving routines act on their root.
Any idea on how to manage such situations?
Jean, any caffeine for my brain a little asleep ?

#### jeanfabre

• Hero Member
• Posts: 15396
• Official Playmaker Support
##### Re: challenging collision problem
« Reply #1 on: July 20, 2012, 03:34:45 AM »
hi,

I am not really following the trick and the problem you have here. what is the different between colliding the front of the boat or the side?

What do you want to manage actually? you want to re route the boat but because it's following a complex path, you don't know how to redefine the path?

I am the one who need caffeine actually

bye,

Jean

#### santelia

• Junior Playmaker
• Posts: 78
##### Re: challenging collision problem
« Reply #2 on: July 20, 2012, 05:52:53 AM »
The difference is that if the ship has got an obstacle in front of her bow, you expect her to stop. While if she hit an obstacle with her side, or with a stern moving in circle, you expect the ship to force her route as if the collider was actually pushing her hull by side. You know, as when a boat is scraping a dock with her side

#### jeanfabre

• Hero Member
• Posts: 15396
• Official Playmaker Support
##### Re: challenging collision problem
« Reply #3 on: July 20, 2012, 07:18:11 AM »
Hi,

ah ok I see.

well then, that indeed will cause major headaches if your boat if not physics driven and you are not using a pathfinding with dynamiv obsctacle avoidance... Not sure how to tackle that otherwise.

bye,

Jean