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-03-07, 06:50 PM   #1
mcoca
Loader
 
Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
Default

Thank you everybody for your support! Now, start using the thing so I can feel I haven't completely wasted my time :p

Quote:
Originally Posted by lurker_hlb3
What would be the code to randomly change speed on each way point i.e pt1 is 5, pt 2 is 8 etc ???
I'm writing from memory, but it would be something along these lines:

Code:
from random import randint
for waypoint in group.waypoints:
    waypoint.speed = randint(2,8)
Obviously, change the numbers to the ones you want. The spaces at the beginning of the third line are important, since python uses indentation to control what's inside the loop and what isn't.

BTW, if you want to get cute, there are functions to provide randomness along a probability curve, so most of the time ships will be around the middle of the range, with the occasional fast or slow one. Check the docs if you are interested.
mcoca is offline   Reply With Quote
Old 05-03-07, 06:58 PM   #2
lurker_hlb3
Admiral
 
Join Date: Apr 2005
Location: San Diego Calif
Posts: 2,290
Downloads: 187
Uploads: 12
Default

Quote:
Originally Posted by mcoca
Thank you everybody for your support! Now, start using the thing so I can feel I haven't completely wasted my time :p

Quote:
Originally Posted by lurker_hlb3
What would be the code to randomly change speed on each way point i.e pt1 is 5, pt 2 is 8 etc ???
I'm writing from memory, but it would be something along these lines:

Code:
from random import randint
for waypoint in group.waypoints:
    waypoint.speed = randint(2,8)
Obviously, change the numbers to the ones you want. The spaces at the beginning of the third line are important, since python uses indentation to control what's inside the loop and what isn't.

BTW, if you want to get cute, there are functions to provide randomness along a probability curve, so most of the time ships will be around the middle of the range, with the occasional fast or slow one. Check the docs if you are interested.

It worked perfectly, thanks very much
lurker_hlb3 is offline   Reply With Quote
Old 05-04-07, 09:12 AM   #3
Yanaran
Watch
 
Join Date: Apr 2007
Posts: 29
Downloads: 0
Uploads: 0
Default

Thanks for this awesome tool. Now I can finally make some changes myself!

I have a few simple questions though. I want to reduce traffic similar to your example script, but I also want to make convoys smaller early in the war and have less escorts. Is it enough to just reduce the spawnprobability for every unit in a convoy to say half? Like this for example,

if unit.type == UnitType.DESTROYER:
unit.spawnProbability *= 0.25
else:
unit.spawnProbability *= 0.5

Also, I'd like to remove all gunboats from the subhunter groups, and maybe replace them with some other ships like subchaser or minesweepers. Can I replace the "type" of ship or do I need to remove the gunboat unit altogether and then add a subhunter unit? I want to keep all the stats for the unit the same (crew, spawnprobability etc).
Yanaran is offline   Reply With Quote
Old 05-04-07, 09:44 AM   #4
akdavis
Samurai Navy
 
Join Date: Mar 2005
Location: Fort Worth, Texas
Posts: 597
Downloads: 0
Uploads: 0
Default

Best thing to do with gunboats would probably be to change their type so they aren't spawned as patrol vessels (or whatever type is drawn on for that group).
__________________
-AKD
akdavis is offline   Reply With Quote
Old 05-04-07, 09:52 AM   #5
U-Bones
Grey Wolf
 
Join Date: Mar 2005
Location: Treading Water
Posts: 847
Downloads: 56
Uploads: 0
Default

It would be nice to have both brown and blue water hunter/killer groups

Blue: DD/Subchaser/Minesweeper
Brown: Subchaser/Minesweeper/Gunboats

or similar.

Brown groups would also be common near smaller ports.
U-Bones is offline   Reply With Quote
Old 05-04-07, 04:57 PM   #6
akdavis
Samurai Navy
 
Join Date: Mar 2005
Location: Fort Worth, Texas
Posts: 597
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by U-Bones
It would be nice to have both brown and blue water hunter/killer groups

Blue: DD/Subchaser/Minesweeper
Brown: Subchaser/Minesweeper/Gunboats

or similar.

Brown groups would also be common near smaller ports.
I believe the devs confused these gunboats with accounts of US sub encountering "converted gunboats." While I can't find an view of a specific wartime Japanese example, here is a US converted gunboat from between the world wars:



Her upper decks had been removed to increase open water stability. A variety of different ships were converted to gunboat status during the war. Steamships were common.

The gunboats in the game should probably be excised entirely. Both the Atami and the Hira were not part of the Combined Fleet, but rather assigned to the Japanese naval forces in China, as can be seen in this document:

http://www.ibiblio.org/pha/pha/misc/45-41.html

They and their sisters (Atami class: Atami, Futami; Seta class: Seta, Katata, Hira, Hozu) were Yangtze River patrol boats. To show where they where later in the war, references indicate that the Atami was damaged by Chinese aircraft near Tung Ting Lake in China on June 10, 1943, while the Hira was damaged in an air attack at Kiukiang, China.

