Adding new games

The place for all discussion of the Oculus Rift compatible open source 3D drivers.
2EyeGuy
Certif-Eyable!
Posts: 1139
Joined: Tue Sep 18, 2012 10:32 pm

Adding new games

Post by 2EyeGuy »

Have you got any advice for adding new games and profiles?
User avatar
Dakor
Binocular Vision CONFIRMED!
Posts: 213
Joined: Sat Nov 03, 2012 8:58 am
Location: Dortmund, Germany
Contact:

Re: Adding new games

Post by Dakor »

I was wondering what exactly the game_type number means? Obviously 101 is for Source Engine but some details on that would be nice too.

I tried adding Killing Floor with a copy of the Unreal Tournament 3 Engine profile but Killing Floor gave me an Exception. Not sure what it was called exactly, but it was something like "general security fault". KF is an Unreal Engine 2.5 Game not 3 but I thought it's worth a try. Moreover UT3 only has "poor" support anyway, thus it might be an problem here. Even though the Exception more sounded like KF detected the Hook and crashed?
German blogger, enthusiast and developer.
Image
Baristan6
Cross Eyed!
Posts: 111
Joined: Sat Dec 15, 2012 11:33 am

Re: Adding new games

Post by Baristan6 »

the game type number determines which D3DProxyDevice is used.

here is the current list:

Code: Select all

0: mono
	D3DProxyDeviceMono

10: fixed
	D3DProxyDeviceFixed

100: source
101: source L4D
	D3DProxyDeviceSource

200: unreal
201: mirror
202: UT3
	D3DProxyDeviceUnreal

203: Bioshock
	D3DProxyDeviceMono

300: EGO
301: dirt2
	D3DProxyDeviceEgo

400: RealV
401: arma
	D3DProxyDeviceTest

500: unity
501: unity slender
	D3DProxyDeviceTest

600: advanced
601: skyrim
	D3DProxyDeviceAdv
The D3DProxyDevice classes have code that overrides d3d calls for that engine, and some game specific code( registers, matrix index...).

I kind of understand some functions like SetVertexShaderConstantF() but am clueless about how to determine returns for validRegister().
2EyeGuy
Certif-Eyable!
Posts: 1139
Joined: Tue Sep 18, 2012 10:32 pm

Re: Adding new games

Post by 2EyeGuy »

I think "fixed" means the Fixed Function Pipeline, ie any game that doesn't use vertex shaders.
The others are quite game-specific though.

I made a D3DProxyDeviceDebug that outputs as much information as it can about what is happening, so I could identify what registers are the ViewProjection matrix. I didn't get any games working though. I got Lego Star Wars almost working, except most parts of the minifigs and the buildable blocks wouldn't render at all, and I couldn't work out why.

Most games I tried wouldn't even hook though.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Adding new games

Post by cybereality »

In order to get games working you would need to create a profile for that game/engine. Simply editing the XML file is probably not going to work, unless it is another game using the same engine (and even then its not a sure-fire bet).

If you are building from code you can create another game_type number to go with that game and add it to the proxy config and proxy device factory files. A good place to start would be the 'D3DProxyDeviceTest' file, which I was using for testing. You can try commenting some of the shader stuff out (SetVertexShaderConstantF, etc.) and just leave in the "Present()" proxy. I think there should be code to display a square on the corner of the screen. That should work in most games (I had very little issues getting this far).

After that you will have to try to find the view matrix if you can (its difficult). Most of the time developers use a combined model/view/projection matrix, which is a little harder to work with. What I was doing is proxying 'SetVertexShaderConstantF' and looking for arrays of 16 values (or more). I'm assuming those are matrices, and probably the modelViewProjection matrix if its in the first register (this is an important value, so I assume here developers are using it first). But this was very much a trial and error of process, I'm not sure of a better method to determine these values.

After you get that far you can try editing the values in the matrix and seeing if anything changes on screen. Otherwise you can try using some of the D3DX helper functions to modify matrices. MirrorsEdge probably has the best implementation, so that may be a good place to look for code.

Wish I could be of more help, but there was a lot more hacking than computer science in this project and I just couldn't find a good generic way to support lots of games. I know that it should be possible to find a good generic solution, since something like the Nvidia driver works with so many applications they didn't specifically support. So the potential is there, if you guys can figure out how to fix things. Wish I could help more, but that's what I've got.
lordvtp
One Eyed Hopeful
Posts: 27
Joined: Fri Mar 22, 2013 8:19 pm

