Montag, 26. Oktober 2015

GameMaker - Introduction

As discussed in my last post, I have chosen GameMaker: Studio as my development environment for game programming.
Now I would like to provide an easy entry for beginners and other interested parties to this IDE (Integrated Development Environment) by listing a few sources of information and tips and explaining the basics.

Official GameMaker: Studio site

Communities:

Documentation:

Resources:

Of course, there are countless other sources of information, but the best will be to use Google. ;)

The various versions of GameMaker: Studio
and Supported Platforms

Here we see the different versions of GameMaker: Studio and the various modules for additional platform support. This table I have simply taken over from the official GameMaker page.
[http://www.yoyogames.com/studio, 09/28/2015]
FeatureStandardProfessionalMaster Collection
PriceFree $149.99$799.99
Registration Required
Made with GameMaker Splash Screen in game
Unlimited resources
Texture Management
Multiple Configurations
Team Features
Developer Services Portal (DSP)
Mobile Testing (Android)
GameMaker: Player Export
Windows Desktop Module
Windows Desktop Module + YoYo Compiler + Export
Windows App Module + YoYo Compiler + Export
Mac OS X Module + Export
Ubuntu Linux Module + Export
HTML5 Module + Export
+$199.99
Android Module + YoYo Compiler + Export – x86, ARM, MIPS
+$299.99
iOS Module + YoYo Compiler + Export
+$299.99
Windows Phone 8 Module + YoYo Compiler + Export
+$299.99
Tizen Module + Export
+$199.99
Xbox® One Module + YoYo Compiler + Export
+$299.99
PlayStation® 4 Module + YoYo Compiler + Export
+$299.99
PlayStation® Vita Module + YoYo Compiler + Export
+$299.99
PlayStation® 3 Module + YoYo Compiler + Export
+$299.99
Includes all current & future modules in version 1.x


Basics of using GameMaker: Studio























Here we see the GUI (graphical user interface) of Game Maker IDE. On the left is a column with all resource types that can be used. These include:
  • Sprites (images that can be drawn)
  • Sounds (audio files for sound effects and background music)
  • Backgrounds (graphics for backgrounds)
  • Paths (predefined movements)
  • Scripts (code scripts: corresponds methods / functions)
  • Fonts
  • Timelines (predefined timings)
  • Objects (objects from which instances can be created)
  • Rooms (rooms / levels / maps)
  • Included Files (files integrated into the game)
  • Extensions (extensions for several platforms: JAR, DLL, ...)
  • Macros (constants and snippets)
  • Global Game Settings (settings for all platforms)
And that you may even want to see now how to tinker a first small program I wrote a little guide below, before I explain how the whole as such plays together:

How does it start?These instructions have been starting from GameMaker: Studio is written in latest version.

  1. At the very first, when a new project is created, a room is required.
    -> Right click on the Rooms folder - Create Room.

    (Now the "game" could already be started, but we would only get a blank window.)
  2. We need to create an object with which something should be done.
    -> Right click on the Objects folder - Create Object.

    -> Let's call it obj_hello.
  3. Now we open (if not already open) the newly created room by double-clicking on its name, jump into the Objects tab, and click right into the room to place the object obj_hello.
  4. In the created object (double-click on obj_hello in resource tree, if not already open) we create a new event:-> Add Event - Draw - Draw
  5. Here we use drag'n'drop to move the tile with the big A (Draw Text) from the right (in the draw tab) into the Actions list.
  6. We open this newly created command Draw Text by double click (also opens on its own after the pull-in) and write "Hello World" in the text field "text:" and click OK.
  7. With one click on the green arrow in the top menu (Run the game) of the IDE, we now start our "game" and see - a Hello World Program is "written".

What happens next?


Now you should have a first impression of how the GameMaker is constructed and works roughly:

  • You can drag objects into an editor and arrange as desired.
  • These objects function event oriented. For example, you can respond to:"Instance created," "instance clicked", "instance deleted", "instance1 collides with instance2" ...
  • And to these events you can drag instructions into, which will be triggered in turn, or only under certain conditions. It is also possible to drag a "piece of paper" and to write everything yourself (me as an experienced programmer wouldn't do it the other way).
Of course, there are countless ways that I have not indicated at all. If you feel like you want more, you can look for tutorials in the mentioned communities, on YouTube, or in other sources, or simply experiment yourself.
GameMaker itself also provides a small selection of tutorials and demos directly.

Important tip: If you are still inexperienced, you should definitely start with a project that is as small as possible! Even the idea to start a complex game, such as an RPG, keep it short and expand it later, probably suggests the wrong way.
Your way of programming and implementing things will constantly change and improve. You will eventually notice how inefficient or opaque your old code is and would like to do everything from scratch... It is extremely demotivating if you start something, but never brings to an end...


In my next post I want to share a little game with source code with youso you can look at everything in peace and understand it. It is a short held replica of a very old but still often played game that everyone knows. ;)
The source code is well commented in English, but not necessarily addressed to beginners. But so you have the opportunity to see how something can be done the "professional" way

GameMaker - Einführung

Wie in meinem letzten Posts erläutert, habe ich mich für GameMaker: Studio als meine Entwicklungsumgebung für die Spieleprogrammierung entschieden.
Nun möchte ich Anfängern und Interessenten einen Einstieg für diese IDE (Integrierte Entwicklungsumgebung) erleichtern, indem ich ein paar Quellen für Informationen und Tipps aufliste und die Grundlagen ein wenig erkläre.

Offizielle GameMaker: Studio Seite

Communities:

Dokumentation:

Ressourcen:

Natürlich gibt es noch unzählige weitere Informationsquellen, aber die beste bleibt schließlich doch Google. ;)

