depth = -y: The Most Famous Line of Code in GameMaker

  Рет қаралды 6,021

DragoniteSpam

DragoniteSpam

Күн бұрын

Пікірлер: 37
@cutegamesclub
@cutegamesclub Жыл бұрын
When I added this code for the first time to a step event, my eyes became orbs of light, I hovered out of my chair, and I saw the birth event of every human being in a 4.5 mile radius. In all seriousness though, I love these single videos that explain a single really important, reusable concept. Thanks for sharing!
@DragoniteSpam
@DragoniteSpam Жыл бұрын
i believe "levitation" is an undocumented feature
@macehilmatecilof4140
@macehilmatecilof4140 Жыл бұрын
all bow to the immaculate power of the mighty depth = -y. Even staying it out loud can cause soul death in the weak minded.
@joestromo2592
@joestromo2592 Жыл бұрын
Could also drop depth sorting into the create event of objects that don't move
@innercerulean
@innercerulean 9 ай бұрын
Believe it or not, I figured this out on my own many years ago and low-key felt very very smart 🥲 great video by the way. Subscribed
@AL-lh2ht
@AL-lh2ht Жыл бұрын
Great video! More videos about commonly used code, like the ones you reference here( with their pro’s and cons) would be a awesome and very useful video series.
@Lexipumpkin783
@Lexipumpkin783 7 ай бұрын
thank you for being the only Game maker guide to actually help me on this planet, archive what i wanted to, couple questions i have, how can i make the camera more zoomed in and how can i change the angle like instead of a 45 degree maybe 90 degree, etc? and lastly how do i rotate the camera as well.
@Lexipumpkin783
@Lexipumpkin783 7 ай бұрын
i think i figured out how to at least change the angle, i just need to change var zfrom = to what ever number
@DragoniteSpam
@DragoniteSpam 7 ай бұрын
@@Lexipumpkin783 i think you might've meant to post this on the diorama video anyway you can use some sine and cosine magic (or lengthdir or whatever) to figure out the to/from positions for any given distance and angle of elevation, although from there you might also start to want to tilt the sprits at different angles to prevent perspective weirdness if the camera is at too sharp of an angle
@Lexipumpkin783
@Lexipumpkin783 7 ай бұрын
@@DragoniteSpam I ment to post that on the other video sorry I was really tired last night lol but ty.
@deathzero0212
@deathzero0212 4 ай бұрын
A very long time ago, back in GM5 or 6, this was taught in one of the official bundled tutorials. I believe the example used a tree sprite with some mountains in the back if I remember correctly. It gave a Space Harrier style 3d effect. A very cool effect that can be used for more than just sorting top-down sprites but for pseudo-3d games as well.
@DragoniteSpam
@DragoniteSpam 4 ай бұрын
@@deathzero0212 Was that the tutorial for a ski slope game where the sprites were scaled for a sense of false perspective? I vaguely remember one like that
@deathzero0212
@deathzero0212 3 ай бұрын
@@DragoniteSpam No im thinking of a different one. Speaking of old tutorials, it was pretty crazy that they had a Doom example with actual doom sprites in it, that was cool as hell back then.
@Zer0cip
@Zer0cip Ай бұрын
It's so simple as a beginner i literally wrote it myself whilst messing around and thought i was a genius
@MisogynyMan
@MisogynyMan Жыл бұрын
I didn't know some of this. Very useful. Now I need to figure out what the Shaun Spaulding collision code is... might be equally useful. Collision issues is a recurring problem for me with mass mobs.
@Wizirdi
@Wizirdi Жыл бұрын
If only I could fix the rest of the problems in my life this easy
@BatCorkill
@BatCorkill Жыл бұрын
Very cool, I didn't know you could reference the bounding box like that
@atomicus5000
@atomicus5000 6 ай бұрын
I have the problem of a really large room, so I had to set depth based on y relative to the viewport origin. So when moving up for example, when the player reaches the margin and the view port moves, the player depth stops changing and the depth of everything else that is active on screen is updated. Things that are off screen (with a margin) are deactivated and so nothing ever gets a depth set with an out of bounds value.
@keisui_music
@keisui_music 8 ай бұрын
i have no idea why but i cant get this to work for the life of me , ive tried setting it to the player , the sprite , both , and every time it either results in the player always over the object or always under the object . if it makes any difference im using gml visual edit : tried it with gml code as well and it still doesnt work
@lianvelasco3
@lianvelasco3 Жыл бұрын
Is there a way to do this with tiles? I'm really struggling to get this effect with trees, like in the trees of Pokemon. I'm using 2 tilemaps, cuz placing 500+ tree objects is just pain. The second tile layer having a negative y offset to simulate depth, but I cannot set a dynamic depth to a tileset, or I just dont know how.
@DragoniteSpam
@DragoniteSpam Жыл бұрын
Not easily, since you can't assign per-vertex colors to tiles (or any per-tile color at all).
@LunarcomplexMain
@LunarcomplexMain 9 ай бұрын
I just have "depth = -1000-(bbox_bottom%1000);" for the player and "depth = obj_player.depth-(y-obj_player.y);" for everything else (these keep them in the depth range of -1000 to -1998) and this can be handled anywhere in any sized room, and for any and all dynamically moving objects. Provided some sprite isn't 1000+ pixels tall, and if so, you'd have to change some values accordingly.
@AL-lh2ht
@AL-lh2ht Жыл бұрын
I’d using the vertex or z tilting less processing intensive?
@vaguener
@vaguener Жыл бұрын
What is the equivalent of depth = -y in gamemaker 1.4?
@plokijhugf
@plokijhugf 11 ай бұрын
it should be the same i think
@GooseNinja
@GooseNinja Жыл бұрын
what is that Heathcliff icon?
@AL-lh2ht
@AL-lh2ht Жыл бұрын
Hopefully when they finish the updated official UI / hub layer it fixes that issue.
@TheRealLifeSonicTheHedgehog
@TheRealLifeSonicTheHedgehog Жыл бұрын
You can make custome origins
@YELLOWZhang
@YELLOWZhang Жыл бұрын
非常非常感谢您的分享!
@ginofm7142
@ginofm7142 Жыл бұрын
very good video!
@kuroiryu1509
@kuroiryu1509 Жыл бұрын
depth = -y + 15999?
@Spliffurt
@Spliffurt Жыл бұрын
this vid thumbnail dope lol
@furbyteaspoon4091
@furbyteaspoon4091 8 ай бұрын
haha so funny, i discovered that a few days ago :D
@voxeledphoton
@voxeledphoton Жыл бұрын
9:00 my brain blew up 20_000 ??? underscores???
@DragoniteSpam
@DragoniteSpam Жыл бұрын
yeah you can use underscores as spacers in numbers now
@gamesgonenuts
@gamesgonenuts Жыл бұрын
wow this was helpful hit the like
@fierorecensione5828
@fierorecensione5828 Жыл бұрын
🔝
Audio Busses in GameMaker
10:59
DragoniteSpam
Рет қаралды 544
[GameMaker] Simple Depth Sorting (Normalized)
6:50
Badwrong
Рет қаралды 2,1 М.
БАБУШКА ШАРИТ #shorts
0:16
Паша Осадчий
Рет қаралды 4,1 МЛН
Маусымашар-2023 / Гала-концерт / АТУ қоштасу
1:27:35
Jaidarman OFFICIAL / JCI
Рет қаралды 390 М.
She wanted to set me up #shorts by Tsuriki Show
0:56
Tsuriki Show
Рет қаралды 8 МЛН
The 15 Commandments of Game Maker
16:32
PixelatedPope
Рет қаралды 125 М.
Optimisation Tips | GameMaker Studio 2
19:10
FriendlyCosmonaut
Рет қаралды 52 М.
I Beat Minecraft From One Grass Block
35:27
Beppo
Рет қаралды 7 МЛН
How to Make a Save and Load System in GameMaker
11:53
GameMaker
Рет қаралды 21 М.
Making A Depth Sorting System | Game Maker Studio
6:15
Blekoh
Рет қаралды 2,8 М.
GameMaker Inventory with Structs | GMS 2.3+ New Features
7:48
GameMakerStation - Matharoo
Рет қаралды 24 М.
DS Map Based Save System
18:56
PixelatedPope
Рет қаралды 37 М.
Why EVERY Gamemaker dev should use Structs
18:33
RiptideDev
Рет қаралды 8 М.
БАБУШКА ШАРИТ #shorts
0:16
Паша Осадчий
Рет қаралды 4,1 МЛН