01 First Steps

A quick overview over the project and setting up the basics of the 2D roguelike game.

This game tutorial series will teach you how to create a 2D roguelike game with procedurally created tile based levels. The player will control a scavenger running through ruins and searching for food – each move costs food and causes enemies to also move.

In this tutorial we’ll take a quick look at the project and set up some basics in the Makinom editor.

Setting up the Unity Project #

By now you should’ve downloaded the project resources, a unitypackage file containing the assets we’ll use in this tutorial series.

Create new Unity Project #

Use the Unity Hub to create a new Unity project, make sure to use at least Unity 2019.1, best one of the LTS versions (e.g. Unity 2019.4 LTS).

The new project comes with an empty sample scene set up, we don’t really need it, so you can delete it (and the folder Assets/Scenes/) if you want.

We’ll use the Unity UI module, make sure the project contains the TextMesh Pro and Unity UI packages. They should automatically be included in a new Unity project, if not, use the package manager (Window > Package Manager) to import them.

Layer Setup #

We need to set up sorting layers and a layer in the Unity project we’ll use later. Open Unity’s layer settings using the Unity menu: Edit > Project Settings… > Tags and Layers

Add the following sorting layers (in that order):

  • Floor
  • Items
  • Units

In case the sorting layer configuration of the prefabs is not imported correctly, all floor prefabs use the Floor sorting layer, all items, the exit and walls use Items sorting layer, the player and enemies use Units sorting layer.

Change the following layer:

  • User Layer 8
    Set to BlockingLayer.

Importing Resources and Makinom #

Next, we’ll import the project resources you’ve downloaded and the latest Makinom 2 version (or any you’ve got lying around).

The order in which you import them doesn’t matter. If you get a warning regarding script updates, confirm it to continue with the import.

The tutorial resources can be found in this folder: Assets/Tutorial Resources/

All our setup will be done in the Level 01 scene (found at Assets/Tutorial Resources/Scenes/), so you can already open it.

Setting up Makinom #

We’ll now set up some basics in the Makinom project. Open the Makinom editor (Window > Makinom) – this will create a new Makinom project at Assets/Gaming Is Love/_Data/Project.asset, in case no project has been created or opened yet.

Game Settings #

First, we’ll add some global variables – you can learn more about variables in the variables documentation. Navigate to Game > Game Settings and change the following settings.

Initial Variables #

Click on Add Variable to add a new variable. The variable will be initialized to a defined value when the game is started.

The first variable will hold the game’s current level.

  • Variable Key
    Set to level.
  • Type
    Select Int.
  • Operator
    Select Set.
  • Float Value
    Set to 1 (Value).

Click on Add Variable again to add another variable. This variable will store the food of the player.

  • Variable Key
    Set to food.
  • Type
    Select Int.
  • Operator
    Select Set.
  • Float Value
    Set to 100 (Value).

Click on Add Variable again to add another variable. This variable defines how much damage the player does to a wall to chop through it.

  • Variable Key
    Set to wallDamage.
  • Type
    Select Int.
  • Operator
    Select Set.
  • Float Value
    Set to 1 (Value).

That’s it for the game settings.

Music #

Next, we’ll set up the background music. Navigate to Game > Music and change the following settings of the Default music.

  • Name
    Set to BGM.
  • Audio Clip
    Select scavengers_music.
    The clip is located in Assets/Tutorial Resources/Audio/.
  • Loop Clip
    Enable this setting.

That’s it for the music.

UI System #

We’ll use the Unity UI module – it’s best to select the UI system as one of the first things when starting a new project.

Navigate to UI > UI System and change the following setting.

UI System Settings #

  • UI System Type
    Select Unity UI.
  • Default Screen Size
    Set to X=900, Y=900.
    You should also change the resolution of your Unity project to use the same size.
    You can find them in Edit > Project Settings… > Player, they’re available when not using fullscreen mode.

Changing the UI system will show confirmation dialogue, which we’ll accept via the Ok button.

UI Layers #

UI layers are used to manage displaying UI content above each other. We’ll use it to display a dialogue above the screen fader.

Navigate to UI > UI Layers, add a new UI layer and change the following settings.

  • Name
    Set to Above Screen Fader.

The new UI layer should be below the already added Screen Fader layer (i.e. have a higher index) to show it’s content above the layer.

And that’s it – click on Save Settings (and on Confirm in the following screen) to save the changes.

Scene Setup #

Finally, we’ll add Makinom and the background music to the scene. Open the Main scene (found at Assets/Tutorial Resources/Scenes/).

We also need to add the scene to the Unity build manager (File > Build Settings…), otherwise we’ll not be able to reload it later.

Adding a Game Starter #

To add Makinom to the game, we’ll need a game starter. You can learn more in the game starters documentation.

Add the game starter using the scene wizard (Window > Makinom Scene Wizard). Click on Add Game Starter, select the Makinom project if it’s not already selected (found at Assets/Gaming Is Love/_Data/Project.asset) and click on Add Game Starter again. The scene wizard will create a new game object and attach the game starter to it.

Move the new game starter object out of the way, e.g. to X=-5, Y=0, Z=0.

Adding the Music #

Again, we’ll use the scene wizard to add the background music: Create Object > Music Player

Move the new music player object out of the way (e.g. X=-5, Y=2, Z=0) and change the following settings in the inspector of the Music Player component.

  • Play Type
    Select Play.
  • Music
    Select BGM.

And that’s it for now – save the scene.

The next tutorial will handle generating the level.