Search Unity

World Building EasyRoads3D v3 - the upcoming new road system

Discussion in 'Tools In Progress' started by raoul, Feb 19, 2014.

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    It looks like indeed tangent info is currently not yet calculated for crossings. I wil add that. Thanks again for reporting this!

    Raoul
     
  2. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    continuous_roading.png
    Hey Raoul! Now stop to make any more changes and release what you have. This
    white surface start to annoying me too ;-)

    It helps all of us to continue...

    Btw, I made a little test for runtime road. I set both road ends "pointing" to my workers.
    It was pleasant to follow how the road was always settled on every step what workers take.
    No errors whatsoever within 24 hour continuous re-roading...

    FPS counter: Running on my one VERY OLD computer and almost a full graphics settings. A good way to test is it the game playable with older machines.

    I'm surprised, that this is still playable with so little FPSes.
     
  3. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    No can't get rid of them!
    Can I delete them manually or something?
    Thanks
    G.
     
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi JOKaija

    Uhm, I am not entirely sure how to take this especially with the ending ;-)? Are you referring to something specifically discussed in recent posts?

    Otherwise, what we have now in v3 is already released in the betas you are using, releasing it means the release will match the current beta. It is only being improved and some additional new crossing features are added of which one is about ready.

    Do you mean your request of adding the editor option "Hide white surfaces" to the runtime API? That option is available in the next Beta. Your recent API requests are also additional things to implement or do you want me to wait with that as well until the final release?

    But if you want I can send you an alpha build of the next beta release. I can send it already to you but I am about to prepare a build anyway for those who like to try the new bending option for T crossings. It needs some optimizations but it is functional.

    Glad to hear the runtime functionality is working well for you.

    Yes, unless the road is quite long creating the road should be relatively fast. I also experimented with continuously updating a road, like a never ending road. That also works relatively well but will probably not work very well on slower devices.

    Thanks,
    Raoul
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Earlier today I tested this in the development project. I just tested this again in another project with the current 6.5 beta imported:

    1. I created a new side object.
    2. with this new side object selected I clicked "Delete"
    3. The confirmation dialog appears saying the side object is being used on road objects (this is wrong and is fixed in the next update).
    4. I click "Yes" to confirm that I want to delete the side object anyway

    The side object is no longer listed in the side object dropdown.

    Is this indeed what you doing and what is not working for you? Do you get error messages? Or are the side objects not removed from the roads? This should also work fine but in any case, these objects are child objects of the specific road in the hierarchy, that is were you can remove them manually.

    Thanks,
    Raoul
     
  6. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    That was the correct sentence :cool:
     
  7. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    1. ok
    2. ok
    3. ok
    4. ok

    Side object is still there!

    This is now Side Object 27 - I have tried so many times. lol

    There is an error - should have noticed b4 sorry...

    NullReferenceException: Object reference not set to an instance of an object
    EasyRoads3Dv3.OQDODDCCQD.OQQDDOOCOO (EasyRoads3Dv3.ERModularBase scr, EasyRoads3Dv3.SideObject so)
    EasyRoads3Dv3Editor.ERSideObjectsManager.OnGUI (EasyRoads3Dv3.ERModularBase scr, EasyRoads3Dv3Editor.ODQDCOODQQ eScr)
    EasyRoads3Dv3Editor.ODQDCOODQQ.OnInspectorGUI ()
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1150)
    UnityEditor.DockArea:OnGUI()
     
  8. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Raoul another thing...

    On side objects eg. trees on long roads where there are many trees, if you use Combine Objects unity will throw an error and trees are not rendered. Error is due to there being too many vertices over 65k etc.
    Perhaps you can put a check in there somewhere to avoid this.
    rgds
    G.
     
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Jari,

    Ok, tomorrow morning I will send you a new version. The new crossing option I have been working on affected the code for generating roads that's why I didn't create an update for you yet. This should work fine now as you are mainly using the runtime API which doesn't include crossings yet.

    For those who like to try the new bending option for T Crossings, a test version will be available shortly. It is functional but needs more optimization and I have to finish some other small updates like terrain backup and restore options which will be active in the next beta.

    Thanks,
    Raoul
     
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Gus,

    Yes, that explains why the side object isn't deleted.

    I had a look at the error, it occurs in the part where this particular side object is removed from road types and road objects.

    Tomorrow I will send you an update which will output more info. You will also be able to try the new bending option you were asking about earlier this week.

    Thanks,
    Raoul
     
  11. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    If the error is related to the Combine option, this is actually most likely a warning thrown by EasyRoads3D itself because the generated mesh exceeds the maximum allowed number of vertices for a Mesh (65.000 in Unity).

    One thing on the list is to optimize this and split the mesh in multiple objects when this happens. But in general you may want to be carefull with this anyway. 65.000 for a mesh is a lot, certainly when it involves multiple objects.

    Especially for trees it is not recommended to use the Combine option. Instead add the tree as a tree prototype to your terrain if this is not already done and assign this particular terrain tree prototype from the Terrain Vegetation dropdown in the Side Objects Manager to the specific side object. In Build Mode these trees will be added to the terrain object.

    If you are using SpeedTree trees you probably also don't want to use the Combine option as it will deactivate the speedtree LOD groups functionality.

    Thanks,
    Raoul
     
  12. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Raoul, If you have time, could you also include:
    Thanks pal.
    G.
     
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Gus,

    I will add a temporary solution in the custom build so you can adjust the road network to your new terrain position. A final built-in solution does need more thought/time as being able to change the road network positon can potentially turn into a big problem with the road network no longer matching the terrain if the previous position was not the default (0, 0, 0) position. In the final implementation Road Network position and marker / crossing postions bust be in synch to avoid that but I will need more time for that.

    But I belief you only need to change the Y position at this moment? I will add an option that will update all affected road network data according a specific Y change.

    Thanks,
    Raoul
     
  14. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    This is great thanks.
    G.
     
  15. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    More to think of:

    If I add only one road piece. Vectored as: Pointed1 -> Pointed2

    The road material stays what I set earlier to roadNetwork/roadType/road.

    BUT!

    If I add more than two points for road, like: Point1 -> Point2 -> Point3;

    Runtime resets material to null!

    Right now I have to use this:

    It seems to be an only way to hold material settings on inspector&visible road. But, I know, when I have a huge list of roads and I loop them throught like this (what I'm forced to use now):

    Code (CSharp):
    1. void LateUpdate ()
    2.     {
    3.         foreach (_road rd in _roadMain)
    4.         {
    5.             setRoadMaterial(rd.roadName, rd.roadMaterial);
    6.         }
    7.     }
    8.  
    9.     public void setRoadMaterial(string roadName, Material material)
    10.     {
    11.         if (GameObject.Find(roadName) != null)
    12.         {
    13.             GameObject.Find(roadName).gameObject.GetComponent<MeshRenderer>().material = material;
    14.         }
    15.     }
    I will use alot processor resources for nothing...

    Any idea?

    btw. I had same kind of problem with Editor too. Seems that ER won't keep the material what I select for the road. Sometimes it does, sometimes not.

    EDIT:

    And right now it works again as it should be. Can't figure out, what is the problem....

     
    Last edited: May 24, 2015
  16. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,080
    When we upgrade form V2 to V3 will we lose previous roads? or we can continue editing V2 roads on Easy Road3?
     
  17. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    176
    I'm looking at how I get a nice blend of the road texture to the terrain texture in V3 Beta 6.5?
    I added a dirt road and the blend is not very nice, there is a very clear line that can be seen where the dirt road texture alpha doesn't fade out entirely. This leaves a perfect straight line and the dirt road looking like a texture overlayed on another texture. Is there a process/workflow to making this blend better somewhere inside EasyRoads or do I just need to make my own texture with a nicer alpha blend?

    upload_2015-5-25_2-53-10.png
     
  18. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    I think I could use something like this, too. I have a road that I want to "hover" a fixed distance above the terrain. (I don't want to raise the terrain.) Unless this is already possible, consider my hat in the ring for a y-adjustment feature.
     
  19. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    You can make roads as "bridge segment" this will not deform terrrain, I use this to create tunnels inside terrain.
     

    Attached Files:

  20. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    That's true, but I'd have to do that for every segment. Maybe a default switch on the Road Object settings pane is all that's needed.
     
    Last edited: May 25, 2015
  21. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    When lightmapping, most of the road meshes get lightmapped just fine, but a few do not. I can't figure out the difference between the two groups. Below is the console log warning. Is there anything I can do?

    Secondary UV set on Default X Crossing00001 is incorrect. Lightmapper needs UVs inside the [0,1]x[0,1] range. Skipping this mesh...
    Choose the 'Generate Lightmap UVs' option in the Mesh Import Settings or provide proper UVs for lightmapping from your 3D modelling app.
    UnityEditor.DockArea:OnGUI()
     
  22. armspecial

    armspecial

    Joined:
    Oct 28, 2014
    Posts:
    4
    Hi. please if you can make it like Road Architect with ready bridges, roads 2 ,4 ways and if you use it, you will see, that you can connect to road system very easily.
     
  23. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    First of all, sorry guys! For some reason I didn't receive any notification emails this week related to new posts on this thread...

    Raoul
     
  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Jari,

    Road objects inherit the road type settings, including the material, from crossing connections. I know this is not related to your situation but this means that changing the material using ...GetComponent<MeshRenderer>().material = material; will be overwritten after road changes through the API.

    Road.SetMaterial(Material value), is an API option but I see it is not yet fully implemented. I will finish that.

    Thanks,
    Raoul
     
  25. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi ksam2,

    Currently there is no upgrade option yet for v2 roads. If there is demand for that I can add that. For roads only this is relatively easy. The runtime API (which also works in the Unity editor) could even be used for that.

    If this is indeed roads only, I can create a script for this. This will be a little bit more complicated and this will require more time when side objects are involved because this system has changed a lot in v3.

    Thanks,
    Raoul
     
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Hi catflink,

    This was actually also reported yesterday by email with the fix kindly included (updated in the next beta).

    You can fix this yourself meanwhile. Please open /Assets/EasyRoads3D/shaders/EasyRoads3D-Alpha-Diffuse.shader

    and change:

    #pragma surface surf Lambert alpha

    to

    #pragma surface surf Lambert alpha:blend

    That should fix this, otherwise please let me know.

    Thaks,
    Raoul
     
    catfink likes this.
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Marble,

    I can send the update I sent to gibmation to you if you want but it will raise every single object in the road network.

    It looks like you are looking for a "Raise" option for a specific road only? Or the selected of markers?

    At this moment I have to be careful the Inspector doesn't get too cluttered with options. I will see if that can be added. I belief changing marker positions is not yet part of the runtime API but for sure it has been requested and will soon be available. So regardless whether this will be implemented you will be able to add this sort of functionality and all sorts of other additional road editing functions yourself as well.

    Thanks,
    Raoul
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Dave,

    It is hard to tell what goes wrong without being able to look at it. The uv2 coords should all be within 0..1, I would probably output the UV coords just to double check. Is it possible to have a look at these specific roads? Could you email me in that case?

    Thanks,
    Raoul
     
  29. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi armspecial,

    More bridge presets will follow.

    Also, more road type presets and corresponding crossings will follow but all the tools are already there so you can customize the road system exactly to what you need and maximize the productivity.

    The first sections of the manual explain the recommended workflow:

    1. Prepare your road types (2 way, 4 ways roads), General Settings > Road Types
    2. Prepare your dynamic crossings accordingly, General Settings > Crossing Connection Prefabs

    See the manual and videos on the first page of this thread for more.

    You can now instantly use these road types and crossings in the scene without having to change road/crossing settings every single time for each road and crossing.

    Please let me know if you have more questions related to this.

    Thanks,
    Raoul
     
  30. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Did you ever decide what you was going to do with the river tool in v2? Will this eventually get added to v3 or as a separate product? I just started working on my project again and started playing around with it but then figured I should ask before I get too attached.. lol
     
  31. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Shawn67,

    You can simulate the v2 river tool using side objects in v3. The main demo scene includes an example. This way you actually have better control over the river bed shape / terrain deformation compared to v2. The only thing not yet possible is adding variation to the width per marker. That will be possible in a future update, for now you can add variation manually to the river bed.

    Thanks,
    Raoul
     
    BackwoodsGaming likes this.
  32. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Cool.. It looks like I haven't received a beta email since 3.0 beta 5 back in January. Am I still on your list or should I send you another email? I'm assuming there may have been a couple new betas since then... heh
     
  33. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    I understand. Either way sounds good. I do actually want to raise all road markers, but I can just attach a script that raises the road parent at runtime for now, right? There are a lot of them and they all have mesh colliders, so eventually a design-time solution would be best, but I know there are higher priorities (so to speak!).
     
    Last edited: May 29, 2015
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    That is right, many people were not receiving the beta update emails with the new downoad link. That is why the download link has remained the same since beta 5. New betas are announced on our website and in this thread.

    Thanks,
    Raoul
     
    BackwoodsGaming likes this.
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    The position for road objects are locked but this is indeed inside the editor when creating the road network. As soon as you Finalize the road network or indeed at runtime you can raise the roads.

    Do you need it urgently? Raising the road is fairly easy to implement, I can send you a custom script if you want. Otherwise, selecting multiple markers is on the To Do list. I guess that will also do what you need?

    Thanks,
    Raoul
     
  36. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    Not urgent. I'll bug you if it ever gets that way, but I've no need to distract you for now. Thanks!
     
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ok, in any case, GetMarkerPosition() and SetMarkerPosition() have been added to the runtime API. So in the next beta you can do this sort of thing using the API anyway.

    Thanks,
    Raoul
     
  38. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hi Raoul,
    Is General Setting/Terrain Management/Tree Distance & Detail Distance working and if so how are values used?

    Thanks

    Gus
     
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Gus,

    General Setting/Terrain Management/Tree Distance & Detail Distance should be functional (I just double checked). The values represent the distance (in Unity units) from both sides of the road. Trees and detail objects inside this distance should be removed. For value 0 only trees / detail objects on the road are removed.

    Removing detail objects needs a small adjustment but when using a minimum value of 1 or 2 the road should be clear.

    Thanks,
    Raoul
     
  40. piercew102

    piercew102

    Joined:
    Dec 24, 2012
    Posts:
    9
    Hi Raoul,

    I'm working on a project that uses procedural noise to generate terrain. I'm interested in v3's API for generating rivers at runtime, but I wasn't sure if the runtime functionality only worked with roads. Either way the tool looks awesome, just making sure it's what I'm looking for.

    Thanks,
    Pierce
     
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Pierce,

    In v3 rivers can be created using side objects.

    Side objects is not fully supported in the runtime API yet, but you can assign side objects to road types in the editor, you can set road types as side objects only, and in the runtime API you will have access to all available road types.

    So it looks like generating rivers at runtime could already work. It is late in the evening over here in Europe, I will do some tests tomorrow.

    Thanks,
    Raoul
     
    BackwoodsGaming likes this.
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I just checked this, rivers can indeed be added at runtime following the steps in my previous post.

    The only thing that may need attention is the terrain deformation. The generated riverbed object and river surface object match. Due to the grid based nature of the Unity terrain object this can result in a gap between the river surface and the terrain at the start and end. What is needed to deal with this is the side object Start / End Offset option also available in the editor. By using offsets slightly bigger than the terrains heightmapscale on the river bed object, the river surface will nicely match the terrain at the start and end.

    Let me know if you decide to give this a try, I will already add this option to the API in that case.

    Thanks,
    Raoul
     
    BackwoodsGaming likes this.
  43. piercew102

    piercew102

    Joined:
    Dec 24, 2012
    Posts:
    9
    Thanks Raoul,

    I'll keep following the project :)
    Keep up the good work!
     
    raoul likes this.
  44. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    Are you informed about this with WebGL?

    IL2CPP error for method 'System.Void EasyRoads3Dv3.ODQCQQQDCQ::.cctor()' in assembly 'C:\Users\Jari\Documents\Unity5 Projects\The Colonizers\Temp\StagingArea\Data\Managed\EasyRoads3Dv3.dll'
    Additional information: Build a development build for more information. Attempting to create array of rank > 3
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
  46. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    While compiling (building) Project to WebGL. It seems, there is something thread or dynamic code generation problems, when IL2CPP tries convert C# files to C++ files, since next stage C++ to Java conversion can't handle them.

    Just wild guess...

    (I will test same source with Development build enabled tomorrow. Maybe it tells a little more...)
     
  47. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hey there, now coming very close to using v3 in a proper project and was hoping/wondering waypoint generation was in. If so, could you provide details on the format and generation process of these, prticularly regarding crossroads. The AI system im looking to use has it so waypoints are numbered sequentially with no two numbers repeated, they be placed with regard to the direction of traffic and crossroad waypoints be tagged and numbered particularly. If it hasnt made it in yet but some guidance as to how I can get this working myself be given ill be very grateful, thankyou
     
  48. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Jari,

    After fixing the intial errors with WebGL builds I do now also get this error. I will look into that.

    I am also looking into the problems for Windows Store builds at the moment. That should work in the next beta.

    Thanks,
    Raoul
     
    Last edited: Jun 3, 2015
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Lazygunn,

    At the moment v3 is primarily a road geometry creation tool. You can create road types, your own dynamic and custom crossings but it doesn't tell much about the road characteristics, 2 lane, 4 lane, lane direction etc.

    Currently markers can be exported as waypoints. Expanding this has been discussed before in this thread and I started looking into expanding this by including the option to add markers set to "Waypoint" for more detail. I ran into some issues with this and the person who asked about it didn't have "Start Conversation" switched on, neither did he get back on this, so I left this for now.

    At this stage including a full AI system is not on the list, there are indeed packages available for that but I certainly do want to make it easier to build the waypoint system for these packages using the road data.

    I did make some notes regarding this a while ago:
    - add an option for road types to define lanes and lane directions
    - add a new interface for crossings where you can make connections between the lanes defined for the road types associated with these crossing connections so this can be resued within the road network, if that makes sense?

    But this has to be worked out further. If you have suggestions, please let me know.

    For roads, perhaps this is also something to include in the API so you can generate and name the waypoints the way you want inside the editor?

    At the moment getting v3 out has priority but if there are any specific wishes regarding this, please let me know.

    Thanks,
    Raoul
     
  50. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hey raoul thank you for your reply it's much appreciated. I don't think the waypoints as I need them would be too hard to implement if they were simply extra information attached to markers - the current format is simply that the waypoints are numbered sequentially with no two numbers being the same, and sequences of numbers along a road be ordered in one direction along the road - 'handedness' can be decided by the ai itself, so the sequence can be in either direction. Some form of visualisation , like a gizmo or something on the waypoint would be helpful. Naturally the ability to add extra information to a waypoint however gracefully for now would be appreciated too, examples being speed limits and a possible index for ai-defined items of interest such as traffic lights.

    Exposing the underlying spline data for a road and providing an api for getting an offset to the spline for easily generating lane positions, finding the closest point on a spline from some position and so on would also be extremely useful and I'm not sure if too hard.

    I would be happy to test the hell out of an arrangement like this, and while I appreciate that you wish to finalize the release of v3 soon, implementation of this will enjoy heavy testing and feedback should you find the proposal agreeable. I don't know how much work the above involves, it doesn't strike me as too much, you're certainly not expected to write an ai yourself, but the additions I mention would be extremely useful and get the ai I'm working with, working quite nicely with easyroads. I can go into further details for crossroads if need be

    I suppose further down the process, being able to place markers and connecting splines without actually laying roads to guide ai while still using the easyroads system where a road surface is already defined - typically when using systems like cityengine or ghosttown for 3ds max
     
    Last edited: Jun 3, 2015