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 10-29-08, 08:46 PM   #1
gutted
The Old Man
 
Join Date: Apr 2005
Location: New Orleans, LA.
Posts: 1,353
Downloads: 470
Uploads: 10
Default need help from you math wizards

i need some math help.

basically im going to rewrite the speed calc program i made some time ago.
http://files.filefront.com/SH4+Speed.../fileinfo.html


new feature one is to grab the names & lengths of ships automatically from your game files so that they will always be up to date instead of hard wired into the program like before.

feature 2 is going to be AOB determination using the tick marks in the scope.

basically, you'll be able to get his AOB by entering his range and the number of tick marks from center to bow. but the math is throwing me off.

i know how to get his "apparent" length. but how to comapre that with his real length to get an AOB is giving me the prob.


apparent length = SIN(a) * range

where 'a' = number of ticks across from tail to nose * degree of each tick
(degrees per tick for given zoom levels will be configurable incase you dont run stock stuff and also to make it SH3 GWX friendly).

'a' would naturally be times 2 behind the scenes for center to bow input.

here's example im figuring from in a test mission:

real length = 78.5m
apparent length at 886m = 48.7m

real AOB using map contacts enabled = 34 starboard

how to translate the difference in lengths to that AOB with a formula?

i know its probably something stupid easy.. but im having a mental fart right now.

in some targeting manual i saw (cant remember which one), the author took the ratio of mast height to length and the ratio of vertical to horizontal ticks to get a percentage the apparent ratio is to the real ratio and used it in some scale he provided to get the AOB.. but what formula would that scale be based on?

i can do the same thing (without the use of the mast heights) and getting the percentage of the real length that the apparent length is... and using that in the scale he provided. i just dont know the math involved in that final conversion to AOB.

help meh. i wont sleep till i know it. im that obsessive. lol.


[edit] i plan to put a little 4-way widget so that the AOB direction gets determined correctly by letting you flip around a picture of a ship so that it is facing left or right and is either pointing to or from you.

Last edited by gutted; 10-29-08 at 09:59 PM.
gutted is offline   Reply With Quote
Old 10-29-08, 08:50 PM   #2
SteamWake
Rear Admiral
 
Join Date: Mar 2005
Posts: 13,224
Downloads: 5
Uploads: 0
Default

Wow... hope you get this worked out... sounds sweet.
SteamWake is offline   Reply With Quote
Old 10-29-08, 09:05 PM   #3
gutted
The Old Man
 
Join Date: Apr 2005
Location: New Orleans, LA.
Posts: 1,353
Downloads: 470
Uploads: 10
Default

what i really want to do is to create a whiz wheel for this.


as seen in that uber u-boat periscope mod for GWX; which was half ported to u-boat addon in SH4. my main motivation for this is that i like the idea of it.. but it's just too obtrusive and hard to read the small tick marks he put in the scope (maybe im just getting old). it also completely removes the use of your stadimeter in SH3. gah! i prefer the stock scopes and tick marks. plus my method would remove the need of wasting time having to first align his vertical ticks to his mast height because you'll be using the stadimeter to get his range before hand.

basically you'd rotate a range ring on the wheel to line up with the ships real length.. then look at the tick scale ring on the inside to get his AOB.

but, i have no experience in making those kinds of wheels yet.. so i will start simple with a calculator. i know how the wheel would function..i just dont know how to determine the progressively growing distances between ticks around a radius accurately enough to make it useable. i'm guessing those guys use CAD programs maybe?
gutted is offline   Reply With Quote
Old 10-29-08, 10:05 PM   #4
gutted
The Old Man
 
Join Date: Apr 2005
Location: New Orleans, LA.
Posts: 1,353
Downloads: 470
Uploads: 10
Default

think i may have figured it out for my test case

appaarent 48.7m length is 62% of the real 78.5m

since im trying to find the AOB FROM 90 (ship real length is at 90) instead of TO 90 (as i was doing before) i need to take the opposite of 62%

100 - 62 = 38%

38% of 90 = 34 AOB

the exact value i measured in the nav map with the contacts turned on.

weeee!

i knew it was something stupid i was overlooking. i was going in the wrong direction !!#$

now i just need to test the math in a few more cases to make sure its right.. then to cut the math down to it's simplest formula. then put in some special cases for when the ship is pointing away from you instead of towards you so it adds it to 90 instead of subtracts and im golden.

Last edited by gutted; 10-29-08 at 10:28 PM.
gutted is offline   Reply With Quote
Old 10-29-08, 11:27 PM   #5
gutted
The Old Man
 
Join Date: Apr 2005
Location: New Orleans, LA.
Posts: 1,353
Downloads: 470
Uploads: 10
Default

after some testing.. using the ratio of real length to mast height vs. apparent length to mast height yields far more consistent results.

after checking a ship stationary in front of me at direct 90 AOB. the number of ticks he should have been in length was off.

i was doing my tests in SH3 GWX, because thats what i've been playing lately... and a supposed 140.5m ship was off in length by almost 3 ticks (1.5 in both diections) on the scope.

i checked and re-checked. and even worked backwards. his 140.5m length at that range should have been 6 ticks from center to bow. but he was showing as 7.5 ticks in the scope.

maybe this was just an issue for that ship or this mod.. i dunno.

but when i calculated the ratio of real mast height to real length... then calculated the ratio of apparent mast height to apparent length. i got a near 90AOB calculation off by +- 2 degrees.

his real mast/length was a ratio of 3.38
his apparent mast/length ratio of 3.33

