top of page

Making a Compass

One of the main visual elements in Aural Island is the compass. The compass helps players locate audio sources, get around obstacle without getting lost.

I was concerned about making the compass, but quickly learned that phones have built-in compasses that I could easily access. How convenient! The compass worked well, until it didn't. I tested the game on my new phone and the compass went all over the place. It turns phone compasses are sensitive to interference and need calibration. Using a compass for my compass was to be too unreliable.

Instead I went with the gyroscope, which measures the phone's rotation. First I directly applied the gyro orientation to my player character, but the phone and the player use different orientation systems, so turning the phone up and twisting it turned my player left.

Next I tried converting the gyro's orientation to work with my player controller, which worked at first; when I turned left, so did the compass. Unfortunately, after some testing, I found out this method has a nasty quirk. The gyroscope had a habit of thinking it was rotating when it was stationary. Tracking tends to be a bit difficult when the world is turning uncontrollably around you.

I scoured the internet for solutions and found posts suggesting that instead of asking the gyroscope for it's orientation, I ask it for how much it is turning, and use that to rotate the player myself. I couldn't figure out why this would be any different, but I tried it. It worked. I got responsive and reliable results. The only problem I found was rotation tracking was less direct the more the phone was tilted up - starting north and doing a 360 could leave you facing east. Still, this is a more manageable problem for players, and I had similar issue with the other methods.

I finally made a compass that worked. Plus, with this method, players always start facing north, which means I have direct control over the start of the game.

Featured Posts
Recent Posts
Search By Tags
No tags yet.
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page