Skyrim and Hydra

Talk about Head Mounted Displays (HMDs), augmented reality, wearable computing, controller hardware, haptic feedback, motion tracking, and related topics here!
Post Reply
ikedude
One Eyed Hopeful
Posts: 14
Joined: Sat Sep 15, 2012 9:42 pm

Skyrim and Hydra

Post by ikedude »

Long-time lurker, thought I should try and actually contribute something, ha.

So, after playing around with the awesome Hydra Tuscany demo I really wanted to try and get something like that working in Skyrim.

I think it's finally in a state where it's somewhat workable and wanted to share the fun if people are interested. Here's a little demo:

http://www.youtube.com/watch?v=wBT_A2s9x_s

A prerequisite is Script Dragon.

After installing, you can drop this file in either the main install directory or create an "asi" folder and drop it in there.

https://dl.dropboxusercontent.com/u/10464544/Skydra.asi

At startup it expects the hydra controllers to be sitting on the base, in the little slots. Once they are ready it will display "Controllers Ready!" in the upper-left corner.

With the controllers still on the base, hit the middle button on each one and it will set this as the reference position.

Pressing '4' on either controller will put a dragon claw 'hand' in the controllers position. If you press '4' while a claw is on-screen it will disappear and any held item will just fall. You can press the middle button again now, even hold it until you feel the on-screen position and orientation of the claw matches your controllers.

The left stick is set up to use WASD at a 50% threshold, I haven't quite figured out how to fake full analog movement. The right stick emulates mouse control and is analog, might wanna play with the mouse sensitivity till it is how you like.

On the right controller, '1' is mapped to space bar (jump), '2' is mapped to left alt (run), '3' is mapped to 'E' (interact). When the right bumper is pressed, a red apple is created in the position of the claw, just to give you something to throw around easily. The left bumper gives you a sword. You can transfer objects between hands, grabbing something will just move it from one hand to the other.

Pulling the trigger past 50% on either hand will attempt to grab a nearby object. With the way Skyrim is set up, it's not easy to make this work for all items so I had to make a compromise. Before you can grab objects with the claw, you have to pick it up using a long hold on 'E' ('3' on the right controller). Once you've grabbed the object, you can drop it again and now pick it up with the claw. Each time you add an item like this, it gets stored in a file called "grabableFormList.log" which means it will persist across play sessions, and it should be automatically created. This file just has the hex form ID for each object that can be picked up.

