Let's Make a 3D Gravity Platformer - Video tutorial series

TheSnidr

Heavy metal viking dentist
GMC Elder
Let's Make a 3D Gravity Platformer - Video tutorial series

GM Version
: 2.3
Target Platform: All
Download:
Source from video 11
(Sources from all the other videos are available in the video descriptions)

Links: N/A

Summary:
This is a video series where I create an advanced 3D game from start to (hopefully) finish. Every step will be documented, and you may ask questions and make suggestions for new subjects to handle.
This topic used to be the 3D tutorials in one hour thread, but I got hooked on developing the 3D Gravity Platformer. So now it's the "Let's make a 3D gravity platformer" topic!
The videos are all commented to make it easier to understand what's going on, but this is definitely not a beginner's tutorial series.

My first ever 3D game project in GameMaker was Planetoids, which I started making ten years ago. I never finished it. This project is a recreation of that project, and I intend to make it into an actually playable game while recording every step.


Tutorial:
3D gravity platformer
Part 11:
Recap so far + Implementing ColMesh

Part 10:
Mushy's new finite state machine

Part 9:
Starry Skies

Part 8:
Animating a character created in Blender for use in GameMaker Studio 2.3

Part 7:
Creating a black hole

Part 6:
How to draw a circular shadow beneath the player in 3D
Drawing proper circular shadows in 3D using blend modes

Part 5:
How to make a sweet rim lighting shader
Making a rim lighting shader

Part 4:
Making a cloud shader
Making a fast, dynamic and procedural cloud shader

Part 3:
Block and Cylinder Collisions
Drawing and colliding with a block and cylinder

Part 2:
Capsule Torus and Disk collisions
Drawing and colliding with capsule, torus and disk

Part 1:
Making a 3D Gravity Platformer in one hour
In this video I create a 3D gravity platformer (similar to Mario Galaxy or Outer Wilds) completely from scratch in one hour.


Other:
Heightmapped racing game
Source for one-hour heightmap racing game
Here I create a heightmapped offroad racing game, completely from scratch, in one hour.
This was intense, mostly because this kind of game requires a lot of custom functions working toghether.

More to come
 
Last edited:

Joe Ellis

Member
Your stuff has always been really cool, I've always admired it. It's nice to see that you're that used to it now that you can just bang it out in an hour, freestyle :D
 

TheSnidr

Heavy metal viking dentist
GMC Elder
It's been a productive week - here are two more videos!
These are not as long as the others, and I've been playing around with the format of the videos. What do you think of the editing in the last video, the one about circular shadows?

How to make a rim lighting shader:

How to draw a circular shadow in 3D using blend modes:
 

❤️×1

Member
I'm 97% sure you are producing them in less time it takes to watch them.... Pretty sus... Are you like a pandimensional creature for whom the time flow slower? ಠ_ಠ
 

TheSnidr

Heavy metal viking dentist
GMC Elder
Lol! Well, it's simultaneously a video tutorial series and a game project, and I have so much fun stuff planned that I can't wait to make it come to life. But I also want to explain each step so that people may learn a bit from it.
I know watching somebody code for hours can be a bit tedious, so I've started dividing it up into smaller bite-size chunks, and as such more frequent videos.

I definitely won't be able to keep this tempo all the time, but I have some extra time on my hands nowadays, with the pandemic and everything. All my plans for the fall have vanished, and the gym's closed...
 
S

samtussing

Guest
this is pretty amazing stuff. Thank you for showing the work! I would like to get my maths up to speed with this. Udemy perhaps 🤔😅
 

TheSnidr

Heavy metal viking dentist
GMC Elder
Mushy's new finite state machine!

In this video I create a new movement system for Mushy, and give him a bunch of new moves.

 

TheSnidr

Heavy metal viking dentist
GMC Elder
Since I've already made videos about the clouds and the starts, I'm going to refrain from bringing those up again in future videos. But I've done some changes I'm kinda excited about, and kinda wanted to share, so I'll keep it in this post!
If you recall from the cloud shader video, the clouds are created by layering Worley noise, which is characterized by its "bubbly" appearance.

I showed how in order to properly sample from the Worley noise, you'll need to check the 25 surrounding cells for each pixel per layer, and you'll typically need 5-6 layers, resulting in a *lot* of calculation and will bog down your game. So what I did instead was to write the Worley noise to a "3D" texture. The texture is still a regular 2D texture, but to simulate the third axis I rendered the worley noise pattern in 64 horizontal slices and placed them beside each other. GM's built-in function gpu_set_texfilter lets us blend between pixels in the x and y directions, but if we don't also smoothen between the horizontal slices, things will look ugly. So what I did to more easily allow for smoothing along the vertical axis was to store a noise pattern slice in the red channel, and then the slice directly above it in the green channel. Interpolating between them then became trivial.
Now, since this only makes use of the red and green channels, I could use the blue and alpha channels to store a whole different noise pattern!

Back in the cloud shader, I still needed to layer these noise textures on top of each other to create fluffy clouds. Since I now had two different noise patterns to work with, I could interpolate between them as time passed, and I could interpolate each layer at a different speed, resulting in seemlingly random clouds movements. For the clouds to look detailed enough, I needed to put six noise layers on top of each other. That means six samples from the noise texture, at different scales. In addition, for the lighting to work, I'd need to cast a ray towards the sun and check the density of the clouds there; that's another six samples. In order to make it run faster, I reduced the resolution and rendered the sky to a surface at half scale. And that's how I left it.

...Until now. I wanted to find a better way to do it, hopefully both reducing the number of samples, and make it look better. I don't like having to sample a noise texture twelve times for a background effect. So I've messed around with varying techniques for precalculating as much as possible. I tested pre-rendering a layered noise texture to an equirectangular texture, but that results in either a weird pinching of pixels towards the poles, or the necessity of additional trig.
A cubemap was also considered, but I ended up making a couple of very simple functions for reading from and writing to an octahedron. An octahedron has eight triangular faces, and its topology lets you easily fold it out onto a square texture:

Putting a different noise texture into each of the surface's four channels yields the following texture:

Using this, the clouds need a single sample, and the shading needs another, for a total of two samples for practially the same effect as before. In addition, I've opted to sample the noise texture in order to add smaller details to the clouds. For the side facing away from the sun I reuse all the samples I've already got. The detail noise sample is used to draw thousands of tiny starts that blink in and out, and the layered noise is used directly to make this ever-shifting "nebula cloud" colour scheme.

All in all I'm happy with how it turned out! With only a total of three samples and a little math, I can let it run at full resolution with a good conscience.
 
Last edited:
Top