View Full Version : Working Gyrocompass Vernier
bobchase
04-06-09, 07:26 PM
I came home sick from work, got bored, and I was playing around with the idea of making a vernier dial on the Gyrocompass work today. I was Semi-successful because I don't do photoshop well and I only partially understand the links in the files.
1st - I run a stock version of the game (1.4b) with various mods I added or copied.
I copied the following section of the dials.cfg
[Dial20]
Name=SpeedFdbk
Type=1; DIAL_SPEED
Cmd=Set_speed,Crew
Dial=0x3F1B0001
CrtVal=0x3F1B0002
NewVal=0x3F1B0003
DialVal=-150,150
RealVal=0,10.3; knots
Circular=Yes
Then I put the copy at the end of the file and made the following changes:
[Dial52]
Name=Add_CompassVernier
Type=12; DIAL_GYROCOMPASS
;Cmd=Set_course,Crew
Dial=0x3F1D0001
CrtVal=0x3F1D0005
;NewVal=0x3F1D0003
;DialVal=-180,180; degrees original
DialVal=-6480,6480
RealVal=-180,180; degrees original
Circular=Yes
Dynamic=Yes
We don't need the 'cmd' or the 'NewVal' sections because we arn't going to click on this dial. The new 'DialVal' is 360 / 10 * 180 = 36 * 180 = 6480. This gives us 10 turns of the dial for every 10 degrees of course change.
The last thing we need to do with the dials.cfg file is to increment the number of dials allowed up at the top of the file by one.
[DIALS]
;DialsNo=52
DialsNo=53
Now we open the menu_1024_768.ini file and find the following entry.
[G3F I67]
Name=Center
;Type=1030;Static bmp (original)
Type=1031;Static bmp array
ItemID=0x3F1D0005
ParentID=0x3F1D0000
Pos=20,-35,61,61
Materials=1
;Display=0;No stretch (orginal)
Display=5;Linear&rotation
Mat 0=data/menu/gui/layout/dialsfdbbob4.tga
;Crop 0=0.878906,0.757813,1,1; (original)
;Crop 0=0.878906,0.757813,0.12,0.24; good
;Crop 0=0.878906,0.757813,0.118,0.232 better
MatFlags=0x9
TexFmt=0x9
Drag=false
BmpState=1
NeedFocus=true
SelOne=false
IdGroup=0
StatesColors=0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF
I changed the dial 'Type' to 1031 and change the 'Display' to 5. And that's where the problems started. I played with the 'Crop' settings to get the original dialsfdb.tga to work and I was fairly successful at getting that to work. However, the Vernier dial has lighting effects that are very noticeable when the dial starts spinning. So I made my own file with no lighting effects and that is why all of the 'Crop' elements are rem'ed out in the example below. (I'm using the file in a one-to-one import.)
You may have noticed that your officer will say 'New course is 257 degrees' while the printed words in the message area say '254 degrees'. Well, the vernier is about as accurate as that is. It's about +/- 3 degrees from actual, depend on what you deem 'actual'. So if you call for a course of 010 degrees and the vernier shows the numeral 1 or 2 at the top, you are working well within the allowances of the game. (But it is fun to watch it spin around when you are making turns!)
I'll put the three files up on my FileFront page if you want to play with them. If any of you 'uber modders' want to incorporate this into your designs, it's just fine with me, and no credit is needed or desired. All I did was find the path - you can do the hard lifting of making it look pretty!
Have fun,
Bob
makman94
04-07-09, 07:01 AM
nice idea ,Bobchase ! :up:
(but where are the files ? )
You mean that you managed to add a smaller compass dial that rotates 10 times faster than the original one? :o This could be what I was looking for in order to have the U-505 compass work as intended, please see the last posts in this thread: http://www.subsim.com/radioroom/showthread.php?t=148239
Could it work for that purpose?? :cool:
UberTorpedo
04-07-09, 01:56 PM
Here's bobchase's FF link but no uploaded files yet??? :hmmm:
http://hosted.filefront.com/bobchase/
bobchase
04-07-09, 02:53 PM
You mean that you managed to add a smaller compass dial that rotates 10 times faster than the original one? :o This could be what I was looking for in order to have the U-505 compass work as intended, please see the last posts in this thread: http://www.subsim.com/radioroom/showthread.php?t=148239
Could it work for that purpose?? :cool:
Hitman,
Most probably. The original dialsfdb.tga file has the inner circle (vernier) outer circle (compass), and the outer ring (pretty stuff) as parts of the gyrocompass. Out of frustration with knowing how to use the the clip settings correctly, I made my own vernier file rather than modifying the dialsfdb.tga file.
Bottom line, there are two ways to skin the cat depending on how your dial was built (One file or many files) and how how you want to proceed.
The only bright idea of mine was creating a new object in dials.cfg for the vernier and then changing the static vernier in the menu_1080_786.ini file from a static image to a dynamic image that is controlled by the new object in dials.cfg.
Bob
bobchase
04-07-09, 03:06 PM
OK! What part of "home from work because I'm sick" didn't you rabid sea dogs get? :arrgh!:
At 0600 I reported to sickbay and she said take these Aspirins, go back to bed, and see me be chow time. At 1200 I reported back to sickbay and she pulled the same drill on me again. Damn Navy medics! Anyway, she just left for the airport to pick up another micro-dog (Bijon Frise) for her own personal pleasure and left me on my own cognizance. (Foolish women.)
I snuck out of the ET berthing area and came up to Radio Central. The PROTOTYPE files are now up on FileFront. Have fun destroying the enemy fleet know that you know where you are going.
Bob
changing the static vernier in the menu_1080_786.ini file from a static image to a dynamic image that is controlled by the new object in dials.cfg.
Ahhhh nice, that was the relevant part I didn't get well :up:
Briliant idea, certainly :salute:
What I need to do now is to have that new rotating dial make a full turn each time the big one moves 10 degrees, and we have the job complete :yeah:.
I'll study your files, but if you have the idea of how to it, then pelase post it here :cool:
UPDATE:
YAY IT WORKS!!! :rock:
You are a genius man, the only thing I have to tweak now is the indicator needle for set course (Which moves a bit oddly now) and the correct synchronization of the rotation of the inner dial, because for some weird reason 10 degrees in the large compass are not a full turn in the small one, but a bit less (Say 80% or so). But that is just a matter of trial and error until the correct value is found.
I owe you a beer, you have given the community the chance to have a proper Gyrocompass working in game, you are a GENIUS sir :yeah:
bobchase
04-08-09, 07:34 PM
UPDATE:
YAY IT WORKS!!! :rock:
Hitman,
Before you go too far, check for vernier dial repeatability by changing course over and over again. I always found that the game had a built in error as to where I click on the compass vs. what direction the boat actually goes vs. what the officer says vocally vs. what the game writes in the message area. For instance, if I click *exactly* on N (000) I may see the gyrocompass stop at about 003 while the officer says (vocally) "new course 357 degrees" and the same office writes "new course 000 degrees" in the message box.
I'd give the game a best case error band of +/- three degrees for actual course direction - That's a 6 degree wide error band. With more testing, it just might prove to be even wider, like +/- 5 degree error.
When we make the dials larger and more detailed like you have and/or add a vernier like I did, the built in error just becomes more apparent. I'm guessing the offset that you are seeing is that error, not the .tga file or the math in the .cfg file.
Bob
Did I menthion very detailed and pretty too? Very nice work sir!
Sharkley
04-08-09, 07:43 PM
Any screenshots ?
:salute:
GoldenRivet
04-08-09, 11:06 PM
sounds cool, i would like to see it in action :up:
FIREWALL
04-09-09, 12:00 AM
I copied and pasted the cfg and the 1024 files and all I got was a dial with a blank center. I backed up both files so everything is back to same.
The large slideout dial wouldn't work either.
What did I do wrong ?
As I type I could kick myself for not takeing a screenshot. :haha:
Hitman,
Before you go too far, check for vernier dial repeatability by changing course over and over again. I always found that the game had a built in error as to where I click on the compass vs. what direction the boat actually goes vs. what the officer says vocally vs. what the game writes in the message area. For instance, if I click *exactly* on N (000) I may see the gyrocompass stop at about 003 while the officer says (vocally) "new course 357 degrees" and the same office writes "new course 000 degrees" in the message box.
I'd give the game a best case error band of +/- three degrees for actual course direction - That's a 6 degree wide error band. With more testing, it just might prove to be even wider, like +/- 5 degree error.
When we make the dials larger and more detailed like you have and/or add a vernier like I did, the built in error just becomes more apparent. I'm guessing the offset that you are seeing is that error, not the .tga file or the math in the .cfg file.
Bob
Did I menthion very detailed and pretty too? Very nice work sir!
Well fortunately the opposite seems to happen :yeah:
As I adapted your modifications to the large slide-out dial in NYGM/GWX with my U-505 graphics, the inner dial (10 degrees) seemed to function more or less properly, with just about 0.3-0.5 degree difference.
I would say that this minor error lies in the game being unable to steer a course as exact as a decimal of a degree, while the dial instead can indicate that decimal. This seems to confuse the game to a certain extent, but you actually always get the proper course reading within that degree.
Am example: If I am on course 000 (N) and click course 010, then:
1.- The navigator calls "New course 010"
2.- The large dial on the outside rotates to the right from 000 to 010 (As usual)
3.- The inner dial does a FULL turn and stops somewhere between 9,3 and 9,5, NOT at 0 as it should. That minor 0,7 to 0,3 of a degree difference is what I was talking about. But it's not by any means too relevant, since you are steering inside the degree you ordered. You can aswell think that it roots to the imposibility of actually steering such a precise course on a ship, and simply note the slight error for correction in the chart :smug:
I must further tweak the graphics because with a rotating inner dial now the needle for set course does some weird things, but I think a reasonable outcome is to be expected :yeah:
Any screenshots ?
It looks in-game exactly as the dial shown in the screenshots of the thread I linked to previously, the only difference is that now the inner one also rotates coordinately. I should post a video instead of a screenshot, but I lack the time to do it and prefer to dedicate it to the mod itself. Don't worry, it should be ready very soon :shucks:
I copied and pasted the cfg and the 1024 files and all I got was a dial with a blank center. I backed up both files so everything is back to same.
The large slideout dial wouldn't work either.
What did I do wrong ?
There's actually a lot of things that could have gone wrong. Myself, having experience in modding the menu.ini and following Bob's detailed instructions, still made some mistakes and had to correct them, so it's nearly impossible to diagnose what failed with your attempt. :hmmm:
Well, how sure can you be you exactly pressed on the 10 degree mark. A pixel or so to the side and it could very well account for that fraction of a degree being off.
Wouldn't it be more reliable if you make a test-mission where the initial direction of the uboot is set to 0 degrees, or other specific courses. And check the dial readout.
Wouldn't it be more reliable if you make a test-mission where the initial direction of the uboot is set to 0 degrees, or other specific courses. And check the dial readout.
LOL how on earth did you think I tested it? :har: Did exactly that!!
But yes a pixel can make a big difference...however I'm positive (Yes I could be wrong) that as usual, the simpliest answer is the right one: SH3 wasn't designed to allow a course in decimals.
bobchase
04-09-09, 07:56 PM
Hitman,
Well, I'm glad that your mod is working and that your in-game repeatability testing is better than mine. I'll have to revisit my course repeatability the next time I take my boat out.
It would seem that a constant -0,5 degree offset (-0.5 in the USA) could be done with a manual anti-clockwise rotation (CCW) of the vernier graphic in photoshop and a re-save it to a .tga file. Quick and dirty but it should work.
I can tell you from personal experience that keeping my 717 ft inboard within a couple of degrees of intended course took a monumental effort (both mental & physical ) when I was at the helm and any sea was running at all. Of course the bubble-heads would have it easier down below without the effects of wind and wave but still, ships were never meant to be driven to within a degree of true course. :D
Bob
It would seem that a constant -0,5 degree offset (-0.5 in the USA) could be done with a manual anti-clockwise rotation (CCW) of the vernier graphic in photoshop and a re-save it to a .tga file. Quick and dirty but it should work.
Had already thought about it, but it would not work because of two problems:
1.- The error is not constant, it moves between 0.3 and 0.5
2.- The error appears only in the last degree of the ordered course, i.e. when the vernier moves you don't notice it but just when it gets to the final degree you see that it fails to move that last 0.3 to 0.5 of degree.
I can tell you from personal experience that keeping my 717 ft inboard within a couple of degrees of intended course took a monumental effort (both mental & physical ) when I was at the helm and any sea was running at all. Of course the bubble-heads would have it easier down below without the effects of wind and wave but still, ships were never meant to be driven to within a degree of true course. :D
Yeah, I have only steered much smaller vessels (90 ft max) but keeping an accurate course to the degree is far from easy as soon as the sea moves a bit. Hence I think that the curremnt accurancy is good enough -or even too good!- for what a WW2 U-Boat helmsman would have been able to do.
Thanks again :up:
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.