Zipp425 Posted September 11, 2018 Share Posted September 11, 2018 Hey All, I just got back into Skyrim in VR and I'm loving the immersion. After doing lots of walking in VR with Natural Locomotion, I decided it would be awesome to ride around Skyrim on my bike. I've done it the old fashion way by just holding forward on my Vive wand and rotating as necessary with the other wand, but it's a pain to hold two wands and my bike handlebars. I'm a developer myself (primarily C# with a focus on web technologies), so I thought it would be fun to make a mod that would work to translate the speed from my bike into forward momentum in Skyrim. Ideally I could also find a way to make it so a Vive wand attached to the handlebars of the bike could be used to turn. Having never developed a Skyrim mod, I started to dig through the source code of a few mods to explore possible solutions. Here's my idea so far:Similar to DragonbornSpeaksNaturally, create a plugin that utilizes SKSE drivers to hook into Skyrim and communicate with a Windows application that monitors the bike speed/cadence through ANT+In the plugin, receive speed updates from the monitoring app and move the player forward at a specific speed relative to the speed on the bike Having never created a Skyrim mod before, I have quite a few questions that I'm hoping this community can help with: Would I use MoveTo on the Player object/actor to move the player forward? Do you know any similar mods with an open source that I can review to get an idea of how to tackle this? ANT+ has the ability to tell smart trainers to set resistance to a specific level to simulate hills. Is there a way to get the grade of the Player position? Any ideas on how to tackle making it so one of the Vive wands becomes a navigation tool to direct the bike from the handlebars? Alternatively, any idea how to make the player move on rails so that all the Player does is pedal to adjust their speed? I'm pretty comfortable making the Windows application, as that's closer to my area of expertise, so if there's anyone out there that's remotely interested in this and has more experience modding Skyrim, help would be greatly appreciated. Link to comment Share on other sites More sharing options...
zepperik Posted September 15, 2018 Share Posted September 15, 2018 (edited) Funny I came across this when looking for how to get the players position to incorporate it into a exercise bike exactly as you are trying to do. I've only started today tho - I'll let you know if I figure anything out. I didn't realize you could talk to the game directly with a dll, I was looking at just continuously writing a file with FileAccess Interface to get the hill incline, and then using the bike as an input by just mimicking control pad inputs (no plugin/API). Your's is the right way to do everything but I think it may be more difficult, but maybe you got the skills :smile: Edit: Just found: https://www.creationkit.com/index.php?title=Game_Script Game.GetPlayer().GetPositionX() and Y and Z seems to be the way to get your position. Keeping track of the way Z is changing is likely the only way to get the incline/decline. I'll let you know if I discover otherwise. Edited September 15, 2018 by zepperik Link to comment Share on other sites More sharing options...
Zipp425 Posted September 15, 2018 Author Share Posted September 15, 2018 Good find. I was thinking that tracking the axis would be the right way to determine in-game grade and communicate resistance back to the trainer. At this point, I'm still not sure how to hook into Skyrim to get that data streamed out though... I hacked together a rough solution this week doing something similar to what you suggested. Basically, it just watches the speed and cadence of the bike via ANT+ and then emulates a gamepad to transmit that as moving the left stick forward. Then to get that into VR, I'm using Joy2OpenVR to translate the left thumbstick movement into left Vive wand trackpad. There are still quite a few issues with this approach though: It works to move forward, but you still have to control turning with the right trackpad so it really only frees up one hand. There's no way to stop. I tried tracking cadence and stopping when the user stopped pedaling for 1s, but that led to issues at lower cadences. The delay between speeding up and having it happen in the game is very noticeable because of the way that speed is measured/tracked by my trainer. Here's how I was thinking about addressing each of the issues: Find some way to track the rotation of the handlebars or add some way to turn left/right to the left and right side of the handlebars (maybe a button or something). Add a brake button or the best would be to find some way to watch the tension from pulling the break Rather than using the speed data, create a sort of virtual bike where the speed is only based on cadence or power. This could be pretty complicated and I'm not sure how "instant" the trainer's power readings would be. Anyway, glad to know that there's someone else that's tackling the problem too, let me know what else you find or if you need any help getting data from the ANT+ devices. Link to comment Share on other sites More sharing options...
Recommended Posts