Vvvv to CryEngine - Keyboard Input/Output

Hi everybody,

I’m new to vvvv and I got a simple question. I’d like to make a scene I created in CryEngine 3 Sandbox controllable with my voice. I found Speech for vvvv and I got it up and running. Nearly no problem. It triggers keyboard keys up on a defined list of voice commands. I say “Door” and vvvv “presses” the “u” key on my keyboard.

So far so good.

But next i’d like to get this input to CryEngine3 Sandbox. I set up a so called “Flowgraph” inside of CryEngine3 Sandbox(a node-based scripting system like vvvv provides) and were able to open a door when I press the physical “u” key on my keyboard. When I press “i” it’s getting closed.

But when I try to use vvvv to output a keypress nothing happens. I can see the keypress output in my notepad editor and in the CryEngine3 Sandbox Console line. But the output don’t affects any in-game actions. I can press the physical key on my keyboard to open the door in CryEngine3 Sandbox.

I’m confused about that. Is the vvvv key pressed output different from the physical input my keyboard provides?

Does anyone have experience in is field and is able to help me, please?

Attached you can find my testing patch. It alters between the keys “u” and “i”. Credits for this one go to MSBERGER. Thank you.

Best Regards,

huppys

P.S.: I apologize for my weird english sentences.

simulatekey.v4p (5.1 kB)

This totally depends on how CryEngine handles key inputs.

Most game engines do this on a very low level to prevent injection of key events into them (cheating), what you are basically trying to achieve. This means: vvvv can only inject keystrokes into the Windows messaging system, but CryEngine doesn’t use that - it directly gets data from the physical device.

Thus, directly sending keystrokes might not be possible. What you can do to get your data in some other way into CryEngine: build some kind of receiver which either listens for key strokes differently - not using the built-in key receiver - or receives data in another way (e.g. OSC). Haven’t used the CryEngine, but with the Unity game engine and probably every other system-where-cheating-might-be-a-problem it’s quite similar - you have to built your own backdoor.

Thanks for your kind and precise answer. I saw a connection between Kinect and CryEngine via TCP. So I will concentrate on that. In vvvv I should use the OSC nodes, right?

Thanks for your kind and precise answer. I saw a connection between Kinect and CryEngine via TCP. So I will concentrate on that. In vvvv I should use the OSC nodes, right?

my guess is that the cryengine gets its keyboard state from the hardware directly. see http://freesdk.crydev.net/display/SDKDOC4/CryInput
i don’t think they follow the winapi model of input handling (http://msdn.microsoft.com/en-us/library/windows/desktop/ms646267(v=vs.85).aspx). our keyboard node uses SendInput internally, which from my understanding, will only send a message to windows, but will not affect the hardware’s state.
i think what you’d need to do is write your own keyboard input device for the cryengine (see link above) in order to translate the windows messages.
alternative would be a virtual keyboard driver, which would get its data from some special vvvv node. but sounds like a lot of work too. :/

hey, was too slow ;)

I found a great OSC-Plugin for CryEngine 3 Sandbox:
https://github.com/hendrikp/Plugin_OSC

It’s packed in this CryEngine-Plugin-Repository from “hendrikp”:
http://hendrikp.github.com/Plugin_SDK/

And think I don’t have to say more than: I works.
Inputs from my HP smartphone are working, too.

Additionally I found a quick tutorial about setting up the osc plugin for CryEngine 3 Sandbox:
http://www.youtube.com/watch?v=I7rWbfCllt8&list=PL1DcRWGqhCQRIBhLfd9pyfeyH-GZZobkR&index=2

Thank you for your advice about the osc interface. It help, obviously.

Best Regards,

huppys