Categories
Uncategorized

DLC Downloader GUI

This week I worked on the GUI for downloading DLC packages. Since I could automate the process of producing the ready-to-upload package for Android, I needed to test if we could conveniently download the downloadable game packages from Play Store servers. For this, we require an in-launcher GUI, which users can use to browse available downloadable games and download any game. I will refer to this new GUI as downloader GUI.

There are currently 11 freeware games that ScummVM is allowed to distribute. And we plan to make them downloadable through our downloader GUI.

Mockup

I first created a mockup design for our new downloader GUI based on the ScummVM theme and asset. Here is a video feed of the same:

You can find the Figma link here.

Keep It Simple, Stupid

Our current GUI is limited. Current widgets will unfortunately not be able to structure and display the elements the way I want. For example, there is no multiline support; the grouped list can’t have a button and an icon, etc. So, it’s not possible to recreate the above design without modifying or creating new widgets, which might take a lot of time.

Sev has recommended getting things done pragmatically and keeping it simple initially –

simple list, with the installed games graying out. And one button “Download” aside, similar to how the launcher now works

and so, I did exactly that this week.

After this, I will do the most important thing – implement the downloading mechanism, i.e., retrieve list of DLCs, request a DLC to download, handle broken downloads, etc.

If there is time, we can implement the new functionalities of widgets according to our needs.

The GUI

ScummVM’s GUI is composed of Widgets and Dialogs.

Widgets are the building blocks of our user interface. There are implementations of how the widget should be drawn, how it should look, what text/images it should contain, etc. Dialogs are modals that provide the space to draw and display widgets.

There are also STX (ScummVM Theme XML) files that contain the layout specifications. We can describe the actual positioning and layout of widgets and dialogs here.

Current Progress

I have created a “Download Games” button on the launcher that opens the Download Games dialog. In this dialog, users will be able to browse the available downloadable games. Here is how it looks currently:

I have also implemented the functionality where already downloaded games are grayed out. To know if a game is already downloaded, we are scanning game entries in scummvm.ini for unique “download” keys.

Categories
Uncategorized

Implementing Automatic DLC Packaging For Android

In my last blog, I explained how I got started on the DLC Packaging System, which is one of the parts of my Project. Today I will talk about how I have implemented this automatic DLC packaging for Android Play Store. If you have read my previous blog, you know Android has a new universal format for packaging called Android App Bundle (AAB). You can read more about the new format here: https://developer.android.com/guide/app-bundle. The important point for us is that it has support for Dynamic Features, which supports on-demand delivery of DLCs.

In AAB, we are utilizing the Asset Delivery Feature of Play Store. So, we need to prepare a new AAB package that will include our freeware DLC packages. Note that we cannot upload DLC packages separately (like in Steam) in Android.

Currently, ScummVM Team is creating the APK (not the AAB) for Android. So, there is a need to change some configurations to cater to our new needs. Fortunately, since we are using gradlew commands to build our Android APK, we only need to change one thing – running a different command. We need to modify the command ./gradlew assembleDebug (or assembleRelease) to ./gradlew bundleDebug (or bundleRelease). We can also add a new option for AAB, so devs can produce both APK and AAB depending on their need. E.g. we only need AAB when releasing a new version for Play Store, and the buildbot can build the APK as usual.

Once we have created our new ScummVM format, we need to add our DLC games to the AAB. Google has provided some Python scripts to do this. There are two steps involved in creating the ready-to-upload package for Android: First, prepare an intermediate DLC package using the game data files. Basically, organize files and generate the AndroidManifest.xml. Second bundle the AAB we created earlier with the intermediate DLC to produce our ready-to-upload package.

So, I modified my export-platforms.json and the master packaging script to run those provided Python scripts and set up any required dependencies. The output is a ready-to-upload AAB file.

Categories
Uncategorized

Getting Started With Game Packaging System

Hey there! I’m very excited to share what I’ve been up to since the coding period started. But before I jump into the details, let’s get familiar with the tasks I’m tackling during this period.

Tasks During Coding Period

My project involves three major tasks:

  1. Package games as DLC packages for various distribution platforms. The freeware games that ScummVM is allowed to distribute should be separately packaged such that they can be downloaded on-demand. This will give the users the flexibility to download any available games from the ScummVM launcher itself.
  2. Create the launcher’s GUI for showing/listing the games and implementing the downloading mechanism.
  3. Package games with the ScummVM executable:
    1. Single game bundled together with the ScummVM executable with their own icon, screenshots, etc. (using autostart). Eg: https://store.steampowered.com/app/1368340/Beneath_a_Steel_Sky/
    2. One or more games bundled together with the ScummVM executable such that users can launch these games from inside the launcher. Eg: https://snapcraft.io/scummvm

