SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH4 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 05-14-07, 11:43 AM   #46
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

OK, I got it. Tabbing was off.
tater is offline   Reply With Quote
Old 05-14-07, 11:53 AM   #47
Yanaran
Watch
 
Join Date: Apr 2007
Posts: 29
Downloads: 0
Uploads: 0
Default

Exactly like you wrote it but with proper spacing in front

Code:
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)
Then just paste that in group change, rather than group condition (you can leave that empty).

Edit: Also just a suggestion from playing a patrol with zig-zagging convoys: 4.5nm might be too short, the AI isn't very good at turning in formation.
Yanaran is offline   Reply With Quote
Old 05-14-07, 11:54 AM   #48
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

BTW, this tool is an amazing addition to the toolbox. Thank you so much.
tater is offline   Reply With Quote
Old 05-14-07, 11:57 AM   #49
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

http://www.mediafire.com/?8jzux3g1gxb

that is the mission file I made (quick mission).

Open it with the editor and take a look!
tater is offline   Reply With Quote
Old 05-14-07, 12:37 PM   #50
mcoca
Loader
 
Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
Default

tater,

Good work! Are you using Yanaran's fix in init.py? Some of your waypoints come out of zigzag at extreme angles, which will break the AI formations.

BTW, for everyone playing with zigzags, I recommend you use the output path option in the program, so your original file is untouched. That way you can always edit without zigzags and add them later. Once all those waypoints are put into place, it looks very confusing.
mcoca is offline   Reply With Quote
Old 05-14-07, 12:41 PM   #51
mcoca
Loader
 
Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by Yanaran
Edit: Also just a suggestion from playing a patrol with zig-zagging convoys: 4.5nm might be too short, the AI isn't very good at turning in formation.
Now, that's an understatement. It's even worse with scripted formations, BTW. As I mentioned in another thread, I ambushed the Japanese fleet going to Leyte Gulf and sank the Yamato. After the turning and confusion, they decided to reform... in a standard, compact, convoy box of cruisers and battleships! There was no way to launch a torpedo into that formation and not hit something.
mcoca is offline   Reply With Quote
Old 05-14-07, 12:47 PM   #52
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

Ah, no, I didn't use the changes Yanaran made. I misunderstood and thought that you had added those changes to version 0.3.

The 4.5nm was based on the base speed of 9 knots. That was for a zig or zag every 30 minutes.

Later in the war every 5 minutes was not uncommon. 9-10nm for that convoy would mean only 1 change per hour, which is better than default, but pretty unlikely to spoil a torpedo attack. A long torpedo run might be 4 minutes, unless there is a significant chance of a course change during a long run like that, it will have little effect.
tater is offline   Reply With Quote
Old 05-14-07, 12:50 PM   #53
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

Quote:
Originally Posted by mcoca
Quote:
Originally Posted by Yanaran
Edit: Also just a suggestion from playing a patrol with zig-zagging convoys: 4.5nm might be too short, the AI isn't very good at turning in formation.
Now, that's an understatement. It's even worse with scripted formations, BTW. As I mentioned in another thread, I ambushed the Japanese fleet going to Leyte Gulf and sank the Yamato. After the turning and confusion, they decided to reform... in a standard, compact, convoy box of cruisers and battleships! There was no way to launch a torpedo into that formation and not hit something.
This shows where the people coding the actual AI need to either learn something of IJN doctrine, or ASK PEOPLE WHO MIGHT. It's like the CV formations. Standard practice was a 7km spacing between CVs in the IJN. 7,000m between ships in a box formation. So of the escorting ships were out on the flanks 15km in a shallow arrow shape.

I'd think that SOP for large surface combatants should probably be line astern, even though that was a combat formation and not a general steaming formation.
tater is offline   Reply With Quote
Old 05-14-07, 01:08 PM   #54
mcoca
Loader
 
Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by tater
This shows where the people coding the actual AI need to either learn something of IJN doctrine, or ASK PEOPLE WHO MIGHT. It's like the CV formations. Standard practice was a 7km spacing between CVs in the IJN. 7,000m between ships in a box formation. So of the escorting ships were out on the flanks 15km in a shallow arrow shape.
I think that's a symptom of two things: programming good AI is very hard, and it does very little to sell games. For example, I played around with writing a simple formation keeping AI a few months ago, and it was surprisingly difficult. In this case, it obviously felt like I had upset the formation so much they had to reform in some way, and they defaulted back to the box formation.

