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 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 04-06-09, 07:26 PM   #1
bobchase
Torpedoman
 
Join Date: Jan 2008
Location: Pearland, Texas
Posts: 118
Downloads: 21
Uploads: 0
Default Working Gyrocompass Vernier

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
bobchase is offline   Reply With Quote
Old 04-07-09, 07:01 AM   #2
makman94
Hellas
 
Join Date: Jul 2008
Posts: 2,325
Downloads: 182
Uploads: 7


Default

nice idea ,Bobchase !

(but where are the files ? )
makman94 is offline   Reply With Quote
Old 04-07-09, 07:07 AM   #3
Hitman
Pacific Aces Dev Team
 
Hitman's Avatar
 
Join Date: Sep 2002
Location: Spain
Posts: 6,099
Downloads: 109
Uploads: 2


Default

You mean that you managed to add a smaller compass dial that rotates 10 times faster than the original one? 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??
__________________
One day I will return to sea ...
Hitman is offline   Reply With Quote
Old 04-07-09, 01:56 PM   #4
UberTorpedo
Planesman
 
Join Date: Jun 2006
Location: Southern California
Posts: 194
Downloads: 78
Uploads: 0
Default

Here's bobchase's FF link but no uploaded files yet???

http://hosted.filefront.com/bobchase/
UberTorpedo is offline   Reply With Quote
Old 04-07-09, 02:53 PM   #5
bobchase
Torpedoman
 
Join Date: Jan 2008
Location: Pearland, Texas
Posts: 118
Downloads: 21
Uploads: 0
Default

Quote:
Originally Posted by Hitman View Post
You mean that you managed to add a smaller compass dial that rotates 10 times faster than the original one? 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??
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 is offline   Reply With Quote
Old 04-07-09, 03:06 PM   #6
bobchase
Torpedoman
 
Join Date: Jan 2008
Location: Pearland, Texas
Posts: 118
Downloads: 21
Uploads: 0
Default Vernier prototype files on FileFront

OK! What part of "home from work because I'm sick" didn't you rabid sea dogs get?

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
bobchase is offline   Reply With Quote
Old 04-08-09, 09:44 AM   #7
Hitman
Pacific Aces Dev Team
 
Hitman's Avatar
 
Join Date: Sep 2002
Location: Spain
Posts: 6,099
Downloads: 109
Uploads: 2


Default

Quote:
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

Briliant idea, certainly

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 .

I'll study your files, but if you have the idea of how to it, then pelase post it here
__________________
One day I will return to sea ...
Hitman is offline   Reply With Quote
Old 04-08-09, 10:02 AM   #8
Hitman
Pacific Aces Dev Team
 
Hitman's Avatar
 
Join Date: Sep 2002
Location: Spain
Posts: 6,099
Downloads: 109
Uploads: 2


Default

UPDATE:

YAY IT WORKS!!!

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
__________________
One day I will return to sea ...
Hitman is offline   Reply With Quote
Old 04-08-09, 07:34 PM   #9
bobchase
Torpedoman
 
Join Date: Jan 2008
Location: Pearland, Texas
Posts: 118
Downloads: 21
Uploads: 0
Default

Quote:
Originally Posted by Hitman View Post
UPDATE:

YAY IT WORKS!!!
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!
bobchase is offline   Reply With Quote
Old 04-08-09, 07:43 PM   #10
Sharkley
Engineer
 
Join Date: Mar 2009
Location: Ontario, Canada
Posts: 216
Downloads: 12
Uploads: 0
Default

Any screenshots ?

Sharkley is offline   Reply With Quote
Old 04-08-09, 11:06 PM   #11
GoldenRivet
Subsim Aviator
 
GoldenRivet's Avatar
 
Join Date: Mar 2007
Location: Texas
Posts: 8,712
Downloads: 146
Uploads: 0


Default

sounds cool, i would like to see it in action
__________________
GoldenRivet is offline   Reply With Quote
Old 04-09-09, 12:00 AM   #12
FIREWALL
Eternal Patrol
 
Join Date: Mar 2006
Location: CATALINA IS. SO . CAL USA
Posts: 10,108
Downloads: 511
Uploads: 0
Default

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.
__________________
RIP FIREWALL

I Play GWX. Silent Hunter Who ???
FIREWALL is offline   Reply With Quote
Old 04-09-09, 03:06 AM   #13
Hitman
Pacific Aces Dev Team
 
Hitman's Avatar
 
Join Date: Sep 2002
Location: Spain
Posts: 6,099
Downloads: 109
Uploads: 2


Default

Quote:
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

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

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

Quote:
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

Quote:
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.
__________________
One day I will return to sea ...
Hitman is offline   Reply With Quote
Old 04-09-09, 11:50 AM   #14
Pisces
Silent Hunter
 
Join Date: Dec 2004
Location: AN9771
Posts: 4,892
Downloads: 300
Uploads: 0
Default

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.
__________________
My site downloads: https://ricojansen.nl/downloads
Pisces is offline   Reply With Quote
Old 04-09-09, 12:10 PM   #15
Hitman
Pacific Aces Dev Team
 
Hitman's Avatar
 
Join Date: Sep 2002
Location: Spain
Posts: 6,099
Downloads: 109
Uploads: 2


Default

Quote:
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? 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.
__________________
One day I will return to sea ...
Hitman is offline   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 02:54 PM.


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.