Project Template Overview - Grisgram/gml-raptor GitHub Wiki

Project Structure

When you create a new game from the template, it contains several folders and two rooms:

  • The rmStartup (hidden in the _GAME_SETUP_ section in the picture below)
  • The rmMain, which is the room, you will see when you hit F5

It looks like this:

image

Unfortunately, GameMaker does not save the colors of folders in the template file, so on your side those folders will very likely not be colored like that. I got used to these colors over time, but that's just a personal taste.

Let's go through the sections one-by-one so you understand how the template works.

_GAME_SETUP_

This is the most important section and the one where you will make most of your initialization changes.

image

browser_extensions

This folder contains YAL's Browser Click extension, which I have adapted a bit to fit into the startup cycle of raptor. It should not be necessary to change anything in there, but you can play around with the colors of the loading bar in the gmcallback_imgloadbar script.

startup

Here you find the first room of the game, rmStartup. It is set as first room in the game settings and will do nothing, except initializing the PersistentGameController and GameStarter objects. The GameStarter invokes the initialization scripts (we'll cover those in a moment) and then jumps forward to rmMain which is the first room in the game you can work with.
You should not make changes in here, except for the room's size, if necessary.
This is the only reason, why those two files are located in _GAME_SETUP_.

Script files

The scripts contained here initialize your game. Each of these files has a comprehensive file header and a comment block that explains what is set in each of them.

File Description
Browser_Click_Handler Open Links in new tabs. Ignore (but don't delete!), if you are not doing a HTML5 game
Draw_Debug_Info Contains a callback you can fill with code to print debug info on the screen.
A detailled documentation can be found at the DEBUG_MODE page
Game_Configuration The most important of all files!
You set up the scribble fonts, load initialization files, etc. Look inside!
Game_Exception_Handler Creates encrypted Crash logs on disk, which you can pick up later
Game_Particle_Types Holds the generated code of the Particle Editor for the Particle Effects module
Game_Settings Save your settings (sounds, volume, all other settings from the running game) through this script to have an automated save/load process of your settings on game start and game end. Look inside!
LG_Configuration Configuration switches for the LG Localization system
Logger_Configuration The settings for the Logger module
MessageBox_Configuration Configuration switches for the MessageBox Functions
Race_Configuration The settings for RACE (The Random Content Engine)
Savegame_Configuration The settings for the Savegame System

_gml_raptor_ and _gml_raptor_packages_

The _gml_raptor_ folder contains all the core classes of raptor. You should not make changes here, but if you do, keep in mind that they get overwritten with every new release of raptor.

In the _gml_raptor_packages_ folder are some of my own libraries that I included in the template.
All of them are available as stand-alone repositories at github too:

Link to the github repository
image animated-flag
highscorer
outline_shader_drawer

If you do not plan to use any of them, you can safely delete them, but remove the animated flag object from rmMain before you do so! The default room contains one animated flag just to show, that everything is up and running.

_third_party_packages_

This section contains the required libraries, raptor uses.
While I am quite confident, that you have heard about Scribble, the others might be new for you, so here are all github links to the libraries:

Link to the github repository
image Canvas
Scribble
SNAP

Do not delete these, they are used in raptor core code!

The Rooms

By default, I have set up a main room (meant to be the main menu, the landing page, if you want).

Rooms for raptor are organized as one folder for each room.
This folder contains at least:

This is the minimum structure, I strongly recommend, when you do a raptor game.

RoomController is designed to control not only the ROOT_UI, a ControlTree of the UI Subsystem, it also offers lots of features and functions, specific for the room.

PersistentGameController

In the root of the Rooms folder, you find one of very few persistent objects of raptor: The PersistentGameController.

This object is here for you, to adapt it to your needs. It shall hold and manage all the "once-in-the-game" things. The PersistentGameController is part of the Savegame System, so make sure, that you put all things, that shall be saved in the data member of the object.

Alternatively, you can use the GLOBALDATA macro to store your global values, that shall be part of the Savegame. See there, to get more information.

Add more rooms

I recommand, that you use the RoomTemplates, that are available at the Releases Page and will be updated with every raptor release.
Those templates contain an empty room, together with a RoomController and all layers for raptor set up, so you can start designing immediately.
Rename the room, rename the controller, and go!

Note

If you are doing a HTML game, there is also a raptor-html-template-room package available!

rmMain

This room is the first visible room of the game. It contains a single animated flag to have something to show when the game starts.
Of course, you are not required to have this as the starting room, but rmMain is a quite common and generic name, so even if you just want to use it for your intro, it should be ok.

How to get rid of rmMain

In case, you really can't accept rmMain as the room's name, you must change one line in the Game_Configuration script:

// Startup Room - The value of this constant is taken by the GameStarter object
// Set the constant to undefined to use the instance variable of GameStarter in rmStartup
#macro ROOM_AFTER_STARTER	rmMain

At the time of writing this documentation, this was line#56 of the script. Enter the room name here, that shall be opened, when the initialization room has finished.

That's it for the project structure! Head on now to Starting a new game.

⚠️ **GitHub.com Fallback** ⚠️