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 08-17-07, 03:14 PM   #91
minsc_tdp
XO
 
Join Date: Mar 2007
Posts: 411
Downloads: 1
Uploads: 0
Default

Hot off the presses!

sh4speech 1.6 Voice Command Reference Card *NEW!
__________________
June 29 2016 - shSpeech v2.55 - Voice Command for Silent Hunter 4! View Thread
minsc_tdp is offline   Reply With Quote
Old 08-17-07, 11:52 PM   #92
panthercules
The Old Man
 
Join Date: Apr 2005
Posts: 1,336
Downloads: 6
Uploads: 0
Default

Awesome! I just D/L'ed version 1.6 and will be taking it out to sea tomorrow (dying to do it now but it's just too late here). Just had to say that the new reference card is a great thing - I'd done a quick-and-dirty printout of my own from the .csv file but it ran about 4 pages and was not organized or formatted well at all - this one-pager will be perfect for ready reference till it gets to be second nature.

Well Done

Just one question regarding how you managed to get the course and speed commands working - does it depend on using exactly the formulation you have written (e.g., "heading xx degrees", "heading right xx degrees", "make your speed xx knots"), or is it possible for us to modify these slightly (e.g., "make your course xx degrees", "come right xx degrees", "make turns for xx knots")? There's certainly nothing wrong with the way you've got it now, and I think it's amazing that you've gotten this to work, so I don't want to sound like I'm looking a gift horse in the mouth, but I'd love to be able to have alternate ways to say these things too.

This just keeps getting better and better
__________________
panthercules is offline   Reply With Quote
Old 08-18-07, 12:13 AM   #93
minsc_tdp
XO
 
Join Date: Mar 2007
Posts: 411
Downloads: 1
Uploads: 0
Default

Quote:
Originally Posted by panthercules
Just one question regarding how you managed to get the course and speed commands working - does it depend on using exactly the formulation you have written (e.g., "heading xx degrees", "heading right xx degrees", "make your speed xx knots"), or is it possible for us to modify these slightly (e.g., "make your course xx degrees", "come right xx degrees", "make turns for xx knots")? There's certainly nothing wrong with the way you've got it now, and I think it's amazing that you've gotten this to work, so I don't want to sound like I'm looking a gift horse in the mouth, but I'd love to be able to have alternate ways to say these things too.
You're free to change them, of course man! Open voice_commands.csv with Excel and edit the third column. You can highlight a block of cells and do a search / replace for "heading right" to "make your course" or whatever you want and it will only replace in the selected cells. Hell, you could copy them all to another block of 360 commands and then you'd have both.

Unlike all the other voice commands, you might notice that these 1.) All have the same ID for a particular type (that maps to the dial ID) and B.) The Name (2nd column) is somewhat special. The Name is generally ignored but in this case I needed to actually put the numbers somewhere and this was as good as any. So just be careful copy and pasting so that you retain all of that.

(Note: These CSVs are just text so you could use Notepad if you must, but you'll just have to watch more closely to ensure you don't change anything you don't mean to.)
__________________
June 29 2016 - shSpeech v2.55 - Voice Command for Silent Hunter 4! View Thread
minsc_tdp is offline   Reply With Quote
Old 08-18-07, 04:43 PM   #94
Fraggulus
Swabbie
 
Join Date: Jul 2007
Posts: 7
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by minsc_tdp
Quote:
Originally Posted by Fraggulus
..Is there a possibility to get umlauts working?
[...]
Under Language, what is selected? Should be v8.0 German.
.What happens if you start the windows speech recognizer widget from control panel ... Which works?
Hi minsc,
yes, it is 8.0 German and it is working with the German commands. English commands are not recognized.

Quote:
If so your German recognizer is working fine, it could be an umlaut/unicode/script problem, but before I dive into it I'd like to hear that the above is working right.

I'm not sure how I can test that without installing German Vista,
finally I got it working in large part. If I run 'python hear.py' words with umlauts are recognized. I guess I 'just' have to train my speech recognition one or two more times.

But I saw another failure. If I run 'sh4speech.bat' all commands are recognized except those with umlauts. The error message is as follows:
Code:
Phrase processed.  Waiting for a new phrase...
pythoncom error: Python error invoking COM method.

Traceback (most recent call last):
  File "C:\Python25\Lib\site-packages\win32com\server\policy.py", line 285, in _Invoke_
    return self._invoke_(dispid, lcid, wFlags, args)
  File "C:\Python25\Lib\site-packages\win32com\server\policy.py", line 290, in _invoke_
    return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None)
  File "C:\Python25\Lib\site-packages\win32com\server\policy.py", line 588, in _invokeex_
    return func(*args)
  File "hear.py", line 94, in OnRecognition
    print phrase
<type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\xe4' in position 1: ordinal not in range(128)
The spoken command was 'nächste Einheit' and the used version of sh4speech was 1.51.

F.
Fraggulus is offline   Reply With Quote
Old 08-18-07, 06:06 PM   #95
Capt. Shark Bait
Ace of the Deep
 
Join Date: Apr 2007
Location: in a convergance zone
Posts: 1,186
Downloads: 3
Uploads: 0
Default

got it in jsgme but i gotta leave for work...now

i'm wondering if the orders are repeated back, ie: "make your depth 225ft." "make my depth 225ft, aye (sir)"
__________________
Leiser und tödlicher edler Ritter der Tiefe



Corsair Vengeance M70; ASUS Crosshair V Formula-Z; FX 8350; Asus 7870; Samsung SyncMaster 2243SWX; coolmax CUG950B 950w psu; 8GB Kingston HyperX DDR3; Corsair M4 SSD 128GB, WD 1TB; x18 DVR212D; 7SP1
Capt. Shark Bait is offline   Reply With Quote
Old 08-18-07, 10:02 PM   #96
Digital_Trucker
Silent Hunter
 
Join Date: Jul 2007
Location: The Peach State
Posts: 4,171
Downloads: 141
Uploads: 10
Default A little behind the curve here,

I hate being so far behind, but I'm just now getting to getting sh4speech installed and ran into a bit of a problem. I've followed the installation instructions (unless I missed something somewhere) and run into the following error when I attempt to run the app

can't locate Time/HiRes.pm in @INC <@INC contains C:/Perl/lib C:/Perl/site/lib.> at go.pl line 13
Begin failed--compilation aborted at go.pl line 13.

I have active perl and python installed on C: and the sh4speech folder is also on C:
I followed the instructions to run the COM Makepy utility successfully. I tried rerunning the install.bat and received messages stating that Win32-Locale and Win32-API were already installed and got the "everything should be done now" message.

Any suggestions on a resolution would be greatly appreciated.

Thanks, and nice work on the project.
__________________

RSM-GIEP-Killflags-LV Tribute-Playable Elco __Peace be with you, Dave.

Digital_Trucker is offline   Reply With Quote
Old 08-18-07, 11:56 PM   #97
minsc_tdp
XO
 
Join Date: Mar 2007
Posts: 411
Downloads: 1
Uploads: 0
Default

Quote:
Originally Posted by Capt. Shark Bait
got it in jsgme but i gotta leave for work...now

i'm wondering if the orders are repeated back, ie: "make your depth 225ft." "make my depth 225ft, aye (sir)"
1. JGSME does nothing with sh4speech - it's a self-standing application that should run from c:\sh4speech. Check the readme for detailed installation info.

2. I make no effort to repeat them back, so you'll only hear them repeated back if those orders would normally be repeated back in game, which many are.
__________________
June 29 2016 - shSpeech v2.55 - Voice Command for Silent Hunter 4! View Thread
minsc_tdp is offline   Reply With Quote
Old 08-18-07, 11:59 PM   #98
minsc_tdp
XO
 
Join Date: Mar 2007
Posts: 411
Downloads: 1
Uploads: 0
Default

Quote:
Originally Posted by Digital_Trucker
can't locate Time/HiRes.pm in @INC
Any messages like these mean a Perl module isn't installed. If you used ActiveState Perl it should have included this but, who knows.

Any message like this can generally be resolved by typing this from a command prompt:

ppm install Time-HiRes

Those are case sensitive I believe - so the module name for HiRes.pm in the Time folder (Time/HiRes.pm) will always be called Time-HiRes. Another example, if it says it can't locate some/module/name.pm then you would type ppm install some-module-name
__________________
June 29 2016 - shSpeech v2.55 - Voice Command for Silent Hunter 4! View Thread
minsc_tdp is offline   Reply With Quote
Old 08-19-07, 12:07 AM   #99
minsc_tdp
XO
 
Join Date: Mar 2007
Posts: 411
Downloads: 1
Uploads: 0
Default

Quote:
finally I got it working in large part. If I run 'python hear.py' words with umlauts are recognized. I guess I 'just' have to train my speech recognition one or two more times.

But I saw another failure. (...error details...)
Wait, that detailed error looks like an error in hear.py. But you said when you run python hear.py that they are recognized, so that is a bit confusing. I'm trying to figure out which of the two is failing - hear.py or go.pl.

I ran some quick tests with go.pl and I see that, even if a valid umlaut voice command is forced in (not using hear.py but with my special trick), go.pl does not handle it properly. I'll look into it.
__________________
June 29 2016 - shSpeech v2.55 - Voice Command for Silent Hunter 4! View Thread
minsc_tdp is offline   Reply With Quote
Old 08-19-07, 12:10 AM   #100
minsc_tdp
XO
 
Join Date: Mar 2007
Posts: 411
Downloads: 1
Uploads: 0
Default

I just noticed an error message in 1.6:

"my" variable $x masks earlier declaration in same scope at go.pl line 346, <DATA> line 164.
"my" variable $y masks earlier declaration in same scope at go.pl line 346, <DATA> line 164.

I've fixed it (just updated 1.6 without changing the version number) since it was a harmless error that didn't affect anything.

By the way, you can run sh4speech from anywhere now, it doesn't need to be in c:\sh4speech.
__________________
June 29 2016 - shSpeech v2.55 - Voice Command for Silent Hunter 4! View Thread

Last edited by minsc_tdp; 08-19-07 at 01:53 PM.
minsc_tdp is offline   Reply With Quote
Old 08-19-07, 12:40 AM   #101
panthercules
The Old Man
 
Join Date: Apr 2005
Posts: 1,336
Downloads: 6
Uploads: 0
Default

Just noticed something while tweaking up the voice commands for depth and course as mentioned above - all of the course-related commands are relative to current heading (e.g., come right (or left) xx degrees). Is there any chance of making it work so that you could order a course in "absolute" terms, i.e., "make your course 60 degrees"? It seems like there should be some way to do this by formula, if there's any way to know what your current heading is, but maybe there's no way to automatically get this info to your speech program.

Perhaps you could set this via some sort of variable command (like you do with the resetting your tubes thing) - for example, first say "current heading xx degrees", followed by saying "make your course yy degrees". Then the program could compute how many degrees (zz) left or right you needed to go by properly comparing yy to xx, and then trigger the same mouse click command as if you had spoken "come left (or right) zz degrees".

Any chance something like that could work?
__________________
panthercules is offline   Reply With Quote
Old 08-19-07, 01:41 AM   #102
panthercules
The Old Man
 
Join Date: Apr 2005
Posts: 1,336
Downloads: 6
Uploads: 0
Default

Also just noticed what seems to be an error in the new 1.6 voice_commands.csv file - the setup items for the number of tubes you have on your boat are still numbered 61-64, which throws off errors in test mode. I think these are supposed to have been re-numbered to 200-203, to match up with the numbering in the new variables.csv file.

My personal tweaks on the course commands seem to have gone well, and once I renumbered the tube setup items the tube commands seem to be working well in test mode too. Can't seem to catch up with your version releases to actually get out to sea and try this out in game, but it's all good - keep up the great work
__________________
panthercules is offline   Reply With Quote
Old 08-19-07, 02:11 PM   #103
minsc_tdp
XO
 
Join Date: Mar 2007
Posts: 411
Downloads: 1
Uploads: 0
Default

Fixed the broken tube commands, updated to 1.61 for that. Thanks man!

There's just no way to do absolute headings. For two main reasons: 1. I have no way to know the current course of the ship, 2.) even if I assume it is North on game start with some kind of reset command, it would lose track quickly if you issued a second heading change while the boat is still turning to meet the first.
__________________
June 29 2016 - shSpeech v2.55 - Voice Command for Silent Hunter 4! View Thread
minsc_tdp is offline   Reply With Quote
Old 08-19-07, 03:14 PM   #104
panthercules
The Old Man
 
Join Date: Apr 2005
Posts: 1,336
Downloads: 6
Uploads: 0
Default

Quote:
Originally Posted by minsc_tdp
Fixed the broken tube commands, updated to 1.61 for that. Thanks man!