There are a few problems still. While running around, the claws tend to update asynchronously so they glitch around a bit, but if you stand still it is pretty smooth movement. Make sure to put the claws away before going through any doors, fast traveling, or saving (otherwise it'll most likely crash). Also, the controls don't work in any menus, for some reason scripts don't run so I can't pass in key-presses. I'd probably be better off using the Motion Creator but that seemed a lot harder, ha.

Anyway, please give it a try and let me know how it goes. Thanks.
JMX
One Eyed Hopeful
Posts: 13
Joined: Fri Aug 03, 2012 4:27 am

Re: Skyrim and Hydra

Post by JMX »

This is really cool! I just got Skyrim to try out with this and Vireio when my Rift arrives in a few days. The physics interations are pretty good!

It would be great if it could automatically detect all objects, or at least some types of objects. I think the Fallout 3 script extenders had some functions for getting different types of near objects, so Skyrim might have something like that.

I got a crash when trying to pickup/carry the claws. Is there a way to fix or handle that in the plugin? Maybe a non-interactable object could be used for the hands?

Thanks for making it!

Some suggestions:
Button/stick configuration options?
Put it on sourceforge/github or somewhere so other people can help work on it?

I got analog movement in Skyrim working by using this to emulate xbox controller input using the hydra http://sixense.com/forum/vbulletin/show ... on-0-4f%29 It seems to work pretty well so far, but I still need to get a good button config worked out. It seem like both the xbox controls and the hydra plugin control are running at the same time, so I guess right now the full analog is only working at less than 50%, then the plugin's wasd controls kick in.

It might also work to script freePIE to emulate the xbox controller with the hydra.
ikedude
One Eyed Hopeful
Posts: 14
Joined: Sat Sep 15, 2012 9:42 pm

Re: Skyrim and Hydra

Post by ikedude »

I got a crash when trying to pickup/carry the claws. Is there a way to fix or handle that in the plugin? Maybe a non-interactable object could be used for the hands?
I wanna switch to a non-interactable object. There are some perfect hand models in game but they aren't separated into a right and left hand, and I have yet to figure out blender / NifSkope well enough to fix that.
It would be great if it could automatically detect all objects, or at least some types of objects. I think the Fallout 3 script extenders had some functions for getting different types of near objects, so Skyrim might have something like that.
The only function available right now is http://www.creationkit.com/FindClosestR ... ist_-_Game. Maybe SKSE will add other functions but ScriptDragon and SKSE aren't really compatible in that way, unless the author of ScriptDragon ports over those functions which I don't see happening.

I've updated the file, it now adds some simple collision detection for weapons, so you can do damage :D

http://www.youtube.com/watch?v=u_1fhU4XXAA

The bumpers have now been changed, when the claws are out it switches to the weapon you have equipped in that hand. Press it again and it switches back to the claw. Shields will show up but they don't really do anything... you could push people away with them I guess but they don't block hits. Also, any object that you are holding with the claws can be used as a weapon, the hit detection might not work very well for objects not shaped like a weapon (say a plate).

Right now damage is only dependent on how fast the tip of the weapon is moving. So, your level or the strength of the item doesn't affect it. Use whatever sword you like best, ha. Since the damage doesn't scale as you get stronger, right now you're a little over-powered at the beginning of the game but I'm sure it gets tough pretty quickly. Probably a good idea to roll a new character just in case.
Ziggurat
Cross Eyed!
Posts: 189
Joined: Fri May 03, 2013 12:48 am

Re: Skyrim and Hydra

Post by Ziggurat »

Oh this is getting along very nicely!
I am kind of nerdgasming about how this mod will turn out in the end. :woot

Will follow your progress! Keep up the good work!

A tip for you is to check out http://vrmods.wordpress.com/ I guess you know about it already, here is the MTBS3D thread from the same guy I was just thinking that maybe you could see some things that worked for him, and some things that did not. Not everything is applicable though. And I know I probably have not brought anything new to the table :)
ikedude
One Eyed Hopeful
Posts: 14
Joined: Sat Sep 15, 2012 9:42 pm

Re: Skyrim and Hydra

Post by ikedude »

I've made an update to change how things work for combat. Damage is based on the formula found at UESP:Weapons with the addition of a speed multiplier. Based on how fast you swing the weapon the damage increases. Highest I've seen is around 1.7x which seems reasonable.

Code: Select all

displayed damage = (base damage) * (1 + 0.5 * skill/100) * (sqrt(velocity) / minimum velocity)
Also, I've adjusted the collision detection so it should register hits a little better. I've mainly tested with humanoid enemies, so if you run into anything weird let me know.

Shields aren't as useless as I thought...

http://www.youtube.com/watch?v=wIXmZJkQ-Pk

Also saw it block some ice projectiles, which makes magic combat more interesting, ha.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11406
Joined: Sat Apr 12, 2008 8:18 pm

Re: Skyrim and Hydra

Post by cybereality »

Nice.
Pheregrim
One Eyed Hopeful
Posts: 6
Joined: Tue May 07, 2013 11:41 pm

Re: Skyrim and Hydra

Post by Pheregrim »

This is really interesting :D Keep us updated :) /subbed
8bit
One Eyed Hopeful
Posts: 28
Joined: Mon Feb 04, 2013 1:20 pm

Re: Skyrim and Hydra

Post by 8bit »

Dude that arrow blocking is awesome. I can't wait to get my Rift and experience this.
GML
One Eyed Hopeful
Posts: 1
Joined: Sun May 19, 2013 2:40 am

Re: Skyrim and Hydra

Post by GML »

