Perlin Noise in GameMaker Studio 2

  Рет қаралды 13,348

SamSpadeGameDev

SamSpadeGameDev

Күн бұрын

Пікірлер: 32
@e_buffturtle
@e_buffturtle 3 жыл бұрын
This is EXACTLY WHAT IVE BEEN LOOKING FOR literally no one has made a tutorial like this thank you so much
@1upIndie
@1upIndie 3 жыл бұрын
Really great video on such a relevant topic. I pinned this video to my community tab so more guys can check it out. Thanks for sharing.
@SamSpadeGameDev
@SamSpadeGameDev 3 жыл бұрын
Thank you! I'm a fan (and subscriber) of yours as well!
@1upIndie
@1upIndie 3 жыл бұрын
@@SamSpadeGameDev Oh nice, am I not too small to be a "fan" of? If you keep on doing this high quality content you defently will bypass me and I have to be your pupil :D
@LunarcomplexMain
@LunarcomplexMain 3 жыл бұрын
The fact that TRON is in part responsible for creating a near limitless amount of virtual worlds even to this day is crazy...
@bit-6425
@bit-6425 Жыл бұрын
Did some slight modifications to your script but this was exactly what I was looking for, thank you so much for this
@ZBLdrawings
@ZBLdrawings 8 ай бұрын
Great work! You're the only one that made tutorial for this!
@konjecture
@konjecture 3 жыл бұрын
I have to say that your voice is the best robot/ai voice I have ever heard 😁.
@SamSpadeGameDev
@SamSpadeGameDev 3 жыл бұрын
Thanks 😅
@indieklem
@indieklem 2 жыл бұрын
Thanks for the tuto, very clear. I use it for my pnj movment and... it work well!
@JardsonJean
@JardsonJean 3 жыл бұрын
Amazing job as always.
@krystofoxik
@krystofoxik 3 жыл бұрын
Amazing!
@craigosborne3812
@craigosborne3812 3 жыл бұрын
The seed is actually the doubled perm table, generating a different perm table gives different results
@tanura5830
@tanura5830 2 жыл бұрын
with the sheep example you can just make them change direction once in a time so no need for perlin noise.
@headspin4120
@headspin4120 3 жыл бұрын
Thank you again!😀
@sabriath
@sabriath 3 жыл бұрын
Or you can use a moving average on the fed random number from the generator to perform similar analysis on-the-fly without needing to do that entire function. What I mean is: get_next(last, nval, spd) { return (spd*nval + (1-spd)*last); } last = the last value you got from running "get_next" nval = the next "random" number in the generator spd = from 0.0 to 1.0 based on how quickly you want the formula to follow the randomness....0.0 means that it will never move, while 1.0 means that it's just giving you 'nval' If you want even more smoothness to the gradient, you can run the function 2 or 3 times per step with the same 'nval' and a lower 'spd' to anneal slower to value. 'nval' specifically gives you the range, so if you want 0.0 to 1.0 range, then just make sure 'nval' is 0.0 to 1.0...and done. This is similar to a "scanline" of the perlin noise function, just faster (because it's 1d). To use higher dimensions, you just add in a new generator for each additional dimension, seeds are usually stored with the blocks of data within each field, while the field itself is done on-the-fly based on the block seed. If the values in the higher dimensions are used in a collapsed form, then you simply average the returns of all the dimensions (the video you show has x/y directional movement, so it's not a collapsed form....but....if it were trying to find the height of a block at a specific point, then it would).
@SamSpadeGameDev
@SamSpadeGameDev 3 жыл бұрын
That's cool - I'll have to experiment with it!
@dugl
@dugl 3 жыл бұрын
Thank you
@soubakouh
@soubakouh Ай бұрын
Aleluia!!!! if anyone reads this comment.. Yes! this is your definitive video!!
@thomasrebicki8834
@thomasrebicki8834 2 жыл бұрын
thanks man
@nightsout.
@nightsout. 3 жыл бұрын
This video was amazing! The sheep got me thinking of ai. I'm curious if you will make a video on obstacle avoidance? All the stuff I've found online and tried out seems kinda archaic, so I'd love to see your take on it.
@SamSpadeGameDev
@SamSpadeGameDev 3 жыл бұрын
There's lots of ways to do avoidance, and I will be doing a couple versions in the upcoming months as part of the vectors and steering behaviors series. Flee and avoid will be in the next few tutorials (avoiding a single instance) and towards the end of the series I'll be doing a more general avoid all instances of a certain object type behavior.
@nightsout.
@nightsout. 3 жыл бұрын
@@SamSpadeGameDev Looking forward to it! :)
@raylolpez
@raylolpez 3 жыл бұрын
I could be wrong, but the map_value() function you use is using the formula for linear interpolation, right? So it’s sort of like GM’s built-in lerp() function, but with some added functionality, so kind of like a lerp_ext()! I think lol 🤔
@SamSpadeGameDev
@SamSpadeGameDev 3 жыл бұрын
Pretty much - if you break down the steps over multiple lines, instead of doing it all in one line, it looks like this and you can even use GM built-in lerp function: total = current_upper_bound - current_lower_bound; percent = (value - current_lower_bound) / total; new_val = lerp(desired_lower_bound, desired_upper_bound, percent); return new_val; I did a written tutorial on the GMC forums awhile ago on this function itself: forum.yoyogames.com/index.php?threads/map-remap-values-from-one-range-to-another.59699/
@MisterNewYear
@MisterNewYear Жыл бұрын
is there a way to use periods and octaves with this function?
@nyeponpon
@nyeponpon 2 жыл бұрын
Hello Sam! I've been following your videos for a while now, you're an excellent teacher I'm trying to think how I'ld use the perlin noise for terrain generation in a 2D hexagonal map, where each hexagon has 3 coordinate values, or axis: S, Q, and R-> based on RedBlob's Cube Coordinates. I created another loop inside the other two loops, incrementing an Z_Value for the perlin_noise function, but I believe I felt in one of the traps you said- Now the terrain generation can took up to minutes, and before it was only 3 seconds at best to create the map. Is there any better way to implement it? Thanks!
@SamSpadeGameDev
@SamSpadeGameDev 2 жыл бұрын
To be honest, I don't know. I've never tried to generate a 2D hexagonal map. That said, there aren't a lot of ways to speed up the original function. It's code is already pretty much as fast as GameMaker can run it. Just make sure you're running the minimum number of iterations. However, one possibility would be to test using the YYC (if you have a license or subscription) that should be a lot faster. Another possibility would be to look into alternative ways of running it. I've never done this, but I know some people run it in a shader, which would be a lot faster as it uses the GPU. There's an old post on this in the forums (link below) that talks about some of the ways to speed it up. forum.yoyogames.com/index.php?threads/pure-gml-perlin-noise-function.25534/
@LVWattsPlays
@LVWattsPlays 3 жыл бұрын
for some reason mine keeps generating again and again whilst running :/
@SamSpadeGameDev
@SamSpadeGameDev 3 жыл бұрын
I'm sorry, I'm not sure what this refers to. With a little more specifics I might be able to help?
@mikebarthold783
@mikebarthold783 2 жыл бұрын
too many hardcoded assumptions for my taste - there's a huge array inside the noise function... no offense, but this is not the implementation i am looking for. your map_value function assumes that the current value is always in range - you should clamp(current, current_lower, current_upper) use as base for your calculation to ensure the value is in the desired range (unless you WANT results out-of-range from this function). you could add an additional parameter at the end, something like enforce_range = true to make it use the clamp
Introduction to Steering Behaviors in GameMaker Studio 2
11:01
SamSpadeGameDev
Рет қаралды 6 М.
Create Life From a Simple Rule
14:37
Brainxyz
Рет қаралды 786 М.
When u fight over the armrest
00:41
Adam W
Рет қаралды 27 МЛН
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 9 МЛН
2 MAGIC SECRETS @denismagicshow @roman_magic
00:32
MasomkaMagic
Рет қаралды 36 МЛН
Optimizing Steering Behaviors for GameMaker Studio 2
9:16
SamSpadeGameDev
Рет қаралды 4,6 М.
Programming Perlin-like Noise (C++)
27:54
javidx9
Рет қаралды 105 М.
How to turn a few Numbers into Worlds (Fractal Perlin Noise)
15:24
The Taylor Series
Рет қаралды 195 М.
C++: Perlin Noise Tutorial
8:52
Zipped
Рет қаралды 14 М.
Optimisation Tips | GameMaker Studio 2
19:10
FriendlyCosmonaut
Рет қаралды 51 М.
Hand drawn is easier than pixel art | HD graphics vs low-bit vs Hi-bit
10:00
Coding Challenge 11: 3D Terrain Generation with Perlin Noise in Processing
22:44
The Pubsub Pattern in GameMaker Studio 2.3
16:37
SamSpadeGameDev
Рет қаралды 3,8 М.
A new way to generate worlds (stitched WFC)
10:51
Watt Designs
Рет қаралды 540 М.
When u fight over the armrest
00:41
Adam W
Рет қаралды 27 МЛН