Search Unity

Unity Road System

Discussion in 'Works In Progress - Archive' started by atilah, Jul 19, 2016.

  1. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    We are working on some assets for a future game and would love some feedback on our "work in progress" road system. Mainly, the road system must be able to support very complex road networking in a very simple manner. The idea is to remain unassisted from third party software and be able to diagram in the unity editor. The road system must be able to provide several configuration parameters and various functions to aid a future AI that can use the network to simulate traffic.

    All the mesh is generated procedurally and basically the approach is to have an orientative set of bezier curves which "diagram" the road network to be rendered. The process of rendering must be very performant, and the resulting mesh must be very efficient in polygon count.

    Here you can see some of our first tests showing some intense calculation in various intersections, all solved procedurally, and quite performant. Please excuse the poor and simple textures and presentation, all textures can be replaced via the editor.

    Roads2.jpg
    Here you can see a complex 3 road intersection being generated on the fly.

    Roads3.jpg

    This is another test with a more complex network. This is probably unrealistic, but the idea is to strain the process and see results.

    Roads1.jpg
    Most curves are in very few steps for the test, but we have already included a process for smoothing and increasing resolution in this type of sections.

    Our brief feature roadmap goes as follows:
    Simple design with curves very complex road networks [Done]
    Road mesh procedurally generated [Done]
    Auto calculated intersections [Done]
    Customizable widths for road and sidewalk sections [Done]
    Customizable textures [Done]
    Bezier design of road/sidewalk sections [Done]
    Conform to terrain and other unity 3D objects [In progress]
    Roundabouts generated on the fly [In progress]
    Adapt the unity terrain to road [Aug 2016]
    Decals & sculpturing tools to add detail [Sept 2016]
    Possibly publish beta 0.7 [Sept 2016]
    Noise for bumpiness in road [Nov 2016]
    Grid node system for AI implementation [Nov 2016]

    Version 1.

    Finally, if there is some interest for this asset please express it as we may consider publishing.


    Chris
     
    Last edited: Aug 12, 2016
    Rombie, willemsenzo and Haagndaaz like this.
  2. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    This is precisely what I would like to have!
     
  3. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    I'm sure you've done your competition research already, but you might be up against some stiff competition from things like "easy roads" (on the front page of WIP at the moment also). What does your asset do that they don't?
     
  4. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    Dear friends, thanks for your interest.

    Also, thanks to @LeftyRighty, as yours is a very good question. Before answering your question please also let me remark our development is now in pre-alpha stage, and we still have some weeks to go to have a tested beta to consider including in the asset store.

    You are right, we've seen various products in the asset store and tested them individually, probably being "Easy Roads" one of the most complete ones. But despite this, we decided to develop our own asset due to the lack of certain characteristics we considered vital to our development process, which in no way pretends to diminish other products achievements.

    The main reasons for our course of action were:

    We couldn't have access to the source code in some of this products (eg. easy roads).

    Additionally we wanted the road network mesh to be fully procedural, and none of the other solutions we've tested solved properly intersections. For example Easy Roads V3 (I'm not considering V2 as it is mainly a looped circuit designer and roads simply overlap) intersections are predesigned and the author has included a tool to create "templates" for further create particular ones.

    Intersections are quite a challenge to be solved procedurally and I guess this is why this hasn't been done by other developers. In our development crossing roads is simply solved algorithmically, no need to create the intersections.

    Also, as we were thinking in very complex road networks upon our design, our product is aimed for performance. We are very serious in our process on poly counts and handling lods. Poly count increases to smoothen curves and decreases in straight sections, and as this is dynamic, if you define a camera, the roads level of detail varies with distance.

    On other notes, solutions as Easy Roads needs a terrain to be placed on while ours no, any mesh will do.
    We've also have set basis for an AI interaction with the road system, and various other features.

    The idea is to have a road network fast and felxible tool. We will post some video on our workflow to illustrate this process in the near future.

    If you request further info I'd be glad to extend myself.

    Chris
     
    Last edited: Jul 28, 2016
    one_one and willemsenzo like this.
  5. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    Thanks for the detailed explanation, I'd personally love to see how this tool looks when there are elevation differences (ie. not a flat road), making roads for uneven areas is such a pain and it would be amazing to be able to just lay down some curves and have it just 'work'

    Excited to see this progress! And I'd love to be able to try this out if you need testers :)
     
  6. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    Hi there !

    Roads4.png

    We've added height to our sidewalks with independent widths in the road system. Backface culling has been implemented so only relevant sides are drawn. We will be posting further info about this feature, as now we are working the intersections so to consider this extrusion.
     
  7. padmalcom

    padmalcom

    Joined:
    Oct 27, 2013
    Posts:
    8
    Hi atilah, very nice. Can you briefly explain how you create the intersection mesh?
     
  8. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    Very nice, but not enough roundabouts :)
     
    willemsenzo likes this.
  9. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    Would be great if the extrusion profile of the road could be defined by a Unity Animation Curve, that would make things real simple and powerful
     
    willemsenzo likes this.
  10. willemsenzo

    willemsenzo

    Joined:
    Nov 15, 2012
    Posts:
    585
    Thanks for this great suggestion! I've made a simple roadtool with splines and I was thinking how I could make a profile editor without writing an extensive UI for it. Currently I'm using game objects that define lines but the simplicity and elegance of your idea just amazes me. I've used Animation Curves for many things but this just didn't occur to me at all! It makes perfect sense to me.

    Don't mind me btw... Just lurking here and there and I just love procedural stuff.
     
  11. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    @willemsenzo Animation curves are one of my favorite features in Unity, especially when it comes to procedural things!
     
  12. willemsenzo

    willemsenzo

    Joined:
    Nov 15, 2012
    Posts:
    585
    They sure are the real deal. The best thing since sliced bread hehe.:p
     
  13. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    Of course, we work with shapes and clip of the differences. It's long to explain as it comprehends various steps in the process but the main idea is that we make a boolean operation with the mesh object and remove extras.
     
  14. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Looks interesting but conforming to mesh terrain (not unity terrain) or other mesh topologies is an important aspect of any road system. In addition to this, perhaps consider the kerb (sidewalk) and road to be controlled by an AnimationCurve type value so we can say ok it's bumpy here but smooths out over there or has a funky shape. Finally the road itself needs to be rather deformable: it might not be a road but a dirt path feathering alpha to 0, just thoughts!
     
    willemsenzo likes this.
  15. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    So are mine !!! We had thought of implementing this, but we will have to consider various issues. As intersections need to be performant and neat in design, the intersection of different shaped meshes is a complex thing to solve. We will have to look into this with detail before giving a positive answer, but we will surely try to give this a solution or a neat workaround.
     
  16. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    Thanks for your comment, we totally agree. As bumps, holes and various other details need to be included we will probably include a sculpting/decals tool to achieve this. We don't want to compromise the simplicity and performance in the diagramming of the road network.
     
  17. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    Cool, and thanks for commenting !
     
  18. willemsenzo

    willemsenzo

    Joined:
    Nov 15, 2012
    Posts:
    585
    You're welcome! I love to see what becomes of this. May I ask you what sources you use for inspiration? In particular when it comes to workflow. For example I get inspired by Simcity. I really like the way you create roads and how you can add new roads and remove them. Of course it has way less options, but the general workflow is something I enjoy while creating a map. I'm curious to know what inspires you if that's alright, and perhaps how that reflects in the product. To me it looks a bit like how CityEngine works, which is a neat tool but the workflow is a whole different story.
     
  19. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    Thanks for the support and... you are so correct !!! Simcity, City Skylines, and probably Esri CityEngine, all of them are under the hood !!! This idea (which we started for a project of a driving sim) was a fast way of prototyping and setting the base for a small city that is realistic enough to provide the experience of driving through it. Let me also mention road networking is the first phase. The idea is to provide various tools for infrastructure development (railway, buildings, etc.) with a more procedural + unityeditor approach. We will see, its going to be a lot of work, but we are a small team with the idea of moving our development labour into unity.
     
  20. willemsenzo

    willemsenzo

    Joined:
    Nov 15, 2012
    Posts:
    585
    Nice, those are some good sources for inspiration. I never tried City Skylines but if I'm correct it's similar to Simcity, and best thing of it that it's made with Unity. Did you by any chance also try Pixelactive Cityscape? I liked that workflow a lot more than CityEngine, too bad AutoDesk got its hands on it and development has been stopped. If you haven't heard of it before you might want to check some videos on youtube, just to get another different perspective. :)
     
  21. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    Now extruded sidewalks are properly calculated in intersections. Some props and a blue sky always help.

    Roads5.jpg
     
    Last edited: Jul 27, 2016
    carking1996, Rombie, orb and 3 others like this.
  22. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    Be sure sidewalks either have buildings/something on the other side, or they go smoothly to the terrain.
     
  23. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    Thanks for the recommendation. In the particular case of this picture, we've exaggerated a little the height (30cm) of the sidewalk to provide a better view of the extrusion. Usually this height would be half of this. As per @Haagndaaz recommendation we will try to include also some kind of bezier designer for the street and sidewalk profile which should allow further manipulation so to shape as desired. I will modify the starting post to include a list of features to be expected with a small roadmap. Thanks for showing interest, this summons more of our effort.
     
    one_one likes this.
  24. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    Looking forward to seeing how this turns out, I think you have the start of something wonderful here :)
     
    willemsenzo and atilah like this.
  25. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    We've improved our tool to include extrusion profiles as defined by an animation curve (in an x longitudinal axis), as suggested @Haagndaaz, @willemsenzo and @hippocoder (thanks guys!). Now the main road and both sidewalks can have individual extrusion profiles. This will allow for simple sidewalk detail and more advanced roadside texture implementation.

    As you can also see, the extrusion detail has been optimized and takes into consideration a "smoothness" level for mesh generation (ie. the left flat sidewalk has very little tris count compared to the right one)

    Roads6.png

    We're now in the process of finishing the roundabouts and modifying the crossroad generation due to the introduction of this extrusion profiles. We should have something like an alpha next week.

    We've also considered, as @hippocoder I think has suggested, a z axis extrusion profile. We are not shure if for bumpiness we could use something more practical, like noise, and maybe a deformation tool for particular effects. This will be revised in the near future.

    Hope you like it.

    Chris
     
    Last edited: Aug 12, 2016
    willemsenzo, one_one, orb and 2 others like this.
  26. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    Looks great! Would also be great to have an option to have the sides be mirrored, so only author one curve and have it applied to both side.

    Looking forward to trying this out someday!
     
  27. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    What many people tend to miss is curvature of sidewalk intersections. That was the reason I wrote my own generator several years ago:
    http://mn-solutions.net/div/intersection3.png
    (the small image zoom at the top)
    Do you intend to add that, too?
     
    atilah likes this.
  28. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    @Carpe-Denius, you are very kind to post and yours is a very keen observation. Yes, we will implement this. We are thinking on also allowing some params for this, as sometimes the small curve can also be a flat section (as if the end of the corner was chopped off). This will be done when we finish adjusting intersection handling, which is being done as I write !
     
  29. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Ok, nice. Even the first cityengine couldn't do that and it looks very "artificial".
     
  30. SyGem

    SyGem

    Joined:
    Apr 8, 2017
    Posts:
    17
    Any updates on this? Looks really nice. I have about 70km of roads that I am looking to replace, and complex intersections are a must have feature for me. That's why I ditched EasyRoads. Can you find out which roads are connected to an intersection? I need to be able to traverse the road graph to create things like traffic lanes.
     
  31. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    Dear @SyGem we've been working in another asset to finish and prepare it for production. We have set a goal to publish this before the end of August. Hope you can wait.
     
  32. SyGem

    SyGem

    Joined:
    Apr 8, 2017
    Posts:
    17
    OK, thanks. If you need any beta testers I'd be happy to help :).
     
  33. TrollAxeThrower

    TrollAxeThrower

    Joined:
    Dec 24, 2012
    Posts:
    16
    According to the wireframe, it seems like the mesh that connects the roads is extremely complex. You don't seem to put any textures on it anyways, but accurate UV mapping would be really hard to achieve in such a complex mesh.
    How is this asset coming up? We need something like that in our company. We tried "Easy road" which we can't change since it's not open source, and TruckBuildR which I had trouble integrating with. I started building one of my own, (using a "Unite" lecture from 2015 about procedural meshes) and intersection generation seems to be the hardest thing. We really need a lot of flexibility in regard to the number of lanes each road - that connects to the intersection - has. Did you happen to solve that problem?
     
  34. atilah

    atilah

    Joined:
    Mar 9, 2015
    Posts:
    29
    Dear @TrollAxeThrower, thanks for you question. We have discontinued working in Unity for the time being and moved to UE4. We developed other assets but never got any promotion from their side, and were seriously disapointed with their lack of support for developers. Sorry for this. BTW our approach was to look the system in a bi-dimensional way and project the third axis. The crossroads were resolved via this strategy and some clever ideas over the problem of UV mapping. We made this for a customer, and once finished we discontinued further work. Seems Unity is only pushing certain assets which in some cases are then bought into Unity or replaced. This is not a viable commercial strategy for us. Sorry for this.
     
    jlocke likes this.
  35. dibdab

    dibdab

    Joined:
    Jul 5, 2011
    Posts:
    976
    I was pretty enthusiastic for this too
     
  36. Moxid

    Moxid

    Joined:
    Jan 24, 2016
    Posts:
    51
    ;( this is what i am exactly needing. create a cross road at intersection(overlap)