I think it is really a good job, I registered especially in the forum in order to praise and encourage you. The main issue seems to be that ennemies are pushed by the weapons, maybe it would be better to simply kill them instantly ? It would break the gameplay balance (but I don't think balance is a matter for now) but it would provide a better feeling I think. Anyway this is a great work !
ikedude
One Eyed Hopeful
Posts: 14
Joined: Sat Sep 15, 2012 9:42 pm

Re: Skyrim and Hydra

Post by ikedude »

Thanks for the encouragement! Insta-kill's might work a little better, but I like having to fight.

I've been working with two handed weapons, trying to figure out the best control schemes. I think it works pretty well.

http://www.youtube.com/watch?v=a3YTw2WAG0k

I haven't gotten very good with the bow, aiming is way harder, ha. I roll back from the table because I've noticed weird results when my hands get too close to the base station.

I've uploaded the new file to the same spot Skydra.asi

Main changes:
-single-handed and two-handed weapons now give experience

-two-handed axes and swords now actually use both hands
  • -left hand controls the "base"
    -right hand controls the rotation around the shaft
    -line connecting the two hands should match the shaft of the weapon
-bows can be fired now
  • -left hand controls the bow
    -right hand can grab arrows from the quiver (uses your equipped arrows)
    -with arrow held if you bring the two hands together it "notches" the arrow
    -arrow direction is dictated by the line connecting the two hands
    -bow can be rotated around the arrow with the left hand
    -release the trigger and it'll fire
I've noticed some weird aiming issues with the bow, so if you run into anything please let me know and I can try and track it down.

I'm thinking it might be nice to be able to specify handed-ness, then the role of the hands for two handed weapons would be reversed. But, I'm not left handed so I don't know how awkward this setup is, ha.
Ziggurat
Cross Eyed!
Posts: 189
Joined: Fri May 03, 2013 12:48 am

Re: Skyrim and Hydra

Post by Ziggurat »

Glorious progress!
I think that this will be more than playable before I get an Oculus Rift !! :)
So basically what is left for this to be playable is to make NPC's recognise that your attacks are yours?
Also cant wait to see arms blended in! Maybe you can make it draw the whole character and control the animation of the arms (you might need help for that?)

How does the placement of your virtual hands compare to your head in virtual space? I am thinking of use with the Oculus Rift of course.
nvman90
One Eyed Hopeful
Posts: 13
Joined: Thu Mar 15, 2012 10:32 pm

Re: Skyrim and Hydra

Post by nvman90 »

Great works, this looks awesome! Can't wait to see the progress of this mod.

I tried it out, found a bug, I was holding a sword and shield while in a house. When I exited the house I was carrying a tree and a rock.
ikedude
One Eyed Hopeful
Posts: 14
Joined: Sat Sep 15, 2012 9:42 pm

Re: Skyrim and Hydra

Post by ikedude »

Ziggurat wrote:Glorious progress!
I think that this will be more than playable before I get an Oculus Rift !! :)
So basically what is left for this to be playable is to make NPC's recognise that your attacks are yours?
Also cant wait to see arms blended in! Maybe you can make it draw the whole character and control the animation of the arms (you might need help for that?)

