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

Reply
 
Thread Tools Display Modes
Old 01-03-13, 09:29 PM   #496
minsc_tdp
XO
 
Join Date: Mar 2007
Posts: 411
Downloads: 1
Uploads: 0
Default BigWalleye

BigWalleye, send me your files and I will post them. PM me.

I took a quick look at the source code - which I haven't looked at in years btw.

How the whole thing works is as follows:

* The coordinates in the Excel are based on a 1024x768 screen 4:3 aspect, but the aspect shouldn't come into things anywhere, it's certainly not coded to change anything depending on aspect, only resolution.
* sh4, when resolutions change, simply moves, but does not stretch, the image, based on quardrants. The right quadrants move further right, the left ones move further left.
* shSpeech checks the quadrant defined in the CSV,
* And if it is lower or upper right, such as the Oxygen at 590 x 729...
* it adds your resolution to the X and then subtracts 1024, resulting in 902 for a 1336x768 scenario.
* it adds your resolution to the Y, then subtracts 768, resulting in 729 for a 1336x768 scenario (no change).
* If the quadrant is any of the left side quadrants - there is no change. Note that all but 5 of the quadrants are lowerleft (even if the object is further right, SH4 treats it as if it were lower left).

What I would suggest is taking a screenshot at 1024x768 and take another at 1336x768.

Then confirm the oxygen click point is indeed at 590 x 729 for the 1024x768 scenario.
If so, check the 1336x768 screenshot. Figure out how far off it is, then PM me with the screenshots and how far off it is, and any theories as to why.

If for any reason some stretching is occurring, that would definitely be it.

Essentially the cause must be, simply put, that increasing your resolution beyond 1024x768 does not merely "move" the entities by a relative amount, but something else is happening. I'd imagine that when you modified all of the X/Y values, you modified them all by the same amount based on each quadrant.

If you're feeling adventurous, feel free to modify voice.pl with a text editor and then compile it with perl2exe.

If you have any mods installed that, say, add a new button to the command bar, that would account for why you had to modify every single X value.
__________________
June 29 2016 - shSpeech v2.55 - Voice Command for Silent Hunter 4! View Thread
minsc_tdp is offline   Reply With Quote
Old 01-04-13, 03:07 PM   #497
BigWalleye
Sea Lord
 
Join Date: Jul 2012
Location: On the Eye-lond, mon!
Posts: 1,987
Downloads: 465
Uploads: 0


Default

Thanks for the explanation, minsc. I was never able to reverse-engineer the algorothm to make corrections analytically.

The Compressed Air button stays at 590 x 729 regardless of screen resolution. I have never had to change the position of any of the four consumables buttons. They all work correctly from your "stock" command_bar.csv parameters. So your coded correction for screen resolution is working. The left-side command bar button X- and Y-parameters, on the other hand, do have to be adjusted, because RFB, TMO, and OM all apparently change both the height and the width of the buttons, in addition to changing the number of buttons. The position of the button bar itself remains the same in each case. The dials and buttons for setting the torpedo parameters (upper left group) also remain correct with no changes. The TDC input dials (upper right group) and HUD dials (lower right) all require adjustment. Interesting that the consumables buttons, which are part of the lower right group, are OK, but the HUD dials in the same group are not.

I will PM you so I can send you my files. Perhaps they will give you a better idea of what is changing.

I just want to say once again how much your package adds to the SH4 game. Thanks for all the work you have put into it.

-Wayne

-Real sub skippers give orders. They don't push buttons.-
BigWalleye is offline   Reply With Quote
Old 03-11-13, 09:49 AM   #498
messageboy101
Engineer
 
Join Date: Mar 2012
Posts: 210
Downloads: 429
Uploads: 0
Default

How to install this
messageboy101 is offline   Reply With Quote
Old 03-11-13, 01:18 PM   #499
BigWalleye
Sea Lord
 
Join Date: Jul 2012
Location: On the Eye-lond, mon!
Posts: 1,987
Downloads: 465
Uploads: 0


Default

Quote:
Originally Posted by messageboy101 View Post
How to install this
Remember that shSpeech is not a mod. It's a stand-alone program that runs in the background while SH4 is running foreground. You install it by itself (nothing to do with JSGME) and start it first, then start SH4.

First, go to Start/Control Panel on your windows (I hope!) computer. Click on Speech Recognition and spend a few minutes or so training it to recognize your voice.

Then go here http://knepfler.com/shSpeech/ and download shSpeech. Unzip it into its own folder. RTFreadme and print out the reference card, so you can refer to the voice commands that come stock with the program. Select the appropriate sh4speech .bat file, click on it, and wait while it launches Speech Recognition. Turn Speech Recognition ON (By now, you should know what I am talking about. If you don't, go back to the first step, rinse, and repeat until you do.) When you can see that Speech Recognition is responding to your spoken words, launch SH4. DO go through the shSpeech setup: "I have N tubes." "Reset all tubes." Reset all dials." while the game is loading. Then start playing and watch the sub follow your orders. That's it.
BigWalleye is offline   Reply With Quote
Old 05-16-13, 06:46 AM   #500
in_vino_vomitus
XO
 
