Welcome to 2022 and a new year of GameMaker! We have been working hard over the last few weeks on the first stable version of GameMaker of the year. In this blog we will talk about the features being introduced in this month’s release, and something exciting for our beta users.
Starting with this month’s release, we are switching to a new numbering scheme for GameMaker Studio 2 releases: the year, followed by the month number after a dot: 2022.1 (Jan 2022), 2022.2 (Feb 2022) and so on. This should make it clear when a particular version was released and when a newer version will arrive.
We decided to make this change as our existing version numbering was opaque and arbitrary, and while it reflected some major changes, other things were gleefully placed in a minor release. Since we moved to monthly releases last year, it became apparent that a new version numbering scheme was needed.
July and December will not see new releases, and to avoid confusion we will be skipping those months (7 and 12) in our version numbering.
Filters and Effects, released last year, are easy-to-use shader effects that you can set up in the Room Editor and additionally modify at runtime. Once placed in a room, a filter layer applies its shader on all of the layers present below it.
We are now introducing single-layer functionality on FX layers. You can apply an effect to a non-filter layer using the Inspector, or call the fx_set_single_layer() function in-game to change a filter to single layer mode. This will make the filter visible only on the layer that it is applied to, and not to any other layers below it.
You can now apply many filters, such as Screen Shake, Colour Tint, Blur, and more, to specific layers in your room, like the example shown below:
To create the above example, I created a filter layer in the room, made it invisible and used some quick GML code to apply it to the player’s layer:
// In the player’s Create event
// Get the FX struct from the FX layer
fxshake = layer_get_fx("FXBlur");
// Enable single-layer mode on it
// Apply it to the instance’s layer
In addition to Single-Layer effects, we have also improved the loading of filters: while previously you were required to place a filter in a room layer to use it at runtime, you do not have to do that anymore. You can simply call fx_create() with a filter name as a string literal, which GameMaker will then detect and load the specified filter for use in your game. Read Filter & Effect Functions for further information and examples.
More Inspector Support
The Inspector is a fairly recent addition to GameMaker that allows you to view and edit assets efficiently. It can be opened from the Windows menu at the top of the GameMaker window:
More inspector support means less reliance on workspaces and the ability to do more on one screen. With 2022.1, the Inspector now allows you to modify Font assets and Room layers:
Left: Font Inspector, Right: Room Layer Inspector
The Room Layer Inspector also allows you to set a Filter/Effect for the selected layer, and if applied to a non-filter layer it results in a single-layer effect which only applies to the selected layer.
Collision System Changes
Using non-integer values for your instances’ position and scaling in previous versions of GameMaker could result in collisions behaving unexpectedly, and a slight disconnect between rendering and collision checking. This is now resolved, as the collision system does not round coordinates anymore.
This means that the bounding box coordinates for a collision mask are now represented as proper floating point values (i.e., numbers with decimals), which results in more accurate and logical collisions.
This change may not work well for existing games that were coded to work with the previous collision system, which is why we have added a “Collision Compatibility Mode” option to the General Game Options. Enabling this reverts the collision system for the current project back to the one used in previous versions, so if your project started having collision issues after the update, you can enable this.
Intellisense: codename ‘Feather’ (Beta only)
Improvements have been underway on our code editor’s “intellisense” (intelligent code completion) and we have constructed a whole new system that improves how information is presented and the choices that can be made. This has been enabled for beta users, but we do not plan on releasing it to Stable until we feel it is ready (which may take a few releases to get to as it needs to be battle-tested first).
While Feather provides the usual code completion features, it is also able to track the data types being used in your code, meaning that it can give a more intelligent list of elements that can be selected at any given time. It will also provide type information that users can see by hovering over variables in the code editor.
In the example below, we can see that the variable embers is an array of obj_ember instances:
Within the subsequent with() block (that runs on an obj_ember instance) we can see that self resolves to an instance of obj_ember as well, showing instance variables declared in that object as well as their types:
Feather also provides information about assets, colours, functions and more when you hover over them. Some examples are shown below:
Feather shows you information about a sprite when you hover over its reference.
Feather shows you detailed information about a colour when you hover over a constant.
Feather pulls information from the manual for keywords.
Custom JSDoc information can also be used intelligently and presented to the user. Where information is known the system will present that to the user with description and argument information as the user is typing (or hovering with the mouse) function names.
Warnings and Errors have also been revised and we are still working on rules that will prompt users to avoid common pitfalls and draw attention to potential problems within their code. For some of these there are “Quick Fixes” available. If a feather icon appears in the gutter then you can press Control + Q to open the “Quick Fix” menu, simply navigate with the arrow keys and press Enter. The appropriate action will be taken to address the reported issue with your code.
Feather can be switched off in Preferences if you are having too many problems with the new system and wish to revert to the old one. You can toggle it on and off under File > Preferences > Feather Settings > General by changing the “Enable” checkbox.