Occulus Rift Mod for World of Tanks – Part 1 (with Download)

Source: http://habrahabr.ru/company/wargaming/blog/249115/

(yes, there’s a download, exclusive for FTR – if you have that device, you might like it)

Hello everyone,

the following article describes how Wargaming developed a special mod for Occulus Rift from the developer point of view. Enjoy.

c6ca290b9349030c0a00f1481f153343

Roughly a year and a half ago, Wargaming developers got their hands on the DK-1. After some time spent playing Team Fortress and Quake in Full 3D, they decided to do something with it for World of Tanks. You can read below about the results.

World of Tanks supports a certain number of game devices (peripheries), which extend the player user experience (various vibrations for example). However, with the appearance of the Occulus rift, we decided not to please only the butt of the player, but to give them some new eye candy as well.

To be honest, noone knew what it should look like, the task to create a Rift mod was issued just “for the lulz”. We did not hurry and worked on it only when the brain refused to think of the main tasks, we slowly downloaded the Rift SDK, installed it and started rummaging through the source code examples. The work started using the first devkit, which was somewhat dangerous to the psyche.The problem was that the devkit had relatively low screen resolution. Luckily for us, we got our hands on a HD version soon and working with it was much more fun.

Software Development Kit

The development started with the 0.2.4 SDK version for DK-1. When the HD Prototype arrived, new SDK version was not required. That’s why we used the old, but satisfactory version of the SDK for 90 percent of the time. After that, when the DK-1 mod was practically finished, DK-2 came and it turned out that the old SDK wouldn’t work with it anymore. But would that pose a problem? Well, we downloaded the new SDK version (0.4.2) only to found out that it was totally rewritten. We had to chance practically the entire device support and to introduce various fixes. But the most interesting thing happened to the render. Earlier, the pixel shader was quite simple, but the new version made it more complex – the reason for all that were the lenses. I don’t remember anymore why the decision to do that was taken – but a nasty side effect were terrible chromatic aberrations, decreasing from the edges of the lenses towards the center. And to reduce this effect, new pixel shader was written. It was a strange solution to put it mildly: it reduced the performance due to an odd developer solution. But! Good old human ingenuity saves the galaxy yet again. It turned out that the DK-1 and HD Prototype lenses work just fine with DK-2 without any side effects. And that was it.

Initialization

The initialization process was copypasted without any pitfalls.

Rendering

The device creates stereoscopic image rather classically, using the method of rendering the scene on two separate screens in various angles, introducing one part of the scene to one eye. You can read more about this method here.

Accordingly, our original algorithm for creating stereoscopic images was as follows:

1) Matrix creation

Since you have to create a render with a slight offset for each eye, you have to as a first step modify the original view-matrix. Occulus Rift SDK provides the required matrices to transform the image for each eye. The modification looks like this:

- acquiring the matrix of additional transformation
- transforming this matrix (Occulus uses a different system of coordinates)
- to multiply the transformed matrix on the original one from the left

2) Rendering two times with the acquired matrix

After modifying the view-matrix for the left eye and setting it in render-context, the rendering happens as usual. After that, the view matrix is modified one more time for the right eye, is set in render-context once again and rendered one more time.

3) Lens distortion post-effect

In order to fill better the field of view, Occulus uses lenses, that have a side effect of distorting object geometry. In order to suppress this side effect, an additional post effect is applied to the final render, this post-effect distorts the geometry to the opposite side.

4) Release of the final render

The final render is formed by combining of the renders for both eyes, which are depicted each on their respective half of the screen and by applying the anti-distortion post-effect to them.

Challenges

During the development, we quickly discovered that there are no clear, hundred percent working guidelines for making Occulus Rift work in games. If you run several games with OR support, you’ll get several interface versions and several versions of Occulus management. As far as we know, Occulus developers do now issue strict sets of rules and requirements. Their idea is for the game developers to experiment and work with the device themselves. This caused us to rework our Occulus version more than once: when everything seemed to be ready, there suddenly were still some issues here and there and in the result, you had to throw out half of the code.

To add to the fun, some of our own special features caused trouble as well. In World of Tanks, the camera is hanging above the tank and turning your head using the Occulus in this mode does not correspond to your experience from real life. You can’t fly in real life above the vehicle you are driving (although sometimes, this might be useful).

