3D Clockwork Knight Style 2D gameplay on 3D backdrop

Valerie

Member
Hi everyone!

I hope everyone is safe and healthy. I've been doing a lot of experimentation with faux-3d effects in game maker recently, and was wondering what the possibility is for programming a 2D sidescroller, but using 3D assets in the background to provide detail, similar to old sega saturn titles like clockwork knight. I see a lot of examples of a 2D game with a 3D camera, but this isn't what I'm looking for. This would be a fixed perspective, standard 2d platformer, but with some 3d objects in the scene. I've included a photo reference.

Would this be done using standard 3D functions but with rendering the 2d to the surface? Or is there anyway to retain the programming functions of a 2D platformer, while still taking advantage of GM:S 1's limited d3d abilities?

Any help / suggestions to point me in the right direction would be super appreciated!
 

Attachments

kburkhart84

Firehammer Games
The easiest way(and likely the way it was done in the games you are thinking of) would be to pre-render the background image and simply display it like a parallax scrolling image in your typical platformer.
 

Valerie

Member
The easiest way(and likely the way it was done in the games you are thinking of) would be to pre-render the background image and simply display it like a parallax scrolling image in your typical platformer.
This would definitely be the easiest way to do it, and I had considered it. The disadvantage of this method is that the background graphics would not change perspective, unlike the example game. I had an idea to take different angled photos of the model from front, right, or left, and then adjust it based on the player's position, but this wouldn't be as smooth as adjusting the perspective at runtime.
 

kburkhart84

Firehammer Games
OK, if you really want the perspective to change, you probably need to render it using an actual 3d camera and actual 3d models/graphics. I question if it is really worth doing it that way and how much it would really add to your game. If you really want it that way, it is possible to run multiple cameras, some 2d and some 3d. Another option that is likely better is to look up some "fake 3d" tutorials, as there are several ways I've seen that people go about faking it and maybe one would be close enough to look like you want it to.
 

Valerie

Member
@kburkhart84 Aha, I think I found what I needed with the draw_sprite_pos function, which is the technique used in the fake 3d tutorials you're talking about. Basically, it will let me dynamically adjust sides of a cube in perspective with the player, simulating 3D without using any d3d functions. I can see how combining that with pre-rendered parallax-ing 3d assets will definitely give me the effect I'm looking for. Thank you!
 

kburkhart84

Firehammer Games
OK, so you are going to change the corners for the quad of the sprites as you draw them based on the position, etc... that makes sense to me as a fake 3d. Glad you got something going.
 

sp202

Member
It's relatively easy to add 3D elements to a 2D game, though it might be a bit tricky if you've never touched 3D before. Getting models into GameMaker will likely require using a obj file import script, I like using the one found in the GM1.4 version of this package: https://forum.yoyogames.com/index.php?threads/smf-3d-skeletal-animation-new-version-available.19806/. Once you've imported your model, you'll just need to use a 3D camera while drawing it, before switching back to a 2D camera to draw the rest of your game.
 
H

honeybone82

Guest
I've been watching using 3D cameras with zbuffers from the youtube user DragoniteSpam. Dude knows his stuff, even though he's super opinionated about GM2, he understand raw code and how it's put together. Here's the intro to his 3D tutorials
 
Top