Setting A Random Seed In Unity3d : Procedural Generation (C# Game Development Programming Tutorial)

  Рет қаралды 20,312

Matt MirrorFish

Matt MirrorFish

Күн бұрын

Пікірлер: 40
@newbquesttv
@newbquesttv 5 жыл бұрын
What are some of your favorite games that used random seeds for gameplay? For me Spelunky and the daily challenge mechanic, where the seed is set by the day is one of my faves. What are some creative ways to use seeds that you've seen? Or ideas you've come up with?
@gaming4fun419
@gaming4fun419 5 жыл бұрын
Right now it's Gekraxel.
@newbquesttv
@newbquesttv 5 жыл бұрын
@@gaming4fun419 Huh that's a new one to me, it looks cool! I like how minimal it looks and the generated levels have a nice shape to them. Almost like he took a maze generator and just re-oriented it for a platformer. Cool idea! Thanks for the tip!
@gaming4fun419
@gaming4fun419 5 жыл бұрын
@@newbquesttv Yeah, it's a bit like a vertical super meat boy where your only enemy is gravity =) Or a minimalistic Spelunky. You can line yourself up to walls below (they will turn red when you are lined up) and catch hold of them to slow decent with shift. It's a challenge, but loads of fun.
@GaryMcKinnonUFO
@GaryMcKinnonUFO 2 жыл бұрын
Valheim!
@notlaw1567
@notlaw1567 2 жыл бұрын
Great explanation for an important programming concept, no difficulties to understand the logic at all. I can't wait to try this out by myself. Thanks!!
@gamedevbaiyi936
@gamedevbaiyi936 2 жыл бұрын
Thank you Matt, now I got somthing that can help for my random map generation.
@Robertganca
@Robertganca 4 жыл бұрын
This is exactly what I was looking for. Thank you. I thought I would have had to do everything from scratch.
@newbquesttv
@newbquesttv 4 жыл бұрын
Random seed sets the seed so that if you use the same seed you will get the same set of random data. It allows you to create reproducible random results.
@Toxicblackmambahs
@Toxicblackmambahs 3 жыл бұрын
These procedural tutorials are some of the best i've seen on youtube. Thank you so much.
@ZkrytobojcaO.O
@ZkrytobojcaO.O 4 жыл бұрын
I am making procedurally generated minigolf course for my thesis work in computer science. I got all information that I needed about seeding generator from you. Thanks :D
@newbquesttv
@newbquesttv 4 жыл бұрын
Glad it helped! Best of luck!
@funnyanimalworld7579
@funnyanimalworld7579 4 жыл бұрын
you helped one lost soul to find some peace .Thank you
@soerennielsen
@soerennielsen 5 жыл бұрын
Hey great tutorial. High quality and straight to the point!
@newbquesttv
@newbquesttv 5 жыл бұрын
Thank very much!
@artinstroukeprod
@artinstroukeprod 4 жыл бұрын
Super lessons! Most thing clear to understand!
@zackpoirier1378
@zackpoirier1378 5 жыл бұрын
Hey I really liked this video (gonna go back and watch the others in the series now). You should definitely make a playlist for the procedural videos, it'll help those who wanna binge them)!
@newbquesttv
@newbquesttv 5 жыл бұрын
Thank you, please check the playlists on my channel, there is one although it’s obviously not visible enough. Thanks for the comment!
@newbquesttv
@newbquesttv 5 жыл бұрын
Link: kzbin.info/aero/PLuldlT8dkudoNONqbt8GDmMkoFbXfsv9m
@javiergarcialopez7339
@javiergarcialopez7339 4 жыл бұрын
Nice Tutorial!!! Working like a charm! Perfect to my dungeon random generator. Thanks!!
@newbquesttv
@newbquesttv 4 жыл бұрын
Glad to hear it!
@raphaelfrank5337
@raphaelfrank5337 4 жыл бұрын
Thank you this really helps me a lot, good video
@newbquesttv
@newbquesttv 4 жыл бұрын
You're welcome!
@noejacques
@noejacques 2 жыл бұрын
This is not something that i knew was possible! It is interesting, but if it influences all of the output number given by Random class, that means that your seed could impact all of your rolls when playing the game, right ? Wouldn't that make the game more deterministic, since every placement for ennemies and loot or every ability used that uses some kind of randomness are related to the seed ?
@bluegru
@bluegru 4 жыл бұрын
Does it matter how much time passes between setting the state and getting the random number? Can I set the state right after game start, and use Random.Range a minute later and get the same number as if I had used it right away?
@Beldrama
@Beldrama 4 жыл бұрын
How do I fetch the S0 value in a Random.state to display a random seed?
@TechExpanse
@TechExpanse 4 жыл бұрын
I see big flaw in this, for example you set a seed and every time you use Random.GetRange(0, 100); you will get a list of say 10, 56, 89, 14, 35 .. now you use this function in various places in your code like generating terrain, then generating enemy spawn point, then generate player speed modifier of the buff item you get from defeating enemy. .. its all fine as long as you keep the order in which Random.GetRange is called .. but what if you went another way and game generates 2 terrain chunks and use 10 and 56 for that, but wait last time 56 was used to generate enemy spawn points and now we need 2 sets of spawn points so it grabs 89 and 14 .. but these numbers last time were used for speed bonuses .. you see the issue ? in order to reproduce same results from same seed you have to call every random action in exact same order .. I'm actually looking for solution if anybody could help that would be appreciated :)
@newbquesttv
@newbquesttv 4 жыл бұрын
My suggestion is you implement and try it, this approach has worked for me in producing reproducible deterministic random generation. Keep in mind it's not necessarily a deterministic _playthrough_ since the players actions are not deterministic, but you can make something like level or world generation deterministic using this approach. Try it and see where it falls down for you, for me it has worked the way I intended.
@StigDesign
@StigDesign 5 жыл бұрын
Awesome :D i remember that Minecraft has Seed to get genereated by the name you type inn or blank :) this can be cool for topdown shooter etc that has random room`s and hall`s, randomed by seed, i dont know how but hehe i think it whud be cool kind of like Doom(1993) that has pre-made room that auto generates by seed or random(but the random also has a seed so that if like the generated level you can re-genrate it),i think V-Rally 2 might have seed to auto-generate racing track am not sure thoe :) (ps Norwegian with dyslexia)
@newbquesttv
@newbquesttv 5 жыл бұрын
Thanks! Yeah Minecraft is a great example, that whole world is generated. I think an auto-generated FPS like Doom could be really cool too. Thanks for checking out the video :)
@StigDesign
@StigDesign 5 жыл бұрын
@@newbquesttv Yes :D
@MathieuHaas68
@MathieuHaas68 4 жыл бұрын
Is that possible to add some random hazards bases on procedural biomes/buildings/places etc... Let's admit you have a park with 3 trees and there is a zombie. And after you have a park with 1 tree but 4 zombies (or even none) I'm getting stuck on it ahah ! Any help, for one donut.
@newbquesttv
@newbquesttv 4 жыл бұрын
Yes, it's definitely possible. You'd need some kind of data structure, maybe a ScriptableObject to hold the data about the probabilities of certain things appearing. Then you could spawn them randomly based on that data. Take a look at the other videos on the channel in the Procedural Generation Basics playlist and that should give you some ideas.
@lostlakeboy4765
@lostlakeboy4765 4 жыл бұрын
you could set multiple tilemaps one for main scape one for enemies and one for other things
@simonsobenes9289
@simonsobenes9289 4 жыл бұрын
thanks
@gladboy9335
@gladboy9335 4 жыл бұрын
Can you put the genereation on an object (I am new to programming in Unity so dont laugh please
@newbquesttv
@newbquesttv 4 жыл бұрын
Yes you can. Attach the script shown in the video to a game object.
@rbanister100
@rbanister100 2 жыл бұрын
WAY TOO MUCH OVERHEAD in explaining this...
@bensmith5288
@bensmith5288 4 жыл бұрын
Less of your face More videogame
@newbquesttv
@newbquesttv 4 жыл бұрын
You can also watch less of this channel and more of something else lol
How to turn a few Numbers into Worlds (Fractal Perlin Noise)
15:24
The Taylor Series
Рет қаралды 195 М.
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
Как Я Брата ОБМАНУЛ (смешное видео, прикол, юмор, поржать)
00:59
Натурал Альбертович
Рет қаралды 4,9 МЛН
Practical Procedural Generation for Everyone
31:30
GDC 2025
Рет қаралды 418 М.
How I Learned Procedural Generation
5:36
Lejynn
Рет қаралды 271 М.
MESH GENERATION in Unity - Basics
11:10
Brackeys
Рет қаралды 458 М.
Procedural Generation in Unity
10:22
TNTC
Рет қаралды 74 М.
PERLIN NOISE in Unity - Procedural Generation Tutorial
10:34
Brackeys
Рет қаралды 269 М.
How does procedural generation work? | Bitwise
13:48
DigiDigger
Рет қаралды 391 М.
Procedurally Generated 3D Dungeons
9:42
Vazgriz
Рет қаралды 294 М.
5 Ways to use AI in Game Development in 2024!
5:12
Sloyd
Рет қаралды 46 М.
How many people are in the changing room? #devil #lilith #funny #shorts
00:39