How To Use Filters And Effects To Improve Visuals In GameMaker (2024)

How To Use Filters And Effects To Improve Visuals In GameMaker (1)

GameMaker Studio v2.3.6brings some exciting, major additions to your favourite game engine, such as a new, streamlinedStart Page, Template Projects, and the topic of this tech blog: Filters & Effects! In this blog we will explore this new functionality, learn how to use it in the IDE and through GML, and look at some attractive visual effects you can implement within a minute to make your game prettier!

Feature Overview

In the Room Editor, you can click onHow To Use Filters And Effects To Improve Visuals In GameMaker (2)in the Layers panel to add a new "Filter/Effect" (or "FX") Layer. This will allow you to select any one of the filters/effects provided with GMS2 and apply them to the contents of your room:

How To Use Filters And Effects To Improve Visuals In GameMaker (3)

The following Filters/Effects are present in GMS 2.3.6:

  • Colourise: This changes everything to appear with a single hue, with an adjustable intensity value
  • Large Blur: This blurs the image using a specified noise texture, allowing you to change the blur radius to increase or decrease the blur effect
  • Edge Detect: This enables an edge detection shader for the rendered content, with an adjustable threshold value
  • Desaturate: This reduces the saturation of the rendered content by the specified intensity value
  • Posterise: This applies a posterisation effect to the rendered content, allowing you to change the max colour levels for each hue
  • Screen Shake: This makes the rendered content shake to simulate a camera shake effect, allowing you to adjust the Magnitude (how much it shakes), the Shake Speed (how fast it shakes) and the noise texture that controls the movement
  • Pixelate: This makes the rendered content look pixelated, allowing you to change the size of each pixel; this gives the rendered content a low resolution look
  • Colour Tint: This applies a colour tint to the rendered content

Now because rooms have a "layer order", i.e. your layer can be above or below other layers in the list, an FX layer will only apply its filter to layers that are below it:

How To Use Filters And Effects To Improve Visuals In GameMaker (4)

Selecting a filter in an FX layer will show you its properties that you can edit to change how it looks; for example, the "Screen Shake" effect allows you to change its Magnitude, Shake Speed and apply a texture for the shaking movement:

How To Use Filters And Effects To Improve Visuals In GameMaker (5)

GML Usage

Here's the real power of FX layers: you can set up and manage Filters/Effects in real time through GML code to display filters dynamically and achieve the results you want!

You can use the following functions, among many others, to manage Filters/Effects through GML:

  • fx_create(): Use this to create a new Filter/Effect (or FX) struct
  • fx_get_parameters(): Use this to get a struct containing all the parameters for the filter/effect
  • fx_set_parameters(): Use this to apply a modified parameter struct back to your filter/effect
  • layer_set_fx(): Use this to apply a new FX struct to an existing layer
  • layer_get_fx(): Use this to retrieve an FX struct from an existing layer that has one applied to it

Read this manual pageto learn about the various functions that have been provided for working with Filters & Effects.

Do keep in mind that currently the compiler will only load those filters/effects that have been added through the IDE. For example, if you have not placed the "Large Blur" filter in any of your rooms but try to load it in GML using fx_create(), it will not work -- you will first need to add it to a layer in any of your rooms so the compiler knows to load it.

Visual Effects

Fog

This is the scene that we'll be working with:

How To Use Filters And Effects To Improve Visuals In GameMaker (6)

It looks nice, but it would be better to have depth so you can see what's in the foreground and what's in the background. Let's add a new Filter/Effect layer and implement fog!

You can get a fog effect by using the "Colourise" filter, selecting a blue-ish colour (adjust it to your liking) and using a lower intensity value.

How To Use Filters And Effects To Improve Visuals In GameMaker (7)

Of course, you will need to ensure that it's placed at the correct level in your Layer Order so that it only affects what's behind the player and the foreground.

Depth of Field

Making high quality games is all about having blurs! Well, it isn't, but it surely does contribute!

You can add a new FX layer for this, select the "Large Blur" filter and adjust the radius to your liking:

How To Use Filters And Effects To Improve Visuals In GameMaker (8)

