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 > Silent Hunter 4: Wolves of the Pacific
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 05-31-07, 09:57 AM   #1
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default Are all random elements determined at the start of a patrol?

<EDITED> People seem to have many "all or nothing" issues with stuff that should be random in game on a case by case basis. Could every random event determined by a "die roll" made at the beginning of a patrol. Anyone (a dev?) know if this is true?

There is a mod to make the US Mk14 torpedo less reliable than it is in the stock game. The problem is that it seems like the random elements of this might be globally true for all mk14s for the entire patrol.

For example: The gyro angle error rate for the torpedo is set to 5%. You'd expect that a single sub might have 1 such error on average per patrol given a load of 24 torpedos. Some are suggesting that they get every torpedo with such an error. That would imply that the gyro angle failure "roll of the dice" happened at the beginning of the patrol and then applies to every torpedo instead of rolling the dice every SHOT to see if that torpedo will fail.

Which is it?

If this was true, the same would be true of damage, etc. Ie: the random seed is used to create the explosion force for all torpedos for that patrol at the beginning, not a case by case basis. Some patrols you'd sink ships in 1 shot, others every single torp would be at the minimum end of the random range.

That would be really crappy, frankly. If your first hit did little damage, might as well go home and start a new patrol.

Last edited by tater; 05-31-07 at 11:08 AM.
tater is offline   Reply With Quote
Old 05-31-07, 10:03 AM   #2
SteamWake
Rear Admiral
 
Join Date: Mar 2005
Posts: 13,224
Downloads: 5
Uploads: 0
Default

In a manner of speaking yes.

Computers cannot generate a rruely random number. It starts with a "seed" number then generates "random" numbers based upon that seed number. Where or when it gets those seed numbers is unknown.

If you get a bad seed the rng can be brutal.
SteamWake is offline   Reply With Quote
Old 05-31-07, 10:15 AM   #3
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

Yeah, there is a random seed for each patrol I have noticed.

So if DC damage is in a range from 10 to 50 (making up numbers), with an equal chance of each value, is the die roll deterministic based on the random seed? So if you have a bad seed ALL DCs will do 50, instead of just 2.5% doing 50, 2.5% doing 49, and so forth?

That would be truely horrid design IMO, so goofy it cannot be the way they did it.

That would mean that if a DD has a 2% chance of spotting you every minute, with a bad seed the die would be rolled at the beginning, and the DD would never see you after any number of tries because instead od having a shot at "rolling" a 1 or 2 every minute, it will have rolled "5" the beginning of the patrol, and you'd effectively be invisible until you do something only seen on a roll of 5% or better.

Last edited by tater; 05-31-07 at 11:09 AM.
tater is offline   Reply With Quote
Old 05-31-07, 10:21 AM   #4
SteamWake
Rear Admiral
 
Join Date: Mar 2005
Posts: 13,224
Downloads: 5
Uploads: 0
Default

Quote:
Originally Posted by tater
Yeah, there is a random seed for each patrol I have noticed.

So if DC damage is in a range from 10 to 50 (making up numbers), with an equal chance of each value, is the die roll deterministic based on the random seed? So if you have a bad seed ALL DCs will do 50, instead of just 2.5% doing 50, 2.5% doing 49, and so forth?

That would be truely horrid design IMO.

That would mean that if a DD has a 2% chance of spotting you every minute, with a bad seed the die would be rolled at the beginning, and the DD would never see you after any number of tries because instead od having a shot at "rolling" a 1 or 2 every minute, it will have rolled "5" the beginning of the patrol, and you'd effectively be invisible until you do something only seen on a roll of 5% or better.
Well there are alot of variables involved take that 2% chance to spot and surface next to it and it now has a 100% chance to spot you.

Run under that target at flank speed at periscope depth it has a good chance to "hear" you.

Run under that target in silent at 220 feet of water and it has a lot less of a chance to hear you.

There are many many variables its not like you flip a coin at the beginning of a campaign heads you win tails you die.
SteamWake is offline   Reply With Quote
Old 05-31-07, 10:23 AM   #5
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

Note that there are times when it makes sense, like the campaign layers. Ie: you have the roll for all the random layers happen the same way every time for a given seed. then with save games, etc, all you need is the date and time and the seed, and all the convoys, etc can be rebuilt en route.

For individual gun shots, torpedo explosions, torpedo errors, etc, it makes no sense at all since it would result in some patrols being hopeless (all torpedos doing min damage, all escorts seeing you optimally, all torpedos running deep and being duds, etc). Others might have the effect where some "novice" DDs should see you, but this patrol NONE see you. This would explain a lot, actually, if true.
tater is offline   Reply With Quote
Old 05-31-07, 10:27 AM   #6
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

Lets say that running 200ft under a DD (no thermal layer) at flank has a 90% chance of being detected every 15 seconds.

Does the random seed I started my patrol with roll this "die" once for the entire patrol, or does the seed help generate a pseudo-random number every 15 seconds?

So in the example, if the "die" is rolled once, I will either ALWAYS be detected running 200ft deep at flank under a DD, or NEVER be detected running that way (for this entire patrol, every DD set to the same skill level).

If the die is rolled every 15 seconds, the seed is used to generate a pseudo-random number between 0-100 every 15 seconds, and I have a 90% chance of being detected each 15 seconds like I should.
tater is offline   Reply With Quote
Old 05-31-07, 10:50 AM   #7
VonBlade
Mate
 
Join Date: Apr 2007
Location: Inside my head
Posts: 51
Downloads: 0
Uploads: 0
Default

It is possible to get true random numbers by creating a random sized grid of 3d space, firing a random atom from a random place at a random speed and after a random period of time with it bouncing about, finding where it is on the grid and using that number. It's complex, but does eliminate the seed problem.

Ok, it's not truly random (is anything?), but random enough for anything anyones going to use.
__________________
VonBlade is offline   Reply With Quote
Old 05-31-07, 10:52 AM   #8
Uber Gruber
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

It would be usual coding practice to roll the "weighted" dice periodically rather than prior to patrol start. In your example then, every 15secs. It would be madness to roll the dice prior to patrol start in this example.
  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:52 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.