Exuding awesomage...
   
Subscribe to the exclusive RSS feedGet more of my Pleph awesomeness on Twitter!

[Games] How to get Bastion from the Humble Indie Bundle 5 working on Optimus cards with Bumblebee on Ubuntu 12.04


Posted by aspersieman on 2012-06-04

If you've not heard about the latest Humble Indie Bundle 5 you must have been living under a rock. This is certainly the best Humble Bundle yet.


All the games are super awesome but my favorite is Bastion, a fantastic and super fun game. It's definitely become one of my favorite all time games.

Unfortunately after paying more than the average for the bundle and claiming the games on the Ubuntu Software Centre and installing the games I realized that Bastion didn't work. All the other games worked fantastically and I was very impressed at the developers work to make this so easy, but I really wanted to play Bastion.


I could run Bastion using my Intel 3000 graphics card, but once it reached the menus, the screen was completely black. I tried running it using the I did some investigation by running Bastion from the command line using Bumblebee as normal. Doing this however gave me the following error:

Unhandled Exception: OpenTK.Graphics.GraphicsModeException: Requested GraphicsMode not available.
  at OpenTK.Platform.X11.X11GraphicsMode.SelectGraphicsMode (ColorFormat color, Int32 depth, Int32 stencil, Int32 samples, ColorFormat accum, Int32 buffers, Boolean stereo) [0x00000] in :0 
  at OpenTK.Graphics.GraphicsMode.LazySelectGraphicsMode () [0x00000] in :0 
  at OpenTK.Graphics.GraphicsMode.get_Index () [0x00000] in :0 
  at OpenTK.Platform.X11.X11GLNative..ctor (Int32 x, Int32 y, Int32 width, Int32 height, System.String title, OpenTK.Graphics.GraphicsMode mode, GameWindowFlags options, OpenTK.DisplayDevice device) [0x00000] in :0 
  at OpenTK.Platform.X11.X11Factory.CreateNativeWindow (Int32 x, Int32 y, Int32 width, Int32 height, System.String title, OpenTK.Graphics.GraphicsMode mode, GameWindowFlags options, OpenTK.DisplayDevice device) [0x00000] in :0 
  at OpenTK.NativeWindow..ctor (Int32 x, Int32 y, Int32 width, Int32 height, System.String title, GameWindowFlags options, OpenTK.Graphics.GraphicsMode mode, OpenTK.DisplayDevice device) [0x00000] in :0 
  at OpenTK.NativeWindow..ctor (Int32 width, Int32 height, System.String title, GameWindowFlags options, OpenTK.Graphics.GraphicsMode mode, OpenTK.DisplayDevice device) [0x00000] in :0 
  at OpenTK.GameWindow..ctor (Int32 width, Int32 height, OpenTK.Graphics.GraphicsMode mode, System.String title, GameWindowFlags options, OpenTK.DisplayDevice device, Int32 major, Int32 minor, GraphicsContextFlags flags, IGraphicsContext sharedContext) [0x00000] in :0 
  at OpenTK.GameWindow..ctor (Int32 width, Int32 height, OpenTK.Graphics.GraphicsMode mode, System.String title, GameWindowFlags options, OpenTK.DisplayDevice device, Int32 major, Int32 minor, GraphicsContextFlags flags) [0x00000] in :0 
  at OpenTK.GameWindow..ctor (Int32 width, Int32 height, OpenTK.Graphics.GraphicsMode mode, System.String title, GameWindowFlags options, OpenTK.DisplayDevice device) [0x00000] in :0 
  at OpenTK.GameWindow..ctor () [0x00000] in :0 
  at Microsoft.Xna.Framework.GameWindow.Initialize () [0x00000] in :0 
  at Microsoft.Xna.Framework.GameWindow..ctor () [0x00000] in :0 
  at Microsoft.Xna.Framework.LinuxGamePlatform..ctor (Microsoft.Xna.Framework.Game game) [0x00000] in :0 
  at Microsoft.Xna.Framework.GamePlatform.Create (Microsoft.Xna.Framework.Game game) [0x00000] in :0 
  at Microsoft.Xna.Framework.Game..ctor () [0x00000] in :0 
  at GSGE.ExceptionGame..ctor (System.Exception e) [0x00000] in :0 
  at GSGE.App.Run[App] () [0x00000] in :0 
  at GSGE.App.Main (System.String[] args) [0x00000] in :0 
