Printable Documentation



Installation

Download your preferred version from the Itch.io download page or the older releases page.

Windows

Two versions of GB Studio are available for Windows. The Squirrel Installer version just requires you to unzip, double click and then wait a few seconds while the application installs to your C:\ drive. Once installed a shortcut will be added to your desktop automatically and the application will start. The application will be installed to %LocalAppData%\gb_studio, if you need to install to a different location use the Manual version.

The Manual version is a zip containing the application files, you can unzip this to any location. Once unzipped double click gb-studio.exe to start.

macOS

For macOS unzip the downloaded file and move GB Studio.app to your Applications folder. Double click to start.

If you're having trouble building or running your game you may also need to install Apple's Command Line Tools by opening Applications/Terminal.app and entering the following command.

xcode-select --install

Ubuntu / Debian-based Linux

For Debian-based Linux distros, download the .deb version and run the following commands (Tested on Ubuntu 18.10)

> sudo apt-get update
> sudo apt-get install build-essential
> sudo dpkg -i gb-studio_1.0.0_amd64.deb
> gb-studio

Fedora / RPM-based Linux

For RPM-based Linux distros, download the .rpm version and run the following commands (Tested on Fedora 29)

> sudo yum install libXScrnSaver make lsb
> sudo rpm --ignoreos -i gb-studio-1.0.0.x86_64.rpm
> gb-studio

Getting Started

When you first open GB Studio you will see the New Project window.

If you have an existing project you can open it from here by clicking Open and navigating to the .gbsproj file.

New Project