Current Progress

This week, I focused on the first task of automatically packaging games as DLC for different platforms and, if possible, automatically uploading them to the intended platform.

For this, I will be using the infrastructure and APIs provided by distribution platforms to host and deliver our game packages on demand. Each distribution platform has its own requirements for how the package should be structured, including relevant metadata and config files.

So, I’ve been working on a program that takes user-provided games, allows them to specify the export platform, and generates ready-to-upload DLC packages. If possible, the program will also handle the upload process of the intended distribution store.

DLC Packaging System

We have a simple architecture for the DLC packaging system: One program (master packaging script) will load relevant information from the game’s metadata and export formats using the data provided by the user and, using that, outputs a ready-to-upload DLC package(s).

Think of the “game’s metadata” and “export formats” as black boxes that hold all the necessary information for packaging a game in a specific format.

The game’s metadata acts as a universal database containing all the required metadata for creating and publishing the DLC package for any export format.

On the other hand, the export formats specify how we should package a game’s DLC for a particular target platform (Steam, Android, Snapcraft, iOS, etc.). These export formats guide the master packaging script in preparing the DLC package according to the requirements of each platform.

Describing Game’s Metadata

For creating the universal metadata, I had to research as much distribution platforms as possible and check if they support DLC (i.e. provide any infrastructure/API to host/deliver our DLC). If DLC is possible, I had to find what kind of metadata they required for packaging and publishing the DLC package. You can see my findings here.

Some useful insights:

  1. Steam and Microsoft Store lists DLCs on their store. So, we must provide screenshots, logos, header images, etc. On other platforms, we need very little information (just enough to identify DLCs) as we are not showing DLCs on the store and only requesting them on-demand from the app.
  2. Android has introduced a new universal standard called Android App Bundle, which has some useful features like dynamic deliveries that also support DLC. This is great because it means the packaging process remains the same and we only need to integrate different SDKs/APIs for each distribution stores.
  3. Linux has three different universal packaging standards available – Snap, Flatpak and AppImage (relevant xkcd). As far as DLC support goes, none of the distribution platforms supports the on-demand delivery. So, we will create standalone packages for the DLC (with its icon, description, etc.), with the ScummVM executable package as a dependency. The game can be hosted on snapcraft as a new content-only snap, and users can download it from the store instead of the launcher. After installing the game package, users can launch it from the desktop shortcut (which essentially runs ScummVM with some command line arguments) or from the ScummVM launcher (if it’s possible to edit the scummvm.ini game entries)

Describing Export Formats

Right now, the export formats are all about specifying which script to run and what arguments to pass in each phase.

Based on my findings, I have divided the process of creating DLC package into three phases:

  1. Preparation Phase: This phase prepares the game files in the appropriate format. It will either be used by the bundling phase or will be ready to upload to the distribution platform. This phase also prepares/downloads any other required files like icons, screenshots, etc., so they can be used in the uploading stage, or we can manually upload them to the store.
  2. Bundling Phase: Some distribution platforms require the DLC package to be included with the base package, not as a separate package. Eg: Play Store’s Android App Bundle. So, in this phase, we prepare the bundle using the intermediate game files prepared in the preparation phase.
  3. Uploading Phase: If any API is available to automate the upload of the DLC package or any other required files to store, then we do that in this phase.

Phase 2 and 3 are optional.

This is still work in progress and I’ll be making improvements to it in the future. So stay tuned for updates!

Thanks for reading to the end! If you have any feedback, I’d love to hear it.

 

Categories
Uncategorized

Introduction

Hello, I am Ankush Dutt, a Computer Science student based in India. I am thrilled to be part of the Google Summer of Code this year and I am very excited to start contributing to my project – Automated system for packaging freeware games with ScummVM. I will be regularly posting updates on my progress through my upcoming blogs. All communication regarding the project will happen on ScummVM discord’s gsoc-packaging channel.

If you need to reach out to me, please feel free to do so via email at ankushdutt.cs@gmail.com or on discord at @ankushdutt.

Thank you for your time, and I look forward to making a meaningful contribution to the project.