View Full Version : Looking for info on TDC use
reaper7
08-23-11, 03:40 PM
Hi Guys working on a project and need some info on how the Real TDC worked to see its possible to implement into my project.
http://i1183.photobucket.com/albums/x477/U-Boot_HAHD/Random/TDC.jpg
1: I think this is the Impact Angle (Not implemented in SH3)
How does this dial work, that is from what data does it get its calculations does it use a formula to calculate the angle the torp will hit a target from the torpedo track and the targets bearing and course?
The reason I ask is I'm going to try to simulate this dial from values known to us from other dials etc if possible.
2. Any idea what this dial is and its function?
3. The Salvo Angle - here appears to use a 0 to 25 degree angle for both Port and starboard - How did this work compared to SH3 implementation of just 0 to 20degrees?
Thanks Guys :Kaleun_Salute:
sharkbit
08-23-11, 04:11 PM
1 looks like the AOB angle. It is used and can be set in SH3.
2 looks like the target speed dial. It is also settable in SH3.
:)
reaper7
08-23-11, 06:11 PM
1 looks like the AOB angle. It is used and can be set in SH3.
2 looks like the target speed dial. It is also settable in SH3.
:)
Hi Sharbit, thanks for reply.
No 1 is definitely the Impact or Track Angle - but I'm unsure as to how it works, anyone got a diagram of what this does in relation to the Torpedo Solution.
The Target Speed is the dial between 1 and 3 with the Torpedo speed Inner dial. I'm unable to find any info on the bottom left dial (2 in pic) it appears to go from 0 to 60 and have a continuous rotation needle. :hmmm:
Wolfstriked
08-23-11, 06:25 PM
Salute Reaper.:salute: Great to see you still at it.Are you still building new ships?
makman94
08-24-11, 03:11 AM
.....
No 1 is definitely the Impact or Track Angle - but I'm unsure as to how it works, anyone got a diagram of what this does in relation to the Torpedo Solution.
.....
hi Reaper7 ,
the impact angle is calculated through two angles the (Aob at bearing 0) and the (Gyroangle)
in the case that is drawn at the following pic we have : (Aob at bearing 0) = (Gyroangle) + (Impact Angle)
http://img577.imageshack.us/img577/9063/11111i.png
Wolfstriked
08-24-11, 04:35 AM
Sweet stuff Makman:up::up: Your drawing works perfectly to illustrate.
reaper7
08-24-11, 01:21 PM
Salute Reaper.:salute: Great to see you still at it.Are you still building new ships?
Hi Mate, still around alright :DL, working on a longterm project at the moment.
Deatils will be a few months away yet though.
On a bit of a break from ship building - Have one 1/2 finished and hope to get back to it soon.
Also trying to get my SH5 Mod finished up too :up:.
hi Reaper7 ,
the impact angle is calculated through two angles the (Aob at bearing 0) and the (Gyroangle)
in the case that is drawn at the following pic we have : (Aob at bearing 0) = (Gyroangle) + (Impact Angle)
http://img577.imageshack.us/img577/9063/11111i.png
Excellent Makman, that explains it perfectly, true what they say 'A picture paints a thousand words'.
Easier than I expected using the law of the triangle being 'all angles equal 180' the Impact angle can easily be worked out.
Cheers Mate, I'll see whats possible to get this working in SH3. :up:
Wolfstriked
08-24-11, 02:30 PM
Reaper you TEaSE.............:nope: Its ok though.So this dial be useful in telling you if the torpedo will hit in the recommended angles.....pretty kool.
Maybe this old thread helps:
http://www.subsim.com/radioroom//showthread.php?t=178147
reaper7
08-24-11, 05:12 PM
Cheers LGN1. Another question is there a list of Dial types anywhere ?
I'm looking in the dial.cfg file
eg:
Type=1; DIAL_SPEED
Type=4; DIAL_THROTTLE
......
.........
Type=42; DIAL_TGT_ANG_ON_BOW
There is no dial type 2 or 3 and many more are not listed.
Anyway to find out if all values are hardcoded and if so can these be used?
I'm trying to find a dial type thats not used ingame to use for the Impact Angle Dial.
makman94
08-25-11, 02:55 AM
Cheers LGN1. Another question is there a list of Dial types anywhere ?
I'm looking in the dial.cfg file
eg:
Type=1; DIAL_SPEED
Type=4; DIAL_THROTTLE
......
.........
Type=42; DIAL_TGT_ANG_ON_BOW
There is no dial type 2 or 3 and many more are not listed.
Anyway to find out if all values are hardcoded and if so can these be used?
I'm trying to find a dial type thats not used ingame to use for the Impact Angle Dial.
actually ,there is type 2 and 3 dials (type 2 = port engine RPM , type 3 = starb engine RPM).
ALL types (till type 80) for dials exists.you can view the whole list of them and what each one does through the super tool s3d . open ,for example,the
NSS_Uboat7_CR .sim (in interior folder) and go at a dial and clic on its type (look at pic).
see all types listed there (with each 'number' in front and what it does after) . the dial for track angle is the type 66 BUT the code for this dial doesn't exist in sh3's code (must be added in order to make this dial type fuctional for sh3)
http://img814.imageshack.us/img814/1779/2222r.png
reaper7
08-25-11, 11:49 AM
actually ,there is type 2 and 3 dials (type 2 = port engine RPM , type 3 = starb engine RPM).
ALL types (till type 80) for dials exists.you can view the whole list of them and what each one does through the super tool s3d . open ,for example,the
NSS_Uboat7_CR .sim (in interior folder) and go at a dial and clic on its type (look at pic).
see all types listed there (with each 'number' in front and what it does after) . the dial for track angle is the type 66 BUT the code for this dial doesn't exist in sh3's code (must be added in order to make this dial type fuctional for sh3)
http://img814.imageshack.us/img814/1779/2222r.png
Makman, you are a wealth of information. Thankyou my friend :up:
So the dial type is there already, I'm going to see what I can achieve with this new info.
I believe I will be able to bring you a working solution to the non existent Impact Angle dial in Sh3 :hmmm:
Still its just theory in my head for the moment - but using what I've learnt with my current project I think I can make it reality :D
EDIT:
Well no go on my Idea - Can't get the needle to rotate at all. Seems that the dialtype has no memory location assigned to that variable, never mind not having code for it.
So no way for me to hook onto its value, even if I got code working to calculate the Impact Angle - there's nowhere to put the value for the dial to read :(
Judging by the German text labels (I'm of Dutch origin so it's not my native language, but I think it's enough):
1 is indeed impact-angle (auftreffwinkel= angle of collision)
2 is some sort of vernier dial (feinanzeige= fine display) of an angle that represents a bearing, or AOB. Hitman I think once said that (based on his extensive studies) "lage" was used often in both contexts of bearing on ownship, or AOB on the target. I'm betting on AOB. The dictionary that I have at home translates "Lage" as: situation, location, pose, position, state. The dial to the right of 2 seems to be the AOB dial (Gegner = opponent ), as the 2 dials on the far right can be clearly translated to be to be the crude and fine dial for the target bearing (Schiffspeilung= Ship bearing ) Dial 2 shows a value of 30, which could mean 30 minutes of arc, or halve of a degree. The same fractional value as is shown on the small inset dial of "Gegnerlage". 4.5 degrees starboard AOB ("Bug Rechts" = Bow Right)
3 seems to me to be the gyro angle or lead angle. (Schusswinkel= shooting angle) It makes no sense if this is the spread angle. How is a red (port) spread of 2 degrees any different than a green (starboard) spread. Spreads are symmetric. Besides ...
The 2 dials below 3 are probably the torpedo course (Torp. Kurs) and spread dial ("spreizung" means spread, and my dictionary says "Fächer" means "fan") But "Kurs" means course, so it is probably the "True" shooting bearing. IOW, there might be a compass correction involved that is hard to notice on this dial.
makman94
08-26-11, 03:11 AM
.....
EDIT:
Well no go on my Idea - Can't get the needle to rotate at all. Seems that the dialtype has no memory location assigned to that variable, never mind not having code for it.
So no way for me to hook onto its value, even if I got code working to calculate the Impact Angle - there's nowhere to put the value for the dial to read :(
read the OP of the thread that LGN1 pointed to you .
the code for track angle is allready written in sh4's and in sh5's code . as i am not familiar with executables at all, i am only guessing here that MAYBE all that is needed is to copy the code lines for TrackAngle from sh4's code to sh3's code (if possible).
this dial (track angle) is ONLY for reading (i mean that player is not interacting with it) so MAYBE the code will not be so extensive or hard to locate.
just guessing...no idea at all about the code :up:
reaper7
08-26-11, 08:29 AM
read the OP of the thread that LGN1 pointed to you .
the code for track angle is allready written in sh4's and in sh5's code . as i am not familiar with executables at all, i am only guessing here that MAYBE all that is needed is to copy the code lines for TrackAngle from sh4's code to sh3's code (if possible).
this dial (track angle) is ONLY for reading (i mean that player is not interacting with it) so MAYBE the code will not be so extensive or hard to locate.
just guessing...no idea at all about the code :up:
Hi Mate, afraid that is out of my area of expertise - That would be a job for a Reverse Engineer in Code (H.Sie or TDW would be the experts there).
But I have another idea, going to test now to see if it works :03:
reaper7
08-26-11, 01:45 PM
I have managed to find a dial in SH3 that does not appear to be used in the TDC operation to my knowledge (Please let me know if this is not the case).
I'm using this dial
[Dial44]
Name=Impact_Angle
Type=42; DIAL_TGT_ANG_ON_BOW
Cmd=Set_tgt_sel_value
Dial=0x3BBF0002
CrtVal=0x3BBF0001
NewVal=0x0
DialVal=0,360
RealVal=0,360; degrees
Circular=Yes
I have not noticed any ill effect on using this dial type - but I've not done any real in-dept testing as of yet.
Ok so what have I done:
Basically I have external code that is hijacking that particular dial that is setting it to the position that I've coded.
At the moment It is basically taking the Gyroangle from the game and subtracting 180 from it (In essence mirroring the gyroangle).
I need to work out what the actual code for the Impact Angle needs to be and replace my current code with that maths. :woot: :03:
Here you can see it in action:
http://i1183.photobucket.com/albums/x477/U-Boot_HAHD/Random/utube-1.jpg (http://www.youtube.com/watch?v=rtpoEnCaE1w)
What calculation will be needed to do this. Is it just the AOB plus the gyro subtracted from 360?
http://i1183.photobucket.com/albums/x477/U-Boot_HAHD/Random/Angle.jpg
Wolfstriked
08-26-11, 02:43 PM
Looks kool Reaper.I do not know how accurate it is modeled in Sh3 the angle on impact.Since we are gonna now have this tool to calculate will there be changes to make off angle hits dud out even more?
reaper7
08-26-11, 03:23 PM
Looks kool Reaper.I do not know how accurate it is modeled in Sh3 the angle on impact.Since we are gonna now have this tool to calculate will there be changes to make off angle hits dud out even more?
Its not modeled at all in Sh3, hence this mod attempt :DL.
What this will do is show a visual indication of the Impact Angle the torp will hit the target. This will be useful for attacks which are not set up for fast 90.
:up: Once I get the formula worked out that is :D (Maths not being my strong point)
LGN1 has a great tutorial on making more realistic Torpedo duds using SH3 Commander here:
http://www.subsim.com/radioroom/showthread.php?t=158642
Wolfstriked
08-26-11, 04:44 PM
Its not modeled at all in Sh3, hence this mod attempt :DL.
What this will do is show a visual indication of the Impact Angle the torp will hit the target. This will be useful for attacks which are not set up for fast 90.
:up: Once I get the formula worked out that is :D (Maths not being my strong point)
LGN1 has a great tutorial on making more realistic Torpedo duds using SH3 Commander here:
http://www.subsim.com/radioroom/showthread.php?t=158642
Great Reaper and I know its not modeled...yet:O: What I was asking is the angle of impact of a torpedo on the ship....how accurate does SH3 model this in regards to if the torpedo explodes or not.Is it simplified so that a torpedo impacting at an angle of say 30deg will still explode.Which then begs the question....what are the WW2 torpedoes max angle for the pistol to work and did it get better as the war progressed?
reaper7
08-27-11, 02:07 AM
Great Reaper and I know its not modeled...yet:O: What I was asking is the angle of impact of a torpedo on the ship....how accurate does SH3 model this in regards to if the torpedo explodes or not.Is it simplified so that a torpedo impacting at an angle of say 30deg will still explode.Which then begs the question....what are the WW2 torpedoes max angle for the pistol to work and did it get better as the war progressed?
Hi Wolf not sure how this is modeled in SH3, most likely just done as a percentage rate of failure if within a certain angle range. :hmmm:
makman94
08-27-11, 05:05 AM
......
What calculation will be needed to do this. Is it just the AOB plus the gyro subtracted from 360?
http://i1183.photobucket.com/albums/x477/U-Boot_HAHD/Random/Angle.jpg
hello Reaper ,
i told you at my previous message what angles are involving for calculating the impact angle.(read it again more...carefull).
at your figure ...you have drawn wrong the impact angle (it is not the 'x'and forget the Aob) .look at pic :
http://img819.imageshack.us/img819/9738/reaper1h.jpg
now, generally speaking the formula for getting the impact angle is :
(ImpactAngle) = (AoB at bearing 0) + (Gyroangle)
OR
(ImpactAngle) = (AoB at bearing 0) - (Gyroangle)
depending if you shoot right or left of your bearing 0 and depending if you are on a port or on a starboard attack.
the rule is this : when your gyroangle = 0 then the (ImpactAngle) is equal to (AoB at bearing 0).NOW, if you shoot with gyro NOT 0 degrees the needle of Impact angle dial will 'follow' the GYROANGLE dial and either will add or abstract the gyro angle .look at the following pics to understand how the impact angle dial works.
ps: your idea by using one of the existing types for dial and use it for the needle of impact angle will go nowhere . the only thing that you will manage is to make the needle just moving around but it will never show the impact angle .you need the code ,without the code it will be very complicated to show the impact angle (and this will not be directly shown).
LGN1 has managed to 'appear' the impact angle(without the code) but it is so complicated that only advanced player will be able to 'read'.
port attack :
http://img856.imageshack.us/img856/54/1port.png
http://img153.imageshack.us/img153/7627/2port.png
http://img33.imageshack.us/img33/4793/3port.png
starboard attack :
http://img190.imageshack.us/img190/5127/4stb.png
http://img233.imageshack.us/img233/7209/5stb.png
http://img97.imageshack.us/img97/1033/6stb.png
===============
reaper7
08-27-11, 11:38 AM
hello Reaper ,
i told you at my previous message what angles are involving for calculating the impact angle.(read it again more...carefull).
at your figure ...you have drawn wrong the impact angle (it is not the 'x'and forget the Aob) .look at pic :
now, generally speaking the formula for getting the impact angle is :
(ImpactAngle) = (AoB at bearing 0) + (Gyroangle)
OR
(ImpactAngle) = (AoB at bearing 0) - (Gyroangle)
depending if you shoot right or left of your bearing 0 and depending if you are on a port or on a starboard attack.
the rule is this : when your gyroangle = 0 then the (ImpactAngle) is equal to (AoB at bearing 0).NOW, if you shoot with gyro NOT 0 degrees the needle of Impact angle dial will 'follow' the GYROANGLE dial and either will add or abstract the gyro angle .look at the following pics to understand how the impact angle dial works.
ps: your idea by using one of the existing types for dial and use it for the needle of impact angle will go nowhere . the only thing that you will manage is to make the needle just moving around but it will never show the impact angle .you need the code ,without the code it will be very complicated to show the impact angle (and this will not be directly shown).
LGN1 has managed to 'appear' the impact angle(without the code) but it is so complicated that only advanced player will be able to 'read'.
Hmmm, Ok need to study this to figure out how it works correctly.
Thanks for the more indepth explanation on how it works - afraid I don't play much spend more time modding than playing :D.
The reason for my diagram is due to I wish to figure out a calculation that calculates the ImpactAngle from your Scope bearing rather than just at 0 degrees. So what I need to know is how does the AOB change when moving from 0 to say 90deg in relation to AOB along the same target course line.
Using your examples above I will figure out the calculation for 0 degrees, than rotate to 45 degrees, 90 degrees a35 degrees etc and see what the change is to update the formula. :)
(Away for the weekend but have my laptop with me so may get some time to work on it.)
As for code, don't worry about that my example video is showing the Sims Dial being controlled by my code overwirting what ever the game wants to do with it.
So I have code in my app thats retriving the Gyroange and just subtracting it from 360 to mirror the gyro (But its my code thats moving the hijacked dial).
So it will do what I want it to do :D:D:D:D so once I program the formula above it will show the angle.
:yeah:
EDIT: Ok studied those diagrams and explanations and its finally clicked :) OK now I understand what the Impact Angle is doing.Thanks makman your a great Teacher - everything I've learnt about the Interface and its operation is due to you. Cheers.
reaper7
08-27-11, 03:48 PM
Using your example pics above I worked out the following:
AOB Gyro Bearing Impact Angle
-120 0 0 -120
-100 30 20 -90
-140 -30 -20 -150
120 0 0 120
140 20 20 140
105 -20 -15 100
So Using the above figures I was able to work out the Required formula to calculate the Impact Angle:
(AOB + (Gyro - Bearing)) = Impact Angle
Popping in the above shows they work out :up:
(-120)+(0-(0))=-120
(-100)+(30-(20))=-90
(-140)+(-30-(-20))=-150
(120)+(0-(0))=120
140+(20-(20))=140
105+(-20-(-15))=100
Now to write the code and test :arrgh!:
reaper7
08-27-11, 04:40 PM
:Kaleun_Party: It Works :Kaleun_Cheers:
The Impact Angle is working properly using the above formula and my code.
I'm going to pack this up for Makman94 to test and confirm that it works correctly.
And to make sure that by hijacking this dial-type that its not having any other unforeseen consequences on the sim.
If it works this will be Incorporated into our TDC in the U-Boot_HAHD project.
:Kaleun_Thumbs_Up: :Kaleun_Thumbs_Up: :Kaleun_Thumbs_Up:
@Makman, File sent to your yahoo account.
Wolfstriked
08-27-11, 07:34 PM
Great stuff Reaper and you said you are not good at math.....:nope::yep::up::up:
makman94
08-28-11, 04:30 AM
FANTASTIC work Reaper7 !!!! :yeah:
yes ,the formula you found (many many congrats !! ) seems that covers all situations and works correct :up:
[just a note : the values for the above examples are :
-120 0 0 -120
-99 30 21 -90
-141 -30 -21 -150
120 0 0 120
134 20 14 140
106 -20 -14 100 ]
the impact angle dial is working absolutely correct BUT
there are side effects to other areas which are not allowing to use it ingame yet !
i am almost sure that ,thanks to Reaper, we are very close to overcome these side effects and have ,at last, an ORIGINAL Impact Angle dial for SH3!
just hope to solve the issues !
Congratulations Reaper ! :rock:
reaper7
08-28-11, 05:51 AM
[just a note : the values for the above examples are :
-120 0 0 -120
-99 30 21 -90
-141 -30 -21 -150
120 0 0 120
134 20 14 140
106 -20 -14 100 ]
the impact angle dial is working absolutely correct BUT
there are side effects to other areas which are not allowing to use it ingame yet !
i am almost sure that ,thanks to Reaper, we are very close to overcome these side effects and have ,at last, an ORIGINAL Impact Angle dial for SH3!
just hope to solve the issues !
Congratulations Reaper ! :rock:
:haha: I have a habbit of rounding thing up or down - thats my bad maths head :haha:
But as stated the formula works - so we are very close to a fully functional dial.
My next step using the Dial types you supplied me is to find one that will have no impact on the game (Current one effect other parts of the sim).
Then I can get rid of the Static Impact Angle in our TDC with a working Impact Angle. :)
Bur I'm sure we'll find one. :up:
reaper7
08-28-11, 03:39 PM
Ok I believe I have a perfect working solution.
Its was a lot more complicated than I expected. :dead:
The problem with Hijacking dials is other function use them under the hood and so we get unwanted side effects.
My first attempt used the tgt_bearing dial which although was not being used visually by the TDC is being used by the Stadimeter and other areas.
This caused them to stop functioning correctly.
Solution find another dial that's not being used:
Well this proved impossible all dial types that are writable are being used.
There are 2 dial types:
Ones writable by the user eg: Bearing
Ones non-writable to the user eg clock seconds
So i need another workaround to use my code - after digging tru the command.cfg and the dial types available, I had an idea :|\\
Maybe its possible to use the Bearing dials after all there are 2 used for it.
Dial_Bearing
Dial_Bearing_10ths
So I converted my Dial over to the Dial_Bearing_10ths but my code didn't work, the dial_bearing10ths is non-writable or so it seemed :hmmm:
After digging about in Sh3's code I traced whats happening.
The Sim writes the Value of the Bearing to the Dial_Bearing and the using more code writes the bearings 1units to the Dial_Bearing_10ths. As the sim is constantly updating this value it will overwrite anything written to that location by my code (so appearing Read Only).
So loading the assembly I found the part of code that writes the value to the Dial_Bearing_10ths and, well basically blanked it :D.
So now nothing gets written to that area, leaving my code free to do so.
Thereby converting the Dial_Bearing_10ths needle into my Impact Angle Needle :woot:
Now as the games Bearing 10ths dial is no longer correctly bisplaying the bearings 1units (As its now an Impact Angle) that dial needs another trick to get it to work.
This I think can be done by turning that dial type back to a Dial_Bearing and converting the dials.cfg for that dial.
[Dial11]
Name=Sol_Bearing
Type=24; DIAL_SOL_BEARING
Cmd=Set_TDC_bearing
Dial=0x3B0D00FF
CrtVal=0x3B0D0001
NewVal=0x0
DialVal=0,360
RealVal=0,360; degrees
Circular=Yes
CmdOnDrag=Yes
SndStep=5
SndList=1,Menu.TDC.Bearing,360
[Dial12]
Name=Sol_Bearing10ths
Type=24; DIAL_SOL_BEARING; Converted Dial
Dial=0x0
CrtVal=0x3B0D0077
NewVal=0x0
DialVal=0,360
RealVal=0,360; degrees
Circular=Yes
Just need to work out the values needed for the lines above :hmmm:
EDIT:
Well it all works so far - need to test fully and send to Makman for indepth Testing - but its looking good.
Bearing_10ths dial is working using this fix:
[Dial11]
Name=Sol_Bearing
Type=24; DIAL_SOL_BEARING
Cmd=Set_TDC_bearing
Dial=0x3B0D00FF
CrtVal=0x3B0D0001
NewVal=0x0
DialVal=0,360
RealVal=0,360; degrees
Circular=Yes
CmdOnDrag=Yes
SndStep=5
SndList=1,Menu.TDC.Bearing,360
[Dial12]
Name=Sol_Bearing10ths
Type=24; DIAL_SOL_BEARING
Dial=0x0
CrtVal=0x3B0D0077
NewVal=0x0
DialVal=0,12960; Simulates the 1units
RealVal=0,360; degrees
Circular=Yes
:rock:
Screenshot showing it in action using the same values in Makman pic above to show the Impact angle is displaying correctly.
AOB Gyro Bearing Impact Angle
106 -20 -14 100
http://i1183.photobucket.com/albums/x477/U-Boot_HAHD/Random/Impact-Angle.jpg
As this will require editing the SH3 code, I'll have to do like H.Sie and Stiebler and release it as a Patcher - Once I figure out how to do that.
But this will allow a fully working Impact Angle without Interfering with any of the other dials or solution calculations used by Sh3's code. :up:
makman94
08-29-11, 07:46 AM
PERFECT JOHN !!!!!
Brilliant and very clever solution !! this will work for sure !
Impact angle dial will become true for sh3 (:yeah::salute::rock:) and as for the patch i believe that H.Sie will be able to take care of it and also to make it compatible with his great tweaked sh3.exe !
fantastic work and thought :yeah:
bravo John !
reaper7
08-30-11, 05:03 PM
Hi Makman, I've mailed you a bugfix - Impact Angle now works 100% (same as Sh4's)
Required a little more maths coding on my part to fix :)
I apologize for bringing back an old thread. Has anyone successfully added a target impact angle (Auftreffwinkel) dial to SH3? From what I can find, Makman and Reaper7 were close, but I can't find the end to the story.
I have been modding the ARB 1920x1080 GUI to include a more historically accurate TDC (for example, correct AOB and target bearing dials), and would like to include this dial (top right in the picture).
https://www.subsim.com/radioroom/picture.php?albumid=1316&pictureid=11408
This is not nearly as visually stunning as the TDC built by Karamazov for SH4, but it's been a fun project for me.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.