Preamble

I was asked on twitter to share my rendering technique for my current project, which is a lil game with boats and such. The important part of this game is that the boats and such roughly appear to be 3D models, even though I'm using GameMaker: Studio, a (almost entirely) 2D game creation tool. I'm going to assume you're somewhat familiar with GM:S, though hopefully this can still help if you're not using it at all.

The technique I use to achieve this is one I was inspired to figure out thanks to my pal takorii, though his very brief description of it has since vanished. More recently, a dev by the name of rubna made a game called lisa using this (or a similar) technique. My implementation is based entirely off my analysis of these games, and I've seen basically no information on how to do it.Thankfully, it's pretty simple.

A caveat before we start: this rendering method isn't particularly efficient, as it relies on multiple draw calls for each object, and the taller an object is the less efficient it's gonna be. This'll likely only be a problem with complex scenes, but just keep that in mind when designing.

The Good Stuff

Start by figuring out what you want to model. As an example, I'm gonna use that boat up there. You're gonna want a solid idea of what the final "model" should look like. A good way to do this is to use Voxel modelling software, like MagicaVoxel. If you don't want to use 3D software, skip the rest of this paragraph. Voxels can be thought of as 3D pixels, so they're a good building block. Model out your object using voxels and you should have a good understanding of the next part of this process.

Using any pixel drawing software (I used GMS' sprite editor for convenience), draw a top down view of your object. Try to either draw a complete view or the widest/fullest part. It's probably gonna look like a rectangle or oval of some kind, but that's okay. Next, try to envision the different "layers" or "slices" of your object, both higher and lower than your current slice. Draw these slices on different frames/images/layers, whichever works for you. Ideally you'll want a method that lets you scroll through and see your object's layers quickly. Don't worry if you have no idea how it'll look, that's what testing and iteration are for.Here's what my boat looks like, sliced up:

delicious sliced boat

Once you have that all done, import your images into GameMaker as a sprite, with the different layers on different frames. Create a new object and assign it the sprite. It's important that you set

image_speed = 0;

in the Create event for your object, or else it'll break into a horrible mess. This stops it from animating. Now, in the Draw event, loop through the frames, starting at 0. Draw each one 1 pixel higher (-1 y) than the last. This will layer them into a "3D" object.

If you're interested in how the wake in the gif way at the top is made, it's a simple object with a single frame sprite that shrinks over time. I instantiate one of these objects each step that the boat is moving or rotating. Mind you, this is likely inefficient, but this project is early on yet.

So there you have it! That's how to make 3D 2D in GameMaker: Studio! I'll leave you with another gif and a TL;DR.