I'm working on a 3D "city" building game in godot 4. I say "city" because it's the term used for the genre, you actually build a countryside - towns are included but in early 19th century Ireland, when the country peaked in population (around 8 Million), only three towns existed with a population > 50,000 (these being dublin, cork and belfast) so it is a fairly rural game, something most games in the genre don't focus on and I find it annoying.

Besides that I have been struggling with coming up with a system for building an organic road layout. The game will have maps already with houses roads and scattered villages (which I will be laying out myself) but the player would have to add to this with railways, more roads etc. I have considered using a trail system like used in the game Ostriv:
https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.rockpapershotgun.com%2Fhow-a-hermit-house-gets-built-in-ostriv
^ pictures in the above article show it a bit

the problem with this approach is that in 19th century famine pony and traps, wagons and horses were very common means of transportation and also they built a lot of roads - especially during the famine, though I wouldn't mind sacrificing a few things to be unrealistic.

Finally, I could use paths but I'm having trouble connecting them up together and generating custom meshes. I couldn't find any resources online about this. Also working with uneven heights is a pain.

I do have a camera system and system for translating 2d mouse positions into 3d.

  • xyz and Tomcat replied to this.
  • ToastersUnited I'll repeat what I said above. Make a planar 2D road network system based on tangential patching of simple linear segments and circular arcs. This makes managing connections/junctions/networks easy. To generate 3D geometry, offset/tesselate your lines/arcs in 2D and just project vertices orthogonally to the terrain mesh. Lines and circular arcs are trivial to tesselate. By patching a number of lines/arcs you can without problems construct roads that appear organic and curvy.

    ToastersUnited I found that instead of beziers, using only straight segments and circular arcs makes things much easier to handle in almost every respect. The engine prefers beziers because they are general purpose curves that cover a lot of use cases but they're not necessarily best option for everything. So you'll initially have to build a small api for dealing with segments and arcs. But once you have it in place making roads could be much less unwieldy than with beziers. Assembling paths, their parametrization and projection on meshes is trivial compared to beziers. And imho it looks nicer.

    Tomcat

    Ostriv is one of my favourite games of all time, it even inspired what I'm working on now.

    Also the plugin you mentioned does not have godot 4 support but thats the only problem - unless of course the roads with the funny north american road markings are the only option

      ToastersUnited Also the plugin you mentioned does not have godot 4 support

      Supports. Work on this is in progress.

      the funny north american road markings

      Road markings can always be changed, as well as the texture of the road — the principle of operation is important here.

      Ostriv is one of my favourite games of all time, it even inspired what I'm working on now.

      I assume that this development is being done at a very high level. The amount of work, the shown features - require serious qualification. The change of seasons in games is extremely rare - it is difficult to make it worthy.

        Here is the awesome video that will show you how to build roads, train tracks, tunnels and other meshes based on path:

          Skipperro
          yes I've done this before the problem is it doesn't cover junctions, and I don't want a janky inefficient node that handles bringing paths together, though could probably do something about making it work.

          Tomcat
          Well this project is very ambitious but I've always wanted to make this kind of game. I imagine I'll work on and off with it for a few years. I plan on making it open source anyway.

          Ah, I see, you want something like Sim City or Cities: Skylines, where you just say where the roads should be and it will turn into proper bends and crossings, right?

          That may be complicated. If you have some grid system, then it would be easier, just make all the different tiles and rules like if this road section is surrounded by other roads - it's crossing and you swap to crossing mesh.
          But if you have gridless map, then I'm sorry, I don't have the answer 😢

            Skipperro
            It doesn't need to turn into "bends and crossings" - there would be no road markings of course and also this isn't dublin, cross wherever you want.
            Also on the topic of grids I have considered switching to isometric but the main problem is that Ireland, like much of europe (in rural areas especially) roads are not uniform at all. Some examples on google earth:
            Farmers Bridge Co. Kerry
            Bridge over Carragh River on the National Secondary N70 Route between Glenbeigh and Killorglin
            Gallows Hill, Co. Clare

            • xyz replied to this.

              ToastersUnited I'll repeat what I said above. Make a planar 2D road network system based on tangential patching of simple linear segments and circular arcs. This makes managing connections/junctions/networks easy. To generate 3D geometry, offset/tesselate your lines/arcs in 2D and just project vertices orthogonally to the terrain mesh. Lines and circular arcs are trivial to tesselate. By patching a number of lines/arcs you can without problems construct roads that appear organic and curvy.

                Nice, this is a very helpful thread. I'm making a first-person game and I've come up with a crude method to make roads/tunnels from paths in Blender, but a fully automated method in Godot would be great. Collision shapes for raised roadbeds were the hardest thing to figure out in Blender (solved using shrinkwrap modifier with vertical-axis projection) so hopefully Godot can handle that.

                • xyz replied to this.

                  synthnostate Geometry nodes are probably the best tool to deal with roads in Blender