cancel
Showing results for 
Search instead for 
Did you mean: 

Morrowrift - Morrowind VR (CV1/1.3 alpha! v. 3.0.2)

superllama
Protege
6/6/16 - I finally rewrote the OP... editing this literally gave me a migraine but it's finally cleaned up! If you want to look at the old one for some reason, I archived it here pastebin.com/VDfZgTvB
*ahem* anyway.

DISCLAIMER
- Tested with Disk (GOTY) and Steam copies-- should theoretically work with other versions like the GOG version but this is untested (if someone can confirm that it works I'll remove this disclaimer)

WHAT THIS IS
This is a program that hooks into Morrowind + MGE 3.8.0 and, with certain settings disabled, adds fully playable (except character creation) support for the Oculus Rift.
This is different from configurations for vireio and vorpx because it actually decouples the view from the menu and draws the menu as a 3D projection, meaning you can look around separately from where you're aiming and lean forward to zoom in on game text, and it automatically levels your view pitch so you can play it standing up without getting dizzy.
It's written from scratch in C, so there are no dependencies other than Morrowind + MGE 3.8.0 and the Oculus Runtimes.
Here's a badly recorded gameplay video showing off the features (and bugs) in the already-out-of-date version 3.0 (one of the bugs in the video is already fixed!)
https://www.youtube.com/watch?v=rIMBYREr9yg
(NOTE: if somebody with a decent GPU and recording program wants to take a video of their game window running the latest version of Morrowrift, I'll put it here-- right now all my videos are laggy and ugly because my GPU is old and I don't know how to use OBS)

WHY 3.x?
You might be wondering how this is version 3 when it's so basic... short answer: this one is (theoretically) way more stable and optimized than before due to it using an entirely different structure and coding scheme. Long answer: the first one was DK1 only and was a direct fork of MGE, meaning you had to actually replace MGE with my DLL. Version 2 added DK2 support, and was an extra layer on top of MGE that worked the same way-- that is, by pretending to be DirectX. This version is a standalone program that injects a DLL directly into Morrowind much like VorpX or Vireio, except this program is specifically made for Morrowind/MGE and doesn't have any other dependencies.

WHY ALPHA? (BUGS)
There are still a multitude of bugs present in this version, some of which were even fixed in an older version, but as I've abstracted the code more and more in an attempt to make my edits more portable to other games, certain things got harder to fix. Here's a list of all known bugs that I can think of right now:

  • Overlay ZOrder Bug - Any game overlays (or at least steam) come up behind the main menu or HUD. If you're playing with a steam controller and you can't move the mouse on the main menu, try pressing Shift+Tab to see if you accidentally invisibly opened the steam overlay. Luckily it's completely usable in-game since the menu is transparent there.
  • Native Aspect Loss - The game is currently forced into a Rift-shaped aspect ratio, which applies to in-game menus too. I'd like it to obey the game's starting aspect ratio when it comes to drawing in-game menus eventually but that might not be possible if I want the mirror window to show both viewports correctly.
  • Race Selection Bug - The race selection menu is effectively unusable-- I recommend creating your character outside of VR mode and then running Morrowrift afterward and loading a save.
  • NPC Shadow Bug - You have to set Real-Time Shadows to None in-game or else NPC's will flicker like a banned pokemon episode if you're not staring straight at them. I think they use their own clipping planes and I'll have to locate those to transform them.
  • Weapon Clipping - Weapon/hand models have messed up clipping. Probably a similar cause as above.
  • Water Clipping - Water sometimes disappears when you're not aiming at it, and also looks pretty terrible with reflections and shaders turned off which is still required for the hack to work. Also, if you have Pixel Shaders turned on, water reflections don't look right and sometimes draws twice with incorrect headtracking.
  • Sky Movement - Positional headtracking affects clouds and stuff in the sky, which isn't really that big of a deal but looks stupid and can be a bit disorienting if you try to breakdance ingame (or anything else requiring a lot of positional movement). Also, the sun is rotated based on player aim instead of camera position.
  • Loading Freeze - Since the game renders the progress bar during frozen loading screens, the background freezes but still moves with your head which feels really weird. I honestly have no idea how to fix this.
  • Tracking Asymptotes - If you're looking straight up or down, the headtracking gets pretty weird and overdoes roll. This is because of some really old code I wrote back when I didn't understand quaternions, I'll fix it eventually.
  • Elusive Crosshair - The in-game crosshair is hard to see on most backgrounds, and since headtracking is decoupled from the menu it's easy to lose it. In the future I'll probably add a custom crosshair that renders on top of it and is easier to see.
  • Annoying Menu Placement - Not exactly a bug but a side effect of view auto-levelling still transforming the menu so the crosshair lines up correctly: if you're trying to loot something on the ground the menu will come up down there, which is a pain to read or use and also suffers from the trackign asymptote bug. In the future I'll probably fix this by leaving the game menu level and only transforming the aforementioned extra crosshair and weapon model based on in-game aim. I'm also planning on implementing a system eventually where recentering the view actually moves the crosshair to where you're looking, instead of the other way around, which will make it easier to find it.

Even aside from all that, I'm not 100% sure how well this will run on varying systems, so until a few people test it and confirm that it works, it'll be an alpha. Once enough people are able to run it (which may entail some bugfixing) and I improve the launcher a bit, I'll call it a Beta again.

DOWNLOAD
You can download 3.0.2 Here-- Google was yelling at me for uploading an EXE or something so I had to encrypt it so it wouldn't try to scan it. The password is simply "uh" because that was my reaction to Google taking my first upload down. (Just ask this scientician)

If you have a DK2 and you'd rather run the old unstable 0.8 version for some reason, you can still get it Here. There are instructions for using it somewhere in this old archived post.

SETUP
I recommend starting with vanilla morrowind (goty is fine) since I don't know how different mods (especially MGE and MWSE mods) will affect this. Once you've got it working you can start adding things in and making sure they don't break it.
The first thing you'll need to do is install and set up MGE 3.8.0.
Eventually I want to try to add support for MGE XE and some of the more popular shader mods, but that's a long way off.
Make sure your game has this message in the top left corner before proceeding.
If you're running the Steam copy of the game you'll need to set Morrowind.exe, Morrowind Launcher.exe, and MGEgui.exe to all run as Administrator before this will work.
Next, since this version is still a bit finicky, you have to make sure you run it with the right settings or it will probably just sit there and not draw anything, or render everything totally wrong. Unless you want your game to look that way (or like nothing), you'll need to disable the following MGE features in MGEgui:

  • Distant Land
  • Anti-Aliasing
  • Probably any mods adding shaders

I'm working on getting these features supported but it's very very difficult to do unless I actually modify MGE, and I'm trying to avoid doing that in this version in anticipation of someday retrofitting other games (yes, including skyrim) that don't have open source graphics extenders that I can just rewrite. That's the only reason the ancient DK1 beta version seen on my youtube channel had Distant Land-- I actually modified MGE to add support for it.
If the font size is too small for you, you can choose a lower resolution like 1024x768 and the in-game text will be bigger, but you may get extra aliasing if you do that. Some resolutions render incorrectly right now though like 1600x960.

RUNNING
Just make sure Morrowrift.exe and Morrowrift.dll are in the folder with Morrowind, and run Morrowrift.exe (not Morrowind or Morrowind Launcher). If you're running a Steam copy of the game, you need to make sure Morrowrift.exe is set to Run as Administrator.
If you need the Steam Overlay for any reason (for instance if you use a Steam Controller) You should be able to add Morrowrift.exe to steam as a non-steam game too and still have steam inject its overlay, and if you want to do it with an actual Steam copy of the game you may have to Steam itself as Administrator before it will let you do this (and you still have to add Morrowrift as a non-steam game and run it that way). This may not work for everyone but I was able to run both steam and non-steam copies of Morrowind with Rift support and Overlay support simultaneously.
One caveat with the Steam Overlay though-- for some reason it draws underneath the Morrowind menu right now, so if you accidentally open it on the main menu or during a cinematic, you won't be able to see it. If you can't move the mouse on the main menu try hitting Shift+Tab and see if steam overlay was open invisibly behind the menu.

COMMAND LINE ARGUMENTS
If you run Morrowrift.exe with -nolevel you can disable the auto pitch levelling, but I don't really recommend it since it can make you dizzy. However if you absolutely cannot stand the menu moving up and down all the time when you aim independent of your head position, this feature can be disabled.

This is currently the only command line argument but I'll probably add more options as time goes on, depending on what needs to be customized.

DONATE
If you love my project and want to throw in some motivation for me to continue to add new features, new hardware support, and maybe even new games someday, you could make a Paypal Donation and give me a great excuse to work on this project instead of other stuff 😛

PLANS
First things first, I need to fix bugs. If I can get distant land, anti-aliasing, shaders, and MGE XE working well, I'll consider it a major, major victory. Once I have at least MGE working perfectly I may also try to tackle Oblivion and Skyrim support alongside of MGE XE, since they'll have similar shader setups. MGE XE has the benefit of being open source so I can actually look directly at how it works, which may help me structure the code so it works with newer games.
As a side goal, I'd also like to implement SteamVR support instead of just Oculus support to my codebase. Right now I'm saving up for a GTX 1070 and HTC Vive so I can do this, so that's probably what any donation money will go towards. My current GPU is an old GTX 770 which can barely even run things on the DK2, so if I'm going to get a Vive which has no Async Timewarp I'll definitely need a better GPU to go with it.
If I do get a Vive, another pie in the sky goal would be to hack the game so much that your hands and weapon are drawn based on motion controls, and one of the four weapon moves is performed depending on how you move your hands. This would be so insanely awesome I'm kind of afraid to even mention that I'm planning to try it, since it's probably nearly impossible, but hey, I can dream.
299 REPLIES 299

JonathanVB
Honored Guest
"superllama" wrote:
The framerate drop is unfortunately not something I can really fix though, the fov and double render takes a toll on the framerate, plus the only way I could get it to correctly render everything in the game was to switch between left/right rendertargets every time anything is drawn, so there's a lot of unnecessary communication between the cpu/gpu that I can't really optimize out.


Hence why I think this is a perfect example where a monoscopic option might be beneficial. A number of people have stated that it doesn't detract as much from depth perception as one might think (to the point where some people can't tell the difference).

