PDA

View Full Version : Strange Behaviour of AI (Pathfinding)


winkelried
08-07-05, 10:16 AM
Working on a scenario where I want a few ships (two PTGs and one SS) to stay in a harbor and then to leave the harbor when a trigger fires.

The two PTGs are in a formation and both the formation and the SS have a waypoint tactic assigned with the speed on the origin being 0.

When I now give the order to SetSpeed to leave the harbour and to get beyond the first waypoint the AI behaves strangely. The PTG suddendly start to turn around each other and the sub runs astray even its initial course. Everything seems to be happening completely randomly.

Any ideas how this could work ?

inetd
08-07-05, 10:58 AM
Do they leave the harbour without problems when you set the speed to something > 0 from the beginning? Maybe it's just a pathfinding problem.

winkelried
08-07-05, 11:25 AM
Do they leave the harbour without problems when you set the speed to something > 0 from the beginning? Maybe it's just a pathfinding problem.

Thanks. Tried it - same behaviour. Any idea where I get some wisdom on pathfinding :-?

winkelried
08-07-05, 11:35 AM
Got a fix:
The PTs had to get around a cape. Originally I let them pass a small cape at approx 400 yards (depth 180 feet) when I put them now at 700 yards (depth 280 feet) they work ok.

Fish
08-07-05, 01:35 PM
Pathfinding is only to forcome ships ran on land.
I made maps like that without problems, so I have no idea why it not works in your case.
If you want I can look into your map?

OKO
08-07-05, 04:06 PM
question : did you used a script with pathfinding instruction for this plateform ?

JoGary(sco)
08-08-05, 07:55 PM
I have had problems like this, some times when leaving a harbour if the first waypoint is to close it misses it and circles to try get to it. Try moving first waypoint further out and making the tolerance to 1nm or more if needed. I had the same problem when i was working on one of your scenarios Fish. Remeber the one that i moved the FFG out of the harbour because it kept hitting it when it started to move. Well i could get it out of the harbour with using some waypoint very close to starting position but when it came out it would circle back as it was missing the waypoints. When i took it out of harbour and moved the waypoints farther out it was ok.
btw, dont try setting out a curve of waypoints close together to make it turn once it comes out. Just use one at point u want it to change course then another farther out at least 3nm on the cource u want it to take. If they close together then u get same circling problem even with toleranc set to like 10nm :)

Fish
08-09-05, 05:43 AM
I have had problems like this, some times when leaving a harbour if the first waypoint is to close it misses it and circles to try get to it. Try moving first waypoint further out and making the tolerance to 1nm or more if needed. I had the same problem when i was working on one of your scenarios Fish. Remeber the one that i moved the FFG out of the harbour because it kept hitting it when it started to move. Well i could get it out of the harbour with using some waypoint very close to starting position but when it came out it would circle back as it was missing the waypoints. When i took it out of harbour and moved the waypoints farther out it was ok.
btw, dont try setting out a curve of waypoints close together to make it turn once it comes out. Just use one at point u want it to change course then another farther out at least 3nm on the cource u want it to take. If they close together then u get same circling problem even with toleranc set to like 10nm :)

You are right waypoints to close gives problems.

OKO
08-09-05, 12:34 PM
using pathfinding instruction must solve this problem

put a WP on each side of land, using pathfinding instruction, and you will see the ship is able to avoid ground contact by himself.

at start, use a script =>

name : initgame
event trigger
automatic
run script : pathfind

script =>
name : pathfind
pathfinding / for / your plateform / is on

now you can kill all WP to get out of the harbor, just put one at the end of the harbor and let the script do the thing.
should work for you as it works here.