Re: Adding new games

Post by lordvtp »

A thought...
Any chance of using data gleaned from existing s3d/iz3d and 3dvision profiles to take 'trial and error' up to 'educated guess' for games with existing profiles in the respective system? I mean they all have to be doing fundamentally the same thing in terms of locating view values....
illinx
One Eyed Hopeful
Posts: 3
Joined: Sun Apr 07, 2013 6:17 pm

Re: Adding new games

Post by illinx »

I'd like to work on adding a gametype and D3DProxyDevice for games that already can output side-by-side 3D. Basically just apply the warp on top of that and allow for adjustable convergence/separation. I've got my implementation stubbed out but am not too familiar w Direct3d code, can anyone point me in the right direction to get started?

EDIT: Looks like I'll probably want to ignore eyeshutter and set up the leftSurface and rightSurface to each be half of the backbuffer, but I'm not sure how to go about that.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Adding new games

Post by cybereality »

@illinx: What is it exactly you are trying to do? The software already handles the warping, and setting up SBS stereo (or anaglyph, or any number of outputs). To add a game you would just need to create a new D3DProxyDevice that is tailored for that game/engine.
illinx
One Eyed Hopeful
Posts: 3
Joined: Sun Apr 07, 2013 6:17 pm

Re: Adding new games

Post by illinx »

Cyberreality, I've got a stub D3DProxyDevice, but what I mean is, the game can already output SBS stereo on its own, so this new D3DProxyDevice would accept that as input and only do the warping.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Adding new games

Post by cybereality »

Hmm.. that may be a little tricky. I mean, you could get it to work, but its not a simple fix.

What you could try is the UnityRiftWarp version of the software:
http://www.mtbs3d.com/phpBB/viewtopic.p ... 26&p=97834

It may work for you. It just does the warping, and I guess would work with some (many?) Dx9 apps.

Otherwise what you would need to do is create a new StereoView mode (i.e. StereoView::SIDE_BY_SIDE_RIFT_3D) and then copy the "SideBySideRift.fx" and make a "SideBySideRift3D.fx" which only works with one image instead of combining two. Basically you would need to adjust some of the values to go from 0.0 - 0.5 instead of 0.0 - 1.0 on the horizontal axis and things like that. You would have to also reference this new fx file in "StereoView::InitShaderEffects()". So its not that hard really, its just not necessary a quick fix either.
illinx
One Eyed Hopeful
Posts: 3
Joined: Sun Apr 07, 2013 6:17 pm

Re: Adding new games

Post by illinx »

Thanks for the replies, I'll give that a shot.
User avatar
Neil
3D Angel Eyes (Moderator)
Posts: 6882
Joined: Wed Dec 31, 1969 6:00 pm
Contact:

Re: Adding new games

Post by Neil »

Hi Guys!

The Vireio Perception drivers have a lot of potential behind them. Anyone out there interested in helping beef up the number of games supported? There is only so much Skyrim and L4D a man can take!

Regards,
Neil
mgood
Two Eyed Hopeful
Posts: 80
Joined: Sun Mar 10, 2013 9:21 pm

Re: Adding new games

Post by mgood »

I'll start digging around in the code once I get my Rift. I'm very familiar with C++ and all its cousins and I've done various 3D programming with both DirectX and OpenGL. I'm curious to get Dreamfall to work, and I would attempt The Longest Journey, except that as I recall only the PC is really in 3D.. and did it even use DirectX? Mmmmmm....

Does anyone have any requests? It should be in May sometime.
User avatar
Neil
3D Angel Eyes (Moderator)
Posts: 6882
Joined: Wed Dec 31, 1969 6:00 pm
Contact:

Re: Adding new games

Post by Neil »

Forgive my ignorance, but are the Perception drivers limited to DX9?

I want to see FarCry 3 and Bioshock Infinite in 3D.

Regards,
Neil
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Adding new games

Post by cybereality »

Yes, Perception is Dx9 only. It would require some effort to support Dx10 or 11. I mean, it's all possible. The core hook/proxy code could stay the same. Most of the work would be copying/pasting the entire interface from the DirectX headers, which is a really boring process (but I guess not too hard). Then the parts that are altering the matrices would have to be updated as well as I'm pretty sure function names and methods have changed slightly. Since most games are still Dx9, its probably better spent effort to get this version working better (ie more games supported) rather then switching to the new API.
beatet
One Eyed Hopeful
Posts: 19
Joined: Sun Oct 09, 2011 5:41 am

