How to Procedurally Generate Simple 3D Levels in Godot

  Рет қаралды 17,413

TheBuffED

TheBuffED

Күн бұрын

Пікірлер: 27
@minutesock9649
@minutesock9649 4 жыл бұрын
Really cool. You don't see very many 3d roguelikes and this might be a start to seeing more of them.
@skulltrick
@skulltrick 2 жыл бұрын
Extremely helpful even 2 years later working with Godot 4! Thank you
@MysticStickerV2
@MysticStickerV2 7 ай бұрын
Adding this for anyone seeing this and getting errors. This is posting as of Godot 4.2.2 extends Node3D const dir = [Vector2.RIGHT, Vector2.LEFT, Vector2.UP, Vector2.DOWN] var grid_size = 14 var grid_steps = 50 func _ready(): randomize() var current_pos = Vector2(0,0) var current_dir = Vector2.RIGHT var last_dir = current_dir * -1 for i in range (0, grid_steps): var temp_dir = dir.duplicate() temp_dir.shuffle() var d = temp_dir.pop_front() while (abs(current_pos.x + d.x) > grid_size or abs(current_pos.y +d.y) > grid_size): temp_dir.shuffled() d = temp_dir.pop_front() current_pos += d last_dir = d $GridMap.set_cell_item(Vector3i(current_pos.x,0,current_pos.y), 0, 0)
@Wavelength575
@Wavelength575 7 ай бұрын
Awesome thanks!
@Black_Sheep_0213
@Black_Sheep_0213 6 ай бұрын
Bless you!
@joshmartin8856
@joshmartin8856 3 ай бұрын
Also, set the GridMap's size to 1x1x1 meter. The mesh is a MeshInstance -> StaticBody3D -> CollisionShape3D all cubes.
@mrdinoking6626
@mrdinoking6626 4 жыл бұрын
Why are you so underrated😭 I see always talent gets underrated but I am sure you will rise
@kronos548
@kronos548 Жыл бұрын
wow that was easy to implement, big thing for 4.0 is spatial is now node3d
@thatguyjose6761
@thatguyjose6761 3 жыл бұрын
THIS IS AMAZING. You mentiones I could make walls? How? could you do a follow up tutorial? please
@TokarevTokarevTokarev
@TokarevTokarevTokarev 2 жыл бұрын
Hi, did you found a wayt to place the walls? Please let me know if so
@thatguyjose6761
@thatguyjose6761 2 жыл бұрын
@@TokarevTokarevTokarev no, I haven't, bit I'm still looking
@moonmaker1158
@moonmaker1158 3 жыл бұрын
great tutorial
@KlausWulfenbach
@KlausWulfenbach 4 жыл бұрын
Do GridMaps automatically cull the unseen faces, or are all the cube faces we don't see (because they are adjacent to other cubes) still there?
@TheBuffED
@TheBuffED 4 жыл бұрын
That's a great question and I'm not totally sure, although I believe that they would because they seem very performant. I will have to look into that
@ZarkianStuffnThings
@ZarkianStuffnThings 3 жыл бұрын
It doesn't if it's a blender collada which is sad but hey, at least it works. Oh and also, If you put meshInstance cubes from the GD editor in, it culls the inside of them but IDK about the connected ones
@Leonardo-jt1ry
@Leonardo-jt1ry 3 жыл бұрын
Thank you! Really great tutorial!, I'm going to do something similar for my game. I have a question, did you have problem with the collision of the gridmap? In my scene the character is shaking in the y axis, and I guess it is because of the collision shape 🤔
@dimSKAYEE
@dimSKAYEE 10 ай бұрын
doesn't work, set_cell_item( ) function is invalid in base Gridmap. What to do? How to fix this? I'm using Godot 4.2.1
@davidecilemmi5661
@davidecilemmi5661 10 ай бұрын
i dont know why but even if u can't find with intellisence it stil work, it accept (vector3 position , item index, orientation). i m using 4.21 as well and it work
@dimSKAYEE
@dimSKAYEE 9 ай бұрын
@@davidecilemmi5661 hmmm, turns out i forgot the second zero in set_cell_item( ), but it still doesn't work. says: invalid call, expected 3 arguments im even more confused edit: solved that issue, but now there's a new one: can't convert argument 1 float to Vector3i (last line)
@carlsonraywithers3368
@carlsonraywithers3368 3 жыл бұрын
Can I still make this with different cube meshes? How many meshes can I use? I want to also randomize the blocks as kinda like an LSD Dream emulator vibe. Can I overlap multiple procedually generated levels?
@Sweze
@Sweze Жыл бұрын
how do I get it to generate like a cave though?
@TheBuffED
@TheBuffED 11 ай бұрын
With this method, you would need to do some edge detection within the script and continue generating meshes, but vertically to create walls, and you can basically copy the base level and "move it up" to form the ceiling. Then you have kind of a dungeon layout, and with the right approach to variation, you could get a minecraft-esque cave
@xboydubose7254
@xboydubose7254 2 жыл бұрын
Can you make a maze with this?
@thoaihoquang1578
@thoaihoquang1578 3 жыл бұрын
how to generate a wall?
@TokarevTokarevTokarev
@TokarevTokarevTokarev 2 жыл бұрын
Hi, did you found a wayt to place the walls? Please let me know if so
@wexordante
@wexordante Жыл бұрын
Don't work ((( extends Spatial const dir = [Vector2.RIGHT, Vector2.LEFT, Vector2.UP, Vector2.DOWN] var grid_size = 10 var grid_steps = 30 func _ready(): randomize() var current_pos = Vector2(0, 0, 0) var current_dir = Vector2.RIGHT var last_dir = current_dir * -1 for i in range(0, grid_steps): var temp_dir = dir.duplicate() temp_dir.shuffle() var d = temp_dir.pop_front() while(abc(current_pos.x + d.x)) > grid_size or abc(current_pos.y + d.y) > grid_size or dir == last_dir * -1): temp_dir.shuffle() d = temp_dir.pop_front() current_pos += d last_dir = d $GridMap.set_cell_item(current_pos.x, 0, current_pos.y, 0, )
@WandererStrannik404
@WandererStrannik404 Жыл бұрын
How to generate a wall?
A new way to generate worlds (stitched WFC)
10:51
Watt
Рет қаралды 551 М.
Random Level Generation with a Walker - Godot Tutorial
26:56
Heartbeast
Рет қаралды 99 М.
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
Why Majora's Mask's Blue Dog Took 25 Years to Win the Race
21:04
Vidya James
Рет қаралды 2,5 МЛН
Procedurally Generated 3D Dungeons
10:26
Majikayo Games
Рет қаралды 48 М.
How to Randomly Generate Levels (and Islands)
13:26
Jonas Tyroller
Рет қаралды 207 М.
How to Fail at Open Worlds
3:36
Artindi
Рет қаралды 181 М.
Procedural Generation in Godot 4
18:45
sloth in a hat
Рет қаралды 68 М.
Godot 3 Tutorial | Auto Tile for GridMap
16:04
Calame321
Рет қаралды 20 М.
The Problem With Procedural Generation
17:57
Acerola
Рет қаралды 297 М.
I rewrote my dungeon generator!
4:27
UnitOfTime
Рет қаралды 168 М.
Procedural Generation in Godot: Dungeon Generation (part 1)
14:36
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН