Log in

View Full Version : voice recognition?


minsc_tdp
07-22-07, 04:06 PM
I'm thinking of working on a voice recognition mod for SH4. As with many projects I consider starting, I think it would be pretty easy and have a rough idea of how to do it, but I'd first like to get thoughts from people here.

It would probably be a perl app since that's the only language I know, but I know it well and I know how to use the Win32 API with it. I'd use a similar approach as Enigma, where it would use the existing voice recognition libraries in Windows and translate them into keystrokes or other events. It might be tricky doing things like "rudder right 10 degrees" and other mouseclick only events with no equivalent key.

I'd be doing this mostly for myself but I'd like to hear if others would be interested, and whether folks here might help if I run into trouble?

skwasjer
07-22-07, 04:22 PM
There's already some tools out there, one I've been using for SH3 pretty much since I found it. It's called Shoot.

You can probably just use the same app (it's not related to SH, just a generic speech to keycommand app), but have to modify the config files that define the words/commands vs keys. I never got to it yet, but have thought about looking into this for SH4...

See here (or Google):
http://forums.ubi.com/eve/forums/a/tpc/f/9091085392/m/7401057692/p/1

Digital_Trucker
07-22-07, 06:48 PM
I, too, used Shoot quite a bit when I played SH3. It is a nice little prog for the price ($0). As soon as I get the keyboard commands set up to my liking in SH4, I'll be doing a profile and commands.cfg setup for it.

If you download it, make sure and download the profile editor that I wrote for it, too. It will save you tons of time working with the xml profiles.

Both the voice command program and the editor are available at http://clans.gameclubcentral.com/shoot/

minsc_tdp
07-22-07, 07:34 PM
I get a crash trying to load a simple profile with one command in Shoot:

An unexpected error occurred. Full error message:
Object reference not set to an instance of an object:
at shoot.config.Configuration.load(String filename)
at shoot.MainForm.loadProfile(String file)
at shoot MainForm.openDialog_FilOk(Object sender, CancelEventArgs e)
at System.Windows.Forms.FileDialog.OnFileOk(CancelEve ntArgs e)
at System.Windows.Forms.FileDialog.DoFileOk(IntPtr lpOFN)

Any help with that?

In the meantime, I've been experimenting with sending mouse input and keystrokes to SH4. Both work well. Here's an example of keyboard input:

use Win32::API;
my $keybd_event = new Win32::API("user32", "keybd_event" , [qw(I I N P)], 'V') or die "keybd_event: " . Win32::FormatMessage (Win32::GetLastError ());

use constant F1 => 0x70;
use constant SC_F1 => 0x3B;
use constant X => 0x58;
use constant SC_X => 0x2D;

while (1) { # keep pressing the key so i can switch to sh4
sleep(2);
press_key(C, SC_C); # Crash dive!
}

sub press_key {

my $bVk = shift;
my $bScan = shift;
$keybd_event->Call($bVk, $bScan, KEYEVENTF_EXTENDEDKEY, 0);
sleep(1);
$dwFlags = KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP;
$keybd_event->Call($bVk, $bScan, $dwFlags, 0); # release key

}

And here is an example mouse movement:

use Win32::GuiTest qw/:ALL/;

MouseMoveAbsPix(693,692);
sleep(1);
MouseMoveAbsPix(723,693);
SendMouse("{LEFTDOWN}");
sleep(1);
SendMouse("{LEFTUP}");
sleep(1);
# Speed is now set to Full, will break with different resolutions though.


So, assuming I can get the voice recognition code to work properly, which doesn't look too hard, I have everything I need for precise SH4 control, including specific depth levels and all the keys! Exciting... now to see if I actually finish this :)

If someone can give me a basic Shoot profile for SH4 that does even a few keys, I'll prefer that route and I'll probably go to the trouble of finishing the profile. I've heard it has trouble with certain keys like the backtick ` but we'll have to see.

minsc_tdp
07-22-07, 07:57 PM
BTW here is the shoot profile XML that crashes when I load it:

<?xml version="1.0" encoding="utf-8"?>
<!--- - - - -This profile created with Digital_Trucker's Shoot Profile Editor- - - - - - -->
<!--- - - please address all correspondence to Digital.Trucker@Yahoo.com - - - - - -->
<shoot-config>
<command-list key-delay="0.10">
<command name="C" phrase="dive" />
</command-list>
<push-to-talk initial-state="" />
</shoot-config>

I tried dropping in the new shoot.exe.config file at http://www.gameclubcentral.com/modules.php?name=Forums&file=viewtopic&t=3945 but it didn't work. When I load the EXE nothing happens, no process loads or anything. It looks like it only adds a new section, something about SupportedRuntime with a version number. Maybe they haven't updated this properly for .NET 3.0 yet?

UPDATE: I think it's because I only have .NET 2.0 installed. And you can have more than one at the same time, so I'm installing 1.1 and 3.0 (for thoroughness).

Digital_Trucker
07-22-07, 08:19 PM
Check out the sticky at the top of the game club central shoot support forum at http://www.gameclubcentral.com/modules.php?name=Forums&file=viewforum&f=39

It explains what you have to do to get Shoot to work with any .NET after 1.1. The author of the software hasn't updated it, but you can make it work as long as you have .NET 1.1 installed alongside 2.0 or 3.0. I hear he is in the process of rewriting it, but haven't seen it yet.

You can download my SH3 profile for Shoot at http://www.gameclubcentral.com/modules.php?name=Downloads&d_op=viewdownloaddetails&lid=425&ttitle=Silent_Hunter_III_EXPANDED

The only problem with that is that they changed the format of the commands.cfg file with SH4 and the key bindings file supplied with the Shoot profile will not work with SH4. You'll have to do the same thing I've been putting off (hoping that we'd get a nice tool like Setkeys for SH4) and that is map all the keys manually.

I may break down and go ahead and do it and get it over with. I think that's the last thing I need to do before I can start playing the game for real :rotfl: .

However, if you are going to write something that will handle the things that Shoot can't do, then it's all a moot point.

minsc_tdp
07-22-07, 08:58 PM
Thanks, I got shoot working by simply installing .NET 1.1.

It looks like it would be REALLY easy to finish this up for SH4 but the obvious drawback is that it does keyboard only.

I would really prefer to be able to, say, "set depth 150" but that would involve doing everything Shoot does from scratch to get the mouse support in.

Even if I had Shoot ignore "set depth x" and handled that with my own app running in parallel, given the amount of work to get that going and that we would both be using the Microsoft SAPI, I'd might as well do the whole thing.

What do you think? I could do the following voice actions which have no keyboard equivalents:

set depth 150
set rudder left 10 degrees
set course north by northeast
set time compression 1024
fuel
batteries
compressed air
co2

Version 1.0 would probably be those commands plus all the keyboard commands.

Version 1.1 could do a complete firing solution almost entirely hands-free (after locking a target):

targeting computer
stadimeter
target angle 30 degrees right (i'd have to adjust it from its current position, since there's probably no way to know where it is. probably better to leave this to the mouse)
lock it in (or) solution! (sends to the computer)
start the position keeper
(repeat above as necessary for multiple readings)
estimate target speed (crew would do it, or: )
increase target speed point 5 knots (for manual adjustment)

torpedo speed slow
gyro angle 10 degrees right
magnetic detonator
open tubes 1 and 2 (I see no reason I couldn't intelligently parse this into multiple commands)
fire tube 1!
gyro angle 15 degrees left
fire tube 2!

which would of course be immediately followed by:

crash dive! ahead flank! right full rudder! damage report! blow ballast! abandon ship! :p

panthercules
07-23-07, 12:55 AM
I had a blast using Shoot and yelling out commands in German to control my U-boat in SH3 - I too was planning to update/create a profile to use it in SH4, once all the patching and modding got to a reasonably stable point so I could play it again. I think it would be awesome if you could come up with a way to not only replicate the keyboard commands but to actually do mouse driven stuff like setting course to a certain compass reading (or by a certain number of degrees - such as "come right 20 degrees", or "left full rudder - steer 345 degrees"). Just be sure if you can to let the user customize the voice control phrase/triggers to whatever they want, rather than make them use/remember some arbitrary syntax that's hardcoded in - I know it was a lot easier for me to remember the commands in my Shoot/SH3 setup because I had decided what I wanted to say for the voice commands, raher than trying to memorize some commands someone else had decided on.

If you've got the skills to do this, I'd say GO FOR IT :yep:

I'll be waiting in line to download - just let me know when it's ready :up:

minsc_tdp
07-23-07, 01:46 AM
It would use plaintext definition files for all voice commands, keyboard input and mouse coordinates, as well as being entirely open source (perl) so there's no chance that someone couldn't make it do whatever they want. If it all works well then perhaps the community could localize it into German, Swahili, whatever.

At this point, from the tests I've done tonight, I know I can do all of it. I have yet to actually test the perl SAPI code but I'm optimistic that it will work. I'm a little worried about some of the click-and-drag functions, like rotating the target angle on bow but I see no reason it won't work. The precise mouseclicks have also already been tested OK.

I'll probably do it not only because I want to use it, and others would too, but also to have a nice project under my belt that I can cite in case I lose my job. :cool: "Personal: Developed a voice recognition software from scratch for use with a game using MS SAPI 5 and Win32 API" would look good on a resume don't you think? :know:

minsc_tdp
07-23-07, 07:32 PM
Well I should have known better than to say something is easy before starting it.

I've spent quite a bit of time today trying to get a simple speech-to-text recognizer written in Perl using Win32::SAPI5. There's few decent examples out there and the SAPI5 SDK is so convoluted. I'm surprised there's not a simple of example of "here's a valid word list, here's how you start listening, here's how you store what it hears, here's how you compare that to the list of good words, and then you print the word if it recognizes it." That's all I'm trying to do. I've got something close to working but not there quite yet.

panthercules
07-23-07, 07:36 PM
"Personal: Developed a voice recognition software from scratch for use with a game using MS SAPI 5 and Win32 API" would look good on a resume don't you think? :know:

Hey - it would impress me - if I had any money I'd hire you as my personal modder :yep:

And when you get this one done, I've got another suggestion for you - we could really use an automated captain's log parser/reader/whatever that would allow us to type up log entries (kinda like IL-2 Stab did for the Sturmovik series with its War Diary function) and then output/format it into a form that the game would recognize and be able to display them in the in-game log. See this thread for a discussion about how this works manually: http://www.subsim.com/radioroom/showthread.php?p=562220#post562220

Hey, maybe you could even combine this with your voice-recognition utility, so we could be like James Kirk and dictate our entries .... "Captains Log, star date 194112.07..." :D

minsc_tdp
07-23-07, 09:59 PM
Hey - it would impress me
It would impress me if I make this work at all at the current rate. I had no idea getting basic speech recognition in Perl would be so difficult! Help! I've blown hours on this already today.. can't get it to recognize a single word. It's close... there's a sample EXE that shows 7 or 8 events fire every time I speak and shows the words, and my script does the same thing but just shows a bunch of junk for the events themselves, no way to extract the words out!

minsc_tdp
07-24-07, 06:08 PM
Some good news. I've got a simple C++ app working and modded to taste that can feed perl the recognized phrases. From this and what I've done so far, I'm certain I can do this entire mod, so it's full speed ahead.

The only questionable bit is, will people bother to train their voice recognition systems for an hour or more before trying this to ensure good recognition... it's very boring. :) But once it's done the recognition improves a lot and that will be very important, since certain words are hard to get right ("gyroscope right 10 degrees" is not easy for even the most advanced speech recognizers out there since it's a sentence fragment, let alone something it may not see combined in that way very often.)

Fortunately I'll allow people to change it, so if everytime you say "gyroscope right 10 degrees" it hears "jerry scope light 10 daires" then you could add "jerry scope" as an alias for "gyroscope" and it would just work even when the speech engine gets confused (assuming it always gets confused the same way)!

Anyway, I'm excited about this project. I'll probably go silent running for a week or two while I pound the pavement on the first version.

Digital_Trucker
07-24-07, 07:04 PM
Cool, good luck with it. I guess that's a bit late since you won't see this 'till after the 2 weeks of working on it :rotfl:

panthercules
07-24-07, 07:34 PM
Just in case you do check back before you go deep and silent - the training issue would not be a problem for me if in the end the thing actually works well - I know I've had to train the Naturally Speaking program I used for general voice recognition, and I can't remember (been a while since I set up my Shoot for SH3) but I think that might have had to be trained as well.

Sounds great that you think you've cracked the code on this one - can't wait till you get this one finished off . I'll be glad to be testing it out while you turn your attention to the captain's log program I suggested in a previous post :D

minsc_tdp
07-25-07, 11:21 AM
Thanks for the encouragement. I'll be checking this thread periodically. I might start a different one when the first version is released, but will also notify here.

I've finished a reference file with all of the keyboard shortcuts that I will use, next is the mouse coordinate work. Here's the key file for anyone interested:

http://knepfler.com/sh4speech/commands.csv

corleonedk
07-25-07, 12:34 PM
Well you will have a fan here thats for sure,keep up the work :up:

minsc_tdp
07-25-07, 03:02 PM
There is one thing y'all could do to help. The only thing I'm skeptical on is how accurate the voice recognition will really be after it is fully trained. If you google the Microsoft Speech SDK 5.1, download that, and inside you'll find reco.exe and talkback.exe. This is a basic recognition example that I'll be using the core of. To use reco.exe, you just click the checkboxes called "Create Recognition Context", "Load Dictation" and "Activate Dictation". Talkback.exe you just run. Throw some commands at it and see how it does. Then, go into your control panel / Speech and train it. I'd suggest to do the initial session and then the additional training.

In control/panel speech, you might have a 5.1 Recognizer and a 6.1 Recognizer. Honestly I'm not sure which one these utilities (and mine) will use. If anyone can help me figure that out, great. Otherwise I'll probably end up recommending that people just train both fully (can't hurt) unless I stumble on the answer.

So that's what I'll be doing tonight mostly, training training training to see how accurate I can get it.

If it always hears the word "bananaphone" when you say "gyroscope", it's not too big of a deal since you will be able to just add that as an alias. But if it comes up with 5 or 10 different things every time you say the same word, that's going to be harder for users to deal with. Ideally we want it to only hear the word you say or, at the very least, a "consistent mistake".

Let me know what y'all find out, I'll do the same! I think I need a new headset/mic though, mine kind of sucks :)

UPDATE: I went and bought a cheap mic at Guitar Center (which mean $100 microphone) to eliminate all bad sound input and ensure that the Microsoft SAPI is working to its full potential. I've done three training sessions, plus the intro so I've been training it for 40 straight minutes. It's not bad, but it has trouble with certain terms. Rudder amidships is damn near impossible for it to figure out, a lot of the trouble is these short phrases. Instead of saying "bridge" it's more likely to understand you if you say "let's go to the bridge". This might not be a bad thing as more natural speech would be more fun than belting out single words and very short phrases. It also has a lot of trouble with "port" and "starboard"... which really sucks. I'd like to hear how other people's speech recognition fares.

panthercules
07-25-07, 11:26 PM
Wow - with just the initial training plus one more module (Aesop's Fables), this really stinks at recognizing my voice commands - both in an absolute sense of thinking I'm saying something else, and in the sense of not being very consistent with what it thinks I'm saying from one time to the next (when I repeat the same commands).

I'll do some more training and see if it gets better - seems I was having much better luck with Shoot back in the SH3 days - of course, there I had a particular, lmited set of commands I gave it and was basically manually telling it what I was saying, but once I had done that it did a great job of recognizing it correctly when I said the same thing again.

[edit] Fascinating - when I went back in and just used the reco.exe this time (I was using both it and the talkback one before), before I did any more training, I was getting much more accurate and more consistent results - not perfect, but a lot better. Weird - gonna do some training and see what happens.

[edit] After further training, it seems to be doing better, but it still seems to be suffering from the method/concept that it needs to be trying to recognizing a virtually infinite number of things I might be saying out of a virtually infinite number of possible things to say (i.e,. the entire English language), and thus is trying to use logical/gramatical algorithms to try to "make sense" out of what it is hearing. This has got to be much tougher, and more prone to errors (particularly when what's being said are short nautical/military phrases that aren't what "normal" people would say) than the approach I believe Shoot (and some other/older speech recognition applications) takes. In that approach, you give it a limited set of commands (probably not more than 20 or 30, since at least for me that's about all I can remember, although you could always create a crib sheet list of commands to help you remember more I guess), and all it has to do is try to tell which one of those commands it's hearing - since it's only dealing with a very limited set of possibilities and you've basically trained it by speaking those commands and telling/confirming that it's heard you correctly, the recognition accuracy for any given level of computing power can be extremely high compared to trying to do this "figure out what I might be saying out of all possible combinations in the English language" approach this reco.exe thing seems to be using.

Is there some way to give this reco.exe thing this sort of limited vocabulary/command set, and then test it to see if it's working well?

CaptainKobuk
07-26-07, 01:09 AM
Game Commander 3 is what i've been using for years on especially games like this involving a crew. It's an older program that's not being updated anymore but it still works flawlessly in all games.

I've tried "SHOOT" and it's voice recognition was very spotty in my opinion. But that was years ago. It could be fine now.

Being set free of a keyboard greatly relaxes gaming in my opinion.

CaptainCox
07-26-07, 01:14 AM
My wife would divorce me for real, if i stared to talk to my PC. She thinks I am nuts with my "PC" love affair as it is anyway.

CaptainKobuk
07-26-07, 01:24 AM
At 3am i do wonder what my nieghbors think.

"Dive dive dive!!!"

They gotta wonder what is going on eh? :rotfl:

skwasjer
07-26-07, 03:05 AM
Nothing compared to my Quake III addiction years back. That was swearing and yelling pretty much non-stop every night on TeamSpeak. :roll:

minsc_tdp
07-26-07, 03:23 AM
Panther, you've nailed the problem with generalized recognition (reco.exe method) exactly. I've been mulling this since the start. The SAPI5 SDK has a system where you can supply a limited set of words/phrases that it should compare against and I believe it will do exactly what you're talking about. Unfortunately, the SAPI5 SDK is extremely complicated and convoluted.

I thought it was just my amateur perl programming skills, but I talked to a highly paid programmer/co-worker who groaned at the mention of the SAPI5 SDK. But what you're talking about may be exactly what needs to be done.

I'm going to try to recruit his help but failing that, I might try to muscle through it using a language close to the provided samples - Visual Basic (ugh) - and with the proper IDE helping with object methods and whatnot, it should be a little easier. So all this little utility would do is try to match a phrase from a list, and when it matches, returns it to my perl script where I can do the remainder of the heavy lifting with ease.

If anyone wants to tackle this part, chime in!

kaliber7
07-26-07, 01:06 PM
I have been using 'Voice Buddy 3.0' for both SH3 and SH4 and have had no problems at all. The mouse-click commands can be key-mapped and these mapped keys can be used in the voice profile and trained.

I only have to train each command 2-3 times and the more I use each command within the game, the easier it becomes.

panthercules
07-26-07, 10:36 PM
I have been using 'Voice Buddy 3.0' for both SH3 and SH4 and have had no problems at all. The mouse-click commands can be key-mapped and these mapped keys can be used in the voice profile and trained.

Based on my experience with Shoot in SH3, I'm convinced that it could be used here just fine to handle any of the game commands that can already be mapped to key strokes. I haven't played around with setting up a profile in Shoot to do that yet, as I have been waiting to get the patch and mods situation stabilized and really start playing. The fascinating part of this thread has been the idea that you might be able to use voice commands to do things that, as far as I know, have to be done by mouse in game - principal ones being changing course (and actually, since I always play with the mouse rather than the keyboard whenever possible, I haven't yet really studied the key map capabilities of the game to know what can be mapped to keys and what can't) - are there any course change commands at all that can have keys assigned to them? (besides rudder settings, which I assume can be to somedegree at least). What about depth?

The more I thought about what I posted above about unlimited/natural language recognition versus limited specified-command recognition, I started getting worried because I couldn't really see any good way other than natural language approach to be able to do the course and depth changes stuff. However, then it dawned on me that maybe you could set it up so you would say the commands one number at a time (which I've heard done actually) - like "make your course one five zero", or "make your depth two one five" - that way you'd only have to specify the ten numbers 0-9, rather than every number between 0 and 359 (or more for depth).

Thus, I think the specified command recognition method could probably work as far as getting your commands recognized - the tricky part to me would be how to translate the fact that the program recognized that you said "make your course one five zero" into some form of instruction to the game to actually set your course to 150 degrees unless that can somehow be set to equate to a key stroke/combination. How does that Voice Buddy thing go about mapping the mouse clicks to keys? How does it know how to tell SH4 that you want SH4 to do something that it doesn't have a key assigned to do?

minsc_tdp
07-27-07, 12:52 AM
I have been using 'Voice Buddy 3.0' for both SH3 and SH4 and have had no problems at all. The mouse-click commands can be key-mapped and these mapped keys can be used in the voice profile and trained.

Panther is right. Let me know when you can key-map "gyroscope right 5 degrees" :D Moving the mouse has already been tested and works. Moving dials is trivial.

However, then it dawned on me that maybe you could set it up so you would say the commands one number at a time (which I've heard done actually) - like "make your course one five zero", or "make your depth two one five" - that way you'd only have to specify the ten numbers 0-9, rather than every number between 0 and 359 (or more for depth).

That's what I've had in mind the whole time. However, since strings of words must be recognized as a known string of words, I might have to plug in all 360 spoken degree combinations. But that's not a big deal. If not you just have to speak a little slower so it recognizes every word - the recognition API tends to wait before deciding on a match as it uses strings of words to make that determination. That means you'd have to pause, so putting in all the combinations would help recognition a lot.

So, for those who are hoping for voice control over more than just key-mappable functions, I have good news. I've adapted a python script I found and it works flawlessly. As panther suggested, getting SAPI to focus on trying to match only certain words makes a world of difference, versus the entire english dictionary. Here's an example - as soon as I got it working, I entered these words into the list and tried it - it nailed every word the first time without repeating.

C:\sh4speech>python hear.py
Zero
One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Niner
Gyroscope
Torpedo
Rudder
Right
Left
Minsc rules
Shoot drools

C:\sh4speech>

Play with it here if you like:
http://knepfler.com/hear.py

You'll probably want ActivePython, which includes the necessary win32 extensions, and possibly wxPython as well.

I also worked today on my long forgotten middle school geometry. To move a dial 3 degrees, figuring out all those from-to pixels on multiple resolutions would be a pain. Now, all I need to define for each resolution is the x/y coordinate of the center of the dial, and the radius in pixels. With the angle(a) you supply, sin(a) and cos(a) give me the number of pixels from center to the point. Then I just click at top dead center, hold, move to the new coordinates, and release. Cool eh? I had forgotten how useful basic math could be. :)

kaliber7
07-27-07, 02:28 AM
As far as diving to any particular depth is concerned, I just use the command 'Dive the boat', keep my eye on the depth guage and when approaching the required depth, give the command 'Maintain depth'.

As far as changing course is concerned, I use the command/s 'Hard to port/starboard' and when approaching the required direction, I give the command 'Rudder amidships'. Or, if I have a course plotted on the map and have strayed from it during combat, I use the command 'Return to course', once the combat situation has been resolved successfully.

Presently, I have not been able to find a way to map keys to give specific depths or compass points (using Voice Buddy 3.0), but I hope to eventually solve that problem some time in the not too distant future.

minsc_tdp
07-27-07, 07:48 PM
As far as diving to any particular depth is concerned, I just use the command 'Dive the boat', keep my eye on the depth guage and when approaching the required depth, give the command 'Maintain depth'.

As far as changing course is concerned, I use the command/s 'Hard to port/starboard' and when approaching the required direction, I give the command 'Rudder amidships'. Or, if I have a course plotted on the map and have strayed from it during combat, I use the command 'Return to course', once the combat situation has been resolved successfully.

Presently, I have not been able to find a way to map keys to give specific depths or compass points (using Voice Buddy 3.0), but I hope to eventually solve that problem some time in the not too distant future.

You make some very good points here. You're probably right that, with voice, the dive/maintain method is perfectly fine. I have to admit that perhaps the voice control of precision manuevering, gyroscope rotation, AOB, etc. might be a bit overkill. I recall reading in some manual somewhere that you can be more easily detected if you turn your rudder too fast hard to port, and small steps were encouraged when silently avoiding a DD. Anyone know if this is true in SH4?

This conversation about key vs. mouse stuff has been very helpful, thanks a lot!

I've decided I will focus first on version 1.0 which will strictly do keyboard stuff, and consider whether to do 1.3 (lol) which would include precision dial controls. I really like the idea of setting up a torpedo shot vocally, and tweaking my rudder a few degrees vocally, as some of the most tense moments in the sub movies were during these moments.

minsc_tdp
07-27-07, 09:57 PM
Panthercules, I'm very curious how well hear.py works for you, can you give it a try for me

CaptainKobuk
07-27-07, 10:18 PM
Even with Game Commander 3, i still greatly appreciate having a tilt scroll wheel on a mouse for steering left/right. The setting i've used most is hard left or right.

Where a command is very often repeated the mouse is best. What's coolest about voice commands is ordering the crew to battle station or emergency dive, etc. These "captain" type games can get very immersive that way.

Ordering soldiers around in Armed Assault (operation flashpooint 2) is another fantastic game to play as a "captain".

panthercules
07-28-07, 01:14 AM
Panthercules, I'm very curious how well hear.py works for you, can you give it a try for me

Will be happy to, but I'm going to be spending most of the weekend building a new PC and moving bits around between about 3 others, so it may be a couple of days before I can check into this stuff again, even if all goes well with the PC construction job (and something always seems to go wrong somewhere along the way, so even that time line may prove to be optimistic, but I'll check it out as soon as I can).

This still sounds very promising, but I really hope that you can figure out how to make it work to command a specific depth or course rather than have to go with just the dive/maintain and hard rudder/amidships approach - I'd really like to be able to order a depth and go do something else without worrying that I'll forget to say "level off" and send us all to the bottom (or forget to say rudder amidships and sail around in circles).

Your comment about the string of words maybe having to include all the possible degree combinations ir probably right on target, much as it pains me to realize it. I remember when I was training Shoot for my German profile for SH3, I entered each separate word into the custom dictionary (e.g., "kleine", "langsame", "fahrt" and "voraus"), and then it would recognize each word separately as I put them together in various phrases. However, in order to tell it what to listen for when I wanted it to send the particular speed command, I did have to tell it to look for each specific combination of words (e.g., "kleine fahrt voraus", "langsame fahrt voraus"), so if you are going to be able to give granular, degree-by-degree course commands it looks like you might well have to define a separate command for all 360 degree phrases, which I was hoping to maybe avoid by calling out the numbers one by one. Too bad :(

Still, even if it proves to be too much to be able to command course changes to specific degree courses or in 1-degree increments, being able to do it in maybe 5 or 10-degree increments ("come right 10 degrees", or "come left 45 degrees", etc.) would still be really cool. Same thing with depth - even if you can't order depth in 1-foot increments, being able to do it in 10 or even 20 foot increments would still be pretty cool. You could still use either the mouse or the dive/maintain or hard rudder/amidships approaches as well if you wanted some intermediate results, since the latter are already key-mappable.

Keep up the good work :up:

minsc_tdp
07-28-07, 01:39 AM
On Monday and Tuesday I will be on a business trip, and then I will be visiting family for the rest of the week. I will have a laptop and might do some work here and there but I doubt I'll do much on this next week at all. Please don't think I've abandoned the project! I'm quite obsessed with this, and while I'm fickle with such things at times, I'm committed to getting this done! The more I work on it, the cooler it gets.

I just finished creating voice command aliases for all of the major key commands. Some just have one, but others have many variants, and it's so easy to add them, I've thrown in some fun ones, and you're free to add your own when you start using it. "Let's have a look" for the observation periscope, for example. It really sucks when there's just one command, like Enigma, that sounds so unnatural. This will rock.

I realized today there's going to be a lot more mouse-driven events than I thought, since many MANY functions don't have default key mappings (um, battle stations? Depth below keel? hellooo?) so I'll probably work these in to the first version. The dials will probably wait and getting these simple click based ones in will be a good opportunity to tune in the click delays and such to ensure the mouse commands are reliable before moving onto the trickier dials.

BTW, I'm thinking on the "come right three four zero", I've got a pretty solid plan on how to do this. Since each possibly speakable phrase must be known to the voice rec when it loads, I'm going to write a routine that takes all voice commands that require numbers (like indicating "come right" has property=numeric argument, range=1-360) and simply generates all the additional voice combinations for 1-360 from a lookup list, and it will just magically load them all in. However, when you rotate the gyro dial 90 degrees, it only changes the gyro angle like 15 "gyro degrees" though, so I'll have to account for that somehow too (should be a simple multiplier, ie, "gyro right 15 degrees" secretly means "gyro right [15*6] degrees").

Payoff
07-28-07, 09:15 AM
This sounds very interesting. Too bad they did'nt include in game voice commands such as "Sub Command" did years ago for all the incremental stuff. Keep up the good work.

minsc_tdp
07-28-07, 05:31 PM
Version 1.0 is done and out the door!

http://www.subsim.com/radioroom/showthread.php?p=606880#post606880

No mouse stuff yet.
Full support of all default key commands.
Several good additional voice command entered for certain commands (like "quiet" and "silence" in addition to "silent running" for silent running mode)
Excellent voice recognition! I am ecstatic about how well it is working. Be sure to read the guide on tuning your mic and configuring and training speech!

This thread is officially closed, please move all discussion to the other. Thanks everyone!

Mods, please lock this thread?

skwasjer
07-28-07, 06:36 PM
I have not tested your release, too busy with my own project :p

I did think of one thing: with mouse related commands, try to keep in mind the different resolutions people will be using. You could use screen offsets instead of absolute values in the config, so that users would only need to specify their resolution, and the tool calculates where the actual click must take place. Like for rudder: bottom - n pixels, right - n pixels. Otherwise, it would be a serious pain to recreate configs for all resolutions (don't forget widescreen!).

minsc_tdp
07-28-07, 11:06 PM
I have not tested your release, too busy with my own project :p

I did think of one thing: with mouse related commands, try to keep in mind the different resolutions people will be using. You could use screen offsets instead of absolute values in the config, so that users would only need to specify their resolution, and the tool calculates where the actual click must take place. Like for rudder: bottom - n pixels, right - n pixels. Otherwise, it would be a serious pain to recreate configs for all resolutions (don't forget widescreen!).

Yeah I'm keenly aware of that, it's not as simple as an offset since the controls are completely moved for the different resolutions. The x/y coordinates of everything would need to be done for all resolutions no matter what.