![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
![]() |
#31 |
Watch
![]() Join Date: Apr 2007
Posts: 29
Downloads: 0
Uploads: 0
|
![]()
Yes, concurrentyadayada that's it
![]() Your workaround seems to work, I was trying to figure it out using the iterator but didn't think to try i.remove() hehe. |
![]() |
![]() |
![]() |
#32 | |
Loader
![]() Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
|
![]() Quote:
![]() |
|
![]() |
![]() |
![]() |
#33 |
Watch
![]() Join Date: Apr 2007
Posts: 29
Downloads: 0
Uploads: 0
|
![]()
I have a suggestion for the zigzagging.
I've tried a few zigzags on the convoy files and checked the results in the mission editor. I notice that there are often problems with the final zig, especially if the waypoint at the end is near land. What happens is that if the last zig is almost as long as the distance to the "end waypoint", you'll end up almost at a 90 degree angle to the final waypoint and if it's close to shore odds are you'll end up with a waypoint that's on land. For example try the example from the readme on the 41a_jap_convoys and look at the waypoints just outside Manila. So my suggestion would be that instead of creating zigzags all the way to the waypoint, stop zigging one step earlier so the last leg will be between 1 and 2 "distance" instead of between 0 and 1. I *think* this change to init.py will fix it: In zigZagToWaypoint(waypoint,iterator,offset,distance ) change Code:
for x in range(0,zigSteps(waypoint, offset, distance)): Code:
for x in range(0,zigSteps(waypoint, offset, distance)-1): ![]() |
![]() |
![]() |
![]() |
#34 | |||
Loader
![]() Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
|
![]() Quote:
![]() Quote:
Quote:
Thanks! |
|||
![]() |
![]() |
![]() |
#35 |
Watch
![]() Join Date: Apr 2007
Posts: 29
Downloads: 0
Uploads: 0
|
![]()
Well, let me know if you figure out how to get zig-zags to play nice with random waypoints.
![]() I can't decide if I want to keep the random waypoints or have all convoys follow a precise path but doing zig-zags. As much as I want the convoys to zig-zag I don't want them to pass the exact same spots over and over again, I just know I'd end up "cheating". ![]() |
![]() |
![]() |
![]() |
#36 |
Navy Seal
![]() Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
|
![]()
There is anoother way to create "random" zig zag paths.
Use the loop functionality. There is a FAQ about making alternat paths with it. Have waypoints 2 to X be zig zag along a path. Have waypoint X+2 start next to waypoint 2 itself. Waypoints X+2 to Y are a zig zag on an alternate path. Have waypoint X+1 have a 100% loop to waypoint Y. You now have 2 alternating zig zag paths. Set the % chance of this convoy at 10% of what you want to see. Take this convoy or merchant group, then perhaps the program could be used to clone it, with every single waypoint offset a few kilometers in one direction. Make 10 such clones. You now have a cloud of alternating zigzags each with a 10% chance of happening, but you have 10 of them. Offset the start times, etc to minimize the chances of 2+ at once. That might work, anyway. Alternatly, you could make a cloud of such alternating paths within the same group. Just set a bunch of waypoints before the first zigzag to give many chances of alternate paths that are side by side within a few km. |
![]() |
![]() |
![]() |
#37 |
Loader
![]() Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
|
![]()
I agree, it's a tough decision between zigzags and random routes. Looping will work, but in its current incarnation the zigzagging code doesn't really support loops. They will be maintained, but the ships will not zigzag along the alternative route.
This is one of those frustrating problems: we can spend months finding a kludge that almost works, but makes the campaign files ten times bigger. But the devs can probably code zigzagging into the AI in a few hours at most. Today I discovered http://dangerdeep.sourceforge.net/ an open source subsim in the early phases of development (it already looks pretty, though). I really hope they get it working... the things we could do with it. |
![]() |
![]() |
![]() |
#38 |
Watch
![]() Join Date: Apr 2007
Posts: 29
Downloads: 0
Uploads: 0
|
![]()
Well I just finished my first patrol with all convoy routes replaced with zigzagging waypoints (I set all waypoint.radius = 0) and I loved it. For the first time in weeks I missed an entire spread when I fired precisely at the "wrong" moment from about 7000yards out (mk16 torps).
![]() The convoy turned 40 degrees to port when the torpedoes where about 1/3 on their way and they all missed by what felt like miles. It might be easier to find convoys like this, but it's definatly harder to get the kills. I don't know what would be realistic settings for the zig-zags but I used 20degrees and 10miles like your example script. |
![]() |
![]() |
![]() |
#39 |
Navy Seal
![]() Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
|
![]()
mcoca,
What about the ability to cut and paste after a fashion? Not just the unit, but a group of waypoints? I might make a screenshot to show you what I mean. tater |
![]() |
![]() |
![]() |
#40 |
Navy Seal
![]() Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
|
![]()
Is it possible to make it apply the zig-zags only between certain pairs of waypoints for a group?
I make a convoy sail from Tokyo Bay to Truk. I make a series of waypoints to get them to the open ocean, say 6. Waypoint 7 is near Truk. I then make waypoint 8 all the way back next to 6. 9 is next to Truk, but offset from 7. 10 is back near 6/8. 11 near Truk, etc. I'd have the campaign editor then make zi-zags only between waypoints 6-7, 8-9, 10-11, 12-13, 14-15. I now have 5 zig-zags from near Tokyo to near Truk. I could do 20 if I wanted 5km apart and I'd have a 100km swath. I'd set all of the "near Truk" waypoints (numbers would change since you'd add the zig-zags between) to 100% loop to the very last waypoint for the group, AT Truk. Some of the very first open ocean waypoints would then have a loop % to one of the alternate routes. I tested this, and it works, I can add as many alternate routes for 1 group as I like. If a program could do the zig-zags between waypoint pairs of my choosing it's make it really easy. I agree that it would be better if the devs just coded the game correctly instead though. |
![]() |
![]() |
![]() |
#41 |
Loader
![]() Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
|
![]()
tater,
About copy/paste, do you mean copying the entire route from one group to another? Yes, it's possible, with limitations: you cannot alter the routes after copying in the same run of the program, and you cannot insert just some waypoints. This can be fixed in new versions, though. I can show you code if you tell me exactly what you want. I see what you mean with loops. You can zigzag some waypoints and no others, but you need to "tag" the zigzagging ones in some way. I suggest giving them a random radius, then removing it in the same change, like this: Code:
i = group.waypoints.iterator () for waypoint in i: if waypoint.radius > 0 waypoint.radius = 0 zigZagToWaypoint(waypoint,i,20,10) Code:
i = group.waypoints.iterator () for waypoint in i: if waypoint.radius > 0 # extract distance & convert to meters distance=int(waypoint.radius)*1852 angle=(waypoint.radius-int(waypoint.radius))*100 zigZagToWaypoint(waypoint,i,angle,distance) waypoint.radius = 0 |
![]() |
![]() |
![]() |
#42 | |
Watch
![]() Join Date: Apr 2007
Posts: 29
Downloads: 0
Uploads: 0
|
Quote:
for 500nm: Code:
if waypoint.length > 500*1852: zigZagToWaypoint(waypoint,i,20,10) |
|
![]() |
![]() |
![]() |
#43 |
Navy Seal
![]() Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
|
![]()
^cool. that should do. i will make an example to show you exatly what i mean. The goal might be to automate the process somehow.
|
![]() |
![]() |
![]() |
#44 |
Navy Seal
![]() Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
|
![]()
OK, I'm semi-clueless here.
I have a mission to test. I have it set under Input. Under Group conditions I have: i = group.waypoints.iterator () for waypoint in i: # 400 * 1852 is 400 NM in meters. if waypoint.length > 400*1852: zigZagToWaypoint(waypoint,i,20,4.5) It gives a syntax error (I just copied the example in the readme and altered the numbers a little). |
![]() |
![]() |
![]() |
#45 | |
Loader
![]() Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
|
![]() Quote:
![]() Also, I'm guessing it's because you didn't put code tags around the example, but just in case, spacing matters in python, so make sure what's inside the if and for statments is indented beyond them. |
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|