Welcome to Hero's Trail (Part 1)


Welcome to Hero's Trail (Part 1)

Welcome to Part 1 of the Hero’s Trail tutorials!

Click here to see all 6 parts.

Hero's Trail

Welcome to Hero’s Trail, a simple and fun tutorial for new GameMaker Studio 2 users! This series demonstrates all the amazing things you can do with GameMaker at a basic level and allows you to learn all the ins and outs of the program while developing your own action-adventure game.

undefined

We’ll now use the Hero’s Trail template project to get a quick introduction to the world of GameMaker, and in subsequent parts we’ll build upon this basic demo to create our own fully-fledged action-adventure game!

This tutorial is divided into the following sections:

  1. How Do I Open Hero’s Trail?

  2. What Am I Looking At?

  3. How Are Games Made?

  4. How Are Levels Created?

  5. How Do I Add Custom Features?

How Do I Open Hero’s Trail?

The Hero's Trail template project can be used as a starting point for new projects.

When you open GameMaker Studio 2, click on "New" to see the Template menu. Then select the "Hero's Trail Base - DnD" project, enter your project name & directory and hit "Let's Go!".

undefined

This will open your new project where you can modify the template and play it. To play the game you can click on the undefined Run button at the top, or press F5 on your keyboard:

undefined

This will open the game in a new window, where you can click “Play” and move around the level using the arrow keys:

undefined

This is the base project that we'll build upon to create our own fully featured action-adventure game!

After you’re done exploring, close the game window and we'll take a look at the GMS2 IDE (“Integrated Development Environment”, or simply put, the program’s user interface!).

What Am I Looking At?

The GMS2 IDE consists of two main parts: the Workspace and the Asset Browser.

undefined

Workspace

Asset Browser

This is where you edit assets, such as your images, objects, levels and more.

This is where your assets are created and listed, and double-clicking on any asset here opens it up in the Workspace.

You can open multiple workspaces as tabs, similar to tabs in an internet browser.

undefined

You will see many folders in the Asset Browser, which are called “groups”. You can expand a group and see the assets inside it.

undefined

How Are Games Made?

Games are made using ‘assets’ which are the building blocks of your games: any images, objects and levels are created as assets and can be edited inside the workspace.

Your final game will be made up of many different kinds of assets:

undefined

There are three types of assets that are most crucial in GMS2:

Sprites

Objects

Rooms

A Sprite is an image that can be used anywhere in the game (e.g.: for objects, backgrounds, animations, etc.).

An Object can be used as an interactive element in your game, such as the player, an enemy, a coin, etc.

A Room serves as a specific screen in your game, such as a level or the main menu.

Let’s look at a sprite asset in the Hero’s Trail project.

  1. In the Asset Browser (on your right), open the “Sprites” group and then open the “Baddie” group.

    Here you will find different kinds of sprites for the enemy under the “Attack” and “Idle_Walk” groups.

    undefined

  2. In the “Idle_Walk” group, double click on the spr_baddie_idle asset to open it in the Workspace.

  3. You will see the Sprite Editor open up in the Workspace, where you can preview each frame of the animated sprite and hit Play to see the baddie in action!

undefined

This is just one of the many “asset editors” in GameMaker. You can now close this, or if you want to start tinkering with the project already, you can click on either “Edit Image” to modify this sprite or draw on it, or “Import” to load any other image file you want.

When do we start making things?!

We’re getting there -- we’re going to look at objects and rooms next to learn how and why GameMaker works, but if you can’t wait to start adding new features, you can scroll to the bottom of the page and continue to the next part.

It is recommended to read this page before continuing, unless you are already familiar with the basics of GameMaker Studio 2.

Creating an Object

You can use objects to create interactive elements in your games, such as enemies, barrels, coins, and so on. There is a basic workflow that you can use to create such objects.

  1. First create a Sprite, which serves as the image for your object. This can be an animation too.

  2. Then create an Object and add “Events” to it. Events allow the object to respond to player input or perform its own behaviour.

  3. Finally, place the Object inside a Room (which is a level), which creates an Instance of that object. You can place multiple instances of an object in a room (allowing you to place multiple enemies and coins).