apparent is 98% of real in this case. which comes to an error of about 1.8 degrees of AOB.

note i was actually just ever so slightly off to one side of the target due to not being able to place myself exactly 90 AOB in the mission editor.

so i think when i do get around to making this utility i will grab the mast height also when i grab the lengths of the ship from the game files.. and do the calculations that way. which means you'll have to input ticks high and ticks long from center.

not even sure i'd use this that much because i usually just do two plots on the map and figure out his AOB that way..but it would be nice to crosscheck.
gutted is offline   Reply With Quote
Old 10-30-08, 04:40 AM   #6
IronPerch
Bosun
 
Join Date: Aug 2008
Location: Finland
Posts: 61
Downloads: 100
Uploads: 0
Default

Quote:
Originally Posted by gutted
new feature one is to grab the names & lengths of ships automatically from your game files
A bit out of the actual topic, but can you point me those files with ship lengths? I'd like to add the length information to my recognition manual.
__________________
The sum of the intelligence on the planet is a constant; the population is growing. — Mr. Cole

RFB+RSRD+OM @ 100% realism
IronPerch is offline   Reply With Quote
Old 10-30-08, 05:02 AM   #7
Nisgeis
Ocean Warrior
 
Join Date: Jan 2008
Posts: 2,909
Downloads: 77
Uploads: 11
Default

The percentage doesn't quite work, e.g. An AoB of 30 degrees on a target 1000 feet in length will give an apparent length of 500 feet. 500/1000 = 50%, 90*50% = 45 degrees.

If you know both the apparent length and the actual length, the following maths applies:

Opposite Side = Hypotenuse * Sin(angle),

Therefore:

Sin(Angle) = Opposite Side / Hypotenuse

Hypotenuse is the Actual Length, Opposite Side is the Apparent Length, so:

Sin(Angle) = Apparent Length / Actual Length,

Therefore:

Angle = Inv Sin(Apparent Length / Actual Length)



So, for your example of 48.7m apparent length and real length of 78.5m:

inv sin(48.7/78.5) = 38.34 degrees.

And for the 1000 feet target appearing to be 500 feet:

inv sin (500/1000) = 30 degrees.



To get the angular target length directly, the following formula applies:

Angular Length = (Target length in feet/100) * (2000 / Range in Yards)

Therefore, if you know the range is 4000 yards, a target of 1000 feet long if at an AoB of 90 (to get the largest angular length, equivalent to the actual length) then the length is:

(1000/100) * (2000/4000) =
10 * 0.5 = 5 degrees

So a target at a range of 4,000 yards that is 1,000 feet in length if broadside on will fill 5 degrees worth of markings. This value can then be compared against the observed angular length, by counting ticks and then both the values can be taken and plugged into the previous formula.

So, for example, your 1,000 foot long ship at 4,000 yards appears to be 2.5 degree wide, then the formula for AoB is:

Angle = Inv Sin(Apparent Length / Actual Length)

So,

Inv Sin(2.5 / 5) = 30 degrees.

Hope that helps.
__________________
--------------------------------
This space left intentionally blank.
Nisgeis is offline   Reply With Quote
Old 10-30-08, 08:10 AM   #8
Hitman
Pacific Aces Dev Team
 
Hitman's Avatar
 
Join Date: Sep 2002
Location: Spain
Posts: 6,099
Downloads: 109
Uploads: 2


Default

Quote:
what i really want to do is to create a whiz wheel for this.


as seen in that uber u-boat periscope mod for GWX; which was half ported to u-boat addon in SH4. my main motivation for this is that i like the idea of it.. but it's just too obtrusive and hard to read the small tick marks he put in the scope (maybe im just getting old). it also completely removes the use of your stadimeter in SH3. gah! i prefer the stock scopes and tick marks. plus my method would remove the need of wasting time having to first align his vertical ticks to his mast height because you'll be using the stadimeter to get his range before hand.

basically you'd rotate a range ring on the wheel to line up with the ships real length.. then look at the tick scale ring on the inside to get his AOB.

but, i have no experience in making those kinds of wheels yet.. so i will start simple with a calculator. i know how the wheel would function..i just dont know how to determine the progressively growing distances between ticks around a radius accurately enough to make it useable. i'm guessing those guys use CAD programs maybe?
Doh why didn't you say that before in the SH3 forum? I had already replied telling you what I do!

What you want has already been done:

http://www.subsim.com/radioroom/showthread.php?t=116542
__________________
One day I will return to sea ...
Hitman is offline   Reply With Quote
Old 10-30-08, 03:40 PM   #9
gutted
The Old Man
 
Join Date: Apr 2005
Location: New Orleans, LA.
Posts: 1,353
Downloads: 470
Uploads: 10
Default

thanks nisgeis. i kept having the feeling i was still off after i quit playing with it last night. and it seems i was.


and hitman, yeah i wish i had come across that earlier. now i can quit playing with this lol. instead i'll just use the wheel you made.. and then mod in the aspect ratios into my rec manual to keep from having to do it everytime.

still nice to know the math involved though. cheers to both of you.

Last edited by gutted; 10-30-08 at 04:10 PM.
gutted is offline   Reply With Quote
Old 10-31-08, 03:34 PM   #10
Webster
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by IronPerch
Quote:
Originally Posted by gutted
new feature one is to grab the names & lengths of ships automatically from your game files
A bit out of the actual topic, but can you point me those files with ship lengths? I'd like to add the length information to my recognition manual.
check the cgf file inside each ships folder, im pretty sure its there you find ship length.
  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 05:55 AM.


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.