"superllama" wrote:
EDIT 2: Apparently it's just the main menu for me, when I actually go into the game the judder goes away mostly. Most perplexing.


Unfortunately the judder is everywhere I don't get 75fps for me. Worst case just wait for sdk 1.0 which supports async timewarp natively.

superllama
Protege
Ohh monoscopic. I was confused because you said microscopic at first 😛

I can probably build a monoscopic version but part of the issue is that the DK2 now uses different skewed projection matrices for different eyes, which means if timewarp does start to kick in there will be peripheral judder caused by the reprojections being incorrect. I might be able to turn off the oculus driver's built in timewarp and replace it with my own custom reprojection based on the single eye view, but that's a lot of work (or I could just turn off timewarp and hope that the monoscopic view brings the framerate high enough that it's unnecessary).

I'd be interested to know more about your setup-- my gpu is sub-oculus-recommended (gtx 770) but I still get pretty good timewarp most of the time. Before yesterday my timewarp was 100% flawless no matter how laggy or frozen the game got, but for some reason some update somewhere made it worse recently, with constant judder in the main menu and random frame spazzes every few seconds in-game (none of which happened before). I'll keep messing with my code to see if I can fix anything, but since it's affecting all my previous builds that used to work perfectly, I'm pretty sure something driver-side broke and there may not be anything I can do about it. Hopefully SDK 1.0 will help as you said. I'm also (secretly?) working a brand new multi-game exe-based VR injection launcher that may be able to optimize out a lot of the overhead, but I won't know until it's ready to try.

JonathanVB
Honored Guest
"superllama" wrote:
Ohh monoscopic. I was confused because you said microscopic at first 😛


Opps, damn autocorrect.

"superllama" wrote:
I can probably build a monoscopic version but part of the issue is that the DK2 now uses different skewed projection matrices for different eyes, which means if timewarp does start to kick in there will be peripheral judder caused by the reprojections being incorrect. I might be able to turn off the oculus driver's built in timewarp and replace it with my own custom reprojection based on the single eye view, but that's a lot of work (or I could just turn off timewarp and hope that the monoscopic view brings the framerate high enough that it's unnecessary).


I'm not entirely sure what you're referring to, but wouldn't this be solved by setting the IPD to 0 first?

"superllama" wrote:
I'd be interested to know more about your setup-- my gpu is sub-oculus-recommended (gtx 770) but I still get pretty good timewarp most of the time.


i5 4690K clocked to 4.2Ghz and overclocked GTX 970. AFAIK, Morrowind hardly hits the GPU at all and is almost entirely dependent on the speed of a single CPU core.

superllama
Protege
Interesting... it could actually be that your card is so powerful that it renders the game just as well as the menu (>50fps) which may very well be causing some sort of cpu synchronization issue with my threading. Maybe if I can stop my menu from juddering it'll fix your problem too-- though for me it only started with a recent nvidia update. You could also try Morrowrift 2.2 from the main page where Timewarp wasn't implemented yet-- if that doesn't judder then that confirms this theory (though you'd be stuck without the auto-levelled camera and would have to turn the in-game fps counter on to stop textures from freaking out). I'll double-check all my multithreading code and see if I can sort out why it could be doing this.

As for the eye-specific projection matrices, I'm referring to this:
http://1.bp.blogspot.com/-Sn7c3ax8-84/UluWpeN_HiI/AAAAAAAAAuI/wemkvEGQJ0E/s1600/overview.png
The eyes aren't quite in the center of the view where the game is drawn, so the distortion is off by a little bit and you actually have to "skew" the frustum of the projection matrix itself in order for it to line up correctly. If this was ignored, then any amount of timewarp that did get applied would guarantee to judder because Oculus's software expects you to follow their projection matrix scheme. If other DK2 games have successfully circumvented this by setting IPD to 0 then maybe it will work after all, but I didn't think IPD affected the projection matrix much, just the amount of translation between the left and right eye.

EDIT: AHA! I think I managed to fix it, at least partially. I had to sleep the main thread for 5ms after each frame and then remove a line where I was unnecessarily flushing the device context in the main thread. It was definitely a thread synchronization issue and I think there's probably a better way to fix it than this, but hopefully this will work for you in the mean time. Here's a release that should work, but unfortunately all the craziness I did to try to get DistantLand to work has actually dropped the base FPS even further... I'll try and optimize it eventually, but I think for now your card should be able to handle it if it was running well enough for the flushing to cause a synchronization issue. Since it's not optimized and may have some bugs still I'm not going to post this on the front page, but it should fix timewarp for people having issues with it.

EDIT 2: Whoops, looks like that fix^ also broke steam overlay again. If you plan to run it through steam you'll probably need to disable overlay for now... I'm pretty sure it's caused by some of the changes I made while trying to get distantland to work, so if I can track that down and fix it I'll post another fix.

JonathanVB
Honored Guest
"superllama" wrote:
You could also try Morrowrift 2.2 from the main page where Timewarp wasn't implemented yet
This would cause judder when I can't hit 75fps anyway.

"superllama" wrote:
As for the eye-specific projection matrices

Thanks, I understand now. I have some ideas but I'm not sure they would work. Any chance I could have access to the code to try them out.

"superllama" wrote:
Here's a release

Unfortunately I'm away from my rift PC for about a week so I won't be able to try it immediately. I'll get back to you then.

JonathanVB
Honored Guest
"superllama" wrote:
Here's a release


Got back to my PC and tried this. It's quite a bit better, but I still get the occasional frame of judder. Unfortunately this version crashes when I try to load a new exterior cell (possibly because of your DistantLand work).

superllama
Protege
"JonathanVB" wrote:
"superllama" wrote:
Here's a release


Got back to my PC and tried this. It's quite a bit better, but I still get the occasional frame of judder. Unfortunately this version crashes when I try to load a new exterior cell (possibly because of your DistantLand work).

Ah yeah, I'll probably mess with it some more and see if I can get rid of the crashes. I know steam overlay crashes that version again, for one. I think all I actually did was artificially lower the game's internal framerate to below 50fps, which stopped the timewarp thread from getting stuck. It works as a bandaid-fix right now (or, it will once I stop the crashing...) but hopefully I'll be able to actually fix it eventually. I recall reading somewhere that "some cards/drivers" don't play well with TimeWarp, making things rendered at 60fps judder, maybe that's what's happening? It might actually be that the only way to really fix it is to forcefully lower the main thread's fps until all the drivers support it properly, I don't know.

JonathanVB
Honored Guest
Based on the idea that my video card is too fast, I underclocked it. I now only get the occasional judder and it's playable.

Jeppe
Honored Guest
Today I tried out Morrowrift for the first time (2.4.2) and WOW I'm blown away! I got flashbacks from when I first played Morrowind almost 15 years ago. I got the same feeling of wonder 🙂

I'm really impressed with the general feel of Morrowrift, the VR experience felt very natural. Just walking around in Seyda Neen was really great. Menus worked well apart from the text being very small, but that might be alterable using plugins. Great work!

There were some bugs though, but I'm sure you are aware of them already:

- The game crashes when loading a new area
- Character creation does not seem to work; when selecting race no menu was visible, just a giant floating dark elf head
- The water looks a bit strange
- The sky moves when you move your head (it's like it's only 10 meters away)

Looking forward to the next version! 😄

EDIT: Tried 2.4.3.Alpha, but it did not work at all for me - I could start a new game, but as soon as I tried to exit the ship by the hatch (or tried loading a previous save file in Seyda Neen) it crashed (Morrowind has stopped working...).

superllama
Protege
Strange, the game doesn't crash for me when I load new areas and didn't have any weirdness with the water... I was aware of the character creation and sky bugs though. Glad you like it other than the bugs you're having! Does it always crash when you change areas or just sometimes? Do you have many mods on top of MGE installed, or are you using the steam version or running with any other overlays?

The 2.4.3 alpha doesn't really work at all if you have any kind of game overlays running, due to a bug with my new rendertarget code (made for distantland support) that I haven't managed to find yet, which is why it isn't posted on the first page. 2.4.2 on MGE 3.8.0 with no mods usually works perfectly even with steam overlay, though some cards/drivers cause horrible judder unless you underclock them like JonathanVB had to above, because of an issue with thread syncing at 60fps.

Also, you can make the text bigger by making the base game's resolution smaller, or at least narrower-- fullscreen resolutions will make the menus larger than widescreen ones because of how it generates the floating screen mesh/texture.

Eventually I'm hoping to fix the rendertarget issue as well as any latent crashes and the 60fps sync issue, once those are all fixed I'll probably release it as 2.4.3 even if I can't make distantland work just so we can have a more stable version. I'm still working on getting either getting distantland working or making Insert/Pause move the crosshair to your head instead of just cancelling rotation, or just finding the time to add a configuration file with settings you can change-- if I do any of those things it'll be version 2.5, but making it stabler is priority 1.