Fling to the Finish: Porting (Steamworks, Nintendo Switch, AirConsole)

I worked on generic cloud save systems, leaderboard, achievements and DLC download architecture for the game to ensure that porting to a new platform would be as painless as possible. For example, the Save system of the game uses a generic master SaveManager.cs class that communicates with platform specific sub-save managers. The SaveManager class sends a “Save.cs” object as save data to the platform save managers and receives loaded data as an object of Save.cs from them. It is up to the platform specific save managers to implement their own cloud save, whether synchronous or asynchronous. The SaveManager supports async saving through a delegates and event system.


Steamworks Integration

I integrated all Steam features into the game, including:

  • Rich Presence
  • Inviting friends to a game
  • Joining a friend’s game
  • Displaying a friend’s in-game status
    • Since the game doesn’t use Steam lobbies, but rather Photon’s lobbies, the room code has to be sent to Steam invites as a command line argument for when the invited player starts their game)
  • Leaderboards
  • Stats & Achievements
  • Cloud Saves
  • DLC system

Nintendo Switch

While I cannot talk in depth about my work on Nintendo Switch because of a non-disclosure agreement, I worked on porting the game to the console and got a first playable build running at an average 50 FPS in two weeks.


AirConsole

I worked on an AirConsole version of the game, which is a version of the game that runs on browsers, Android TVs and tablets, and is controlled using your phone instead of traditional controllers or keyboards and mouse.

The Game Window

Since the AirConsole game runs on very low end architecture like web browsers and Android TVs, I had to aggressively optimize it to support at least a 30 frames per second frame rate, while still not looking utterly terrible. Using the Unity profiler I was able to remove certain unnecessary “polish” elements from the AirConsole version of the game without affecting the overall experience, for example: animations from pinball bumpers were removed to gain roughly a ~5 fps boost.

The quality settings of the game only existed on the browser version, but not on the Android TV/tablet version. Reducing overall texture sizes, lowering the overall render distance and shadow quality helped with major fps gains.

Browsers don’t support loading of massive amounts of memory, so unlike the PC version of the game, we couldn’t rely on loading everything all at once. I converted the game to use Unity’s Addressables system, which is basically an updated asset bundle system that helps to only load bundles of data that are required at any given moment. AirConsole’s requirement is to only load a maximum of 50 MB at a time, which is a very steep requirement, even for a small game such as Fling. Addressables and reduced texture sizes helped with this.

The Phone Controller

I learned and used HTML, CSS & JavaScript to program responsive phone controller views for our game that adjusted according to phone screen sizes.

The main gameplay controller view allows players to pause the game at any instance using the button at the bottom.

Flinging is made very convenient by utilizing the gyroscope of the phone. A simple shake of the phone counts as fling input for the character.


The menus view allows players to easily maneuver around in menus and make selections.


Since the AirConsole version only supports up to 4 players (2 teams), the game uses a much more simplified version of the team setup screen to set up the teams. I worked on this system to automatically assign players to 2 teams, and since there can only be 3 combinations of players in each teams, players can easily press the cycle teams button to cycle through all possible team combos. This is much simpler than having to manually choose specific teams per players, and as I noted down in the UI section, not even close to being as bug prone as the old PC version of this UI.

Gameplay controller view
Menus view
Team Setup View

The Save System

Unlike the PC and Switch versions, the AirConsole version uses a dual save system. What this means, is that there are two separate save files generated for each player.

One file saves only the settings data, and this is saved per device (Windows browser / MacOS browser / Android TV / Fire TV) that the player has played the game on. This is done so that each device can save the best quality settings that it can support, so that when the player goes from a higher end system to a lower end one, they can simply play on a lower quality instead of facing low frame rate issues due to their save file having saved a higher quality settings from a previous device they played on.

The other save file saves player progression, and this is saved per player and gets synced across all devices the player plays the AirConsole version on. No matter where they’re playing, they get to keep their progression and continue from wherever they left off.