This is the best procedural generated map tutorial that i have found so far.
@maggot97794 жыл бұрын
If anyone else is having trouble with the background tilemap not placing stone walls correctly, you have to make sure the subtile size is set to 48 for y.
@kshitijbaria58834 жыл бұрын
GOD LIKE Awesome vid man i was cracking my brains at how to get the auto tiling in a procedural map Didn't know it was this easy Keep it up!
@MrSmith_3 жыл бұрын
13:52 Idk if someone else has answered or if you already know by now since this video is 2 years old, but you're exactly right in that it's the frequency per tiles. The denominator value is the ceiling and the numerator is the frequency. Example, 1 out of 4 tiles will be chosen.
@gingerageousgames6133 жыл бұрын
Thanks. I always appreciate a helpful comment even if I was fairly certain I was right.
@nuvod47704 жыл бұрын
14:33 Actually, `and` is short-circuit: if left operand is false - right will not be calculated, so you can do comparison on one line
@ryanbuizon582 жыл бұрын
This tutorial is literally the best. The Simplex noise would look great for spawning something like islands!
@gingerageousgames6132 жыл бұрын
Thanks. It is nice comments like this that make me think I really need to make some more videos since my short break kind of turned into a year.
@knightfury7120 Жыл бұрын
This tutorial was amazing🖤
@robertoaguiar62304 жыл бұрын
Thanks, mate, I'll try it tomorrow in godot 3.2 if I make it I'll let you know
@tofudeliverygt862 жыл бұрын
Exactly what I was looking for, thanks!
@vishu67875 жыл бұрын
I have never seen such use of tile map, looking forward to see new things on this channel, I am trying to come up with a 3d terrain generation for my car game which use perlin noise I'll be great if you can help me go forward.
@sirbranson52544 жыл бұрын
hey im also trying to go the same thing for my 3d fantasy game, have you made much progress? can you share?
@CoderJK2 жыл бұрын
This is just what I was looking for! The command to update the bit mask was the missing piece for me! I guess I have no excuse but to make something incredible now. 😊
@archiebaldry4 жыл бұрын
great tutorial, man. good job.
@NeZversSounds5 жыл бұрын
Procedural proceduralization.
@judelingan58633 жыл бұрын
This tutorial is amazing!
@Syeno5 жыл бұрын
So i understand how to make auto tiles for edges and all that, but is there a way to make auto tiling mountains walls? Making mountains is so tedious with this texture pack. A clever work around would save me so much time.
@gingerageousgames6135 жыл бұрын
Are you talking about the stone walls that go down in the holes? I actually did auto tile them. Use 3x3 minimal. Then I only used the middle 3 bits to see if it had neighbors to the left or right.
@jaymhlurbaloyi78133 жыл бұрын
@@gingerageousgames613 bro can you post it on GitHub Or paste just that part as a comment I can't figure it out.
@masterroyale03764 жыл бұрын
Great Work! :D
@ebregains3 жыл бұрын
I think it would be better if you nest all three functions on a two dimensional loop with the noise value and pass it as an argument. You will avoid iterating through the tilemap 3 times and obtaining that noise value 3 times too. Something like: func _ready(): # ... var noise_value for x in map_size.x: for y in map_size.y: noise_value = noise.get_noise_2d(x,y) check_for_grass(x, y, noise_value) check_for_road(x, y, noise_value) check_for_enviroment(x, y, noise_value) make_background() #... You can even nest this on a new function called generate_world() and just call it in the _ready() function. Anyway, I completely understand that this is an educational video and what I prouposed is maybe harder to read and understand. Thanks for sharing this tutorial, it was really clear!
@gingerageousgames6133 жыл бұрын
I agree. But I also appreciate well thought out and clear suggestions. It would be silly for people to think I really knew what I was doing. I have learned a lot from comments like this.
@robertoaguiar62304 жыл бұрын
Hey, man, I'm looping this error and nothing happens. "ERROR: tile_get_tile_mode: Condition "!tile_map.has(p_id)" is true. Returned: SINGLE_TILE At: scene/resources/tile_set.cpp:480"
@gingerageousgames6134 жыл бұрын
So what he error is saying is it can not find the tile_id that you are trying to set. So making a fair amount of assumptions on my part I would guess that on line 47 you have set the environment to a number that doesn't exist in your tileset. Check that tileset and make sure you have 4 single tiles or your random num reflects how many tile types you have. Also if you went back and deleted any tiles in the tileset it can make gaps. To check if this is right. Use a number you know is in the tilemap instead the randi num in line 47 to set the cell. That is my first guess.
@Garfield910764 жыл бұрын
Thanks for all the help in your tuts! I just have one question for some reason my tiles are getting lines between them when they are rendered. I have to zoom way out to not see these weird lines. Know anyway to fix that? I could provide a picture of it if that would help.
@gingerageousgames6134 жыл бұрын
Are the lines spaces or sprite? If they are spaces check you tile size. If they are part of a sprite check you texture region. Otherwise you could try pixel snap.
@Garfield910764 жыл бұрын
@@gingerageousgames613 Hey thanks for the quick reply! Turns out the lines were just appearing in the editor because I was zoomed in or out and it would make the tiles look blurry and put some weird artifact looking lines in between each tile. Then in the game when I would run it my window settings were weird i guess and messed around with those to fix it. It was creating different a kind of artifacting there. Also like another guy mentioned I'd super appreciate getting the source code if youre ok with giving that out. Having fun with godot but seems like a lot of people dont offer links to their code in tutorial videos. Thanks again
@gingerageousgames6134 жыл бұрын
@@Garfield91076 Well if it means anything most if not all my videos the code is all given in the videos. Nothing is hidden. I just find git tedious and sometimes I am lazy. But I will do this project when I get to my computer. Lol.
@Garfield910764 жыл бұрын
@@gingerageousgames613 Haha thanks much appreciated!
how could you make the environment decorations spawn in the same place when you use the same seed
@hector_dgz944 жыл бұрын
great video, thanks a lot
@MarkJrLuat3 жыл бұрын
How do you make a like a small patch of different grass tiles
@roadtopro-rtp6954 жыл бұрын
Question: How do you figure out the size of your map???
@gingerageousgames6134 жыл бұрын
I just used trial and error. Make it big enough to cover the screen then adjust the noise parameters (period etc.) till it looks nice.
@fouzi60842 жыл бұрын
how to do a minimap with procedural generated worlds ?
@dandymcgee2 жыл бұрын
How would you let the player move around in the world? Would you run all of this code every frame after sampling the noise function?
@gingerageousgames6132 жыл бұрын
No. You would run this code once at the start of the scene. If you wanted a new map then you could re run the code.
@samuelhugo3387 Жыл бұрын
If you can make a tutorial on how to place interactable objects like haravstable plants or openable chests randomly in the correct places on top if this map that would be great obviously you don't want trees to spawn on the roads also if youwant random buildings to spawn you might want a certain amount of distance between them minimum and also a rarity to determine odds of it spawing these are essential things to know for developing proceedural games so I am sure the comunity will love a video on it
@MrLuizhausen Жыл бұрын
Look at Godot4s new TileMap features. It has the option to define Scenes as tiles! It is still in beta, but it works rly well.
@arcticblitz96303 жыл бұрын
My generation seems to stop at the edge of the screen and when I added a player, I figured out that no matter what, the generation doesn't go any further. Any idea how I can make the generation infinite
@rogerlopez6582 Жыл бұрын
Maybe increase map_size var?
@djtatertot13614 жыл бұрын
What are the cap variables used for?
@roadtopro-rtp6954 жыл бұрын
Question: how do I make it so I can fall if i collide with the empty map
@gingerageousgames6134 жыл бұрын
Give a collision shape to the hole tileset. Then use the body or area entered signal (depending on what your player is) to trigger a falling animation which will probably be mostly scaling down the size of your character and setting it to a dead state as to stop the player from being able to move any more. Edit: It might be easier to trigger the animations with an area on the player that detects the hole collision shape.
@roadtopro-rtp6954 жыл бұрын
@@gingerageousgames613 thank you so much
@abdellatifdev3 жыл бұрын
Good video but you probably could use map_size instead of Vector2(map_size.x, map_size.y) because map_size is a vector2 itself
@gingerageousgames6133 жыл бұрын
Close. But the map_size variable finds the size of used tiles in a tilemap. This is procedurally created meaning the tilemap is empty and it is generated at runtime. So we have to define the size of the map we want. After it is generated then map_size would work but I would hope it is the same as the original variable I created.
@abdellatifdev3 жыл бұрын
@@gingerageousgames613 my point is map_size is a const during the run time so it gonna give the same effect but i think writing map_size directly will make syntax cleaner , could save few seconds of creating new vector each time in the for loop
@PikCelAlien4 жыл бұрын
Can you make video about infinite tilemap generation?. I can type infinite terrain script. But i don't know how to remove tiles when player moving. I use clear() but it removes all tiles
@gingerageousgames6134 жыл бұрын
I will put it on the list. To get you started to delete a tile is the same as placing except the tile number is -1. set_cellv(Vector2(3, 0), -1)
@tiradentesmonotrundle78414 жыл бұрын
Nightmare, can you make this script available somewhere? I can't find a good tutorial of infinite terrain in any video
@ShawnMcCourtB3 жыл бұрын
@@gingerageousgames613 I'm curious about this as well. I can't find a good tutorial to make this scale infinitely. Any advice?
@gingerageousgames6133 жыл бұрын
@@ShawnMcCourtB This video gets you 90% there. When the player moves you would track to see if you need more tiles. The reference the noise texture like in this video. Usually you would do chunks of 10 or so tiles so do have to run the code as often. Then when you add more you just delete the same amount from the other direction. I can add it to the list of tutorials to do but it will be awhile.
@ShawnMcCourtB3 жыл бұрын
subbed for the quick response! would I scale the map size down to 10? Or create a separate function that looks for player position and then looks if it needs to generate more tiles if in a certain range? Would I call quadrant size perhaps?
@devinkrike59684 жыл бұрын
Isn't calling for loops in each function detrimental? why not just draw all layers in 1 for x,y loop?
@gingerageousgames6134 жыл бұрын
Your probably right. It doesn't run every frame so I didn't really worry about optimization.
@huahuapro4 жыл бұрын
hi, can you share the code? or the project ? thanks!
@gingerageousgames6134 жыл бұрын
Yeah I have been lazy with GitHub. I will try to get that done for you this week.