Join Date: Jul 2009
Location: Preston, Lancs, UK
Posts: 418
Downloads: 137
Uploads: 0
Default problems with windows 8

First of all thanks to minsc' for the effort he's put into this. The problem I'm having is that shspeech is recognising my commands, but they're not getting through to the submarine. I'm using windows 8 on a laptop. the voice-recognition seems to be part of the operating system. I've set it up, using the built in mic, and it works fine. I did try to download speechsdk, but I suspect the file was corrupt - when I try to run it I just get an error message that says it's not a win32 application - is it essential, given that voice recognition works without it?

I have no idea if this is as good an addition as everyone says it is, but now I've read people praising it to the skies I want it!!!
__________________
Forget death - I'll take dishonour!
[SIGPIC][/SIGPIC]
TMO 2.5
1.5 Optical Targeting Correction 031312 for TMO 2.5
1.5 OTC Realistic Scopes for TMO
TheDarkWraith_DC_Water_Disturbance_v2_0_SH4
Improved Stock environment v3_TMO&RFB
TMO_Alt_engine-sounds
TMO_Alternate_JS_Radar_performance
TMO17_19_different_smoke
in_vino_vomitus is offline   Reply With Quote
Old 05-16-13, 08:05 PM   #501
BigWalleye
Sea Lord
 
Join Date: Jul 2012
Location: On the Eye-lond, mon!
Posts: 1,987
Downloads: 465
Uploads: 0


Default

Have you tried just running sh4speech without starting sh4? you should be able to see in the DOS window whether speech recognition is interpreting your voice commands properly and issuing the correct keyboard commands to the OS. If it is, then your keyboard mapping may be different than standard US. and you may need to edit key_codes.csv to map properly to your keyboard. You should not need speechsdk. Everything you need should already be present in Win8.

EDIT: Just went back and looked at some previous posts on this thread. Another poster couldn't get his keyboard handler to work with Knepfler's program. He ran SH4 in windowed mode and the problem went away. Have you tried this?

Last edited by BigWalleye; 05-16-13 at 08:17 PM.
BigWalleye is offline   Reply With Quote
Old 05-17-13, 12:20 AM   #502
in_vino_vomitus
XO
 
Join Date: Jul 2009
Location: Preston, Lancs, UK
Posts: 418
Downloads: 137
Uploads: 0
Default win 8 probs

thanks for the reply - have run shspeech minus sh4 and yep- it's picking up my commands, it just isn't passing them on - tried running in windowed mode without success, but never thought about editing key_codes.csv - I'll try that directly - Thanks again
__________________
Forget death - I'll take dishonour!
[SIGPIC][/SIGPIC]
TMO 2.5
1.5 Optical Targeting Correction 031312 for TMO 2.5
1.5 OTC Realistic Scopes for TMO
TheDarkWraith_DC_Water_Disturbance_v2_0_SH4
Improved Stock environment v3_TMO&RFB
TMO_Alt_engine-sounds
TMO_Alternate_JS_Radar_performance
TMO17_19_different_smoke
in_vino_vomitus is offline   Reply With Quote
Old 05-17-13, 04:34 AM   #503
Cybermat47
Willing Webfooted Beast
 
Cybermat47's Avatar
 
Join Date: Aug 2012
Location: Australia
Posts: 5,386
Downloads: 293
Uploads: 22


Default

Does this require a microphone or webcam to use? Because I haven't got any of those as far as I know...
__________________
Historical TWoS Gameplay Guide: http://www.subsim.com/radioroom/showthread.php?p=2572620
Historical FotRSU Gameplay Guide: https://www.subsim.com/radioroom/sho....php?p=2713394
Cybermat47 is offline   Reply With Quote
Old 05-17-13, 06:21 AM   #504
in_vino_vomitus
XO
 
Join Date: Jul 2009
Location: Preston, Lancs, UK
Posts: 418
Downloads: 137
Uploads: 0
Default

It needs a mic' - Mine is built into my laptop.

Good news - something worked - The problem wasn't key codes. I had sh4 set to run as admin - I disabled this - I may have tweaked a couple of other things - Whatever, it's working now, although a couple of keys needed reallocating to different commands - rear tubes cycle with the "E" key, crash Dive id CTRL-D etc.

The major bugbear at the moment is the dials, which don't correspond to the increments I specify. I'm looking at the csv file formats and it's going to be fun teaching myself what sin cos and tan all do - I didn't realise in school, that I'd ever need them. But we didn't have games like this back then

The good news though is the sub can be adequately controlled with the program as is, and it can only get better - so thanks again to minsc' for writing it
__________________
Forget death - I'll take dishonour!
[SIGPIC][/SIGPIC]
TMO 2.5
1.5 Optical Targeting Correction 031312 for TMO 2.5
1.5 OTC Realistic Scopes for TMO
TheDarkWraith_DC_Water_Disturbance_v2_0_SH4
Improved Stock environment v3_TMO&RFB
TMO_Alt_engine-sounds
TMO_Alternate_JS_Radar_performance
TMO17_19_different_smoke
in_vino_vomitus is offline   Reply With Quote
Old 05-17-13, 07:19 AM   #505
BigWalleye
Sea Lord
 