You can always add multiple levels of depth by adding various blur layers at different places in the Layer Order.

Dynamic Screen Shake

This is essentially screen shake that you can control at will through code -- that is what you will most likely want anyway, as no one wants to see a perpetual screen shake effect till the game ends.

At the top of your Layer Order, add a new FX layer and apply the "Screen Shake" filter to it. Set the Magnitude and Shake Speed to 0 as we'll be controlling these through code.

How To Use Filters And Effects To Improve Visuals In GameMaker (9)

Add this code to the Create event of your controller/manager object (or create one) to save some variables we'll require:

shake_fx = layer_get_fx("ShakeLayer");shake_magnitude = 0;shake_speed = 1;
  • shake_fx stores the FX struct for our shake layer, which we can modify to change how the filter looks.
  • shake_magnitude is the intensity of our shake and it starts off at 0 so that there is no shake initially.
  • shake_speed is the speed of our shake; while we won't be changing it for this example and it will remain at 1, it may be good to modify it as well along with the magnitude when needed.

Now in the Step event, we'll add code to apply these values to the shake FX and make sure that the magnitude falls down to 0 whenever it's higher than it:

// Apply shakefx_set_parameter(shake_fx, "g_Magnitude", shake_magnitude);fx_set_parameter(shake_fx, "g_ShakeSpeed", shake_speed);// Fall to 0if (shake_magnitude > 0){shake_magnitude -= 0.2;}

The first part applies our magnitude and speed variables to the parameters in the FX struct, and the second part makes the magnitude fall toward 0 when it's higher than it.

Now in the same event, we'll add some code to test our screen shake:

// Testif (keyboard_check_pressed(ord("1"))){shake_magnitude = 2;}else if (keyboard_check_pressed(ord("2"))){shake_magnitude = 6;}else if (keyboard_check_pressed(ord("3"))){shake_magnitude = 20;}

This sets the magnitude value directly when we press a key so we can test it easily, however for your actual game mechanics, you may want to create a new function that sets the magnitude value, and then call that function whenever you need a shake (such as a collision event, a hit condition, etc.).

Now run the game, press the test keys and you will see your Dynamic Screen Shake in action!

How To Use Filters And Effects To Improve Visuals In GameMaker (10)

There is much more you can do, with all of the filters and effects provided with GMS 2.3.6 and the accompanying GML functions! As always, read the manual!

We're looking forward to seeing your content! Share with us on Twitter using the hashtag #GameMakerStudio2 and drop a tweet to @itsmatharoo for any technical questions.

Happy GameMaking!

How To Use Filters And Effects To Improve Visuals In GameMaker (11)

Written by

Gurpreet S. Matharoo

Lead Technical Writer at GameMaker, Gurpreet creates documentation and tutorials to make game making easier for you. He loves using the computer to bring new things to life, whether it's games, digital art, or Metal music.

Back to blogs

How To Use Filters And Effects To Improve Visuals In GameMaker (2024)

FAQs

What is filter and effect in GameMaker? ›

A Filter/Effect (or FX) layer is used to apply a visual filter or effect to some layers. You can select an effect from the "Effect Type" drop-down list, which will show you its parameters in the Layer Properties window allowing you to modify how it looks and behaves.

Do effects GameMaker? ›

This action will create a built-in particle effect, either above or below the layers being drawn in your game room.

Does GameMaker use visual scripting? ›

GML Visual is the visual scripting method for programming with the GameMaker Language (GML).

How do you add animations to GameMaker? ›

How to Animate Objects in GameMaker
  1. Into this: ...
  2. From the Asset Browser, create a new Sequence asset:
  3. Name it seq_coin.
  4. Set the sequence length to 54 frames.
  5. Change the playback mode to Loop.
  6. Move the playhead to frame 27.
  7. Expand your obj_coin track, and select the Position parameter.
  8. Enable Curve Mode.

Does filter increase performance? ›

Several studies have indicated that engine air filtration is not only important to keeping engines safe from dust and debris, but it also increases air intake. This can boost the overall performance of the vehicle.