There's just no way to do absolute headings. For two main reasons: 1. I have no way to know the current course of the ship, 2.) even if I assume it is North on game start with some kind of reset command, it would lose track quickly if you issued a second heading change while the boat is still turning to meet the first.
I figured that there was probably no way to know from the game what your boat's current heading is - that's why I was thinking maybe as captain/speaker the player could tell your program what their current heading was to set a variable, like we do with the number of tubes we have - i.e., start by saying a command like "current heading 45 degrees", which would set the "current heading" variable at "45". Then follow by saying something like "make your course 120 degrees", which would set the "new course" variable to "120". Then, your program could compute via formula that the new course desired was 75 degrees (120-45) to the right of the current course, and issue the same mouse command that would be issued if you had spoken the command "heading right 75 degrees". Of course, the formula would have to take the 0/360 crossover point into account, so it would know that if "current heading" was 45 and "new course" was 320, it would need to issue the mouse command as if you had said "heading left 85 degrees" (45 plus the difference between 360 and 320), but while I don't know exactly how that formula would work it seems like it would be something fairly simple to program.

Just a thought, but what you have already done with the tubes and the relative course change orders already seems so magical I figured it wouldn't hurt to ask about this too - in any event, this is looking very cool so far
__________________
panthercules is offline   Reply With Quote
Old 08-19-07, 05:32 PM   #105
minsc_tdp
XO
 
Join Date: Mar 2007
Posts: 411
Downloads: 1
Uploads: 0
Default

Yeah I considered the "current heading 45" thing, but again, it would break if you issued a second course change while the boat was still turning. I don't like to implement things unless they're pretty foolproof. Besides, there are bigger fish to fry, such as these for v1.7 (don't hold your breath for these, it's going to be a while):

[first you lock a ship on the scope. then -]
"recognition manual" or "target ID" (TM only I believe)

[you get the ID done so the TDC is updated properly, then -]
"prepare for attack" (brings up various torpedo controls on attack scope)

[then you would do these in any order, but this would be the typical order]
"torpedo contact type [magnetic | contact only]"
"torpedo depth [0-50] feet"
"torpedo speed [low | high]"

"stadimeter" and/or "[increase | decrease] target distance 1-???? feet"
"[increase | decrease] angle on bow [0 - 360] degrees"
"[increase | decrease] target speed [1-??] knots" or "calculate target speed" (after two readings of course)
"mark" or "save" or "send to TDC" or "update computer" or whatever

"start position keeper" (making sure not to enable it twice which would turn it off)

Then you would fire or make further adjustments after cheating by looking at your PK line on the attack map (as I do hehe).

There's only two problems with this whole thing that I know of:

1. AOB dial stops turning if you turn it too far in one direction, but spins indefinitely in the other direction. Could be a problem after a few "increase aob" orders when it hits the wall and doesn't know it. Should be solvable by simply inverting "increase" requests of 5 degrees into 355 degree "decrease" requests, and always spin it that direction.

2. Some of these commands require multiple key presses and clickdrags, and I don't currently have a way to string those together, but it shouldn't be too hard to implement. I just want to implement this properly as a sort of "macro" like feature where people could string together a series of many commands, for example, you could set up a "crazy ivan" that stops the ship, enables silence, and turns of the radio and gramophone, and jumps to the command room just for atmosphere.

For example, increasing AOB on a target would involve this macro sequence:
A. Press the attack scope key to ensure we are there (unless you're already there or on attack map)
B. Click all of the TDC pullout buttons to ensure all computer panels are visible
C. Click the AOB button on the TDC
D. Change the AOB with a click/drag
C. Click the red "mark" button automatically (if I decide you shouldn't have to say "mark" after each one)

So there's four things to do. I'll probably extend the "parent" system that the CSVs already support, where A is the parent of B, B is the parent of C, C parent of D, and D childless. I just have to be sure it is not going to screw up when different types of parents are intermixed, which I'm pretty sure it will right now.

Anyway, don't hesitate to put out to sea with 1.6 since 1.7 will be a while. Unlike certain publishers we all know and love, I enjoy sharing what I'm working on long before I start and sharing exactly how I will do it so I can get community feedback.

As an aside, I'm thinking of putting a longer delay on all commands in order to allow you to say "belay that" which would cancel the last order before it is implemented. But this is pretty tricky.
__________________
June 29 2016 - shSpeech v2.55 - Voice Command for Silent Hunter 4! View Thread
minsc_tdp 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 09:33 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.