Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

6. December 2017


GameMaker is a seminal game engine, with roots dating back to the late 1990s.  It is a cross platform 2D game engine with tools that run on Windows and Mac machines while capable of targeting both desktop operating systems as well as Ubuntu Linux, Android, iOS, UWP, HTML5, XBox One and PlayStation 4 consoles.  GameMaker is commercial software with a free trial available, we will discuss pricing shortly. 

The closer look series is a combination of overview, review and getting started tutorial aimed at helping you decide if a given engine is the right choice for you.  As always, there is an HD video version available here and embedded below.

Let’s jump right in with GameMaker Studio 2!


The Tools

GameMaker Studio is an all in one integrated environment for creating games.  It includes everything you need in a single application with a tabbed working environment and a unique virtual desktop style approach supporting multiple editing windows at once.  The all in one all tools at hand nature of GameMaker is probably one of it’s greatest selling points.


The Main Interface

image


Side and bottom panels can be collapsed down to give more room:

image


The primary work area is tabbed, supporting multiple open views at once:

image


As mentioned earlier, GMS has a workspace setup that enables you to work with and pan between multiple editors at once, like a giant virtual desktop.

GMSDesktop


The resource panel is commonly used across the various editors and contains the various assets that make up your game.  You can also drag and drop assets onto this window to import them for use in your game.  For example, dropping in an image file will create a new Sprite entity for you.

image


You can also create new entities via the dynamic right click menu.  For example, right clicking the Tile Sets area will bring up this menu:

image


The Room Editor

image

This is your traditional level editor, where you can create various layers of entities that compose your game level.  A top left you have the layers controls, enabling you to create/delete/hide the various layers that make up your game.  Layers can be composed of instances (objects), backgrounds, tile maps and paths.  The editors below the layer controls change dynamically based on what kind of layer is selected.


Selecting a tile layer brings up the tile map editing tools, including a palette of tiles you can paint with.

image

GMS even has support for auto tiling, if your tileset is compatible.


The Sprite Editor

image

This editor enables you to define how a sprite is imported, the various frames of animation if any as well as a preview of the sprite or animation.  Additionally, clicking Edit Image brings up a full blown image editor within GameMaker.

image

This is a full blown sprite editing package with a variety of brushes available, full layer support, the ability to paint across frames, several tools such as text tools, polygon tools, a magic wand selection tool, mirroring tools and more.  Pretty much all the functionality you would expect for creating or editing sprites is available directly in GMS.


Sound Editor

image

You also have control over sound effect details via the sound editor/mixer.  Supported audio files include wav, mp3, wma and ogg.


Tileset Editor

image


As mentioned earlier, the room editor has full support for tileset layers.  There is an editor for defining tilesets as well as defining auto tiling support.  There are also editors for defining tile animations and creating predefined tile brushes.


Path Editor

image

This editor is used to define paths, either straight line or curves.  Often used for AI paths, the generated paths can be used and editing directly in the room editor.


Script Editor

image


This is the built in editor for developing games using GameMaker Script.  It has syntax highlight, code suggestions and a selection of other features.

image

The code editor is also used for shaders.


Drag and Drop Editor

In addition to GMS scripting, GameMaker also provides a drag and drop programming option.

image

You can use drag and drop from the toolbox to script your programs behaviour.  We will cover both programming options in more detail shortly.


Font Editor

image


Enables you to import and preview fonts for use in your game.  Fonts can be in either true type or open font formats.


Object Editor

image

The Object Editor is where you will start to tie your various resources together.  For example, your main character will be an object that connects to a sprite, while handling various different events.  Objects are created in the Object Layers in the room editor and generally represent the entities that make up your world.  We will look at objects in a bit more detail later.


Programming In GameMaker

You may be wondering at this point how exactly you implement gameplay logic in your GameMaker game?  Essentially you attach logic to objects in the game world.  When you edit an object you will notice there is an Events option.

image


Click the Add Event button and you will see the various events you can respond to in your game:

image


These are called at various points by the game engine and are analogous to the game loop in other engines.  Step is called once per pass through the game loop and is most commonly where you will handle update logic.  There are also events for when the object is created, destroyed, etc… as well as various options for responding directly to events such as collisions, touches, etc.


