Oculus Rift support for Jedi Academy

I want to share my new project: Oculus Rift DK1 support for Jedi Academy (for Windows and Linux)

https://github.com/xLAva/JediAcademyLinux/tree/HmdSupportGPL

This project was on my mind since the source code was released last year. Finally I had some time this summer to get started.

This Oculus Rift support implementation is designed for first person game play. It is possible to switch to 3rd-person view, but the best (and motion sickness free) experience is in first person mode.

I haven’t tested the whole game yet, but the first 7 levels are working very good.

Changes and new Features for the Oculus Rift

  • Free look during in-game cut scenes
  • Removed all forced camera rotations and a lot of camera movements
  • Improved game controller support (SDL2 Xbox Controller layout)
  • Auto detection of the Rift display position
  • Enabled first person lightsaber mode as default
  • Resized UI rendering

Play the game

There are binaries for Linux and Windows checked into the Github repository, so if you want to just play the Oculus Rift version, download the binary files and start playing right away.

https://github.com/xLAva/JediAcademyLinux/tree/HmdSupportGPL/binary/win32

https://github.com/xLAva/JediAcademyLinux/tree/HmdSupportGPL/binary/linux

Copy all the files from the Windows or Linux platform folder into the root directory of your “Jedi Knight III: Jedi Academy” installation and start the “jasphmd” executable.

The version was tested on Ubuntu 14.04 and Windows 7.

Needed libraries on Ubuntu 14.04 32bit:
sudo apt-get install libhidapi-libusb0 libsdl2-2.0-0 libopenal1

Needed libraries on Ubuntu 14.04 64bit:
sudo apt-get install libhidapi-libusb0:i386 libsdl2-2.0-0:i386 libopenal1:i386 libgl1-mesa-glx:i386

Build the game

This time around I used cmake instead of Code::Blocks. It is configured to work on Linux and Windows. If you want to build the code yourself, just follow the instructions in the Github repository.

More information

Because of the license issues with the original Oculus Rift SDK, I used the OpenHMD library. It works pretty good, but the original SDK has more high level features. I might experiment with the alternative solution to run the Oculus Rift SDK in a separate process.

There are some hacks inside the code to improve the Oculus Rift experience, which also affects the normal gameplay without a connected HMD device. I plan to replace all hacks with a proper implementation and merge the Oculus Rift changes with the original port.

Before I started this project, I had a look at the rift support implementation from LeeN (mtbs3d forum). This helped me to get started. Thx LeeN.

Jedi Academy (Single Player Linux Port)

Here we go again. This time it’s a completely playable Jedi Academy and it is better tested than Outcast was. I played at least half of the game.
I guess there was 4 days of porting and 2 days of gaming (not all day long of course).

A lot of Outcast porting code could be used for this version, so I was a lot faster this time around.

https://github.com/xLAva/JediAcademyLinux

 

More information about the Linux Port:

Binary

If you just want to play the game without compiling anything, the binary files are located here: “code/Release/”.
The binary files are not build or tested to run on every Linux system, but they should work on Ubuntu 12.10.
I just wanted to add a little short cut.

The following files are needed to run the game:
– jasp
– jagamex86.so

In order to start Jedi Academy, the “base” folder from your original game has to be copied into the folder of the Linux binary files.
Be sure to mark “jasp” as executable and start the game with it.

For those not having the Steam version: you’ll need the 1.01 update from here http://www.lucasarts.com/support/update/jediacademy.html

Example:
~/jedioutcast/Release/jasp
~/jedioutcast/Release/jagamex86.so
~/jedioutcast/Release/base/

Needed libraries on Ubuntu 12.10 32bit:
sudo apt-get install libopenal1 zlib1g-dev

Needed libraries on Ubuntu 12.10 64bit:
sudo apt-get install ia32-libs libxxf86dga1:i386 zlib1g-dev:i386

Development

I used Code:Blocks as starting point for this port.
The whole compile process is based on it, but I think it should be pretty easy to add Makefiles or other compiling structures.
The source code is compiled with GCC.

My development system: Ubuntu 12.10 64bit
– I’m using a 64bit system, but this port is still a 32 bit program!

Needed development libraries (and codeblocks):
sudo apt-get install codeblocks g++-multilib libgl1-mesa-dev:i386 libxxf86dga-dev:i386 libxrandr-dev:i386 libopenal-dev:i386

Known Issues:

– multi-monitor handling is still experimental
– some font rendering issues with the Intel Mesa driver (on my test machine)
– input handling in window mode is not perfect

Widescreen Feature:

This is the only thing I changed from the original code to improve the gaming experience.
– added some tweaks for widescreen support (show more content left and right instead of cutting content from top and bottom)
– if you want to play in your native monitor resolution you have to choose the following option “2048×1536”. I change this to the current resolution of the main monitor during OpenGL start up.

Porting Notes

This was a fast port, so don’t be surprised to see some bad hacks in place.
The first goal was to get it to run. Making it better is the next step.
I share the code now (in it’s current shape), because I know you want to play with it and maybe help out.

There is still a lot of work left to do:
– CLEANUP: I have a lot of porting helpers in place (comments and other stuff)
– stay closer to the original code: play with compiler flags to avoid/revert some bigger changes
– make my widescreen tweaks optional