Path Based Mesh Generation in Godot 4

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ก.ย. 2024

ความคิดเห็น • 82

  • @Auguste.Lefort
    @Auguste.Lefort ปีที่แล้ว +20

    So cool, great breakdown ! I always wondered how the "grind rail" mechanic was done in Jet Set Radio where you can jump on and out the rail at any point in space, in any direction, could be a nice follow up to this tutorial ;)

  • @paulmaguire872
    @paulmaguire872 หลายเดือนก่อน +1

    OMG getting the objects to face forward.. "direction_to".. I have to stop smacking my head before there's blood.. I was trying to move a ghost object along a dynamic follow path and use it's iterated position to place my instantiated objects.. which I really felt was a clever idea... but I was the only one lol. Cheers man, this was goooold.

  • @adambaker9434
    @adambaker9434 6 หลายเดือนก่อน +4

    Thanks for putting this together, I knew there had to be a better way to create tracks than individually tiling. This has been extremely useful-much appreciated.

  • @dcaucett
    @dcaucett ปีที่แล้ว +4

    Excellent tutorial, explained so well in such a short space of time. Have subbed and going through your other videos. Thanks for great work.

    • @crigz
      @crigz  ปีที่แล้ว +2

      Thank you mate, really appreciate the kind words.

  • @Gredran
    @Gredran ปีที่แล้ว +2

    You’re one of my top Godot guys right now and one of the ONLY ones doing right now! I love your videos!

  • @hotindavid1623
    @hotindavid1623 11 หลายเดือนก่อน +4

    With the Godot 4 you also can place an object with full Transform3D with:
    sample_baked_with_rotation ( float offset=0.0, bool cubic=false, bool apply_tilt=false )

    • @NilsMoller
      @NilsMoller 2 หลายเดือนก่อน

      This should be pinned. Makes it much easier (and solved a rotational issue I had :)

  • @wo_ri_gou_le2974
    @wo_ri_gou_le2974 วันที่ผ่านมา

    very detailed video, real quality, helps a lot

  • @dominicduncan9895
    @dominicduncan9895 ปีที่แล้ว +1

    thank you so much for this extremely helpful, i am using 3.5.1 so it took me a while to find that i needed to use interpolate_baked() instead of sample_baked(), but it ended up working perfectly!!

  • @niloloo
    @niloloo ปีที่แล้ว +2

    great work and unique kind of guide in the Godot space! Thanks!

  • @davidmurphy563
    @davidmurphy563 ปีที่แล้ว

    Awesome vid, subbed!
    I learned precisely nothing because I've literally got a project (vid on my channel) with cars learning to drive round a track so I sat watching merrily nodding my head saying "that's right" repeatedly to my monitor. :)
    Keep it coming!

  • @fanrenchen566
    @fanrenchen566 ปีที่แล้ว +1

    amazing! the best enlightening channel of godot I saw ever before

  • @andrewchapman2039
    @andrewchapman2039 15 วันที่ผ่านมา +1

    This is a pretty cool technique and I'm tempted to put it in a few areas of my project, is it very expensive at runtime though? Don't want to overload the system just to have an easier time making pathways.

  • @danisob3633
    @danisob3633 ปีที่แล้ว +1

    im so glad i found your channel

  • @RetroPlus
    @RetroPlus ปีที่แล้ว

    One of the best tutorial channels I've seen so far, perfect!

  • @rumariomusic
    @rumariomusic ปีที่แล้ว +3

    Wow your videos are mind blowing. I learned so much. Is there a way to use the Godot editor gizmos for paths and object transformation at runtime. A video to do that all at runtime would be amazing

  • @popuptrains9877
    @popuptrains9877 ปีที่แล้ว +1

    Very interestring! Thanks for sharing :)

  • @RileyNiko
    @RileyNiko 6 หลายเดือนก่อน

    oh my god finally an explanation of a basis thank you

  • @AndyCampbell_uk
    @AndyCampbell_uk ปีที่แล้ว +1

    Fantastic tutorial- thank you!

  • @Ochros
    @Ochros ปีที่แล้ว +7

    Hey, very nice tutorial. One question regarding CSG is, that it is usually only used for prototyping. So this method probably isn't that feasible/fast enough if I want to do this during the game? Like for example generating a road a long a path similar how the last SimCity game did it.

    • @crigz
      @crigz  ปีที่แล้ว +11

      I think it's one of those things where you can just use it and optimise later if performance becomes an issue.
      What you could do later if it is an issue, is calculate a set of transforms along the path, like with the mesh instance example, and use them to place vertices to generate your own mesh.
      If this video does well enough, I'll make a part two where we generate the mesh ourselves to avoid these potential performance issues. Hope this was helpful nonetheless!

    • @Ochros
      @Ochros ปีที่แล้ว +3

      @@crigz OK, thanks for the quick reply. If you ever run out of Video ideas, you could also continue this by adding a traffic system to the path. So that, for example, cars use the correct roadside and be aware of intersections (and maybe how to generate an intersection where side walks don't overlap) etc. :D

    • @mapopi-mm
      @mapopi-mm ปีที่แล้ว +1

      Was wondering the same thing about using custom mesh instead of CSG for performance. Another idea for a tutorial: adjust / flatten a terrain below the road to fit its shape.

    • @Smaxx
      @Smaxx ปีที่แล้ว +8

      There shouldn't be any significant difference between this and just having regular meshes. It's cached after all. What you shouldn't do is animating CSG to update your world constantly, as that will cause the stuff to be recreated/recalculated over and over again. IMO it's totally valid to use CSG outside prototyping, too, it's just about how you use it. As a matter of fact, Valve's source engine (Half-Life, Counterstrike, Team Fortress, etc.) is fully based on CSG for the environment. Their editor (Hammer) just "bakes" everything into static meshes when exporting, just like what Godot does when a CSG node is "dirty". Only downside when using static CSGs in Godot is the fact that they might load slower, since the geometry has to be calculated on the fly once first.

    • @crigz
      @crigz  ปีที่แล้ว +1

      Thanks for the insight mate!

  • @ld2studio675
    @ld2studio675 ปีที่แล้ว +1

    Very useful tutorial, Thanks

  • @__narke
    @__narke ปีที่แล้ว +1

    Thank you! That's very good!

  • @bartudev566
    @bartudev566 ปีที่แล้ว +1

    You are the smartest Godot tutorial and etc youtuber I seen so far. I can't wait for future videos ;D

  • @Red_Eagle
    @Red_Eagle ปีที่แล้ว

    I cannot like this enough! Thank you so much! Instant sub

  • @Paruthi.618
    @Paruthi.618 ปีที่แล้ว +3

    Wow.. cool tutorial..
    Some tutorial topic 3D + Godot4 :
    Workflow of import 3d models, animations from blender .gltf, .glb, .fbx, .blend

  • @pascalcasier959
    @pascalcasier959 ปีที่แล้ว +2

    wonderfull!!!

  • @giggio1747
    @giggio1747 ปีที่แล้ว +1

    Uow! Great man! Thanks

  • @martindanihel6653
    @martindanihel6653 ปีที่แล้ว +7

    Is something like this possible in 2D? Draw sprite along path.

    • @forge_builder6455
      @forge_builder6455 4 หลายเดือนก่อน +1

      Yes, I am also looking for this. Please how!!!

  • @RyanScottForReal
    @RyanScottForReal ปีที่แล้ว

    Exactly what I needed, thanks!

  • @213Sid
    @213Sid ปีที่แล้ว +3

    Is there a way in godot to set a rotation for the Curve3D spline? I want to be able to control a slope of the road.

  • @Klayperson
    @Klayperson ปีที่แล้ว +2

    4:30 Euler is pronounced "oiler", because German

  • @owenlloyd2528
    @owenlloyd2528 ปีที่แล้ว +1

    Thank you

  • @pythonxz
    @pythonxz 9 หลายเดือนก่อน

    What a great video!

  • @AleksandarPopovic
    @AleksandarPopovic ปีที่แล้ว

    Very nice, man!

  • @tato6418
    @tato6418 7 หลายเดือนก่อน +2

    Im having trouble holding shift+click to do the curves while using Top-Down view (It just doesnt happen, i have to use perspective, which is bad for "flat" tracks. Any tips or workarounds?

    • @my_yt_
      @my_yt_ 6 หลายเดือนก่อน

      Same here. 4.3 Dev 3

    • @tato6418
      @tato6418 6 หลายเดือนก่อน

      @@my_yt_ havent found a solution yet, but i ended up doing it on perspective mode, and manually changing the Y position to 0 on each point on the node's config.

  • @EeVeE3D
    @EeVeE3D ปีที่แล้ว

    this is really great...

  • @torgo_
    @torgo_ 21 วันที่ผ่านมา

    woah this is awesome.
    would it be possible to procedurally-generate a road on-the-fly?
    like, if you wanted to make some kind of infinite driving game where the road goes along forever with different variations that spawn in

  • @nicholasobrien6920
    @nicholasobrien6920 8 หลายเดือนก่อน

    Awesome video!
    I'm wondering how could you add trimesh collision to the curve after it's generated the geometry?

  • @kevinsellers7566
    @kevinsellers7566 ปีที่แล้ว +1

    Could you please share your Basis scene or better yet do a video explaining how you developed the Basis scene in Godot. Thanks.

  • @dre_met
    @dre_met หลายเดือนก่อน

    How would you handle a split road? Imagine two possible ways for a certain distance that then merge together again?

  • @pill0h130
    @pill0h130 8 หลายเดือนก่อน +1

    Is there a way to do this without Csgs? Csg meshes do have quite a bit of a performance cost and are only meant for prototyping.

    • @crigz
      @crigz  8 หลายเดือนก่อน +1

      The performance hit is only if you edit the meshes during runtime, if the mesh remains static you should be fine.

    • @pill0h130
      @pill0h130 8 หลายเดือนก่อน +1

      Thanks! Also, is there a way to copy the shape of the csg polygon and make a collision shape with the same shape. I need to create an area 3d with a collision shape that is formed based off a path but I haven't found a way to do so.@@crigz

  • @UltimatePerfection
    @UltimatePerfection 3 หลายเดือนก่อน

    Really cool, but how do I add collision to the planks? I'm trying to make a bridge using this method, but the character just falls through.

  • @crazysmile11012
    @crazysmile11012 11 หลายเดือนก่อน

    making a track editor in game would be nice to use this realtime

  • @n41sd
    @n41sd ปีที่แล้ว +1

    Nice tutorial! I`m working in something like this, but multimesh for planks is new for me, one thing that I haven't had a solution so far if you can help me is that I would like to automatically place signs for curves (without placing it where it is straight road), how can I detect them? I needed to understand the size of the curve and if it is curved.

  • @liamkoehler8820
    @liamkoehler8820 ปีที่แล้ว +1

    Nice tutorial! What 'work'? is the CSG mesh doing? Would this method also work with a collection of 3D assets exported from, say, blender?
    Edit: I mean, you say 'Cubes' (for the tracks), but they are really squares. Does the path extrusion work if the model isn't 2 dimensional?

    • @crigz
      @crigz  ปีที่แล้ว

      The path extrusion only works with a 2d polygon unfortunately! You can't use it to build spline meshes like in unreal engine.

    • @liamkoehler8820
      @liamkoehler8820 ปีที่แล้ว +1

      @@crigz Thanks for the reply! Do you think the 2D extrusion is robust enough for most applications? It feels a little weird to me to make stuff directly in Godot.
      I suppose a proper spline-mesh system could be created as a plugin/addon.

    • @crigz
      @crigz  ปีที่แล้ว +1

      I think it will work great for anything which doesn't need its shape to vary along its length, like the roads and tracks in the vid.
      The benefit of doing it in Godot is how easy you can change and tweak things. A lesser known benefit of the CSG nodes though, is once you're happy with it in Godot you can export it as a GLTF file and polish the mesh up in blender.

  • @swiggitywave1436
    @swiggitywave1436 10 หลายเดือนก่อน

    Hey man, Really liked your video. Is there a way to remove the front and back face of the mesh being followed by the spline? I'm trying to generate a cave but I want the path to have a hole in the start and the end :)

  • @LevitskiSRGE
    @LevitskiSRGE ปีที่แล้ว

    would be nice tho have a different distribution according on how much changes are happening in the curvature. & having correct uvs at the same time. 😌
    sounds like a side project for a pr!

  • @bbom9197
    @bbom9197 ปีที่แล้ว

    Wow 😮😮❤❤❤

  • @SW-vy4he
    @SW-vy4he ปีที่แล้ว

    Subscribed. Cheers.

  • @rok_e
    @rok_e 7 หลายเดือนก่อน

    Hi! how to remove a cap of mesh? when the path is done.

  • @ajinkyax
    @ajinkyax ปีที่แล้ว

    what is the different between basis and transform position ?

  • @thefufuu3157
    @thefufuu3157 ปีที่แล้ว

    a way to change the rotation of the tiled polygon ? i have water material applied to the path but the oriantation is wrong and it tiles next to each other instead of into each other ?

  • @lemonking4076
    @lemonking4076 ปีที่แล้ว

    Amazing content!
    I noticed the label 3D's are always facing the editor camera at 4:50, how do you get the editor's camera? I tried scanning editor interface nodes and there are 3 cameras and no way of telling which one to use.

    • @schimmelspreu83
      @schimmelspreu83 ปีที่แล้ว +1

      Go on Flags and change Billboard(Disabled) to Billboard(Enabled)

  • @Barnaclebeard
    @Barnaclebeard ปีที่แล้ว +1

    Great subject and well covered. Using the names of solids like "cube" when you were actually talking about 2d shapes was confusing and a little upsetting.

  • @artisanmage5378
    @artisanmage5378 ปีที่แล้ว

    Is it possible to have custom meshes extruded like this? CSG polygon is cool but custom meshes could really allow more possibilities

  • @pythonxz
    @pythonxz 9 หลายเดือนก่อน

    I find the CSGPolygon node to be very frustrating to use. Anyone else?

  • @martinmajewski
    @martinmajewski ปีที่แล้ว

    👍

  • @DaveyGame
    @DaveyGame 3 หลายเดือนก่อน

    pls link project files i cannot get the rails to work for the life of me

  • @godofdream9112
    @godofdream9112 ปีที่แล้ว

    how to create terrain ? (easy beginers friendly method)

  • @sanketsbrush8790
    @sanketsbrush8790 ปีที่แล้ว

    this video is very informative & educational. But, using "value_changed" instead using "is_dirty" could be more easy to understand function of that variable.👍

  • @drac8854
    @drac8854 ปีที่แล้ว

    Video request: how to make never ending runner game world
    Like subway surprise.

  • @adammax9902
    @adammax9902 10 หลายเดือนก่อน +1

    ok how do i but the car on the track ?

  • @SULTANVIDEOGAMES
    @SULTANVIDEOGAMES ปีที่แล้ว +1

    @tool
    extends Path3D
    @export var distance_between_planks: float = 0.6:
    get:
    return distance_between_planks
    set(value):
    distance_between_planks = value

    if not is_inside_tree():
    await self.ready

    build_planks()
    func _ready() -> void:
    build_planks()
    func build_planks():
    var path_lenght: float = curve.get_baked_length()
    var planks_count: int = floor(path_lenght / distance_between_planks)
    var multimesh: MultiMesh = $MultiMeshInstance3D.multimesh

    multimesh.instance_count = planks_count

    for i in planks_count:
    var curve_distance: float = distance_between_planks * i
    var plank_position: Vector3 = curve.sample_baked(curve_distance)
    var plank_transform: = Transform3D(Basis(), plank_position).looking_at(curve.sample_baked(curve_distance + 0.1))

    multimesh.set_instance_transform(i, plank_transform)

    • @crigz
      @crigz  ปีที่แล้ว

      Looks good! Without curve_changed signal though the mesh instance wont update when you move the path around.

    • @hotindavid1623
      @hotindavid1623 11 หลายเดือนก่อน

      And with sample_baked_with_rotation ( float offset=0.0, ... )
      ? Check the API. Very usefull method