How does the placement of your virtual hands compare to your head in virtual space? I am thinking of use with the Oculus Rift of course.
There is a line commented out that makes an NPC start combat with you with you when attack them (except the bow, that's a little harder). It was a lot easier to test without being killed by a guard in 5 seconds, ha. I don't really have any plans to do arms/hands right now. That would be a lot more work.
I tried it out, found a bug, I was holding a sword and shield while in a house. When I exited the house I was carrying a tree and a rock.
I'm amazed it didn't just crash on you. Before going through doors, fast traveling, etc. you need to put everything away (button '4').
dariusu
One Eyed Hopeful
Posts: 15
Joined: Wed Jun 05, 2013 8:34 pm

Re: Skyrim and Hydra

Post by dariusu »

I'm getting "Controllers Failed" when I start up Skyrim with this script. FYI, I am also running SKSE and did make a custom .mce for Skyrim.
ikedude
One Eyed Hopeful
Posts: 14
Joined: Sat Sep 15, 2012 9:42 pm

Re: Skyrim and Hydra

Post by ikedude »

Are the controllers on the base station when you start up skyrim? Otherwise I've had it fail before and the only way I found to fix it was to restart my computer. I'm still trying to track down what causes that.
dariusu
One Eyed Hopeful
Posts: 15
Joined: Wed Jun 05, 2013 8:34 pm

Re: Skyrim and Hydra

Post by dariusu »

Restarting the PC helped, thanks.

BTW, is there something like scriptdragon that can be used with fallout 3 or fallout NV to do something similar to this?
ikedude
One Eyed Hopeful
Posts: 14
Joined: Sat Sep 15, 2012 9:42 pm

Re: Skyrim and Hydra

Post by ikedude »

The closest thing would be using the NVSE (New Vegas Script Extender) and writing your own plugin. That should allow you to bind the sixense library calls to a scripting function and you can do all the scripting in game. SKSE (Skyrim Script Extender) doesn't have support for plugins that hook into papyrus so I had to use Script Dragon. Hopefully that will change in the future because SKSE adds a lot of nice functionality and is more accepted than Script Dragon.
User avatar
nanicoar
Cross Eyed!
Posts: 101
Joined: Mon Sep 10, 2012 10:09 am
Location: Finland

Re: Skyrim and Hydra

Post by nanicoar »

This is so badass! Any plans for mounted combat and spear support?
ikedude
One Eyed Hopeful
Posts: 14
Joined: Sat Sep 15, 2012 9:42 pm

Re: Skyrim and Hydra

Post by ikedude »

With initial testing, horses met an untimely death, ha. The disembodied weapons didn't play very nice since the horse shows up as another actor... I added in a check to make sure the horse does not come up as a valid target. I don't really know anything about spears, do they just show up like other two-handed weapons? As long as they show up as a two-handed sword or ax they should work fine.

I also changed the scaling for positioning because initial tests with the rift showed it was way off. Still tuning it but should feel a little more 1 to 1.

Also, I removed the setting of a reference orientation, just position now. It was causing more problems than it was fixing.

Clicking the left stick will now switch the role of the hands for two handed weapons.

Same location: Skydra.asi
dariusu
One Eyed Hopeful
Posts: 15
Joined: Wed Jun 05, 2013 8:34 pm

Re: Skyrim and Hydra

Post by dariusu »

Still working on this ikedude? I'm interested to see any progress.
ikedude
One Eyed Hopeful
Posts: 14
Joined: Sat Sep 15, 2012 9:42 pm

Re: Skyrim and Hydra

Post by ikedude »

I haven't been working on it much. I'm kind of stumped as to what to work on / add...
dariusu
One Eyed Hopeful
Posts: 15
Joined: Wed Jun 05, 2013 8:34 pm

Re: Skyrim and Hydra

Post by dariusu »

Maybe implement reactions, so people will fight back when hit?

Possibly magic? Although I don't know how that could be done.

Also, I noticed when using this and wearing the Rift (at FOV 110), your "hands" or whatever weapon you are using, seem a bit too far away. Even if I stretch out my arms straight in front of me, and recalibrate, resting my arms at my sides leaves the hands, what looks like a few feet, in front of me.

Maybe you can post your script so others can tinker with it? ;)
Ziggurat
Cross Eyed!
Posts: 189
Joined: Fri May 03, 2013 12:48 am

Re: Skyrim and Hydra

Post by Ziggurat »

dariusu wrote:Maybe implement reactions, so people will fight back when hit?

Possibly magic? Although I don't know how that could be done.

Also, I noticed when using this and wearing the Rift (at FOV 110), your "hands" or whatever weapon you are using, seem a bit too far away. Even if I stretch out my arms straight in front of me, and recalibrate, resting my arms at my sides leaves the hands, what looks like a few feet, in front of me.

Maybe you can post your script so others can tinker with it? ;)
People do react, he turned it off for demonstration purposes.
ikedude
One Eyed Hopeful
Posts: 14
Joined: Sat Sep 15, 2012 9:42 pm

Re: Skyrim and Hydra

Post by ikedude »

Yeah, there is just one line that is commented out right now.