Re: Adding new games

Post by beatet »

Neil wrote:Forgive my ignorance, but are the Perception drivers limited to DX9?

I want to see FarCry 3 and Bioshock Infinite in 3D.

Regards,
Neil
Me too. Borderlands 2 would be an amazing Cel shading experience :woot
Hooves
One Eyed Hopeful
Posts: 36
Joined: Tue Mar 13, 2012 9:54 pm

Re: Adding new games

Post by Hooves »

FSX or any Flight Sim game would be great.

This seems to be the place to ask. Still waiting on my rift and building up my knowledge base. Id love to hack something up right now but its beyond my Skill level at this time.
Ardhal
Two Eyed Hopeful
Posts: 53
Joined: Wed Apr 17, 2013 4:57 am

Re: Adding new games

Post by Ardhal »

How far fetched would it be for me to simply take an existing profile and try to apply it, in bulk, to a completely different game?

I wish I knew where to get started with this.

Edit:

Heh. Just copy pasted a skyrim profile line and swapped the name of the .exe, and I have it working in Guild Wars! Very cool. Though the mouse cursor isn't duplicating.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Adding new games

Post by cybereality »

@Ardhal: Wow! Nice. Usually the profiles will only work for the same engine (for example HL2 and L4D) but I guess you can get lucky sometimes. The mouse cursor will not duplicate, unless its in games with a custom cusor (like Mirror's Edge), then it will work OK. Otherwise you kind of have to guess where you are. It is possible to add another 3D cursor, but I believe the real cursor will still show up (this is what iz3D used to do on those games).
Ardhal
Two Eyed Hopeful
Posts: 53
Joined: Wed Apr 17, 2013 4:57 am

Re: Adding new games

Post by Ardhal »

cybereality wrote:@Ardhal: Wow! Nice. Usually the profiles will only work for the same engine (for example HL2 and L4D) but I guess you can get lucky sometimes. The mouse cursor will not duplicate, unless its in games with a custom cusor (like Mirror's Edge), then it will work OK. Otherwise you kind of have to guess where you are. It is possible to add another 3D cursor, but I believe the real cursor will still show up (this is what iz3D used to do on those games).
Awesome! Yeah I noticed that the cursor that did show up, didn't seem to accurately show me where I was really clicking. The simplest solution I hope would be to just make everything accesible with keybinds and just not use the cursor in game at all. I'll need the RMB held down at all times for the headtracking at least.

Here's a video of it, btw:

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


I wish I had a rift so bad, just so I can confirm it's all working nicely. FoV looks low, but maybe I can find some 3rd party way of fixing that.
lnrrgb
Binocular Vision CONFIRMED!
Posts: 294
Joined: Sat Jun 02, 2007 1:29 pm
Location: Wenatchee, WA.

Re: Adding new games

Post by lnrrgb »

Forgive my ignorance, but I keep thinking of that scene in the first Bourne movie, where he sends the fem fatale into some hotel to scout the place, after prepping her with all the tried, and true, spy techniques.... and she walks out with the intel instead, after deciding to just ask for the info. You know where I'm headed with this. Wouldn't social engineering be worth a shot? If games can be brute forced into working, with a little luck, why not just ask the developers? I suspect I am just being naive, but are they really out anything if someone finds some matrix, or data set, that makes an old game work on a particular monitor? I know, silly. Someone whack me upside the head.
sgtjay5
One Eyed Hopeful
Posts: 8
Joined: Fri May 03, 2013 2:51 am

Re: Adding new games

Post by sgtjay5 »

Hi everyone,

I've been a long time reader, but first time posting. First, I want to thank everyone who has contributed to Vireio and the immersion movement. Well, the Rift is just one part of a major project I'm working on. My main goal is to use the Rift on a DIY motion flight simulator. There are so many different hurdles to this project that it is driving me mad. I guess that's what we get for having these kinds of hobbies.

For my project, I'm using Wings of Prey. I like the arcadey aspect of it. Well, I've been able to add a Wings of Prey profile into Vireio and the menu works great and seems like the tracking is working well. But when the game switches over to the cockpit, I get a weird result. The view of the cockpit looks nice, but it is just a frozen image, however, the circle radar image, which you know shows where the enemy is, actually holds a small fov of the game. What I mean is that my cockpit is in that circle, crosshair and all. I could move the Rift around and it moves around like I'm looking around, but it's all in that small circle. Nothing else on the screen moves, except that overlay in the circle radar and the speed, elevation, and heading overlay. I've been researching, trying to find how to fix it, but I can't find any reference to it. It may be a simple problem for some of you guys, but my expertise lays in other places, not so much with Directx and such. Next, I will see if this occurs in IL2 CloD as well. Anybody have any ideas? Well, thanks in advance.
mm0zct
Cross Eyed!
Posts: 140
Joined: Thu Nov 19, 2009 9:35 am

Re: Adding new games

Post by mm0zct »

Try disabling virieo tracking and use the opentrack/ftnoir application to do tracking instead. You can find instructions at the bottom of the nearby dirt2 thread.
sgtjay5
One Eyed Hopeful
Posts: 8
Joined: Fri May 03, 2013 2:51 am

Re: Adding new games

Post by sgtjay5 »

There's no issue with the head tracking, but I tried it anyways. No luck. The head tracking works great with Wings of Prey, as far as I can tell. My problem is that the game's video is inside of the small radar screen in the upper right side. In that small circle, you could see the crosshair, cockpit, cloads, planes, etc. The main screen is a view inside of the cockpit, but it is frozen, minus the radar circle and the speed, elevation, and heading indicator.
sgtjay5
One Eyed Hopeful
Posts: 8
Joined: Fri May 03, 2013 2:51 am

Re: Adding new games

Post by sgtjay5 »

Here's a picture of what's happening. In the upper right corner, you can somewhat see the radar circle that I'm talking about. It's like the whole game shrank into a 1.5 inch circle. You can see it more when you duplicate a monitor and the rift.
You do not have the required permissions to view the files attached to this post.
mbuehler
One Eyed Hopeful
Posts: 38
Joined: Wed Apr 17, 2013 1:16 am

Re: Adding new games

Post by mbuehler »

Ha, just opened a thread on this :) I'm seeing the exact same thing. Tried different resolutions, windowed mode, visual settings, etc. It is so close! I haven't had a game I was tinkering with act this way, so I'm not quite sure how to proceed. Mine appears to stop drawing anything that doesn't have something drawn over it. Under the radar still draws. In third person the crosshair still draws. It isn't shrunk down or distorted, just only updating things with something over them.
sgtjay5
One Eyed Hopeful
Posts: 8
Joined: Fri May 03, 2013 2:51 am

Re: Adding new games

Post by sgtjay5 »

LOL. I just posted on your thread. I was about start a new thread to get better visibility and before I totally hijackdll this thread. Get it, hijackdll. nevermind.
RCkanki
One Eyed Hopeful
Posts: 4
Joined: Mon Apr 15, 2013 1:27 am

Re: Adding new games

Post by RCkanki »

Hello everybody! I'll post the first time from Japan.

By using the DX8 to DX9http://enbdev.com/convertor_dx8_dx9_v0035.htm, I was able to stereo display the Live for Speed.
Profiles added it.

Code: Select all

<profile game_name="LFS" game_exe="LFS.exe" game_type="100" separation="0.00548003" convergence="2.09" swap_eyes="false" yaw_multiplier="29.305" pitch_multiplier="25" roll_multiplier="1" />
Image

But some objects are not stereo conversion.
I have to adjust the convergence and separation. Then the car, wheel, driver, record line, start signal is crashed.

Image

I'd like to correct this problem, but there is no experience of the program of DirectX.
I am trying to understand the source code now... I do not know when to complete.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Adding new games

Post by cybereality »

Cool, RCkanki!
morgg
One Eyed Hopeful
Posts: 9
Joined: Sat Dec 25, 2010 7:54 pm

Re: Adding new games

Post by morgg »

Great job RCkanki, LFS is one of the best racing sims around! I will try to test it as soon as I can.
Ryuuken24
Cross Eyed!
Posts: 117
Joined: Fri May 17, 2013 6:49 am

Re: Adding new games

Post by Ryuuken24 »

Wouldn't Battlefield 2 work with the Virio, since it's DX9? Someone, try that out, I'm ordering a copy today!
Phamtrinli
One Eyed Hopeful
Posts: 3
Joined: Thu May 02, 2013 1:25 pm

Re: Adding new games

Post by Phamtrinli »

I would love to see support for grimrock added.

Right now, the menu disappears when you load up grimrock with vireio, and there is no head tracking.
daggey
One Eyed Hopeful
Posts: 5
Joined: Sun Mar 24, 2013 1:56 pm

Re: Adding new games

Post by daggey »

So I have been trying a few different games just copying the "bin" folder from the vireio download into the games .exe directory and trying from there, have had a little success. Got System Shock 2 working which was sweet. Am trying to get Deus Ex working (original), feel like I am close. I can get Far Cry 3 Blood Dragon to load up and have the two separate viewpoints/"eyes" rendered on screen, however both of the eyes are squashed up into the upper left quadrant of the screen (when viewed on my non-rift monitor), rather than each "eye" being a half of the screen, as in say skyrim, and of course it's not working. But it's clearly doing most of the job, just the issue with the output being squashed into one quadrant of the screen. I feel like Blood Dragon would be a major add, so it would be good to get it working.

Any ideas ? I've tried all the different "game type" values in an entry I added to the config.xml as well (starting with the value for Far Cry 3), didn't seem to do anything ....
ChrisJD
Cross Eyed!
Posts: 176
Joined: Mon Feb 25, 2013 10:29 pm
Location: NZ

Re: Adding new games

Post by ChrisJD »

daggey wrote:So I have been trying a few different games just copying the "bin" folder from the vireio download into the games .exe directory and trying from there, have had a little success. Got System Shock 2 working which was sweet. Am trying to get Deus Ex working (original), feel like I am close. I can get Far Cry 3 Blood Dragon to load up and have the two separate viewpoints/"eyes" rendered on screen, however both of the eyes are squashed up into the upper left quadrant of the screen (when viewed on my non-rift monitor), rather than each "eye" being a half of the screen, as in say skyrim, and of course it's not working. But it's clearly doing most of the job, just the issue with the output being squashed into one quadrant of the screen. I feel like Blood Dragon would be a major add, so it would be good to get it working.

Any ideas ? I've tried all the different "game type" values in an entry I added to the config.xml as well (starting with the value for Far Cry 3), didn't seem to do anything ....
Blood Dragon - I'd guess that the projection or view is wrong when the stereo view is drawn. I have fixed this in one of the branches of the source but it hasn't made it into a distribution yet as it's part of a bunch of other changes (the sum total of which may well break something else, I don't have anything that uses the Far Cry 3 engine to check with).

