Introducing Dragonfly Cloud! Learn More

Question: Does GameMaker Studio support 3D?

Answer

Yes, GameMaker Studio does support 3D, although it is primarily designed for 2D game development. The 3D functionality in GameMaker is somewhat limited and not as comprehensive or user-friendly as dedicated 3D engines like Unity or Unreal Engine, but it allows you to create simple 3D games or 3D effects within a 2D project.

To work with 3D in GameMaker, you use the D3D functions which are prefixed with d3d_. These functions allow you to set up a 3D perspective view, define and draw 3D primitives, work with textures and lighting, and perform transformations.

Here's a basic example of how to set up a simple 3D scene in GameMaker:

// Create Event of an object d3d_start(); d3d_set_projection_perspective(0, 0, room_width, room_height, 45); d3d_set_hidden(true); // Enable hidden surface removal enable_lighting(true); // If you want to use lighting // Draw Event of the same object d3d_transform_set_identity(); d3d_transform_add_translation(x, y, z); d3d_transform_add_rotation_y(some_angle); // Define the points of a cube or load a model var size = 100; d3d_draw_floor(-size, -size, 0, size, size, 0, tex, 1, 1); // ...other sides of the cube... d3d_transform_set_identity(); // End the draw event d3d_end();

This code is overly simplified and mainly demonstrates the process of starting a 3D render and setting up a basic transformation. You would need to expand upon this considerably to create a functional 3D game in GameMaker.

While possible, making a 3D game in GameMaker comes with challenges such as less control over depth testing, camera management, and performance issues compared to using a 3D-specific engine. Therefore, while you can experiment with 3D in GameMaker, if your primary focus is developing a fully-fledged 3D game, you might want to consider using an engine that is specifically designed for that purpose.

Was this content helpful?

White Paper

Free System Design on AWS E-Book

Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.

Free System Design on AWS E-Book

Start building today 

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.