Really cool. You don't see very many 3d roguelikes and this might be a start to seeing more of them.
@skulltrick2 жыл бұрын
Extremely helpful even 2 years later working with Godot 4! Thank you
@MysticStickerV27 ай бұрын
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)
@Wavelength5757 ай бұрын
Awesome thanks!
@Black_Sheep_02136 ай бұрын
Bless you!
@joshmartin88563 ай бұрын
Also, set the GridMap's size to 1x1x1 meter. The mesh is a MeshInstance -> StaticBody3D -> CollisionShape3D all cubes.
@mrdinoking66264 жыл бұрын
Why are you so underrated😭 I see always talent gets underrated but I am sure you will rise
@kronos548 Жыл бұрын
wow that was easy to implement, big thing for 4.0 is spatial is now node3d
@thatguyjose67613 жыл бұрын
THIS IS AMAZING. You mentiones I could make walls? How? could you do a follow up tutorial? please
@TokarevTokarevTokarev2 жыл бұрын
Hi, did you found a wayt to place the walls? Please let me know if so
@thatguyjose67612 жыл бұрын
@@TokarevTokarevTokarev no, I haven't, bit I'm still looking
@moonmaker11583 жыл бұрын
great tutorial
@KlausWulfenbach4 жыл бұрын
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?
@TheBuffED4 жыл бұрын
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
@ZarkianStuffnThings3 жыл бұрын
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-jt1ry3 жыл бұрын
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 🤔
@dimSKAYEE10 ай бұрын
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
@davidecilemmi566110 ай бұрын
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
@dimSKAYEE9 ай бұрын
@@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)
@carlsonraywithers33683 жыл бұрын
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 Жыл бұрын
how do I get it to generate like a cave though?
@TheBuffED11 ай бұрын
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
@xboydubose72542 жыл бұрын
Can you make a maze with this?
@thoaihoquang15783 жыл бұрын
how to generate a wall?
@TokarevTokarevTokarev2 жыл бұрын
Hi, did you found a wayt to place the walls? Please let me know if so
@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, )