Obstacle Avoiding Missile

N

Nabil Kabour

Guest
I'm trying to make an obstacle avoiding homing missile, a missile that homes towards a target while avoiding all other specified instances. I attempted to create my own obstacle avoidance system, but then stumbled upon the motion planning functions. I tried mp_potential_step_object, and the missile only moves towards the target if there is a clear direct path to it. And if an obstacle comes in the way it just ignores it until it collides with it and stops. The function description gives me the idea that it's meant to move around obstacles.
 
H

Haulidaie

Guest
Are you using any other movement/collision checking code aside from mp_potential_step_object?
 
N

Nabil Kabour

Guest
Are you using any other movement/collision checking code aside from mp_potential_step_object?
I have a collision line check, to see if the missile is within close proximity of the target to turn off homing mode (so the target has a chance of dodging it). This shouldn't interfere with the motion planning. The missile doesn't move on creation most of the time (far proximity).
 
H

Haulidaie

Guest
And the objects the missile is avoiding are solid? Also worth noting that sometimes when the mp_potential_step object moves straight into a blocking object (0, 90, 180, 270 degrees) it can sometimes get stuck. Also, if the path around the blocking objects is too long, it can get confused.
 
N

Nabil Kabour

Guest
And the objects the missile is avoiding are solid? Also worth noting that sometimes when the mp_potential_step object moves straight into a blocking object (0, 90, 180, 270 degrees) it can sometimes get stuck. Also, if the path around the blocking objects is too long, it can get confused.
No, no solid objects in my game. From what I understand from the function description, the avoiding obstacle scans angles around it's direction and picks the angle furthest away/most likely to dodge obstacles. The process is repeated each step. If that's the case then it should go or at least attempt to go around obstacles. I've tested different angles and there is no obvious difference. The majority of obstacles are moving, so once they move out of colliding with the missile, the missile keeps going. I'm thinking of continuing my own method, I've already got the collision scanning implemented. Although I think the motion planning functions would provide better and lighter obstacle avoidance. A drawback to using them would be less customization, but at this point I want to have something working to start with.
 
Top