Give your project a name to get started (don't worry, you can change this later) and choose a project template. If you're new to GB Studio then I would recommend using the Sample Project template which contains a few example scenes and scripts already set up so you can get a small idea of what's possible. Click Create Project and you'll be taken to the Project Editor.

As soon as you see this screen you can click the Play button in the top right which will just take a few seconds to run the project. After playing the sample project you can try clicking around the editor to see how the project is set up. Select one of the people or signposts and edit the their dialogue using the sidebar on the right then try running the project again, you've just made your very own version of the game! Don't worry if you break anything, you can always make a new project with the sample template later.


Keyboard Shortcuts

Play Window

When playing your game inside GB Studio use the following keyboard controls:

Up - Up Arrow / W
Down - Down Arrow / S
Left - Left Arrow / A
Right - Right Arrow / D
A - Alt / Z / J
B - Ctrl / K / X
Start - Enter
Select - Shift

New in 1.2.0

You can also control the Play Window using a supported gamepad. If your web browser has gamepad support you can also use it when running a web build.

Much of the functionality of GB Studio is accessible through the menu bar and many of the menu items contain keyboard shortcut labels. Try clicking around on the menus to discover all of the shortcuts but the following are a few you should find useful:

Save Project - Ctrl/Cmd + S
Open Project - Ctrl/Cmd + O
Switch View Mode - Ctrl/Cmd + 1-8
Run Game - Ctrl/Cmd + B
Export ROM file - Ctrl/Cmd + Shift + B

Game World

While editing the game world you can use the following keys to quickly manipulate your scenes.

Select Mode - V
Add Actor - A
Add Trigger - T
Add Scene - S
Eraser Mode - E
Collisions Mode - C
Set Player Start Position - P (while hovering over desired location)

Drawing Mode

New in 2.0.0

Drawing mode is automatically enabled in the Collision tool and the Colorize tool.

Draw - Click on scene
Draw line from last point - Click to set first point, hold shift, click to set next point
Lock brush to axis - Hold Shift + Hold Click
8px Brush - 8
16px Brush - 9
Fill - 0
Hide Triggers/Actors - -

Collision Types

These are only availible when using the Collision tool.

Each tile can hold a maximum of 1 ladder and 3 collision sides. Ladders will not replace existing collision when placed on top of other colliders.

Select multiple collision types - Shift + Click
Erase collision tile - Click on a collision tile
Solid - 1
Collision Top - 2
Collision Bottom - 3
Collision Left - 4
Collision Right - 5
Ladder (Platformer only) - 6

Colorize Palettes

These are only availible when using the Colorize tool.

Change Brush Palette - 1-6
Change Palettes - Hold click on existing palette


Saving and Loading

Saving

To save your project select File > Save from the menu or press Ctrl/Cmd + S. If you try to close a project with unsaved changes GB Studio will warn you giving you a chance to save your project first. On macOS any unsaved changes in your project will be represented by a dot in the window close button.

Loading

To load your project again, either use the Open button on the New Project window or select File > Open from the menu and navigate to your project's folder then select the .gbsproj file.

Version Control

The project folder layout and .gbsproj file is designed to work well with version control systems such as Git with each change by the application taking place on a new line in the data file allowing history to be tracked easily. If you want to use version control on your project you can just create the repository at the project root folder.

It's recommended to ignore the build folder from your repository using a .gitignore file or similar.

Backups

Each time you save your project the previous version is saved to your project folder with the extension .gbsproj.bak. If you ever wish to roll back to the previous version in your project you can rename this file to have the extension .gbsproj and open this file instead.


The Project Editor

The default view for the Project Editor as shown below is the Game World. This is where you can create your game by combining scenes, adding actors and triggers then building scripting events to add interactions.

Use the Editor Tools to switch between Select, Add, Erase, Collision, and Color Drawing modes.

By default, your project's properties are shown in the Editor Sidebar on the right. Here you can set the project name and choose the starting scene. This project view is also where initial values for the Player actor are set. See the page on The Player for more information on the Player.

To look at project properties again from the Editor Sidebar, click on any empty space between scenes.

Editor Tools

Select tool: Clicking any scenes, actors, or triggers will update the Editor Sidebar to show the properties and scripts for the item you selected. You can switch back to the Project's properties by clicking outside of a scene.

Add tool: You are given the choice of adding a new Actor, Trigger or Scene. After clicking any of the 3 options, your mouse cursor will be loaded with a new item. You can place the new item by clicking inside the Project Editor, and cancel the action by pressing Escape or selecting another tool from Editor Tools.

Erase tool: All collisions, actors, and triggers will be removed when clicked. Scenes are not affected by Erase mode. To delete a scene, use Select mode and click the scene's background. In the Editor Sidebar click the down arrow at the top to reveal the “Delete Scene” button. All erase actions can be undone by pressing Control Z.

Collision tool: Allows you to add collisions to any type of scene using GB Studio's Drawing mode.

Colorize tool: Allows each tile to be given a different palette to use in place of GB Studio's default palette. The Colorize tool also uses GB Studio's Drawing mode. The palettes used here are determined in the Palette tab in the Project Editor.

See the documentation on Keyboard Shortcuts for editor tool shortcuts.

The Asset Viewer

You can search and preview all the assets in your game by using the Project Navigator‘s drop-down list. Selecting Sprites, Backgrounds, UI Elements or Music will bring up the asset viewer for each type of asset.

The ? button will bring up the documentation page for that type of asset.
The searchbar will narrow down the list of assets to a specific file.
Pressing Edit will open the selected file using your system's default app setting.

As with any window in GB Studio, your project assets folder can be opened with the folder button on the top right.

See the documentation on Assets for more information on how to add new assets.


Scenes

A scene is a single screen of your game, it can contain multiple actors and triggers. A game is typically made-up of many scenes connected together with triggers using the Change Scene event.

Adding a Scene

Click the + button in the Editor Tools and select Scene from the menu. Click on any empty space in the Project Viewport to place the new scene.

You can use the Editor Sidebar to give your scene a name and a background from your project's assets. See the documentation for Backgrounds for more information on adding background images.

Scene Properties

Navigation is a list that shows every Actor and Trigger inside the scene. Clicking any name in the list will select that object and show its properties in the Editor Sidebar.

Scripting

To start building a script, select a scene and click the Add Event button in the Editor Sidebar to open the event menu. Select an event to add it to the script.

For more information see the documentation for Scripting.

Adding Collision to a Scene

Select the Collision Tool from the Editor Tools. There are 6 collision types that can be added.

Solid Collision stops colliding actors from entering the tile on any side.
Top/Bottom/Left/Right collision stops colliding actors from entering the tile from that specific side. This is useful for one-way collision and semi-solid platforms.

Each tile can hold a maximum of 1 ladder and 3 collision sides. Adding 4 collision sides will replace the sides with a single solid block. Ladders will not replace existing collision when placed on top of other collision.

Colorizing a Scene

Select the Colorizer Tool from the Editor Tools. There are 6 palettes types that can be added to a scene with Color Mode enabled. Palettes can be adjusted in Settings.

The palettes used in the Colorizer Tool can be swapped out for existing palettes (such as the UI palette) by long-clicking on a palette.

For more information about the drawing mode used for the Colorize Tool and the Collision Tool, see Keyboard Shortcuts.

Scene Limits

There are several limits that GB Studio has put in place to keep game performance consistent, and to minimize visual bugs.

Each scene can have a maxmimum of 30 actors, 25 unique actor sprite frames, and 30 triggers. You can check this information by selecting a scene and looking for the gray bar under your scene that reads: A: 0/30 F: 0/25 T: 0/30. The letters on this bar represent the following:

Actor Limits

Each scene can have a maximum of 30 actors. Ideally, there should never be more than 10 actors within a 20 x 18 tile boundary, equivalent to 160px x 144px. Clustering more than 10 actors together in a scene will cause some actors to become invisible in-game. GB Studio will warn you if it thinks this will be the case for a scene:

You can address this message by moving or deleting actors so no more than 10 will be seen in a 20 x 18 tile boundary. You can use the Eraser Tool to delete actors. Actors will still become invisible if more than 10 actors move into the screenspace after the scene starts.

Frame Limits

Each scene can have a maximum of 25 unique sprite frames. Read more about frame limits on the Actors page.

Trigger Limits

Each scene can have a maximum of 30 triggers. Each trigger has its collision checked actively during gameplay, even when it's not being touched. Performance issues start to arise above 30 triggers. You can use the Eraser Tool to delete triggers.


The Player

Start Position

The player starting position is indicated in the game world view by the icon.

Clicking in the background between scenes switches the sidebar back to the Project Editor where you'll have options to set the player starting scene, position, direction and sprite sheet.

You can also change the player start position by dragging the icon and can even drag between scenes.

Scripting

Most actor script events can also be applied to the player. In addition you can use Set Player Sprite Sheet event to change the graphics used for the player character mid-game. Changing the sprite sheet will persist between scenes so remember to switch the sprite back if it was supposed to be temporary.

When switching between scenes the player will always become visible at the scene start location regardless of previous visibility options. if you want the player to be hidden on a scene e.g when showing a title screen or cutscene add a Player Hide event to the scene's On Init script.


Actors

Actors are the characters and objects in your scene that you can interact with.

Adding an Actor

To add an actor to a scene click the + button in the Editor Tools and select Actor from the menu (alternatively press the A key), then click on the scene and position where you wish to place the actor.

Setting a Sprite

To add a sprite sheet to your actor, select your actor, and locate the drop-down menu for “Sprite Sheet” in the Editor Sidebar.

To learn more about the different types of Sprites you can add to your actor, see the Sprites page.

Actor Properties

Once an actor has been selected, the Editor Sidebar will show the actor's properties.

General Properties

These are properties that apply to all actors:

Name

Giving your actors a name helps organize them in your project. An actor's name will be visible in any drop-down menu that asks you to pick an actor, such as the Actor: Hide event.

Position

Your actor's Position or X and Y let you set the actor's starting position on the screen.
X starts at zero from the left side of the scene and increases as your actor goes right.
Y starts at zero from the top of the scene and increases as your actor goes down.

You can also click and drag an actor around with your mouse to move it.

Sprite Sheet

The Sprite Sheet property lets you change the look of your actor. Read more about the different sprite sheet types on the Sprites page.

Pin to Screen

When an actor is pinned, the actor will not move without a script, and does not create collisions with other actors in your scene.

Enabling this property will temporarily change your scene to be blacked-out, with a 160px x 144px boundary in the top-left corner showing part of your original scene. Use your mouse to drag the actor to where you want it to be pinned to the screen.

Select a different actor, the scene, or the project to return the blacked-out view of your scene to normal.

Collision Groups

Actors can be given a collision group in the Editor Sidebar. When enabled, the option to run scripts based on collisions will appear in the Editor Sidebar. To learn more about On Hit scripts, see the documentation for Scripting.

Movement and Animation Properties

The following properties change your actor's animation and world-interaction logic:

Movement Speed changes how fast an actor moves. The speed can be changed from Speed 1/2 (Slower) to Speed 4 (Faster). A static actor can still be moved using scripted events.

Most of the properties here are only available to some actors, depending on the type of sprite sheet they use. There are four types of sprite sheets:

Static Sprites have 1 frame of animation. This is the only non-animated sprite sheet type.
Animated Sprites have anywhere from 2 to 25 frames of animation. No directions are associated with its frames.
Actor Sprite Sheets have 3 frames of animation: One to face up, one to face down, and one for facing right.
Animated Actor Sprite Sheets have 6 frames of animation, adding a 2nd frame to each direction of a regular Actor Sprite Sheet.

You can read more about adding a specific type of sprite sheet on the Sprites page.

Movement Types

The Movement Type property lets you change how an actor moves. The one you should use depends on how you want the actor to behave when the player walks around the scene and interacts with it. There are 4 movement types:

Animation Speed

Animation speed changes how fast an animation is played back, from Speed 0 (Slower) to Speed 4 (Faster). Animation speed can also be set to “None” to prevent an actor from animating at all, even if they would normally animate from walking or changing direction.

Animate while stationary / Animate by cycling frames

These two properties are checkboxes that appear in the same place. Your actor will animate on its own when this property is enabled.

For animated actor sprite sheets, “Animate while stationary” will play the two frames of the current direction they're facing. This creates a “running in place” effect.

For other animated actors, “Animate by cycling frames” will run through its sprite sheet in a loop. The Animation Speed property becomes visible on the Editor Sidebar when this property is enabled.

Direction

Direction changes the starting direction of an actor. This is only available to actors with actor-type sprite sheets.

Sprite Type

The actor's Sprite Type property is a way to override the sprite sheet type without changing the sprite sheet asset itself. The current options for sprite type are:

Note If the actor uses a static sprite sheet (containing only a single frame of animation) then the only movement type available will be static, and the menus for choosing the movement type and initial direction won't appear.

Initial Frame

This is the starting frame of an actor's animation, or the frame to display on a static actor.

Other Properties

Add Notes lets you write notes. These notes are only visible in GB Studio's Editor Sidebar and can't be read in-game. This is identical to adding notes to scenes, triggers, and the project itself.

Navigation will show you the scene that your actor belongs to.

Scripting lets you make your actor respond to interactions with scripted events. To learn about how to script your actor, see the documentation for Scripting.

Limits

There are limits to how actors and their sprites can be used in GB Studio. These limits are to make sure your game appears as intended, as well as to keep your actor logic running smoothly.

Actor Limits

A maximum of 30 actors can be added to a scene. However, there can only be 10 actors visible on-screen at once. The screen space is defined as a 20 x 18 tile boundary, equivalent to 160px x 144px. Read more about Actor Limits on the Scenes page.

Frame Limits

Due to hardware limitations only 25 unique frames of animation can be allocated to actors in each scene. The limit on unique sprite frames is shared between all actors. When a scene has actors that use more than 25 unique sprite frames, some actors and UI elements may appear glitchy.

To stay under the 25 unique frame limit, use static or non animated sprite sheets when possible. You can also reuse the same sprite for multiple actors in the scene - reusing the same sprite sheet will not count towards the scene frame total.


Triggers

Triggers are areas in a scene that, when the player walks over them, will cause a script to play. They are useful for creating doorways between scenes and to start cutscenes when the player moves to a specific position.

Adding a Trigger

To add a trigger to a scene click the + button button in the Editor Tools and select Trigger from the menu (alternatively press the T key), then click and drag across the scene where you wish to place the trigger setting the desired width and height.

The Editor Sidebar will switch to show the trigger settings where you can give the trigger a name for easier navigation later, reposition and scale the trigger and create the script that will play when the player walks on the trigger.

Scripting

When the trigger is selected click the Add Event button in the Editor Sidebar to open the event menu and start building the script. For more information see the documentation for Scripting.


Scripting Events

Scripting events allow you to control parts of your game based on interactions from the player. They can be used to connect scenes together, change variables, give dialogue to characters, and more.

Scripts can be added to scenes, actors, or triggers. Selecting one of these objects will update the World Editor to show the script of the selected object in the Editor Sidebar.

To start building a script, select an object and click the Add Event button in the Editor Sidebar to open the event menu. Select an event to add it to the script. The topmost event is the first event to be run for that script.

Adding Events

After clicking the Add Event button, a menu will appear to choose the event to add. If you start typing you can filter this list or you can scroll through it to find what you're looking for. Click an event or press the Enter key to add the highlighted event to your script.

To copy an event, click the down arrow next to an event. All scripts have this same down arrow for copying/pasting. Clicking the down arrow on another event allows you to paste the clipboard event either before or after the selected one. You also have the option to paste the values from the first event into the second.

As a shortcut for pasting, you can press the Alt key to turn all Add Event buttons into Paste Event buttons.

Types of Scripts

There are multiple script tabs to choose from the Editor Sidebar depending on which object you have currently selected.

Scene Scripts

These scripts can be accessed in the Editor Sidebar by selecting a scene in your project.

On Init

This script will run once at the beginning of the Scene. The Scene On Init script is always run after the On Init script for Actors in the Scene.

On Player Hit

This script runs when the player is hit by an actor belonging to a collision group.

Actor Scripts

These scripts can be accessed in the Editor Sidebar by clicking an Actor in your project or using the Navigation list in each scene.

On Init

This script will run once at the beginning of the Scene. Actors in a Scene will always run their On Init script before their Scene's On Init script.

On Interact

Standing the Player next to an Actor and pressing the A button will cause the Player to “interact” with the Actor. Interacting with an Actor will begin this script. In Shoot ‘Em Up scenes, interacting can additionally be done by colliding with the Actor.

This script is often used for dialogue, using the “Text: Display Dialogue” event.

Enabling a collision group for an actor will convert this script to On Hit: Player, which looks for Player collision rather than Player interaction. This behaviour is identical to On Interact in Shoot ‘Em Up scenes.

On Hit

This script runs when the Actor is hit by another Actor or Projectile belonging to a collision group.

On Update

This script is run once every frame, and can only be added to non-player Actors.

Trigger Scripts

Trigger scripts only have an “On Trigger” script. The player must be inside the trigger to start this script. This is often used for creating doorways between scenes.

Event Glossary

Text Events

Scene Events

Variable Events

Your game has 512 variables that can be shared across all the scripts in your game. New in 1.2.0 Additionally every Actor, Trigger and Scene has 4 local variables that can only be accessed by that specific entity. Local variables are useful for keeping track of state specific to an entity such as how many times you have spoken to a character or if a treasure chest is open or closed.

Control Flow Events

Camera Events

Screen Events

Actor Events

Sprite Events

Overlay Events

Input Events

Music Events

Sound Events

Timing Events

Game Data Events

Miscellaneous Events


Custom Events

New in 1.2.0

Custom Events allow you to create reusable procedures in your game that can be used across any of your scripts.

Clicking in the background between scenes switches the sidebar back to the Project Editor which will list any Custom Events in your project along with a button to Create Custom Event.

Once you've given your Custom Event a name you can start building a script in the same way you would for Actors, Triggers and Scenes.

Parameters

Whenever you add an event that reads a Variable it will get added to the list of input parameters for the Custom Event, where you are able to give that input a memorable name. Events that affect Actors will, by default, apply to the player but if you use the actor selector you will be able to set the event to read the Actor value from an input parameter also.

For example the following custom event makes Actor A rotate in a circle.

This custom event can then be used within Actor, Trigger and Scene scripts where it will appear as follows.

If you ever want to edit the Custom Event you can return to it using the list on the Project Editor or by selecting Edit Custom Event from the event dropdown menu.


Assets

When your project was created an assets folder was also made within the project containing a number of subfolders for each asset type in your game.

GBStudio doesn't currently contain any ability to edit the graphics or music in your game directly, you instead can use your favourite existing applications and save files into these folders where they will instantly appear ready to use in your project. If you edit a sprite or background PNG file and save using an external image editor the change will be seen in your Project Window as soon as you switch back it.

While you can create graphics in any application that can output PNG files it is recommended to use Aseprite or Photoshop to create your sprites and UI elements then to use Tiled Map Editor to create your backgrounds. Each image asset type has a different set of requirements detailed over the new few sections of this documentation.

For music you must create new tracks as MOD files with only four channels. You can create these files with OpenMPT or MilkyTracker.

Community Assets

If you're looking for a collection of free assets, ready to be used in GB Studio there is a community run repository on Github available at GB Studio Community Assets.


Sprites

Sprites are the graphics used by playable or interactive characters in your scenes. Add sprites to your game by including PNG files in your project's assets/sprites folder.

Requirements

Sprite PNGs must only contain the following four colors:

#071821
#86c06c
#e0f8cf
#65ff00
Download the GB Studio Palette Swatches for:
Adobe Photoshop
Aseprite

The color #65ff00 is used to represent a transparent background in game and will be invisible in-game and in the World Editor.

Colors that are not one of the above hex codes will be matched to the nearest color. Unlike backgrounds, the color #306850 can not be used in sprites.

A sprite consists of one or more 16px x 16px frames laid out horizontally in file. A sprite with a single frame will be 16px x 16px while a sprite with three frames will be 48px x 16px.

Static sprites

For sprites that only need a single frame (e.g. static items such as signposts) create your PNG as a 16px x 16px image containing just the one frame required.

Animated sprites

If you want to have sprites that play short animations you can make a PNG with between 2 frames at 32px x 16px and 25 frames at 400px x 16px. Using these sprites on an actor will enable you to select which frame you want to display by default and will allow an animation to be played at a specified speed.

Actor

To make sprites that can face in four directions turning towards the player, create a 48px x 16px PNG containing the three frames forward facing, upwards facing and right facing. The left facing sprite is automatically generated by flipping the right facing sprite horizontally so does not need to be created.

Animated Actor

To make sprites that have animated movement, or that can be used as a player character, create a 96px x 16px PNG containing six frames, two forward facing, two upwards facing and two right facing animation frames.

As there are limits to how many sprites frames can be loaded into a single scene don't use animated sprites unless you know your NPCs will need animated movement.


Backgrounds

Each of your scenes requires a background image that defines how that scene should look. You can add backgrounds to your game by including PNG files in your project's assets/backgrounds folder.

Color Requirements

Background PNGs must only contain the following four colors:

#071821
#306850
#86c06c
#e0f8cf
Download the GB Studio Palette Swatches for:
Adobe Photoshop
Aseprite

Colors that are not one of the above hex codes will be matched to the nearest color. Unlike sprites, the color #65ff00 can not be used in backgrounds.

Size Requirements

Tile Requirements

An image can contain no more than 192 unique 8px x 8px tiles at once due to memory limits. This means that even using the smallest background size possible you must repeat about half of your tiles. Where possible repeat tiles between images as they will be grouped together saving on total game size. It is recommended to use a tile map editor such as Tiled to ensure your backgrounds conform to the pixel grid.


UI Elements

Your project contains a number of files in assets/ui with fixed file names that define parts of your game's user interface. Editing these files allows you to change the default font, set the window frame and modify the selection cursor.

If you remove any of the files in the ui folder they will be replaced with the default assets the next time you build your game allowing you to revert any unwanted changes.

ascii.png

Edit this file to change the game's font when talking to actors in your game.

frame.png

The game engine uses 9-slice scaling of this image to create the frame around text boxes. Editing this image will allow you to change the frame design or set it to a solid color.

cursor.png

This image is used as a selection cursor when showing multiple choice options in your game.

emotes.png

This image used to define the look of the emote bubbles that can be shown above actors using scripting. Each bubble is 16px x 16px in size and the each bubble represents Shock, Question, Love, Pause, Anger, Sweat, Music and Sleep in that order left to right.

Requirements

With the exception of emotes.png which follows the standard sprite requirements, UI PNGs must only contain the following four colors:

#071821
#306850
#86c06c
#e0f8cf
Download the GB Studio Palette Swatches for:
Adobe Photoshop
Aseprite

Music

Music can be played in your game using the Music: Play event in your Actor, Trigger, or Scene scripts.

Requirements

Add music to your game by including .mod files in your project's assets/music folder. GB Studio uses GBT Player which is a driver that takes .mod files and converts them to instructions for the Gameboy. GBT Player interprets .mod files differently than the Amiga computers that the .mod format was originally designed for, so every .mod file that GBT Player reads should be composed/arranged to be used with GBT Player.

As an alternative to composing, there is a way to import .midi files to OpenMPT for playback in GBT Player. More information can be found under Frequently Asked Questions. You can also browse the GB Studio Community Assets to find free, GBT-compatible music under the MIT licence.

To compose GBT-compatible .mod files, you can use software such as OpenMPT (for Windows or Linux using Wine), MilkyTracker (for Windows, Mac and Linux), ProTracker, and BassoonTracker (browser-based) to name a few. Any software that loads and exports .mod files can write files that are compatible with GBT Player.

Resources

It is recomended you read through your tracker's documentation to learn about your tracker:

Lastly, the GB Studio Discord also has a dedicated #music-help channel and a #tutorials channel in case you get stuck.

Getting Started

  1. Create a blank GB Studio project, find the file assets/music/template.mod and open it with your tracker of choice.
    • You must edit this file to get an accurate representation of the instruments you can use.
    • MilkyTracker users should save this file as an .XM file. Saving a .mod file in MilkyTracker will corrupt it. Export your song as a .mod file every time you want to test your song in-game.
  2. Use the instrument list shown later in this document to pick the sounds you want. Changing the samples in your tracker will not affect how they sound in-game.

When done, add your .mod files to the assets/music folder of your project. Test your song in-game often to keep track of any audible in-game differences.

Here is a quick rundown of how a tracker works:

C-5 01 v64 ...
--- -- --- ---
 |   |  |   |
 |   |  |   +-- Effect column (Volume changes, arpeggios, panning, etc.)
 |   |  +------ Volume value, this is irrelevant in .MOD. (Most examples here omit this
 |   |          and instead display three dots in its place)
 |   +--------- Instrument
 +------------- Note and octave (A C note in the 5th octave. The dash can be a #, which signifies a sharp note e.g. C#, D#)

This is what comprises of a channel's row. Rows can be empty, or can only be partially filled (with just an effect, for example). There's 4 of those columns in total.

Any part in this documentation where you see data that starts with ModPlug Tracker MOD, you can copy that entire block into OpenMPT as-is. Any data copied from OpenMPT looks like that when you paste it into any text application.

GBT Player's Channel Limitations

.MOD files need to use 4 channels. Loading a copy of template.mod before composing will ensure this is set-up correctly.

Channel # Sound type Note Range1 Instruments Effects
Channel 1 & 2 Pulse C3 to B8 1-4 0, C, E8, EC, B, D, F
Channel 3 Waveform C3 to B8 8-15 0, C, E8, EC 2
Channel 4 Noise Only C5 16-31 C, E8, EC, B, D, F

1 This range is for One-Indexed Trackers (C1 is the lowest-possible note). This is comparable to OpenMPT in default settings. Trackers that are Zero-Indexed by default (C0 is the lowest-possible note) should interpret these Note Ranges a full octave down. This is comparable to MilkyTracker in default settings.

Using default settings on OpenMPT and MilkyTracker, C3 to B8 in OpenMPT sounds the same as C2 to B7 in MilkyTracker.

2 Effects B, D, and F can be also used on Channel 3 if the same row isn't being used to set a note/instrument.

Volume Limitations

Currently, volume can only be adjusted by using the Cxx effect for each channel.

The Gameboy has 16 unique volume settings for Channels 1, 2 and 4. GBT Player will floor (round-down) the values in a Cxx volume effect to multiples of 4.

Unique Volume Settings for Channels 1, 2 and 4:

00, 04, 08, 0C, 10, 14, 18, 1C, 20, 24, 28, 2C, 30, 34, 38, 3C

Any number that's not a multiple of 4 will be rounded-down to one of the above numbers.

Example: Entering C01, C02 and C03 will sound the same as entering C00.

Example: Entering C40 will sound the same as entering C3C.

Channel 3 is the exception to this with only 4 unique volume settings.

Unique Volume Settings for Channel 3:

00, 10, 20, 40

GBT Player will round Cxx effects on Channel 3 to the nearest number listed above.

Example: Entering C30 will round the volume up to C40.

Volume Persistence

In most trackers, if a note is played without a volume command, the note's volume is reset to the maximum. When a .mod file is converted by GBT Player, notes without a volume effect will play at the same volume as the previous Cxx effect that the channel read. For example, take this scenario:

ModPlug Tracker MOD
|C-502...C40|
|...........|
|...........|
|...........|
|........C..|
|...........|
|E-502......|

In the tracker, the E-5 note will resume at full volume after the C00 effect.

In-game, you will not hear the E-5 note. This is because the C00 persists until another Cxx effect is set. To make the tracker playback sound identical to the in-game playback, the following must be done:

ModPlug Tracker MOD
|C-502...C40|
|...........|
|...........|
|...........|
|........C..|
|...........|
|E-502...C40|

Additionally, Channel 3 requires that the instrument and note is set during a volume change for the volume change to have any effect. (Except for C00.) For example:

ModPlug Tracker MOD
|C-511...C40|
|...........|
|...........|
|...........|
|........C20|
|...........|
|G-511...C40|

You will not hear any volume change from the C20 in-game. Add a note and instrument on C20 to register the volume change.

ModPlug Tracker MOD
|C-511...C40|
|...........|
|...........|
|...........|
|C-511...C20|
|...........|
|G-511...C40|

Instruments

All numbers listed here are in base-10 unless otherwise noted.

The pulse channels 1 and 2 have four instrument options:

  1. 25% pulse
  2. 50% pulse (square wave)
  3. 75% pulse (inverted 25% pulse)
  4. 12.5% pulse

Instruments 5 through 7 are intentionally left blank.

Channel 3, the wave channel, has 8 instrument options:

  1. Buzzy (Source code calls this “random :P”)
  2. Ringy (useful for SFX)
  3. (A) Sync Saw
  4. (B) Ring Saw
  5. (C) Octave Pulse + Triangle
  6. (D) Sawtooth
  7. (E) Square
  8. (F) Sine

As of GB Studio 1.2.1, GBT Player uses 16 instruments to access pre-determined noise settings - instruments 16 to 32.

Instruments 16 to 23 use Periodic (looped) Noise at various pitches, while instruments 24 to 32 use Pseudorandom noise at various pitches.

The nicknames and descriptions next to these instruments are not official for GBT Player, they are intended to help identify these noise presets at a glance.

Periodic Noise:

  1. (10hx) “stutter” - A square plus a pulse at random pulse widths
  2. (11hx) “rumble” - The same waveform but faster
  3. (12hx) “engine” - The same waveform but even faster
  4. (13hx) “low tone” - Sounds like D5
  5. (14hx) “undertone” - Sounds like E5 + 50cents
  6. (15hx) “middletone” - Sounds like B5 + 50cents
  7. (16hx) “overtone” - Sounds like D6 + 50cents
  8. (17hx) “high tone” - Sounds like D7

Pseudorandom Noise:

  1. (18hx) “earthquake” - A square with a thin pulse at random pulse widths
  2. (19hx) “spaceship” - The same as 24 but faster
  3. (1Ahx) “ocean” - etc.
  4. (1Bhx) “scratch” - etc.
  5. (1Chx) “glitch” - A fairly clean white-noise sample, unrelated to other instruments
  6. (1Dhx) “volcano” - A pulse with rapidly changing pulse width
  7. (1Ehx) “scream” - The same as 29 but faster
  8. (1Fhx) “static” - etc.

As of GB Studio 1.2.1 there are no GBT Player-readable instruments beyond 31. (1Fhx)

Effects

There are two types of effects: Note-effects and Command-effects.

The only restrictions on effects is the Command-effects with Channel 3. It can use them when it's not trying to play a note/set the instrument on the same row.

Note-effects (uses bit 3) - All channels can use these effects freely

Effect Name Notes on effect usage
0xy Arpeggio Rapidly cycles between 3 notes. x and y both represent the # of semitones above the note the arpeggio effect is attached to.
Cxx Volume Sets the volume to xx. See Volume Limitations for more info.
E8x Pan Sets the panning to x. 0-3 = Left, 4-B = Centre, C-F = Right.
ECx Note cut Cuts the note after x frames. Must be below the Fxx speed for the cut to be heard. EC0 will reset the duty cycle instead of cutting the note.

Command-effects (uses bit 4) - Channel 3 can use these effects if it's not trying to play a note/instrument on the same row.

Effect Name Notes on effect usage
Bxx Jump Jump to a specific position in the song, xx.
Dxx Pattern break Jumps to the next pattern early, where xx is the row it should jump to in the next pattern. Using this on the last pattern will break the song by reading garbage data beyond the song.
Fxx Set speed Sets the song speed to xx. Valid values are 01 to 1F. The value represents how many frames should the song wait before moving on to another row. Setting BPM speed has no effect upon conversion.

For Channel 3 only, the instrument data is too large to allow the 4th bit of a Command effect to occur while it's trying to play a note/set the instrument. Command-effects will ignore new notes on Channel 3 to compensate.

Speed Table

Fxx Value (in tracker) BPM (in tracker) BPM (in game)
F011 750 BPM 900 BPM
F021 375 BPM 450 BPM
F031 250 BPM 300 BPM
F041 187.5 BPM 225 BPM
F05 150 BPM 150 BPM
F06 125 BPM 128.57 BPM
F07 107.14 BPM 112.50 BPM
F08 93.75 BPM 100 BPM
F09 83.33 BPM 90 BPM
F0A 75 BPM 81.82 BPM

This is not a full table, it's just the top few speeds. It's here to highlight some of the speed discrepancies, albeit small to not be very noticeable, with the exception of the values marked with 1.

You might notice that the value of the F effect, when converted to decimal, is just the speed divisor. For instance, F03 divides the BPM by 3 (750 / 3 = 250, or 900 / 3 = 300).

Because of how GB Studio is set up, a 60hz F05 effect, which would result in 180 BPM in-game, is impossible here.

While not in GB Studio, GBT has a flag called -speed that will handle BPM differently, which would require F96 effects for every speed, as it won't handle any internal conversions to get the speed closer. This is the reason why F01 to F04 require F96 in both modes, there's no equivalent for it in tracker speed.

1. Values marked with 1 require an additional F96 effect for the song to sound closer in speed when converted, or setting the song BPM to 150. This F96 effect can be removed once you're done with your song, there won't be any difference as GBT ignores this – It's only here to set the BPM to something closer to the in-game version.

Tricks and Tips

1. High Speed

By using F01 to F04, you can achieve much higher granularity when it comes to changing volumes and creating sounds of sorts. This means that with a high enough speed, you can create more varied bodies for sounds, with sort-of envelopes, or elaborate effects (like 1 channel echos, which I'll cover here in a moment).

This trick means you're going from drums that sound flimsy and primitive to something more impressive.

Here's an example of a Snare Drum, at speed F02, that might sound good for you.

ModPlug Tracker MOD
|C-526...C40
|C-527...C28
|........C20
|........C18
|........C10
|........C08
|........C04
|........C..
(this is on the noise channel)

If this is longer than what you need, simply crop it starting from the bottom.

You can also use this for tones and stuff, like short staccato notes or flutes that fade in.

If you do this, keep in mind the GB Sound hardware has an annoying bug that resets the phase of each waveform on a volume set, meaning you can get scratchy noise in a few emulators and also the real GB.

2. One channel echoes

This works on most speeds. This is useful for when you need a melody on top of some sort of echoing ostinato, or phrase, or whatever.

To illustrate it, I'm going to try illustrating it like this, instead of a tracker layout:

A _ B _ C _ E _ G _ E _ C _ B _ 
Without 1ch Echo

    +-----+ +-----+ +-----+
A _ B a C b E c G e E g C e B c 
+-----+ +-----+ +-----+ +-----+
     
With 1ch Echo (lowercase notes are the echoes)

Notice how each lowercase letter takes the form of it's 3 step behind louder cousin? That's how the trick works. By having shorter notes that, on each step, has another quieter note that's way behind, you get a cool echoing effect.

I can't explain it very well via text, so I recommend you check out this video by explod2a03 covering how this trick works with a better example and actual audio: https://www.youtube.com/watch?v=6GI9gngTn_Y

The best way to do this in a tracker is to use a channel you're not using temporarily, copy your note sequence to it, delay it by 3 (or however many you need) rows, then right clicking on the selection and clicking “Amplify…", and setting the amplitude to something lower than 50%.

After that, you should have both channels “alternate”. Select the entirety of the channel with the echoes (from top to bottom), go to the channel you want to merge the echoes with, right click, go to “Paste special”, then click “Mix paste” (This should have a shortcut, might want to learn it as it can be fairly useful).

3. Quick volume envelopes

Are you in a hurry? No problem, this simple trick will create linear envelopes:

  1. Select two volume / C values of two separate notes (within the same channel), and everything in between
  2. Right click and hover over “Interpolate”
  3. Click on “Effect column”
  4. You're done!

You might wonder how's it going to sound in-game; well, it'll sound as close as possible. The volumes it can't play it'll just clamp it to the nearest ones it can play.

Frequently Asked Questions

Q: Can I use mp3/wav files?

A: No, but you can use .midi files. If you're looking for an easy way to add music to your game, you can ask the #collaborations channel of the GB Studio Discord or browse the GB Studio Community Assets.

This has limited success, and there are easier options to get music in your game, such as the

Q: How do I convert a .midi file to .mod?

A: OpenMPT can open MIDI files and save the result to .mod Some resources on how to do this include a video tutorial as well as Kazy's write-up article pinned in the #music-help section of the GB Studio discord.

Q: Can I use this .mod file I found online?

A: It won't sound as intended, but it can be made to sound good-enough with some adjustments. Any === notes need to be replaced with the EC1 effect. All instrument restrictions should apply, and no melodic instruments should be using Channel 4. You may also need to transpose the notes of a channel to account for differently-tuned samples, which you can learn more about in your tracker's documentation.

Q: How do I stop a note from playing?

A: EC1 will mute a channel's note, C00 will mute the channel until it recieves another Cxx effect.

Q: What do I do if my song sounds completely giltched-out?

A: It's probably corrupted. It can likely be saved by using OpenMPT and saving it as a different filetype. If you're using MilkyTracker, don't press “Save” on a .mod file, always work in a .xm file instead.

Q: Why is my song speed is faster in-game than it is in the tracker?

A: If you're using an Fxx effect with a value lower than F05, add F96 to the first row of your song. This will not impact your in-game playback speed.

Q: Can I play back voice clips/sound effects?

A: Not on GBT Player. Pokemon Yellow's method is unique, and LSDj does not leave much processing power for games to be played while it's running.

Q: Can I use a different tool to write my music?

A: If the tool can natively export to .mod, try it!

Q: Why is my song playing glitched sounds when it tries to loop?

A: D00 is a problematic effect, try using Bxx instead. If you're already using Bxx, make sure the xx number does not go above the number of pattern-slots in your song. A song's first pattern is always in slot 00.

Q: Why do some notes in OpenMPT appear red and sound higher/lower than they're supposed to sound?

A: Go over to the “General” tab that's under the New File, Open and Save buttons. Click the big button next to the “Name” field that says “MOD (ProTracker), 4 channels”. Once there, disable both ProTracker 1/2 Mode (MOD) and Amiga Frequency Limits. This is a thing because the format here is meant to be used with the Amiga line of computers (that's where it was made), which has frequency limits.

Q: Why does my song start out with garbage noise?

A: If your song doesn't start using the first two channels, add a note to their first row with a C00 effect on each.

Q: Can I play sound effects?

A: Yes, with limitations. View the next page of the documentation for more information. Playing sound effects will not interrupt the song being played by GBT Player.

Tips


Sound Effects

New in 1.2.0

Sound effects can be added to your game using the Sound: Play Effect event in your Actor, Trigger or Scene scripts.

You can choose from playing a beep with a given pitch, a tone with a given frequency or cymbal crash.

Using Custom Events you can combine multiple effects into a single reusable event to make jingles.


Building Your Game

Play

Clicking the Play button in the top right of the Project Editor window will start a build of your game and once complete will open a new window where you can play your game. See Keyboard Shortcuts for details on how to play your game in the Play Window.

Build Terminal

Clicking the Project Navigator and selecting Build & Run will take you to the Build Terminal where you can see a log of the project build. You also get to this screen by clicking the Play button while a build is taking place. This screen will show you if there's any errors in your build to help you correct them.

Build as ROM

Clicking the Export button and clicking Export ROM will build your game and create a ROM file in your project's build folder as $PROJECT_ROOT/build/rom/game.gb. You can play this ROM file in any compatible emulator such as OpenEMU or KiGB.

Build and deploy for Web

Clicking the Export button and clicking Export Web will build your game and create a HTML5 web build in the folder $PROJECT_ROOT/build/web. You can upload this folder to any web server and navigate to the index.html file to play your game in a web browser. If you use a mobile or tablet web browser the game will also include touch controls.

If you zip the build/web folder you can upload it to Itch.io as a HTML game. In this case the recommended viewport size to use is 480px x 432px.

Troubleshooting

On macOS if you're having trouble building or running your game you may also need to install Apple's Command Line Tools by opening Applications/Terminal.app and entering the following command.

xcode-select --install

On Windows you may need to whitelist the application in your Anti Virus software to perform a build.


Settings

New in 1.2.0

Clicking the Project Navigator and selecting Settings will take you to a list of your project's settings.

GB Color Options

GB Studio has some limited support for GB Color when your game is run on compatible hardware or emulators. There are two options currently available:

Using a custom color palette you can create a drastically different tone for your game! Try experimenting to see what you can come up with. If you don't like your color palette you can always click Restore Default to the get the original palette back again.

Controls

The Controls section allows you to override the default controls used when playing your game from a web build and the Play Window.

To edit the controls for a button click on the input box and while the input is highlighted type the key you wish to assign. To remove all the assigned keys click the input and then press the Backspace key on your keyboard.

To reset to the original controls you can use the Restore Default button.

Cartridge Type

The Cartridge Type section allows you to choose which Memory Bank Controller you want to use and if a battery will be included when exporting your game to a physical cartridge (requires additional hardware and software).

If you don't know what these settings mean it's best to keep this as the default of MBC5+RAM+BATTERY which you can do by using the Restore Default button.

Custom HTML Header

You can use the Custom HTML Header section to add content to the HTML <head> when generating a web build of your game. You can use this to add any custom CSS or Javascript you want to the web build HTML page.