| View previous topic :: View next topic |
| Author |
Message |
winkelried
Joined: 30 May 2005 Posts: 7
|
Posted: Sun Aug 07, 2005 10:16 am Post subject: Strange Behaviour of AI (Pathfinding) |
|
|
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 ?
Last edited by winkelried on Sun Aug 07, 2005 11:37 am; edited 1 time in total |
|
| Back to top |
|
 |
inetd
Joined: 30 Jul 2005 Posts: 14 Location: Germany
|
Posted: Sun Aug 07, 2005 10:58 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
winkelried
Joined: 30 May 2005 Posts: 7
|
Posted: Sun Aug 07, 2005 11:25 am Post subject: |
|
|
| inetd wrote: | | 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  |
|
| Back to top |
|
 |
winkelried
Joined: 30 May 2005 Posts: 7
|
Posted: Sun Aug 07, 2005 11:35 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Fish
Joined: 21 Sep 2001 Posts: 2412 Location: Netherlands
|
Posted: Sun Aug 07, 2005 1:35 pm Post subject: |
|
|
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? |
|
| Back to top |
|
 |
OKO
Joined: 10 Jan 2002 Posts: 468 Location: Solar system, mainly on earth
|
Posted: Sun Aug 07, 2005 4:06 pm Post subject: |
|
|
| question : did you used a script with pathfinding instruction for this plateform ? |
|
| Back to top |
|
 |
JoGary(sco)
Joined: 05 May 2005 Posts: 102 Location: Loch lomand, Scotland
|
Posted: Mon Aug 08, 2005 7:55 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
Fish
Joined: 21 Sep 2001 Posts: 2412 Location: Netherlands
|
Posted: Tue Aug 09, 2005 5:43 am Post subject: |
|
|
| JoGary(sco) wrote: | 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. |
|
| Back to top |
|
 |
OKO
Joined: 10 Jan 2002 Posts: 468 Location: Solar system, mainly on earth
|
Posted: Tue Aug 09, 2005 12:34 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|