You can also wire up code to be called when a Room is created, via the Creation Code button:

image


Next it’s a matter of deciding HOW you want to program in GameMaker, via Drag and Drop as well as directly using GameMaker scripting.


Scripting

Scripting is done using Game Maker Language, or GML, which is a C like scripting language.  The syntax is fairly simple and if you’ve had any prior C, Python, C++ or similar language experience, picking the language up should be fairly simple.  There are built in methods for most functions you would want to perform such as graphics drawing, audio code, networking, platform specific tasks like in app purchases etc.  There are also built in data types such as Stacks, Lists, Maps and Queues.  Actually teaching GML is beyond the scope of this document but you can access the language reference here.

If functionality is lacking it may be available on the GameMaker Market Place or you can add it yourself by creating a native extension.  You can add new functions to GML in this manner.


Drag And Drop

Programming via drag and drop in GameMaker is your other option and is a great choice for people that just want to jump in and figure things out on their own.  Don't worry too much about performance as the DnD code is ultimately generating GML script so performance should be roughly the same.  In fact, you can switch freely between the two programming methods at will within the same project or call GML directly in your DnD script.

Creating scripts in DnD is as simple as dragging in predefined functions to create a flow chart of sorts that occurs top down, like so:

GMLDnD

Once again, you can freely switch between the two methods.  Additionally, in any script your can right click and select Convert To Drag and Drop.  A reference of all the drag and drop tiles is available here.


The Price

GameMaker is commercial software, so that means there is a price tag attached.  There are multiple versions available for GameMaker as well as addition platforms coming with an additional price tag.  Pricing (as of today, 12/6/17) breaks down as follows:

image

image


In addition to these various different platforms, there is also now a new $39 per year ( most of the above non-console licenses are permanent buy once ) Creator Edition aimed at hobbyist developers.  It is fully featured but requires you to choose Windows or Mac and also requires your game display a splash screen.  There is also a heavily limited free trail available.  For more information on pricing or to download the trial visit here.


Community and Documentation

As you might expect for such a long lived game engine, there is also a very well established community.  The forums are available here.  With almost 20K registered users and 230K posts, the forums are quite active and contain a wealth of knowledge, although much of it is for earlier 1.x versions.  Questions seem to be answered fairly quickly.  In addition to the forums there is also the YoYoGames help desk containing several guides and how-tos.

There is also a fairly comprehensive GameMaker Studio manual available online which can be opened directly within Studio.

Additionally, there are several books available for GameMaker Studio such as:


In addition there are several tutorials and start kits available on the online marketplace, which we will talk about…


Online Marketplace

Quickly becoming the must have feature of modern game engines, GameMaker has an online store available, containing free and commercial assets including demos, scripts, sprites, shaders, extensions and more.

image

You do not need to have GameMaker Studio installed to access the marketplace, you can browse it in your browser here.


Conclusion


At the end of the day, GameMaker Studio faces a challenging new world as it is facing increasing competition from free and free to start game engines.  Is it worth it?  That is impossible for me to answer, as value is very subjective.  Game Maker is certainly a very complete 2D engine with a vibrant community and tons of resources.  Compared to the previous versions, the 2.x editor contains a great deal more polish and most every tool you would need is included out of the box.   Game Maker has certainly proven itself a production capable engine, having powered such titles as Hotline Miami, Undertale and Spelunky, all titles that have seen commercial success.

A proven catalog of game is always a strong selling point.

Personally, if you are working on a 2D title using Windows or Mac, Game Maker is certainly worth considering.  Do keep in mind however that as you add more platforms, you also add more cost.  In many cases though, this means you are ready to commercialize your title, so hopefully cost isn't as much of a concern.  I do think however they are making a mistake in charging for the Creator Edition.  Personally I would do away with the trial completely, make Creator free and charge people to deploy to additional platforms.  If this was the case it would be a great deal easier for me to recommend you check out GameMaker yourself.  Without a free option, its hard to recommend in the face of so many free/free to start options out there.  The engine is great, productive, proven and easy to learn… just saddled with a bit of a dinosaur business model.


The Video

Programming, General, Design , , ,

26. June 2017