Add to that that World of Tanks is a PvP game, where you are fighting 29 15 other players. As a result, Occulus strongly messes up with the combat skills of the player. This nuance adds a lot of hassle to the development. If we have a look at the applicability of Occulus Rift to multiplayer games in general, the device is by far not suitable for every game class. In games with the gameplay dynamics of Quake 3 and Team Fortress 2, it will bring more harm than good. In these games, you seem to look at the environmant with the eyes of a person, but the movement in these games is very different than in real life. As I mentioned before, if the game doesn’t use first person camera, what you get are problems with spatial orientation and with the mechanism of turning your viewpoint when you look to the sides. We had the impression that Occulus is primarily applicable to single-player games where the immersion of the player is paramount and control inconveniences can be forgiven.

To be continued…

….or wait, the mod, right :)

Check this out – you can download the mod here:

English instructions
The mod itself

Enjoy!

19 thoughts on “Occulus Rift Mod for World of Tanks – Part 1 (with Download)

  1. Rift is only good for FPP simulator-like games, where your character sits in one place and doesnt move. Otherwise it creates a bad feeling of being dizzy and stuff due to the fact that your brain receives a signal that you are moving while in the same time it doesnt receive any signals of moving itself (because you are sitting still in one place). This effect varies from person to person but overall it occurs

    As for WoT – I dont think it would be a nice experience to play such TPP game with Rift. I mean that I dont see any profits of playing like that, game doesnt have any features that Rift would benefit from

    Anyway, various FPP simulators are probably a blast with rift. If I would win some monies I would defo buy Oculus+Elite Dangerous+HOTAS joystick :) But well, those VR’s are still toys for rich ppl

    • 300€ for final release that should come soon.

      That’s still cheaper than an iPhone 5.

      When I saw the thing and what it could do I expected like 500€ Or more, but it’s actualy pretty cheap for what it is

      • 300 euro is a minimal wage in my country and well, most ppl here work for that wage

        So yea, it is expensive :) For euro-zone ppl maybe not, but for me – yes

        • Maybe most of the people you know work for that wage, theres plenty of people who make more. Fuck, even some guys I know who make like 400 euro a month still have brand new playstation 4s and galaxy 5s (or whatever is the hottest number nowadays). 300 euro is affordable, I thought it will be much more expensive too.

          • well in Greece i live the majority of young people have just part time jobs with salaries around 300-400 euros … and they have to survive a month with these money while the price of life is similar with Germany were the salaries are at least double .

            so peripherals like Rift are expensive and someone must collect money for such machine for around 6 months . so almost nobody owns or is interested of getting one …

        • Even in my country (Germany) there are many people who have to live for ~350€ per month and they still own a big TV, a PC and the latest phone. Better have these things than spent it on much more important things (sarcasm).
          So money will not be a problem even for those people…

  2. I tried this, it sucks.

    The oculus still have a shitty resolution, you see tons of pixels everywhere and you littterally can’t do something in WoT; if an enemy is too far you would see 3-4 red pixels, nothing else.

    Also, the visual in 3rd person sucks with oculus, every game I tried in 3rd person was bad because oculus is made for 1st person (even if it still sucks in terms of resolution).

    • You can always use the sniper mode to see what you’re shooting at >_>

      WoT with TriDef was in fact the most comfortable experience I had with DK1, probably specifically becuase WoT is a 3rd person game and immersion/nausea issues were thus out of the picture.

  3. The trouble with these immersive 3d gizmos is exactly what WG found, it varies immensely from game to game (nevermind genre) of how well they work (at the moment), and require stupendous amounts of effort for some and fookall for others.

    Not quite in the same “league”. but the TrackNoIR stuff is pretty good when you get it set up, its only half way to the OR style of gaming, but much more accessible, much more workable and a lot less prone to the travel-sickness issues.

    I’ve never been travelsick, dont get vertigo or anything similar, but I can’t watch the new 3D TVs for more than half an hour without problems, whichever type of tech they use. (the instructions even say to not use it for more than 2 hours or something…)

  4. Tried it with my DK2. The fact that WoT’s engine is unable to run at smooth 75fps (more like 40-50) even with a top of the line gaming rig means the picture is super juddery. The head tracking in sniper mode is messy, because both the mouse and the head rotation change the orientation and it’s super confusing, and the IPD isn’t correct so there’s a crosseyed feel to it. The HUD is also way too big but I think that can be tweaked in the included preferences file.
    Those are fixable if they develop it more, but the BigWorld FPS problem is the biggest obstacle to getting WoT run on the Rift properly, as it requires 75fps smoothly at all times even on the DK2 (and 90fps on the final consumer Rift which is a pipe dream in BigWorld).

    The only way WoT will ever be usable on the Rift is if they switch out of BigWorld.

  5. I would love to see them move the player camera to the commanders hatch. That would be amazing.