This workflow can be simplified as shown below:

undefined

Adding Custom Assets

It’s super easy to create a new sprite and even draw your own image right inside GameMaker Studio 2! Here’s how you can create a new sprite asset:

  1. Go to the undefined "Create Asset" menu at the top of the Asset Browser.

  2. Select “Sprites” and click on “Create” (or just double-click on the “Sprites” button).

    undefined

  3. This will create a new Sprite asset in the Asset Browser and allow you to give it a name.

  4. You can then drag the asset and place it into any of the existing groups, or right-click in the Asset Browser and select “Create Group” to add a new group for your assets.

undefined

    If you select a group before creating an asset, the new asset will be created inside the selected group.

In the new sprite's Sprite Editor window, you can resize the sprite and then select “Edit Image” to draw on it:

undefined

Doing this will open the Image Editor, where you can use the various drawing tools to create and animate something entirely new!

undefined


How Are Levels Created?

Levels are created using Room assets, and the Hero’s Trail project already has a few rooms, one of which is the first level that opens when you play the game.

We’ll open this room and move a few things around so we can get a hang of the Room Editor!

In the Asset Browser, expand the “Rooms” group and double-click on rm_level_1:

undefined

This will open the Room Editor, which has the following main parts:

undefined

The Room Canvas is where you will edit your level, and on the left you have various menus for managing layers and the room itself.

The Layers panel contains all the layers in the room, and each layer simply contains assets (such as sprites, tiles, and object instances). We’ll focus on one of these layers and move some things around:

  1. In the Layers panel, scroll down and select the “Instances” layer.

    undefined

  2. This is an Instance Layer where you can place instances of objects, such as the player, enemies, barrels, etc..

  3. Once you have the layer selected, you can go into the room area, select the player, an enemy or a barrel and move it anywhere you like!

undefined

NOTE: Moving the enemies may not change the path they walk on. Changing and creating enemy paths is covered in Part 4 of the tutorial.

When you have the “Instances” layer selected, you can drag objects from the Asset Browser into the room to create new instances!

undefined

Placing Tiles

Tiles are essentially non-interactive images that are placed around the room, and unlike sprites, they’re grouped into a single asset known as a “Tile Set”.

Here is one of the Tile Sets in this project (present in the “Tile Sets” group):

undefined

You can see that it contains multiple tiles (square images), which is why it's called a "Tile Set".

This Tile Set is used for the floor of a level, appearing below the player. You can actually go in the room and edit these tiles right now:

  1. Open the rm_level_1 room.

  2. In the Layers panel, expand the “Visuals_Below_Instances” folder.

  3. Select the “Tiles_Floor” layer. This is a Tile Layer that uses the Tile Set shown above and displays the floor tiles.

    undefined

  4. You can now select a tile from the panel on the right side of the IDE, and place it anywhere in the room. You can also right click to remove a tile (or use the eraser tool from the Toolbox at the top).

undefined

If you would like to read more about the Sandbox project and its assets in detail, please see the Hero’s Trail Project Breakdown.

Adding Custom Features

We’ll now customize this project and develop our own game out of it, complete with sword attacks, interactive level elements such as chests and gates, power ups, abilities and much more!

undefined

Tutorial Format

All Hero's Trail tutorials will demonstrate Drag and Drop™ action blocks using screenshots, where you will have the actual actions on the left (which is how you need to organise them), and comments on the right explaining what each action does.

Here is an example of such a screenshot:

undefined

While there will also be explanations within the tutorial text itself, it is recommended that you pay attention to the comments attached to each action in a screenshot.

Let's Make A Game!

Head over to the next part to continue your adventure, or head back to the index page to take a look at all the topics and jump to whichever one you’re most excited about.

-> Continue to Part 2

-> Read the Hero’s Trail Sandbox Overview

-> Go back to index page