The Esenthel Game Engine has been under development for more than a decade and yet I had never actually tried it before now.  They recently released a Fantasy Tech Demo illustrating recent functionality added to the engine.  After trying out the demo, I decided to give Esenthel a shot.  The following video is a quick hands-on with the Esenthel Game Engine. Esenthel is a C++ powered/scripted game engine with a full editing environment as well as Visual Studio integration.


The Essenthel Engine has a free trial available for download and is available for Windows, Mac and possibly Linux.  The full version is a commercial subscription for 11.40$ a month or 114$ annually.  A source license costs double that amount.

Programming ,

14. June 2017


This is a brand new series being launched on YouTube and GameFromScratch and is somewhat different in scope.  The aim is to essentially make the same game several times in different game engines.  We are creating a simple bowling game in various different 3D game engines.  In fact, we are creating this bowling game which we completed earlier using the PlayCanvas game engine.


For each game engine in the series we will implement basically the exact same game, along with a step by step text version, plus a video of the process.  This should be useful for a number of reasons.  First it enables you to directly compare the workflow between different game engines.  Second, it shows... perhaps not best practices, but how to get started creating a full featured, if extremely limited, 3D game with physics, scenes, model importing an more.


At this point in time I have begun implementing it in a number of different engines, including:

    • PlayCanvas
    • Atomic Game Engine
    • Godot 2.x
    • Unity
    • Unreal Engine

Depending on the popularity of the series I am willing to implement the game in other engines as well with a few caveats.  The engines need to support all the required features ( level editor, 3d model importing, physics, etc ) required to make the game.  So while I could implement such a title in a code focused API such as Ogre or LibGDX, it’s completely outside of the scope of what I am trying to accomplish here.  I also need to have access to the game engine, either through public domain, free trial, etc.  This currently rules out some engines such as Leadwerks and Shiva unfortunately. 


Beyond the engines listed above, I’d love to hear what other engines you would like to see covered? 


GameDev News

6. June 2017


There are several game engines out there that present a code free option such as Stencyl and Construct.  Today we are looking at an open source alternative, GDevelop.  It is a cross platform, open source 2D game engine with a visual programming interface that requires no previous experience.  However there is also the ability to extend the engine using the C++ programming language if desired.  If you are new to the Closer Look series, it is a combination of game engine review and getting started tutorial helping you decide if a game engine is right for you.


As always, there is a video version of this tutorial available here and embedded below.


Without further ado, let’s jump into GDevelop.


Meet GDevelop

As mentioned above, GDevelop is an open source 2D game engine.  It is released under the MIT license for the core engine, while the editor is available under the GPL v3 open source license.  The code is available on Github.

Of course you don’t ever have to touch the source code to work with GDevelop.  You can download binaries for Windows, Mac, Linux as well as Browsers, iOS and Android in the form of GDevApp.  I will not be covering GDevApp today however.  GDevelop is able to compile native applications, HTML5 pages as well as Android applications, which is currently an experimental feature.

The vast majority of your time is going to be spent in the GDevelop editor, shown below.

image

The center of the screen is currently showing the Scene editor.  There is where you can compose scenes.  It is a tabbed view that can contain multiple open scenes as well as Events, the programming model of GDevelop, which we will discuss more shortly.

On the right hand side is the Objects Editor, which contain the building blocks of your game.  On the left hand side is the Project Manager containing the assets and scenes that make up your game.


Let’s walk through creating a sprite in a game.  In the Objects editor, right click objects and select Add an object.

image

This will show us a list of possible objects:

image


For every object except the Sprite you need to enable it before you can use it (thus why they are grayed out).  It’s as simple as double clicking a grayed out object to enable it however, like so:

image


In this case however we are going to use the Sprite object, which is already enabled.  Simply double click Sprite.  Double clicking the newly created object in the Object editor will open up the sprite editor screen:

image


At the top right corner of the editor window you will see the Images bank’s editor, click the plus icon and add the images you will use for your sprite.  Next drag the selected images down to the images section, like so:

GIF


You can rename and configure the animation (if any) under the Animations panel.

image


Now you can create an instance of your Sprite object by simply dragging it into the scene.

GIF2


