GameDuell Cross-Platform Tool Goes Open Source

Over the last year, our developers at GameDuell have been working on a cross-platform solution in order to be able to deliver our games to different systems and devices with more efficiency. The result of this long-term project is the DuellTool.

What is the DuellTool?

The DuellTool a command line tool for setting up, building and running applications on any platform. It is built on Haxe – an open source toolkit based on a modern, high level, strictly typed programming language, a cross-complier, a complete cross-platform standard library and ways to access each platform’s native capabilities.
The Tool, also available to use for other general tasks within app development, is made in a modular way via plugins. Each plugin is separate from the tool itself, which merges the needed plugin on execution.
The execution of the tool is always “duell”, followed by a command such as “build” or “setup”, and then a plugin name like “ios” or “emptyProject”. For example, “duell build ios” will run the command “build” with the “ios” plugin. You can also pass additional parameters to execution by prefixing with “-“, e.g. “duell build ios -verbose”.

DuellTool architecture

The DuellTool has three types of plugins that you can use:

GameDuell Cross-Platform Tool Goes Open Source • The “create” plugins for sample projects
• The “setup” plugins for setting up an environment or anything that requires a one-time set up.
• The “build” plugins.
The latter ones are, of course, the most important, so they should be discussed in more detail.

Duell Environment

The important part here is the environment, which is the real value of the Tool, where libraries can be implemented in the given environment with independence and modularity. If you don’t like one of the libraries, you are free not to use it, but you can also reuse all the others as they are completely independent from each other.

GameDuell Cross-Platform Tool Goes Open Source For multiple engines, we can very easily cooperate and share modules between them. For example, if we make a SDL library, we pretty much replace Input and OpenGL, but we can still use other libraries, too.
We still share the other libraries that don’t depend at all on Input or OpenGL. Every library is modular so it does not require any specific engine to work with as it can operate on its own or with another library.
A great example of this can be an atlas generation library, or a WebP encoding library. This is what we believe can be achieved by doing things in a modular way.

What’s the purpose of the DuellTool and what does it offer?

We created the tool for a handful ofreasons:

1. In Haxe, when you have local Haxlib (made by a game developer), whenever there is a new release or a patch, developers need to update it manually. In contrast, the DuellTool is doing that automatically. For example: when you run a Duell update, the tool will go through all the libraries you’ve already specified, checks the version and then installs/updates them automatically (including both Haxe and Duell libraries). This way, it is much easier to switch between projects and setups.
2. The DuellTool also comprises Duell libraries, which support backends. This means that if, for example, you have one developer working on the iOS and another AS3 developer working on the flash backend, they can actually work simultaneously, in parallel, without breaking each other’s code. The only thing they need to do is to agree on an API and write a simple extern to define that.
3. Regarding the backends, the DuellTool has completely abstracted from #if flash Code #end, etc, that are usually needed for each platform, if you want something native in Haxe, which allows game developers to write only pure Haxe code.
4. Unlike any other Haxe library, the Duell Library supports plugin system. So if you have a library that requires assets to be copied or something else to be added to plist etc, you can write a plugin inside the library. This plugin can be executed at build time. This way, the library is actually self-responsible and does not require any extra setup and time from a game developer.
5. The Tool is able to build NDLL and merge them in the final build – this is a detail that, so far, has been missing in the mainstream building tools. 6. We needed an enterprise level tool which is modular, clean and easier to maintain, and the DuellTool fully answers that need.

And here are some of the benefits of using the DuellTool:

1. Based on the plugin system, it is easier to add a new “build” plugin for another target.
2. The process of creating a Native Extension and link it with the Haxe code is simplified in the DuellTool.
3. The Tool is setting up the environment for you, so you don’t have to install anything manually with the exception of Haxe.
4. The Duell libraries are very powerful, which means that you can make a library perform on its own during the “build” stage, e.g. packing atlases, copying assets, uploading a binary somewhere, etc. The library is responsible for its own setup, making the life of a game developer certainly easier.

How exactly does the DuellTool work?

On the picture below, you can see the general flow that happens when you build. You can also notice which components actually work on it.

GameDuell Cross-Platform Tool Goes Open Source If we take command like “duell build iOS” as an example, starting from below the dependencies of the project get parsed and we update their versions (git tags). After the update comes the selection of the plugins, in this case – iOS. Then we parse the configuration. It looks very much like any build configuration file you are used to, but what is different about it is the way how it is parsed. As you can see, it’s not only the DuellTool that parses the configuration – the plugin also parses its own specific part. Most importantly, however, the libraries can also have specific a configuration which can make them parse completely independently.
From this XML configuration, we can build a data model that allows us to build for the target platform. When we have finally reached the building part, the DuellTool actually doesn’t do anything anymore, as now it’s all about the “build” plugin and the libraries.

It’s open source!

We at Gameduell are happy to announce that we published the DuellTool open source for the entire cross-platform developers’ community. If you go to https://github.com/gameduell/duell, you can find everything there: the tool, the libraries, and the plugins.

How to get started?

Install Duell
In your command line, run $ haxelib install duell
Setup Duell
To setup the Duell, run this: $ haxelib run duell self_setup
Testing Duell
In order to test, run this:
$ mkdir emptyProject
$ cd emptyProject
$ duell create emptyProject
$ duell build html5

GameDuell Cross-Platform Tool Goes Open Source This article is published with the permission of its author, Khaled Garbaya, Cross-Platform Developer at GameDuell (http://www.khaledgarbaya.net)

back to list