Quote:
I'd think that SOP for large surface combatants should probably be line astern, even though that was a combat formation and not a general steaming formation.
Actually, in that particular case, the correct formation would have been a sparse box, wouldn't it? The book I have on Leyte Gulf doesn't list distances, but it shows a kind of box with the heavy columns interspersed with destroyer columns.
mcoca is offline   Reply With Quote
Old 05-14-07, 01:31 PM   #55
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

Possibly, combat vs regular steaming formations varied wildly. Once engaged, standard practice for surface combatants would be to assume a line formation to concentrate fire. A box masks some of the ships farther from the enemy.

Varied a lot though.

AI is indeed really tricky. It would be nice to have the waypoints include a "zig-zag" toggle with degrees and time interval though.

I don't expect it to happen, though, which is why this tool you have created is so great.

Re: Copy and Past:
For copy and paste there are 2 features I'd like to see.

1. copy a group, waypoints and all, and paste a copy of it offset enough that they are unlikely to overlap---tot he opposite side of the globe if needed. Then in the editor you lasso it and drag it where you want.

2. the ability to select a group of waypoints (same as for the zig-zag, for example) and paste them with an offset set by the user. The waypoints should be added to the END of the group's waypoints. So if the group has 20 waypoints, I could select waypoints 6-13 and paste them 10nm West. There would then be a long waypoint connecting waypoint 20, and the new waypoint 21 (which is just #6 moved west 10nm).

tater
tater is offline   Reply With Quote
Old 05-14-07, 02:04 PM   #56
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

That was a Q&D test, but this shows great promise. Ideally, I would use some of your other suggestions for "tagging" waypoints with odd radius values. Such a recurring, random convoy would (ideally) have maybe 10 alternate paths, where some even overlap. The tagged waypoints would get different zig-zags as well. Some get a 20 degree aver 30 minutes, so every hour, others get a 30 degree, and so forth. This would be particularly effective for the random singleton (with the odd 2d ship) Merchant layers. Formation keeping would be no problem, and they could even have some very aggressive zig zagging, like every 2-5 minutes (gotta figure a lone merchant ship is gonna have to be aggressive to survive).
tater is offline   Reply With Quote
Old 05-14-07, 02:10 PM   #57
mcoca
Loader
 
Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
Default

I understand the copy&paste ideas now. They seem easy, so I'll add them for the next version. That will have to wait at least a few days, though, since I'll be out of town tomorrow.
mcoca is offline   Reply With Quote
Old 05-14-07, 03:04 PM   #58
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

Right now, I have a notepad document with the code I am using in there so I can cut and past it into the appropriate fields. Is this what I should expect, or am I missing something? No problem if that is the easiest way. If it is, then perhaps a library of useful (remarked) examples would be in order as a txt doc?

That way some of the code-impared (myself, last code I ever wrote was FORTRAN back in the 80s) can have stuff to plug in where all they need to do is change numbers.

I might not be able to use particularly esoteric elements of this program, but I plan on beating the livig hell out of it.



tater
tater is offline   Reply With Quote
Old 05-14-07, 03:35 PM   #59
mcoca
Loader
 
Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
Default

There are quite a few small examples in the README. Also, you can define new functions for future use by adding them to the init.py file (see the file for a few examples).

Other than that, yes, copy/paste is the best way. I wanted something simple for the non-programmer and that wasn't too hard for me to code. If there is enough interest, I can add a second interface where you can just run code directly from a file.
mcoca is offline   Reply With Quote
Old 05-16-07, 06:36 PM   #60
lurker_hlb3
Admiral
 
Join Date: Apr 2005
Location: San Diego Calif
Posts: 2,290
Downloads: 187
Uploads: 12
Default

I've found a "bug" when generating "zigzag's" that cross 180 longitude, it will generate positions that go around the world vice crossing the dateline correctly
lurker_hlb3 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:09 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 1995- 2024 Subsim®
"Subsim" is a registered trademark, all rights reserved.