As we saw earlier, there are several built in objects in addition to the Sprite object, including Admob integration, a Text object, a tiled sprite (spritesheet), etc.   Next lets move on to adding some logic to our newly created object.


Scripting in GDevelop

Logic in GDevelop are implemented using Events.  Let’s look at an example of moving the sprite around when the mouse moves.  Click on the Events tab.

image


In the Events ribbon, click Add an Event:

image


In this case we have no conditions, we want this to happen every single frame.  Hover over No actions, then select Add an Action.

image


This is where the building block aspect of GDevelop programming comes into play.  Select All Objects->Position->Position of an object.

image


Now we can set the parameters for positioning our object.  First select the object to modify, then set each parameter.  In this case we set the X and Y values to those of the mouse cursor, like so:

GIF3


Upon completion, you will see we now have an event defined:

image


In this particular case we have no condition, so our event will fire every pass through the event loop.  We could however have set a condition which causes our event to fire or not.  Here for example is a condition that will start playing some music once the scene is loaded.

image


Beyond conditions, there are other control structures you can add to events:

image


Link enables you to break link to another event sheet, enabling you to modularize your code.  It is also possible to define variables, both globally, to the scene and at the object level.  For example, right click the Project and select Modify Global Variables.

image


This now enables us to define new variables:

image


This can also be done at the object level, right click an object and select Other Properties.  Then in the resulting panel select Click to Edit...

image


While we are here, notice the Behaviors option?  This enables us to add new functionality to game objects.  Click the Add... button:

image


You will notice once again, by default all behaviors are disabled.  Double click a behavior to add it in.  Let’s go ahead and add Top-down movement as an example.  You can now edit properties of the new behavior in the same dialog:

image


This will instantly add arrow key navigation abilities to your object.  When you play your game, arrow keys will cause your object to move around screen.  Speaking of playing your game, hit the Preview button in the Scene ribbon to launch your game in your browser.

image


You can control application level settings of your project by right clicking your project and selecting Edit the property of the game.

image


This will bring up the next dialog.

image


Finally, if your project has Native extensions enabled, under the File menu you have the option to build a native version of your application.

image


Then simply click the Compile button.

image



Documentation and Community

GDevelop is reasonably well documented, with a Getting Started tutorial, several other tutorials and a decent number of starter templates to choose from.

image 


There is also a manual available online.  If you are intending to extend GDevelop using C++ however, the documentation is almost non-existent.  However being an open source project, all of the code is available.  All of the behaviors and objects we used in this example are available in source form on Github in the extensions folder:

image


GDevelop has a dedicated forum available here.  It is reasonably active with a decent sized community.  Forums are available in both English and French.


Conclusion

If open source, free and a visual programming interface are important to you, GDevelop is definitely an engine to consider.  The documentation is adequate, the engine is mostly feature complete, although annoyingly some features such as Tiled support are only available for native targets.  The entire thing is designed around extensibility and if you are willing to dive into C++, the sky’s the limit on what you can do.  My biggest complaint is a lack of polish on the UI layer, experiencing a few crashes, some UI glitches that went away on a reload and some buttons that simply do nothing.  Most annoyingly, the engine is basically unusable on a high DPI display.

It is however an easy engine to jump into and use if you are willing to deal with some UI warts.  An MIT license around the core engine is always an excellent feature.


The Video

Programming , , , ,

12. January 2017

 

Today we are going to take a quick look at the Tilengine 2D game engine.  Tilengine in their own words is:

Tilengine is a free, cross-platform 2D graphics engine for creating classic/retro games with tilemaps, sprites and palettes. Its unique scanline-based rendering algorithm makes raster effects a core feature, a technique used by many games running on real 2D graphics chips.Untitled 3