Part of the reason your hands are so far away is because (as I'm sure you've noticed) the collision detection does really weird things when objects get too close, including the player. You can shove yourself around the map and even fly if you try...
theomniproject
One Eyed Hopeful
Posts: 1
Joined: Mon May 06, 2013 7:36 pm

Re: Skyrim and Hydra

Post by theomniproject »

I will be checking this out this weekend. Really excited to see how it works out. I would pay $$$ for this to be combined with the first person mod "the beauty of perspective". Skyrim+Mods=The Best VR Environment I can currently think of.
CylonSurfer
Two Eyed Hopeful
Posts: 53
Joined: Tue May 28, 2013 6:13 am

Re: Skyrim and Hydra

Post by CylonSurfer »

theomniproject wrote:I will be checking this out this weekend. Really excited to see how it works out. I would pay $$$ for this to be combined with the first person mod "the beauty of perspective". Skyrim+Mods=The Best VR Environment I can currently think of.
I'm one of the authors of 'The Joy of Perspective' mod, I'd love to see this work made to be compatible with it.

ikedude - what are the chances you can alter your script so one of the Hydra's targets the 'NPC_Head [Head]' node of the player? If you could do this I believe we may be able to achieve separate head and body movement due to the custom skeleton.nif we use in our mod.
Ziggurat
Cross Eyed!
Posts: 189
Joined: Fri May 03, 2013 12:48 am

Re: Skyrim and Hydra

Post by Ziggurat »

CylonSurfer wrote:
theomniproject wrote:I will be checking this out this weekend. Really excited to see how it works out. I would pay $$$ for this to be combined with the first person mod "the beauty of perspective". Skyrim+Mods=The Best VR Environment I can currently think of.
I'm one of the authors of 'The Joy of Perspective' mod, I'd love to see this work made to be compatible with it.

ikedude - what are the chances you can alter your script so one of the Hydra's targets the 'NPC_Head [Head]' node of the player? If you could do this I believe we may be able to achieve separate head and body movement due to the custom skeleton.nif we use in our mod.
For one hand weapons this seam logical, but the torso should be targeted instead.
http://www.youtube.com/watch?v=7bytIGCeGxo

But for two handed weapons like large maces and bows I think its more useful to track the left hand than the body :/
User avatar
Frito
One Eyed Hopeful
Posts: 41
Joined: Tue Mar 19, 2013 8:29 pm

Re: Skyrim and Hydra

Post by Frito »

Any updates Ike? or is it pretty much done?

cheers
Marcosedu
One Eyed Hopeful
Posts: 2
Joined: Thu Apr 10, 2014 6:11 pm

Re: Skyrim and Hydra

Post by Marcosedu »

Nice mod, it is a very nice idea.

Do you guys knows if this is mod is still compatible with the lastest version of Skyrim?

Im asking this because Im always getting the "Controllers Failed" error message, even with the controllers at the base.

Also, I would love to see it on sourceforge/github, so others can help.
ikedude
One Eyed Hopeful
Posts: 14
Joined: Sat Sep 15, 2012 9:42 pm

Re: Skyrim and Hydra

Post by ikedude »

Hey, sorry for the late update on this but I've gotten a few PM's about the source for this and I guess I should probably just let it go. I wanted to try and clean it up since I was in the process of understanding orientation matrices and a lot of the code is pretty uh... shitty? ha. I guess it's better in the wild than chained to me.

Here is the main file:

https://dl.dropboxusercontent.com/u/104 ... mHydra.cpp

If you set that up as the main file for a script dragon plugin and set up the sixense libraries, header, etc. it should just compile.

It'd be cool to set it up as a SKSE plugin that exposes the sixense API functions but I just haven't been motivated enough to do that.

If you have any questions post them here and I'll try to answer but it's been a little while so I might have to refresh my memory a bit.

PS: I might get back into this once I get my Sixense STEM, wireless is gonna be amazing.
jeremdu69
One Eyed Hopeful
Posts: 1
Joined: Sat Aug 16, 2014 3:34 am

Re: Skyrim and Hydra

Post by jeremdu69 »

hey guy can you reupload the asi file or compil for me please the link ared dead! thanks a lots for your amazing job.
Post Reply

Return to “General VR/AR Discussion”