Sprites
Sprites are the graphics used by playable or interactive characters in your scenes. You can import sprites with the button if you want to load the PNG as-is. You can also convert any PNG into MD Engine format with the button. For more information regarding this, you can check the Image Converter section.
You can also add sprites to your game by including .png
files in your project's assets/sprites
folder.
Image Requirements
The image size must be multiple of 8px in both width and height.
If you add the sprite as-is, it must be an indexed .png
files with a maximum of 16 colors.
If you are unsure about the color requirements you can always use the Image Converter.
Animated Sprites
If you want to have sprites that play animations, you need to make your PNG image containing each animation on a separate row.

Each row will represent one animation, during compile time empty space would be optimized out, so it's not a problem if there are some rows that have more empty space than needed.
Settings
Sprites settings have two main sections Animation Settings and Sprite Settings.
Animation Settings
We've two main options to edit here, Animation Cell Size and Animation Speed Type.

Animation Cell Size
This represents the size of an individual frame of the image.
Animation Speed Type
This represents the type of animation setup.
You have three different options:
- Global speed
- Per Animation speed
- Per Frame speed
Global speed
With this option all the sprite animations and frames have the same speed.
It's the most simple option and works best for simple decorations and NPCs.
Per Animation speed
With this option, each animation can have different speed values.
This allows to have faster animations and slower animations when both have the same number of frames.
If you select this option you can edit the value in the Frames window.

Per Frame speed
Each frame of each animation can have different speed values. This allows some frames to stay longer than others without manually duplicating them on the PNG image.
If you select this option you can edit the value in the Frames window under each frame.

Sprite Settings
The Sprite settings hold information related to how the sprite will be used when attached to an actor and how it will be stored in the ROM.

Compression Mode
This represents how the image is compressed when compiled into the ROM.
You have four different options:
- Best
- No Compression
- APLIB: good but slow, don't use it for streamed / animated stuff.
- Custom LZ4: average ratio but fast, recommended for streamed / animated stuff.
The best option if you are just starting is to use No Compression for sprites with animations and Best or APLIB for static sprites with just 1 frame.
Using Best or APLIB will increase the scene loading time but the ROM will be smaller.
Optimization Type
This represents how the image is optimized during the compile time.
You have four different options:
- Balanced: Balance between used tiles and hardware sprites.
- Sprite: Reduce the number of hardware sprites at the expense of more used tiles.
- Tile: Reduces the number of tiles at the expense of more hardware sprites.
- No Optimization: cover the whole sprite frame.
The best option if you are just starting is to use Balanced.
If your sprite is too big it will cause problems during compile time.
Hardware Sprites
Each sprite is composed of an internal type of object called hardware sprite.
They are a small, independently drawn graphic element that the video hardware can move, flip, or hide without redrawing the whole background.
There are a total of 80 hardware sprites available.
Internally they can have a size of 8×8, 8×16, 8×32, 16×16, 16×32, 32×32 or 32×64 pixels.
There is also a scanline limit, even though 80 sprites can exist, only 20 can appear on a single scanline (horizontal row).
If more than 20 overlap, the excess don’t appear (they “drop out”) — classic flicker behavior.
This limit can be removed for the Desktop Export with the Enhanced Mode.
Maximum Sprite Sizes
Each MD Engine Sprite is be composed with the smaller hardware sprite, and can only have a maximum of 16.
This means, the biggest sprite you can have is 128px
x128px
in size.
The can be wider or taller but they would need to have the other axis smaller than 128px
.
If a sprite uses more than 16 hardware sprites, the following error would be printed on build:
Sprite frame '<sprite_symbol>' uses 20 internal sprites, that is above the limit (16), try to reduce the sprite size or split it.