[ERROR] FATAL UNHANDLED EXCEPTION: OpenTK.Graphics.GraphicsModeException: Requested GraphicsMode not available.
  at OpenTK.Platform.X11.X11GraphicsMode.SelectGraphicsMode (ColorFormat color, Int32 depth, Int32 stencil, Int32 samples, ColorFormat accum, Int32 buffers, Boolean stereo) [0x00000] in :0 
  at OpenTK.Graphics.GraphicsMode.LazySelectGraphicsMode () [0x00000] in :0 
  at OpenTK.Graphics.GraphicsMode.get_Index () [0x00000] in :0 
  at OpenTK.Platform.X11.X11GLNative..ctor (Int32 x, Int32 y, Int32 width, Int32 height, System.String title, OpenTK.Graphics.GraphicsMode mode, GameWindowFlags options, OpenTK.DisplayDevice device) [0x00000] in :0 
  at OpenTK.Platform.X11.X11Factory.CreateNativeWindow (Int32 x, Int32 y, Int32 width, Int32 height, System.String title, OpenTK.Graphics.GraphicsMode mode, GameWindowFlags options, OpenTK.DisplayDevice device) [0x00000] in :0 
  at OpenTK.NativeWindow..ctor (Int32 x, Int32 y, Int32 width, Int32 height, System.String title, GameWindowFlags options, OpenTK.Graphics.GraphicsMode mode, OpenTK.DisplayDevice device) [0x00000] in :0 
  at OpenTK.NativeWindow..ctor (Int32 width, Int32 height, System.String title, GameWindowFlags options, OpenTK.Graphics.GraphicsMode mode, OpenTK.DisplayDevice device) [0x00000] in :0 
  at OpenTK.GameWindow..ctor (Int32 width, Int32 height, OpenTK.Graphics.GraphicsMode mode, System.String title, GameWindowFlags options, OpenTK.DisplayDevice device, Int32 major, Int32 minor, GraphicsContextFlags flags, IGraphicsContext sharedContext) [0x00000] in :0 
  at OpenTK.GameWindow..ctor (Int32 width, Int32 height, OpenTK.Graphics.GraphicsMode mode, System.String title, GameWindowFlags options, OpenTK.DisplayDevice device, Int32 major, Int32 minor, GraphicsContextFlags flags) [0x00000] in :0 
  at OpenTK.GameWindow..ctor (Int32 width, Int32 height, OpenTK.Graphics.GraphicsMode mode, System.String title, GameWindowFlags options, OpenTK.DisplayDevice device) [0x00000] in :0 
  at OpenTK.GameWindow..ctor () [0x00000] in :0 
  at Microsoft.Xna.Framework.GameWindow.Initialize () [0x00000] in :0 
  at Microsoft.Xna.Framework.GameWindow..ctor () [0x00000] in :0 
  at Microsoft.Xna.Framework.LinuxGamePlatform..ctor (Microsoft.Xna.Framework.Game game) [0x00000] in :0 
  at Microsoft.Xna.Framework.GamePlatform.Create (Microsoft.Xna.Framework.Game game) [0x00000] in :0 
  at Microsoft.Xna.Framework.Game..ctor () [0x00000] in :0 
  at GSGE.ExceptionGame..ctor (System.Exception e) [0x00000] in :0 
  at GSGE.App.Run[App] () [0x00000] in :0 
  at GSGE.App.Main (System.String[] args) [0x00000] in :0 

I did a lot more research and could find very little related to the above error. I did find people suggesting this to fix the problem by changing the openTK configuration file, but it didn't work. After even more searching I found what worked. You need to prefix "force_s3tc_enable=true" before executing the Bastion binary. I edited the bash file that came with the Bastion installation from the Ubuntu Software Centre to include this command. I changed the file /opt/bastion/Bastion/bastion64.sh to look like this:

#!/bin/bash
optirun bash
cd /opt/bastion/Bastion
force_s3tc_enable=true LD_LIBRARY_PATH=lib64:. ./Bastion.bin.x86_64
exit $?

UPDATE 2012-06-23: Here is a step-by-step guide to get it to work.

NOTE: This applies to 64 bit systems - I am not sure it will be the same under 32 bit systems. Also, this only applies to systems with NVidia Optimus enabled graphics cards. If you have such a graphics card you need to install Bumblebee.

1) Back up the launcher for Bastion by running the following command:

gksudo cp /opt/bastion/Bastion/bastion64.sh /opt/bastion/Bastion/bastion64.sh.bak

2) Now, open a terminal (on Ubuntu 12.04, press the super button and type "terminal") and type the following:

gksudo gedit /opt/bastion/Bastion/bastion64.sh

Make sure to type your password when prompted.

3) Replace all the text in the text editor with the following:

#!/bin/bash
optirun bash
cd /opt/bastion/Bastion
force_s3tc_enable=true LD_LIBRARY_PATH=lib64:. ./Bastion.bin.x86_64
exit $?

4) Run Bastion as normal by hitting the super (Windows) key and searching for "Bastion".

5) ???

6) Profit

Now the game works fantastically, just like on Windows, on my Optimus enabled NVidia graphics card on Ubuntu 12.04.

I'm not sure if this is such a good thing, however, as I probably won't be doing anything other than playing Bastion from now on :)


Categories games.
Tags: games, bug, linux, bash, bundle, optimus, humble, nvidia, tip, bastion, ubuntu, humble bundle

Comments

Posted by Evan on 2012-06-24 04:59:23

Thanks but all I had to was download something from Microsoft ha. Bastion is awesome.



Posted by aspersieman on 2012-06-23 12:33:26

Hey evan!

Thanks for your comment.

I have updated the post to be easier to follow.

I hope this helps. Please let me know if you had any problems or if you got it working.

Now I have to go play some more Bastion.



Posted by evan on 2012-06-23 02:30:43

For someone with all the sytem requirements to play Bastion but little to no knowledge in script and fixing errors how would you explain the process of getting Bastion to function in simplest terms?



Have Your Say

Comments support markdown syntax.

NOTE: COMMENTS HAVE BEEN TEMPORARILY DISABLED.

NOTE: Comments are moderated and will be shown only once it's been approved by the administrator.

loading...
loading...
loading...