The engine for high end graphics on low end hardware

About   Architecture  Tooling


About

The Dynasprite engine is used to power games with a requrement to run on low end devices while still delivering high quality graphics. It does this by mostly utilizing 2d vector graphics and using very compact data storage formats.

Dynasprite is designed utilize little CPU, GPU and power while keeping the size of the entire application down. This is done using clever file formats which contain data which is optimized ahead of time by a customized toolchain. This keeps file sizes and load times down and makes loading as simple as just getting the file into memory. Alternative methods would be to compress and decompress data (like png, jpeg), but that requires time and memory to decompress on the device!

The engine is being developed in parallell with games and it's capabilities will grow with the needs of these games. Parts of the tool chain and file formats will be open sourced in the future. The competition is in the games, not in the technologuy. This will also help enable the community to contribute new efficient engines and more and better tooling than what's available today.

Tooling

Fast and pluggagle tooling is key to being able to use as original files as possible and use automated processing to split and format the data in a way suitable for the platforn.

When using .svg as an input, the "Hippie" preprocessing tool can extract polygonal data, triangulate it and and write it to a binary file. Different layers can be output to separate triangle lists. Coordinate labels can be output to a configuration file (to facilitate indicating pivot points, anchor points or placement of things).


One source file producing several data structures.

All data used by the dynasprite engine are preprocessed to be compact, fast to read and use little memory overhead to decode. Usually it's about mapping the resource content into memory and patch a small companion structure to point into the right places in memory.

Configuration file
A hashmap structure with string indices. The data associated with each key is a binary segment (and tough not common, can be another hashmap).
Integer array
An array of int16, usually used as pairs to store coordinates
Triangle list
A compact vertex and color data for 2D triangles that can be used straight as an array input to a vertex shader. Coordinates are int16 and color is RGBA4444 or RGB565.

In the long run, parts or the whole tool chain will be made public together with the file formats. This is mainly an encouragement to share file formats between engines to allow for the development of more expensive and flexible tools.

Architectural overview

The dynasprite engine is fine tuned for fast rendering and high performance on low end devices. It's espeically well suited for markets where mobile phones aren't very powerful.

By using the dynasprite engine, creating high performing games is much easier since, tooling and engine is geared towards this. It's a "general purpose" engine, meaning that there's full access to any layer, but some basic things are made simple. The current main focus is on rendering smooth vector-based graphics artwork.

When it comes to porting the game to support multiple platforms, the dynasprite engine will assist by providing acces to platform independent APIs for most things needed in a game. New components are being developed continously, but the goal is to keep the API to a bare minimum to make it easier to learn.

On android, it's a NativeActiviy, which means that there is no java code involved, this is to reduce the size of the generated .apk file.

There are also many other components that can be used along with utilities for 2d physics, vector, matrix math, timers etc. Currently there is no support for localization of graphics, sound or text.

Extensible and portable

The engine is written entirely in C and is easy to extend with custom functionality. The engine is a "library style" engine which makes it very flexible. The fact that it's written in C makes it easy to integrate with a game written in C, C++, or expose desired functionality to a scripting language like Lua. It also makes it very portable to new platforms where compilers and tooling might not yet be up-to-date with the latest standards.

(c) 2015-2016 Hati Hati Games AB