File Queue

A predictive file downloader service to help load games faster.

What is File Queue?

File Queue is a feature that allows a game to download important assets that it will need in the future in the background while the game is active. In essence, a player can start playing the game and during their play session, File Queue will pick the assets needed by the game next and download it ahead of time, therefore reducing loading times for the game and improve the overall player experience.

🚧

Feature WIP

This feature is currently a work in progress; the current version allows the game to download assets randomly (no smart algorithm being used yet). However, in the future, we are planning to make this feature smarter so it can -- over time, detect what assets may be required and thus download the correct ones ahead of time.

How it works?

File Queue reads the manifest file generated at build time. This file contains a list of all the assets required for the game to run. In the current implementation -- the initial one, we only iterate over the list top to bottom, downloading the assets within one by one.
Given the randomness of the list being generated, this feature may decrease loading times of your game (i.e. it happens to select the right asset at the right time randomly) or in worst case scenarios, doesn't affect loading times (i.e. if a game needs asset2 but the queue downloaded asset1, then it will just download asset2 once it requests it just like normal).

πŸ“˜

Opt-in

Currently, File Queue is an opt-in feature. This means it isn't enabled for builds by default and you need to enable it, either per build or for all builds.

Activating File Queue in the Game Manager

Navigate to the Game Manager:

The Game ManagerThe Game Manager

The Game Manager

After that select your project and then go to the Builds menu. You can enable or disable File Queue on all future builds at once using the button at the top:

The enable/disable all builds button.The enable/disable all builds button.

The enable/disable all builds button.

You can also enable or disable the File Queue on each build using the Actions drop-down menu, as seen below:

The actions menu showing the "Enable File Queue" optionThe actions menu showing the "Enable File Queue" option

The actions menu showing the "Enable File Queue" option

Controlling File Queue through code

You can also enable or disable File Queue manually through code -- this is particularly useful in multiplayer games as it provides you with the ability to tailor the process according to your network traffic needs.

// Remember to initialize the SDK first

// To start File Queue you can call the method as shown below
private void StartFileQueue()
{
  Result result = SDK.FileKit.StartFileQueue();
  
  if(result.IsError()) {
    Debug.Log("An error occurred while starting File Queue: " + result);
  }
}

// To stop File Queue you can call the method as shown below:

private void StopFileQueue()
{
  Result result = SDK.FileKit.StopFileQueue();
  
  if(result.IsError()) {
    Debug.Log("An error occurred while stopping File Queue: " + result);
  }
}