Version 2024.6: Text In Rooms, Physics Raycast, Depth And Stencil Buffers

cover

GameMaker 2024.6 is here. This release brings text functionality to rooms, raycasting to physics, depth buffer access for surfaces and more.

Text in Rooms

You can now place text in rooms, and manipulate it at runtime.

Create an Asset Layer and press the “T” button in the Layer Toolbox:

Room_text_element.jpg

This functionality is similar to Text in Sequences and can make use of any fonts in your project for customised text.

See a list of functions in the manual for modifying this text at runtime.

Physics Raycasting

GameMaker’s Physics engine now has a raycast function. For this to work, your room has to have “Enable Physics” checked and your objects must also be Physics-enabled.

physics_raycast_example.gif

With physics_raycast(), you can check for collisions on a line from a start point to an end point. You can check for multiple collisions, all returned in an array.

Each collision is returned as a struct, with information on where on the ray the hit was found, the position at the hit, the normal of the surface that was hit, and a reference to the instance that was hit.

Depth & Stencil Buffer Access

Each surface is created with a depth buffer and a stencil buffer, which can now be accessed and modified in more ways. This allows you to include advanced graphics techniques in your game such as shadow mapping, deferred rendering, volumetric rendering, ambient occlusion and more.

When you don’t need these extra buffers, you can save on memory by disabling depth/stencil buffer creation.

A depth buffer stores the Z or depth value of every pixel that is drawn (as a 24-bit float). This value is from 0 (closest to the near camera plane, i.e. znear) and 1 (farthest from the camera, i.e. zfar).

depth_buffer_in_gamemaker.gif

You can use this with z-testing and a custom comparison function to affect how your pixels are rendered out according to the depth.

A stencil buffer is similar, where each pixel has a value stored for it (however as an 8-bit integer) and this can then be used in stencil tests to determine what happens when a draw passes or fails (i.e. the value is smaller). By default all stencil tests will pass, and you can change the comparison function used.

Larger Instance Panel

The instance list in the Room Editor has moved from the Inspector into its own snappable panel, which appears when an appropriate layer is selected:

Editor_Room_InstanceLayer.jpg

This displays a list of all the elements in the layer, such as instances in an Instance Layer, and sprites, particle systems, text and sequences in an Asset Layer.

This makes it easier to navigate elements in a layer, allows you to search through them, and select any element for editing in the Inspector, without the list disappearing.

Misc. Runtime Changes

Misc. IDE Changes

  • Added falloff parameters for Audio tracks in Sequences
  • Tons of bug fixes

Read about more changes on the Release Notes page.

Happy GameMaking!

avatar
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