How mean filters are used for image enhancement? ›

A Mean Filter is a smoothing filter in computer science that calculates the average brightness of a pixel and its neighboring pixels to replace the original brightness, thus reducing noise in an image.

Is GameMaker A virus? ›

It's worth stating 100% just now that there is not a virus in the GameMaker runtime and the detection is a false-positive. We cannot guarantee the behaviour of third-party extensions as to whether they contain something malicious, but then you should already know if your own project contains a dodgy extension or not.

What does ++ do in GameMaker? ›

++, -- are used to add or subtract one (1) from a value. It is worth noting that placing this before or after the value to be added to or subtracted from will have slightly different results. For example: ++a will increment the variable and return the incremented value.

How hard is GameMaker to use? ›

Is GameMaker good for beginners? Yes! GameMaker Studio is relatively easy to learn compared to other game engiens like Unity or Unreal, as you can make a game without very much code or scripting. However, the games made in GameMaker are geneallly not as complex as with other game engines.

Is GameMaker code easy? ›

Thankfully, learning to code with GameMaker is much easier than you think, thanks to our two GameMaker Languages - GML Code, and GML Visual.

What is the best game engine without coding? ›

GDevelop is the most powerful, open-source, no-code game engine. Make 2D, 3D and multiplayer games without limits. Publish everywhere: iOS, Android, Steam, web, gaming platforms.

Should I use GameMaker or Unity? ›

Unity excels in versatility and advanced features, making it suitable for a wide range of projects, while GameMaker Studio 2 offers simplicity and accessibility, particularly for 2D game development and rapid prototyping.

Can you publish games made with GameMaker? ›

Publishing Publicly

You can also publish your game publicly so it appears in GX. games listings and can be searched by players.

What is a sprite sheet used for? ›

A sprite sheet is a bitmap image file that contains several smaller graphics in a tiled grid arrangement. By compiling several graphics into a single file, you enable Animate and other applications to use the graphics while only needing to load a single file.

What is sprite_index in GameMaker? ›

sprite_index in GameMaker Studio refers to a built-in variable that stores the index of the current sprite assigned to an instance. This value determines which sprite is drawn for the instance when it is rendered on the screen.

What is filters and effects? ›

They're both on the menu, and they both seem to offer the same things...so what is the difference? A filter will alter the underlying structure of the path it is applied to. An effect only changes the appearance of the path.

What are filter effects in music production? ›

Filters allow you to manipulate certain parts of the frequency spectrum and can make subtle or extreme changes to your music. Simply put, they “filter out” certain frequencies so that the other ones you want can really shine through.

What does filtering do in games? ›

Texture filtering is a technique that improves the quality of textures in games by smoothing out the edges and reducing aliasing. However, texture filtering can also affect the performance and memory usage of different hardware, such as PCs, consoles, and mobile devices.

What is the effect of mean filter? ›

The idea of mean filtering is simply to replace each pixel value in an image with the mean (`average') value of its neighbors, including itself. This has the effect of eliminating pixel values which are unrepresentative of their surroundings. Mean filtering is usually thought of as a convolution filter.

Top Articles
The Tragic Death Of Nikki Catsouras: A Cautionary Tale
The Tragic Death Of Nikki Catsouras And Its Impact On Social Media
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Toyota Campers For Sale Craigslist
Unlocking the Enigmatic Tonicamille: A Journey from Small Town to Social Media Stardom
Doby's Funeral Home Obituaries
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
Non Sequitur
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Selly Medaline
Latest Posts
Article information

Author: Terence Hammes MD

Last Updated:

Views: 5992

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Terence Hammes MD

Birthday: 1992-04-11

Address: Suite 408 9446 Mercy Mews, West Roxie, CT 04904

Phone: +50312511349175

Job: Product Consulting Liaison

Hobby: Jogging, Motor sports, Nordic skating, Jigsaw puzzles, Bird watching, Nordic skating, Sculpting

Introduction: My name is Terence Hammes MD, I am a inexpensive, energetic, jolly, faithful, cheerful, proud, rich person who loves writing and wants to share my knowledge and understanding with you.