Using a Windows Laptop with a Bluetooth Keyboard

I recently purchased the Microsoft Bluetooth Mobile Keyboard 6000, and while being generally happy with it (despite the lack of dedicated home / end buttons) my main concern with it was that after just 8-10 seconds the keyboard seemed to go into sleep mode, requiring a second or so to wake up again. According to the Microsoft documentation the keyboard should not go to sleep until 8-10 minutes, so this behavior was quite unexpected.

It turned out that the issue was in the Thinkpad laptop. The default settings for the Bluetooth driver is to power down the Bluetooth chip to conserve power, causing the keyboard to become unresponsive after just a few seconds.

So if you too experience this issue, you can remove the lag by:

  1. Pressing the <Windows> button on your keyboard
  2. Type  ”Device Manager” and press <enter>
  3. Open the “Bluetooth Radios” section and right click your Bluetooth driver (in my case “ThinkPad Bluetooth 3.0″) and choose “Properties”
  4. Choose the tab “Power Management” and disable “Allow the computer to turn off this device to save power”

Your keyboard should now be completely “lag-free” in daily use.

Unity 3.4.2 f3

Just a small tip: If you are developing with Unity and plan to upgrade to 3.4.2 f3 (which includes a few fixes for Android builds), there’s a risk that all your audio files will stop working after the upgrade. Personally I had to remove all audio files and re-import them from the asset server to make them work again.

Volvo Trucks FH16

On November 3 Volvo Trucks launched the game FH16 which I have worked on as project leader and developer for almost a year now. If you have an Android device, iPhone 4, 4S or iPad 2, make sure you check it out – it’s fun and completely free!

The game was created with the game development engine Unity.

Samsung Galaxy S2 Tips

If you happen to be the lucky owner of a Samsung Galaxy S2 phone, you might be interested in this thread at XDA-Developers that has some nice usability tips.

From the thread:

  • In the contacts list, dragging left on a contact sends them an SMS, dragging right calls them.
  • The applications drawer can be pinch-zoomed out.
  • You can take a screenshot of the screen using the Home + Power buttons.
  • Hold down your finger on the notification bar for a few seconds, it then becomes a brightness slider. If you then drag your finger left or right you will decrease or increase your screen brightness.

Read more at xda-developers

How To Do a Clean Install of OS X Lion

If you want to do a clean install of OS X Lion when it’s launched in July you can use the following tip posted at TUAW:

  1. Use Finder to locate the Mac OS X Lion installer, right-click and select “Show Package Contents.”
  2. Find the SharedSupport folder and look for a file named “InstallESD.dmg.” This is the Lion Boot Disc image.
  3. Copy the “InstallESD.dmg” file to another folder, such as your desktop.
  4. Launch Disk Utility and click the burn button.
  5. Select the “InstallESD.dmg” copy as the image to burn, insert a DVD, and in a few minutes, you will have a brand new Lion Boot Disc.

Game Development with Unity

Yesterday I presented a longer version of my seminar Game development for iPhone, iPad and Android devices that I held at the Scandinavian Developer Conference, three weeks ago. I did not film it since I already have the Scandinavian Developer Conference version up, but if you are interested you can now download the individual steps to create a game with Unity below.

Download the updated presentation as a PDF document here

You can view and download the individual videos below:

Game Development with Unity 1/9
In this video I will show you how to create a menu background and buttons with Photoshop:

  1. Create a new document 1024 x 768 for iPad
  2. Draw a gradient background
  3. Create normal and touch down buttons
  4. Save background as PNG
  5. Save each button as PNG
    Note: each button is saved as a 1024×768 image
  6. Save image as PSD

Game Development with Unity 2/9
In this video I will show how to create a game level with colliders in Modo:

  1. Zoom to right unit scale
    Unity uses 1 unit = 1 meter
  2. Create game level objects
  3. Set materials
  4. Create colliders
    Prefix with Cn (CX = Box Collider, etc)
  5. Save as Modo object
  6. Use Modo2Unity script to save FBX
    Script removes camera, light, etc

Game Development with Unity 3/9
In the video I will show how to import menu graphics and level data, and set up colliders, lightning, lightmaps and dynamics:

  1. Create new Unity project
  2. Create some standard folders
    Materials, Scripts, Textures
  3. Import Level1.FBX, Menu graphics, Helper scripts
    AssignMaterial.js, BuildColliders.js
  4. Drag Level1.FBX to a new Scene
  5. Save Scene as Level1.unity
  6. Change Camera near / far distance
  7. Add a Directional Light
  8. Create Colliders from meshes prefixed with CX
  9. Create Lightmaps
  10. Add Rigidbody + Sphere Collider to our Ball
  11. Change Project Physics settings (precision)

Game Development with Unity 4/9
In this video I will create a script to control the ball by tilting the device:

  1. Create BallController.cs script
  2. # Get device Tilt values
  3. # Normalize Tilt values
  4. # Add Tilt force to the Ball
  5. Drag BallController script to the Ball in Unity

Game Development with Unity 5/9
In this video I will add script logic to detect if the ball falls down:

  1. Open BallController.cs script
  2. # Store original Ball position
  3. # Store original Ball rotation
  4. # If Ball Y position < 1.0 then reset values

Game Development with Unity 6/9
In this video I will create the menu system with EZ GUI and Sprite Manager 2:

  1. Create a new Scene: MainMenu1024
  2. Set camera to Orthographic
    Size = 384 (half height of 1024 x 768)
  3. Add EZ GUI: UI Manager
  4. Add EZ GUI: Simple Sprite for background
  5. Add EZ GUI: Load Scene Button for Play button
    Set it to load Level1.unity
  6. Add a material for the background
    Shader = Unlit / Texture
  7. Add a material for all buttons
    Material will be created by EZ GUI Build Atlases
    Shader = Unlit / Transparent
  8. Size and position the Play Button
    Using EZ GUI Size Sprites
  9. Add Level1.unity to the Build settings
    So it can be loaded by the Play button

Game Development with Unity 7/9
In this video I will create the end game menu screen with EZ GUI and Sprite Manager 2. The steps in the video are the same as video 6/9.

Game Development with Unity 8/9
In this video I will show how to disable PVRT texture compression on menu textures in Unity.

Game Development with Unity 9/9
In this last video I will show how to add a trigger to our goal object to load the end game menu. I will also switch target platform to iOS:

  1. Add a Trigger collider to our Goal object
  2. Add OnTriggerEnter() to BallController.cs
    Load the level “GameEnd1024” once the ball enter
  3. Add the scene GameEnd1024 to Build settings
  4. Switch target platform to iOS
  5. Play the game!

SSD Tips

If you have a Mac laptop with 8 GB or more RAM memory and an SSD drive, the default Sleep setting in OSX will significantly decrease the lifespan of your SSD drive.

By default, OSX will always save the full contents of your RAM memory to your SSD drive every time you put your laptop to sleep. This feature, called “Safe Sleep” is handy if you have your laptop in sleep mode for weeks and the power runs out. For most use cases however it’s more or less useless, and can safely be disabled.

I have posted detailed instructions on how to disable the Safe Sleep feature on my Mac OSX tips page