How are you running Deus Ex? I assume you have a DX9 wrapper/mod as that will be needed if you're going to have a chance of getting it going. It's most likely to work with game type 10. When you are trying random games it's best to start with type 10 with both the separation and convergence set to 0. If the game runs like that and looks OK you can try some separation and if needed different game types. For an old game it's unlikely that a dx9 mod/wrapper will be using vertex shaders so type 10 is the most likely to work.
daggey
One Eyed Hopeful
Posts: 5
Joined: Sun Mar 24, 2013 1:56 pm

Re: Adding new games

Post by daggey »

So I got Blood Dragon running. It's sweet as all hell.

I was running vireio as well as launching from the .exe and I think that was creating the quartering effect - I read somewhere else that that can happen. Anyways tried it without running vireio at the same time and bamm - we're good to go. Head tracking working as well.
RoTaToR
Cross Eyed!
Posts: 135
Joined: Sun Aug 26, 2012 5:45 pm

Re: Adding new games

Post by RoTaToR »

daggey wrote:So I got Blood Dragon running. It's sweet as all hell.
How?` :o Please post the profile.
Hydra
One Eyed Hopeful
Posts: 3
Joined: Sun Jun 16, 2013 1:11 am

Re: Adding new games

Post by Hydra »

daggey wrote:So I got Blood Dragon running. It's sweet as all hell.

I was running vireio as well as launching from the .exe and I think that was creating the quartering effect - I read somewhere else that that can happen. Anyways tried it without running vireio at the same time and bamm - we're good to go. Head tracking working as well.
Dude, please share with us!
RCkanki
One Eyed Hopeful
Posts: 4
Joined: Mon Apr 15, 2013 1:27 am

Re: Adding new games

Post by RCkanki »

added the LFS to vireio.
Image
Do I have to publish the source code?
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Adding new games

Post by cybereality »

You are not obligated to post the source code, but it would be cool if you did a pull request on the main GitHub repo.
RCkanki
One Eyed Hopeful
Posts: 4
Joined: Mon Apr 15, 2013 1:27 am

Re: Adding new games

Post by RCkanki »

THX, I try.
Post Reply

Return to “Development / General Discussion”