Join Date: Jul 2012
Location: On the Eye-lond, mon!
Posts: 1,987
Downloads: 465
Uploads: 0


Default

Cybermat47, it needs a microphone. A cheap headset with boom mic will cost you about $10-15 at Wally's and it's all you need.

IIV, you need to modify dials.csv. Forget the sines and cosines. You just have to change the locations of dial centers and radii. No trig needed, but you do need some way to measure the locations of the dials in pixels. You can use screenshots and P'Shop, or just measure them on the screen. Depending on the megamod you are using and your resolution, I may have a set of .csv files that will work for you.

EDIT: Checked your sig. I have a set of corrected files that work with TMO at 1920x1080. They might work for your res. If you wish, I can make the files available.
BigWalleye is offline   Reply With Quote
Old 05-17-13, 07:35 AM   #506
in_vino_vomitus
XO
 
Join Date: Jul 2009
Location: Preston, Lancs, UK
Posts: 418
Downloads: 137
Uploads: 0
Default

BW - thanks for the offer, but my laptop runs in 1366x786 - I'm guessing your files won't work - Looks like I'll have to do it by hand
__________________
Forget death - I'll take dishonour!
[SIGPIC][/SIGPIC]
TMO 2.5
1.5 Optical Targeting Correction 031312 for TMO 2.5
1.5 OTC Realistic Scopes for TMO
TheDarkWraith_DC_Water_Disturbance_v2_0_SH4
Improved Stock environment v3_TMO&RFB
TMO_Alt_engine-sounds
TMO_Alternate_JS_Radar_performance
TMO17_19_different_smoke
in_vino_vomitus is offline   Reply With Quote
Old 05-17-13, 09:21 AM   #507
BigWalleye
Sea Lord
 
Join Date: Jul 2012
Location: On the Eye-lond, mon!
Posts: 1,987
Downloads: 465
Uploads: 0


Default

IVV, mine works fine at 1366x768. 1920x1080 is exactly 16/9. 1366x768 is almost 16/9. (Difference of 0.04%) I do have my sh4speech set up to use my own version of Commands.cfg, so you would either have to adapt or convert.

Remember to change the resolution setting in trigger_maru.bat.

If you are going to fix it yourself, you will need to change command_bar.csv and dials.csv. Careful measurement will get you close, then you can refine it by trial and error. I found that ALT-TABing out of SH4 is the fastest way to test the changes, but you must restart sh4speech each time you make a change to any .csv. sh4speech caches the .csv files on initialization, so any change you make while it is running won't have an immediate effect. Tweaking all the dials, the TDC, and the command bar took me maybe 8-10 hours. Not trivial, but not that daunting, either.
BigWalleye is offline   Reply With Quote
Old 06-17-13, 07:03 PM   #508
Fish40
The Old Man
 
Join Date: Aug 2006
Location: Yonkers, NY U.S.A.
Posts: 1,507
Downloads: 146
Uploads: 0
Default

I take it that no RFB version exists?
Fish40 is offline   Reply With Quote
Old 06-17-13, 07:24 PM   #509
in_vino_vomitus
XO
 
Join Date: Jul 2009
Location: Preston, Lancs, UK
Posts: 418
Downloads: 137
Uploads: 0
Default

BW _ I didn't spot your reply earlier - The problem I ended up having was that turning on speech recognition on my laptop meant there were a bazillion other commands that the thing thought I meant - not sure how I'll work round that yet - But the aspect ratio info is very very useful - thanks
__________________
Forget death - I'll take dishonour!
[SIGPIC][/SIGPIC]
TMO 2.5
1.5 Optical Targeting Correction 031312 for TMO 2.5
1.5 OTC Realistic Scopes for TMO
TheDarkWraith_DC_Water_Disturbance_v2_0_SH4
Improved Stock environment v3_TMO&RFB
TMO_Alt_engine-sounds
TMO_Alternate_JS_Radar_performance
TMO17_19_different_smoke
in_vino_vomitus is offline   Reply With Quote
Old 06-20-13, 07:39 PM   #510
BigWalleye
Sea Lord
 
Join Date: Jul 2012
Location: On the Eye-lond, mon!
Posts: 1,987
Downloads: 465
Uploads: 0


Default

IVV, once I trained my voice rec, I didn't have any problems. I load up SH4speech and, since there is a limited set of possible commands, it usually finds the right one without fuss. I did have a problem with a very classy Logitech wireless headset I bought - the sound was killer, but the voice pickup did not seem to come through very clear. I've used a $20 cheapo from the Shack with better results. I now use a Sony wireless set intended for the Playstation and get excellent voice rec.

Fish40, there is an RFB-compatible version. Get everything you need here: http://knepfler.com/shSpeech/ I had to tweak some of the files to get them to work the dials right at my rez - 1920x1080. Happy to share them with you if you want. Pls PM.
BigWalleye 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 08:44 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.