![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|||||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
05-22-12, 02:24 PM
|
#1 |
|
Ace of the Deep
![]() Join Date: Mar 2005
Location: Bucharest, Romania
Posts: 1,056
Downloads: 3
Uploads: 3
|
I think there's supposed to be some accounting for angle of impact for dud chance?
__________________
With strength I burn... |
|
|
05-22-12, 03:20 PM
|
#2 | |
|
Black Magic
![]() |
Quote:
![]() For an impact (non-magnetic) the game says torpedo impacted something, then it checks the impact angle to those defined in the torpedoes .sim file. If the impact angle falls within a max_angle, min_angle combo defined in .sim file then it jumps to do a dud % check. In the dud % check the game loads the % dud chance defined in .sim file into XMM register. The game then retrieves a random number and stores it into another XMM register. Now here's where stock code does 3 multiplications on that random value. Two of them are fractional values, the third is always 1.0 (I believe this one is related to a skill?). Any idea what these 2 fractional values are for? I haven't been able to track them down yet. From what you're saying one of those fractional values could be related to impact angle? So game gets random number, reduces the random number by some fractional % based on impact angle, multiplies that by another fractional number, then finally multiplies that by 1.0...the final 'random' number is so small you never get any duds! I'll have to think this one over more ![]() Any idea as to why the game skips the impact angle check (and thus the dud % chance check) sometimes on impact detonations? |
|
|
|
05-22-12, 03:31 PM
|
#3 |
|
Black Magic
![]() |
ok magnetic detonator duds...here's my idea:
- have a set % chance that every torpedo with magnetic detonator can be a dud (let's say we set it at 10% failure rate) - when game says magnetic impact happened get a random number. If this random number falls within the % chance of magnetic failure then get another random number. Scale this random number to fall within 0.0 to 1.0 value. Multiply this scaled random number by the magnetic detonator range defined in torpedoes .sim file. Let's say scaled magnetic detonator random value is 0.63, magnetic detonator range is 2m. 2 * 0.63 = 1.26m. Recheck for magnetic detonator collision with new magnetic detonator range. If check fails to show collision do not detonate. If check says collision still happened: - do an impact angle check like impact torpedoes do. If the angle is 90 to x degrees (torpedo passing at right angle to ship's course) get a random number. If this random number is greater than some preset value then torpedo is allowed to detonate. If not, torpedo continue on it's merry way. We could define many ranges for this magnetic impact angle check. What do you think? |
|
|
05-22-12, 05:59 PM
|
#4 | ||
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Quote:
Quote:
|
||
|
|
05-22-12, 06:13 PM
|
#5 |
|
Black Magic
![]() |
I have to 'find' all these variables first...that's the hardest part! I like the idea but whether can be implemented or not depends on whether I can find all the variables needed
![]() In the meantime I have a magnetic detonator defect check coded in. When the player launches the torpedo I added a hook into the torpedo initialization routine that will check for magnetic detonator defect. The current defect rate is set at 10%. This defect is a failure of the magnetic detonator to detect at the range specified. So if the game determines that this torpedo has a defect it will get a random number, scale it to between 0.0 and 1.0, and multiply that scaled random number by the magnetic detonator range specified in the torpedo .sim. This new value will be the torpedo's new magnetic detonator range
|
|
|
05-22-12, 06:42 PM
|
#6 | ||
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Quote:
Quote:
EDIT: I've tested your sailboat test mission. Soon I will post my report in the relevant thread |
||
|
|
05-22-12, 07:05 PM
|
#7 |
|
Black Magic
![]() |
v1.0.27.0 released. See post #1.
This version adds support for magnetic detonator range defects. When enabled there is a 10% chance that the torpedo has a magnetic detonator defect that causes it's sensing range to be less than actual. If the torpedo has a defect and does not detonate because of this defect when under a unit there will be NO reports from anyone saying torpedo is a dud or the likes The torpedo will just continue on it's merry way!Looking into adding an impact angle calculator for the magnetic torpedoes. Spoiler: if you have the round torpedo circles enabled, when the torpedo's head is right in the middle of the first circle (1) it has reached arming distance and is live....found that by accident today!
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