At the most, they might appear occasionally in Shanghai harbor.

Here are some examples of converted gunboats sunk by US submarines:




SHOSEI MARU
Japanese Navy; 1929; Amagasaki Zosensho; 998 tons; 210 x
30-5x18-7; triple-expansion engines.
The steamship Shosei Maru was taken over by the Japanese Navy
for use as an auxiliary gunboat. On May 20th, 1944, she was torpedoed
and sunk by a U.S. submarine [U.S.S. Silversides] about 50 miles S.W. of
Guam.


NIKKAI MARU
Nissan Kisen K.K.; 1938; Uraga Dock Co.; 2,562 tons; 297-9 x
45x23-8; 201 n.h.p.; compound engines & L.P. turbine. The
steamship Nikkai Maru was taken over by the Japanese Navy and
converted into an auxiliary gunboat. On November 26th, 1943, she
was torpedoed and sunk by the U.S. submarine Ray 350 miles N. of
the Admiralty Islands.


KEIKO MARU
Osaka Shosen K.K.; 1938; Uraga Dock Co.; 2,929 tons;
297 -9x45x23-8; 255 n.h.p.; compound engines & L.P. turbine.
The steamship Keiko Maru was taken over by the Japanese Navy
and converted into an auxiliary gunboat. On November 8th, 1942,
she was torpedoed and sunk by the U.S. submarine Seawolf off
Mindanao Island, Philippines.



__________________
-AKD
akdavis is offline   Reply With Quote
Old 05-10-07, 06:05 AM   #7
Redwine
Sea Lord
 
Join Date: Jan 2002
Location: San Martin de los Andes, Neuquen, , Argentina.
Posts: 1,962
Downloads: 10
Uploads: 0
Default

Many thanks !
Redwine is offline   Reply With Quote
Old 05-04-07, 10:15 AM   #8
mcoca
Loader
 
Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by Yanaran
I have a few simple questions though. I want to reduce traffic similar to your example script, but I also want to make convoys smaller early in the war and have less escorts. Is it enough to just reduce the spawnprobability for every unit in a convoy to say half? Like this for example,

if unit.type == UnitType.DESTROYER:
unit.spawnProbability *= 0.25
else:
unit.spawnProbability *= 0.5
Yes, that should work... except that I'm not sure what happens if the lead unit in the group doesn't spawn? But the editor let's you enter such a group, so it's no big deal.

OTOH, you could remove half the entries using group.units.remove(unit) and some condition, but adding some kind of counter to how many there were and how many you removed.

Quote:
Also, I'd like to remove all gunboats from the subhunter groups, and maybe replace them with some other ships like subchaser or minesweepers. Can I replace the "type" of ship or do I need to remove the gunboat unit altogether and then add a subhunter unit? I want to keep all the stats for the unit the same (crew, spawnprobability etc).
The best solution, as tater suggested in another thread, would be to move the subhunter and the minesweeper to the "corvette" category by editing the roster files and changing the type=0 to type=1. Then, switch all the patrol craft in the campaign to corvettes:

Code:
if unit.type==UnitType.PATROL_CRAFT:
    unit.type=UnitType.CORVETTE
And if you want to add some gunboats around coastal areas, do so manually with editor. Unless you are a really enterprising programmer and can figure out a way to tell coastal patrols apart based on long/lat
mcoca is offline   Reply With Quote
Old 05-04-07, 11:23 AM   #9
Yanaran
Watch
 
Join Date: Apr 2007
Posts: 29
Downloads: 0
Uploads: 0
Default

Well that seems a bit more complicated than I thought, what I'm trying right now instead is sort of reverse what you did for destroyers... In every SubHunter group I check if it's a patrol craft and then set that units shipclass to subchaser. I think that should turn all gunboats into subchasers, which is good enough for me until I learn more.


Code:
if group.groupName.find("SubHunter") != -1:
    if group.groupName.find("Jap") != -1:
        # less subhunter groups
        group.spawnProbability *= 0.5
        for unit in group.units:
            if unit.type == UnitType.PATROL_CRAFT:
                unit.shipClass="SCSubchaser"
Yanaran is offline   Reply With Quote
Old 05-04-07, 04:29 PM   #10
mcoca
Loader
 
Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
Default

Yanaran, that should work fine, although you will find your subchaser groups a bit boring

I would consider adding a few minesweepers into the mix, but changing them to patrol craft in the roster (edit roster\japan\sea\msno13.cfg to set type=0), so they get escort AI. I have done that and so far it's working out well enough.

Otherwise, from my tests, I think task forces should get a drastic reduction. I set them down to 40% of stock, and still managed to find two of them in one patrol.
mcoca is offline   Reply With Quote
Old 05-04-07, 04:30 PM   #11
mcoca
Loader
 
Join Date: Apr 2005
Location: Madrid, Spain
Posts: 86
Downloads: 0
Uploads: 0
Default

BTW, for those who have downloaded and tested the program. Are there any specific features you would like to see in a future version?
mcoca 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 12:35 AM.


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