Tilengine is open source (sorry, the core isn't open ), available on Github however I never could locate what license it’s released under.

EDIT—Since posted, there has been a bit of conversation about the licensing since this was posted, read here.

  It’s a C library, but contains bindings for Python, C# and Java.  I’m actually going to use the C# bindings for the example in this review as it’s the least documented of the available bindings.  There is a single page class reference available here and a small manual available here.  The engine is geared towards creating retro sprite style games and handles graphics, animations, palettes, input and window management, but has no sound or physics engine built in.  It is also designed to be used as a backend solution to an existing front end renderer.  There are several C based examples available here, and this represents the primary way you will get up to speed.  The graphics system is designed to emulate classic sprite systems like Sega’s SuperScaler arcade board but with Super Nintendo’s Mode 7 style graphics effects available.  Tilengine is layered over SDL and is cross platform, capable of running on most desktop operating systems, as well as Raspberry Pi devices.

Tilengine is composed like so:

image

 

Tilengine has direct support for tiled map files created using the Tiled map editor.  If you want to learn more about Tiled, I have done a complete tutorial series available here.

 

As a pretty straight forward game engine, let’s jump right in with the example created using the C# bindings:

using Tilengine;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var engine = Tilengine.Engine.Init(320,240,1,16,16);
            var window = Tilengine.Window.Create("",Tilengine.WindowFlags.Vsync);
            
            // This is the clear color drawn each frame.  Think of it as the sky color
            engine.BackgroundColor = new Color(0,128,238);

            // Load tsx and tmx file.  These are created in the Tiled level editor
            // tsx is a collection of tiles, tmx is a map painted using those tiles
            var tileset = Tileset.FromFile("SOTB_bg.tsx");
            var tilemap = Tilemap.FromFile("SOTB_bg.tmx","Layer 1");
            
            // create a new layer using our just loaded tiles.  Games can have multiple layers
            var layer = new Layer();
            layer.Setup(tileset,tilemap);
            layer.SetPosition(0,0);

            
            // Now we are loading an animated sprite riped from the 90s classic Shadow of the Beast
            // Spriteset is simply the image collection composing our game Spriteset
            // SequencePack is simple text format describing the available animations, their frames, speed etc
            // While Sequence is a named entry in the SequencePack text file
            Spriteset ss = Spriteset.FromFile("SOTB");
            SequencePack sp = SequencePack.FromFile("SOTB.sqx");
            Sequence walk = sp.Find("walk");

            // Now finally create a sprite using our spritesheet
            Sprite sprite = new Sprite();
            sprite.Setup(ss,TileFlags.None);

            int spriteX = 15;
            sprite.SetPosition(15,215);
            
            // Now play the animation sequence named "walk".  We also pass the final 0 in to tell it how many times the animation
            // should loop.  Zero equals forever
            Animation anim = new Animation();
            anim.SetSpriteAnimation(0,walk,0);
            
            
            int frame = 0;

            // This is your game loop
            while(window.Process()){
                // Draw the current frame of graphics (sprites, layers, etc)
                window.DrawFrame(frame++);

                // Now check if left or right arrow/gamepad are pressed, in which case move in that direction
                // IF moving left, flip the sprite over on the X axis
                if(window.GetInput(Input.Right)){
                    spriteX ++;
                    sprite.Flags = TileFlags.None; 
                }
                if(window.GetInput(Input.Left)){
                    spriteX --;
                    sprite.Flags = TileFlags.FlipX; 

                }
                sprite.SetPosition(spriteX, 185);
                if(spriteX > engine.Width) spriteX = 0;
            }
            

            //Cleanup
            tilemap.Delete();
            tileset.Delete();
            window.Delete();
            engine.Deinit();
        }
    }
}

 

The comments pretty much describe everything that is going on there.  For more details, be sure to check the video version of this tutorial available here [coming soon].  This example loads a sprite and animation from the game Shadow of the Beast, an Amiga platformer classic.  The SequencePack file format is extremely simple XML file, here is the example used:

<?xml version="1.0" encoding="UTF-8"?>

<sequences>
  <sequence name="walk" delay="6" loop="0">
    1,2,3,4,5,6
  </sequence>
</sequences>

 

The tsx and tmx files are generated using the Tiled level editor, another open source and free tool.  As you can see, it’s extremely simple to get up and going.  Run this code you will see:

SOTB

 

This is of course a primitive example, but does show the many parts of a game.  A game loop, sprite loading, animations, level loading, etc.  The major features of the engine, that I’m not covering here, are the various sprite effects it emulates.  You can see these effects demonstrated here or in the samples.

 

The Video

Programming , , ,

Month List

Popular Comments