Die verschiedenen Versionen von GameMaker: Studio
und unterstützte Plattformen

Hier sehen wir die verschiedenen Varianten von GameMaker: Studio und den verschiedenen Modulen für zusätzliche Plattformunterstützungen. Diese Tabelle habe ich schlicht von der offiziellen GameMaker Seite übernommen.
[http://www.yoyogames.com/studio, 28.09.2015]
Feature Standard Professional Master Collection
Price Free $149.99 $799.99
Registration Required
Made with GameMaker Splash Screen in game
Unlimited resources
Texture Management
Multiple Configurations
Team Features
Developer Services Portal (DSP)
Mobile Testing (Android)
GameMaker: Player Export
Windows Desktop Module
Windows Desktop Module + YoYo Compiler + Export
Windows App Module + YoYo Compiler + Export
Mac OS X Module + Export
Ubuntu Linux Module + Export
HTML5 Module + Export
+$199.99
Android Module + YoYo Compiler + Export – x86, ARM, MIPS
+$299.99
iOS Module + YoYo Compiler + Export
+$299.99
Windows Phone 8 Module + YoYo Compiler + Export
+$299.99
Tizen Module + Export
+$199.99
Xbox® One Module + YoYo Compiler + Export
+$299.99
PlayStation® 4 Module + YoYo Compiler + Export
+$299.99
PlayStation® Vita Module + YoYo Compiler + Export
+$299.99
PlayStation® 3 Module + YoYo Compiler + Export
+$299.99
Includes all current & future modules in version 1.x


Grundlagen zur Verwendung von GameMaker: Studio























Hier sehen wir die GUI (grafische Benutzerschnittstelle) der GameMaker IDE. Links zu sehen ist eine Spalte mit allen Ressourcen Typen, die verwendet werden können. Dazu zählen:
  • Sprites (Bilder, die gezeichnet werden können)
  • Sounds (Audio-Dateien für Soundeffekte und Hintergrundmusik)
  • Backgrounds (Grafiken für Hintergründe)
  • Paths (Vordefinierte Bewegungsabläufe)
  • Scripts (Code-Skripte: Entsprechen Methoden / Funktionen)
  • Fonts (Schriftarten)
  • Time Lines (Vordefinierte Zeitabläufe)
  • Objects (Objekte, von denen Instanzen erzeugt werden können)
  • Rooms (Räume / Level / Maps)
  • Included Files (In das Spiel eingebundene Dateien)
  • Extensions (Erweiterungen für verschiedene Plattformen: JAR, DLL, ...)
  • Macros (Konstanten und Codefragmente)
  • Global Game Settings (Einstellungen für alle Plattformen)
Und damit ihr nun mal seht, wie man ein erstes kleines Programm bastelt, habe ich im Folgenden eine kleine Anleitung verfasst, noch bevor ich überhaupt erkläre, wie das ganze so zusammenspielt:

Wie geht es los?
Diese Anleitung wurde ausgehend von GameMaker: Studio in der aktuellen Version geschrieben.

  1. Als allererstes, wenn ein neues Projekt angelegt wurde, wird ein Room benötigt.
    -> Rechtsklick auf den Rooms-Ordner - Create Room.
        (Jetzt könnte das "Spiel" bereits gestartet werden, doch wir bekämen nur ein leeres Fenster.)
  2. Es muss ein Objekt erstellt werden, mit dem etwas geschehen soll.
    -> Rechtsklick auf den Objects-Ordner - Create Object.
    -> Nennen wir es doch obj_hello.
  3. Nun öffnen wir (falls nicht bereits offen) den neu erstellten Raum per Doppelklick auf seinen Namen, springen in den Reiter Objects und klicken rechts in den Raum, um das Objekt obj_hello zu platzieren.
  4. Schließlich legen wir in dem angelegten Objekt (Doppelklick auf obj_hello im Ressourcen-Baum, falls nicht bereits offen) einen neuen Event an:
    -> Add Event - Draw - Draw
  5. Hier ziehen wir nun via Drag'n'Drop von rechts (unter dem Reiter draw) die Kachel mit dem großen A (Draw Text) in die Actions-Liste.
  6. Wir öffnen diesen neu angelegten Draw Text Befehl mit Doppelklick (öffnet sich auch von alleine nach dem Hineinziehen) und schreiben "Hello World" in das Textfeld "text:" und klicken auf OK.
  7. Mit einem Klick auf den grünen Pfeil oben im Menü (Run the game) der IDE, starten wir nun unser "Spiel" und siehe da - ein Hello World Programm ist "geschrieben".

Wie geht es weiter?

Jetzt solltet ihr einen ersten Eindruck davon haben, wie der GameMaker aufgebaut ist und grob funktioniert:
  • Ihr könnt Objekte in einen Editor ziehen und beliebig anordnen.
  • Diese Objekte funktionieren Event-orientiert. Z.B. könnt ihr reagieren auf:
    "Instanz erstellt", "Instanz angeklickt", "Instanz gelöscht", "Instanz1 kollidiert mit Instanz2"...
  • Und in diese Events könnt ihr wiederum Anweisungen hinein ziehen, die der Reihe nach, oder auch nur unter bestimmten Bedingungen, ablaufen. Es ist auch möglich ein "Blatt Papier" hineinzuziehen und alles selbst auszuprogrammieren (ich würde es als erfahrener Programmierer nicht anders machen).
Natürlich gibt es unzählige Möglichkeiten die ich nicht im geringsten angedeutet habe. Wenn ihr Lust auf mehr bekommen habt, könnt ihr euch in den genannten Communities, auf YouTube, oder auch aus anderen Quellen, Tutorials anschauen oder einfach selbst etwas rumexperimentieren.
GameMaker selbst liefert ebenfalls eine kleine Auswahl an Tutorials und Demos direkt mit.

Wichtiger Tipp: Wer noch unerfahren ist, sollte unbedingt mit einem Projekt starten, dass so klein wie möglich ist! Auch der Gedanke, man könne ein komplexes Spiel, wie z.B. ein RPG beginnen, kurz halten und später erweitern, schlägt wahrscheinlich den falschen Weg ein.
Eure Art und Weise zu Programmieren und Dinge umzusetzen wird sich stetig wandeln und verbessern. Ihr werdet irgendwann merken wie ineffizient oder undurchsichtig euer alter Code ist und würdet am liebsten alles neu machen... Außerdem ist es extrem demotivierend, wenn man etwas anfängt, aber nie zu Ende bringt...


In meinem nächsten Post möchte ich ein kleines Spiel samt Quellcode mit euch teilen, mit dem ihr euch alles in Ruhe anschauen und nachvollziehen könnt. Es handelt sich um einen kurz gehaltenen Nachbau eines sehr alten aber auch heute noch gespielten Spiels das jeder kennt. ;)
Der Quellcode ist gut kommentiert (allerdings auf Englisch), aber nicht unbedingt an Anfänger gerichtet. Doch so hat man mal die Gelegenheit zu sehen, wie alles etwas "professioneller" angegangen werden kann.