Procedural Generation In Unity 2D With Tile & Perlin noise
In the previous video we made a Procedural generation script which was a basic version and only useful to know the concept of procedural generation.In this video we will improve this script by using Tiles instead of game objects Which gives us more performance and we will use perlin noise instead of what we did in the previous video which gives us more flexibility on how we want to spawn our terain and lets us save a generation as well.
Script
Previous Script on Procedural Generation
Script is Here:hatebin.com/dwyksgwqtp
Final script is in my Asset bundle
Download for free
chronoabi.itch.io/procedural-...
You can also follow me on
Instagram : / chronoabi
KZread: bit.ly/2CReUlQ
Twitter : / chronoabi
Discord : / discord
You can Support this channel on patron to get the latest video as quickly as Possible
Paytron: / chronoabi
Пікірлер: 51
I love your tutorials! If you could follow this tutorial with more episodes it would be great You deserve more recognition than you have :)
thanks dude you got a great style of teaching, keep doing what you do!
Thank you for your explaining the procedural generation so detailed. Your tutorials are very good. Thank You :-)
Loving it!
Finally a good beginner friendly procedural generation tutorial. Hi ChronoABI, I am a huge fan of Terraria. Can you make tutorial on how we can make Terraria like game in unity?
Fantastic videos. Will you make a video on adding a player with a collision box into these rand gen worlds? I spent an entire day figuring out how to add water pools to the world you showed. It looks great on my computer, and I want to have a player to be able o interact with the world.
A quicker method to modify the script to set a tile map is to change up the spawn object function to this: (also make sure to change the gameobject variables to tilebase variables and add a tilemap variable) void spawnObj(TileBase obj, int width, int height) { tilemap.SetTile(new Vector3Int(width, height, 0), obj); } Thanks for the tutorial bro!
Thank you, you like godsend for this stuff
Awesome, thank you very much for the tutorial, at first it seemed a bit fast but once i slowed it down it was perfect :D
@chronoabi
3 жыл бұрын
Thanks bro and BTW the next video will also be about procedural generation. It's an improvement of this video and I am using rule tile for that.
@zanspl
3 жыл бұрын
@@chronoabi i will deffinitly take a look at that too + the caves, i cant wait :D
Good, but I couldn't add tiles... When i clicked create the tile option was not there
amazing!
could u please make another episode and continue this, it would be cool to see some rule tiles where something like grass adapts and fades in with its neighbour tiles also a simple building mechanic like placing and breaking tiles. btw awesome content!
@chronoabi
4 жыл бұрын
Yeah I am thinking of making that so stay tuned
Great tutorial !, thank you very much for your help. I was wondering how I can add procedural caves in this type of terrain, if you can, help me please.
this is cool but how do you add a box collider for your game
Hi, I love your tutorials, and I have a question, could you make more tutorials about enemy attack, this will be really great, like when the player is in a range of the enemy and then the enemy is attacking the player, or something with animations. I really like your explanation and I'm looking to see more tutorials. :)
hey nice video but i have a question.It allways generates at 0,0 and i was wondering if there is a way to script it so it will generate somewhere in the world space other than default since my character is not in the canvas but it generates in the canvas instead
Hi, great tutorial! I just started with this process (newbie) and I am wondering how to replace the tile color (e.g. green) to a real texture png file (e.g grass texture). How to do that? Thank you!
@chronoabi
4 жыл бұрын
In the sprite section where I put a white colored sprite and the changed the tiles color to dirt color. Instead of that white colored sprite put your own texture that your made for dirt or something then change the color back to white
how can i put blocks under the predra block or put minerios scattered(i newbie)
thankyouuuu
your videos are really very awesome. can i use this method with 'spriteShape' feature in unity to make the upper portion smooth like in the alto's adventure game?
@chronoabi
4 жыл бұрын
Maybe but I have never done that so I don't know😧
Do u know how I could make a 2d rpg world made of tiled generate automatically?
Wow i like ur tutorial sir. Would u teach us more. Sic fi genre BTW SIR AM LUST IN Ur ENGLISH. SO beutibeutifulla
@chronoabi
4 жыл бұрын
Ha GAAAAAAY
@adeshrai3042
4 жыл бұрын
@@chronoabi 😘😘babyyp🤣
exist some way to transform this to 3d?
How would I integrate little water pools at the surface with this system? Please help
@thezodiac8973
3 жыл бұрын
I think youd need a line of code to check neighbor tile and add a percentage chance to spawn water tile if it's neighbour tile is water
@eboatwright_
3 жыл бұрын
@@thezodiac8973 Yeah. I figured it out. Thank you though! :)
@chronoabi
3 жыл бұрын
I am really sorry , I am out of town and don't have my pc that's why it sucks that I can't help but please share how you did that cause many people wanna know how to do that. Thank you in advance :)
@eboatwright_
3 жыл бұрын
@@chronoabi It doesn't really perfectly, because it doesn't keep the water contained but, what I did basically is I had a bool called "lastBlockWater", an integer named "waterLevel", and an integer called "waterProbability". So when you set a block to grass in the script, I just put a if(Random.Range(0, waterProbability) == 0) then instead of grass put water. But if it wasn't 0 then put it to grass. but inside the if() brackets, I set lastBlockWater = true; Then the next frame in the loop it checks if the last block was water, then it increases the probability for water, and sets last block water = false. That's basically what I did, but I can put a script if you want it.
@thezodiac8973
3 жыл бұрын
@@eboatwright_ to contain the water I wonder if you store the previous tiles height and subtract it from the present... If it's greater than 1 I would spawn the water until it becomes less than one🤔
Hey follow me on Discord. Link is here discord.gg/78q3HFnb69 You can ask for help , post what your working on and get motivated , show your funny bugs and memes and more.
apparently you can't make tiles in unity anymore making this tutorial old.... Found a work around !
how to add collision to the tilemap?
@chronoabi
4 жыл бұрын
You can use tilemap collider component
@keventy6114
3 жыл бұрын
You can also set your tiles so that they won't use the tilemap collider he mentioned if you don't want it to for whatever reason. At around 4:20 in his tutorial, when he is showing creating a tile, the Collider dropdown box is in the Inspector. For example, if you apply what he taught to add decoration to your scene, not having that tree/rock/hut with collider could come in handy.
Does anybody know how to generate colliders with this?
@plusplusgames
2 жыл бұрын
Add A tile map collider 2d to the Dirt, Grass and stone
@squeakerboodle
2 жыл бұрын
@@plusplusgames already tried that, doesn't work
@plusplusgames
2 жыл бұрын
@@squeakerboodle Did you add it to the grid
pls update your totruial
How to made Biomes?
@nno64209
3 жыл бұрын
*make
unity finally crashed when i tried to generated 60 million blocks lol
are waaa Lolo kto ko pragati 🤣🤣