Search Unity

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. forzabo

    forzabo

    Joined:
    Aug 28, 2015
    Posts:
    64
    Ok -- so I think a big part of my problem with issue #1 is that the mesh was being imported with convert units being inadvertently selected such that the mesh was getting imported at a ridiculously small scale.

    So ... yay -- got my custom crossing to work!

    And now I finally understand how to get custom road shapes (like rails) to work. It was not intuitive to me that the crossing creator widget actually creates custom roads too. I get it now, it works... cool.

    Ok, so, now I'm hitting a new problem; I've created a new mesh for the crossing item and imported it; it all works fine but when I place an instance I'm getting this error:

    Mesh has a clean uv map created in Maya... I'm not sure where to look.

    TIA,

    --Bo
     
  2. o1o101

    o1o101

    Joined:
    Jan 19, 2014
    Posts:
    639
    upload_2019-9-3_18-4-31.png Hi, After placing a custom intersection prefab, I can't seem to change the angle of the road directly after the intersection, it gives me this big long curve (red line), when I want something a bit sharper like the blue line. I tried rotating this selected point which connects to the intersection, but it seems to be completely ignored, along with any other curve/rotation/spline settings.

    upload_2019-9-3_17-51-13.png

    I also tried adding a point here, but as you can see it ignored, it seems the the connection prefab forces the roads curve to be level with the connection prefab for about 10 units.
    View attachment 477914

    The only was I am able to change that curve is by rotating the actual connection prefab which needs to be flat.
    Is there anyway to make this curve more sharp while keeping the connection prefab level?

    Cheers
     
    Last edited: Sep 4, 2019
  3. raoul

    raoul

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

    Glad to hear that

    Apart from creating unique road networks based on your own crossing / connection prefabs, the purpose of the Custom Prefab Editor window is exactly that. Roads extruded from the defined connections will inherit the exact same shape.

    Is this another mesh, what does it look like? Can we test it?

    Thanks,
    Raoul
     
    forzabo likes this.
  4. raoul

    raoul

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

    Indeed the road will follow the orientation of the custom intersection prefab. This is currently not adjustable. What is the terrain size and heightmap resolution? Or, how far do these white surfaces (General Settings > Scene Settings > Hide White Surfaces) extend on the intersection?

    I belief the start shape of the road depends on the terrains heightmapscale and the orientation of the intersection prefab. I will have a look and see if this can be optimized but abrupt height direction changes of a road are not ideal for adjusting the terrain.

    Perhaps an alternative is to rotate the intersection prefab a little bit so it points more downwards at that connection?

    Thanks,
    Raoul
     
  5. o1o101

    o1o101

    Joined:
    Jan 19, 2014
    Posts:
    639
    Hey!

    My terrain heightmap res is 1025*1025, the size of the terrain is 2x2km.

    Yea, slightly rotating the intersection is what I have been doing, but unfortunately to get any significant result it ends up looking very strange, as well as

    There is several places on my map where this has become tricky for me, Is there any way to reduce the the distance that it follows the orientation of the custom intersection? Or maybe having it ignore completely. I am fine with changing a couple lines of code if needed.

    I don't think terrain deformation will be an issue, as I am able to create the curve I want when not connected to the intersection, and upon building it causes no deformation issues. The purple checkmark is the road while not being attached to the connection prefab, and the red X is the road that is attached to the connection prefab (and that is with the slight rotation, its even worse when not rotated.)

    upload_2019-9-4_4-5-6.png




    Thanks again for the support.
     
  6. forzabo

    forzabo

    Joined:
    Aug 28, 2015
    Posts:
    64
    Screen Shot 2019-09-04 at 8.27.20 AM.png
    attached ...
     

    Attached Files:

  7. raoul

    raoul

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

    There are a couple of things involved that all affect the shape of the road at the connection with the intersection resulting in the two different situations:

    1) Terrain Deformation. For optimal results the road must follow the orientation of the intersection over a distance at least equal to the Minimum required indent value (General Settings > Scene Settings). If you really want the road to go down at the start and ignore this, then there is a way to do that by forcing the Min Indent values to be lower then required. I won't post it here because it is not recommended to do this, but I can send this to you.

    2) A smooth spline curve between the intersection and the road. An invisible control point is used for this. The general Curve Strength slider in the Inspector for the first marker can be used to adjust the strength. Have you tried that?

    3) Additional curve smoothing required for a natural transition between the intersection and the general road shape. This is what is causing the marker on the left road to appear below the road. That marker is not really at a realistic position relative to the intersection position (the matching marker on the other road is not at a similar position). Without this automatic smoothing feature the connection between the road and the intersection will generally not look optimal requiring more work tweaking the marker positions to get the desired shape at the intersection connection. What could be added as an additional control is a slider that makes this additional smoothing customizable.

    Thanks,
    Raoul
     
  8. raoul

    raoul

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

    The attached fbx looks like the crossing on the left in your image. With the correct scaling, it imports fine into the system on our end

    xing.jpg

    Thanks,
    Raoul
     
    forzabo likes this.
  9. forzabo

    forzabo

    Joined:
    Aug 28, 2015
    Posts:
    64
    Thanks Raoul --

    Yeah, it works for me too, it just was throwing those error messages every time I placed an instance.

    But anyway, onward and upward. I feel like I have enough confidence to get back to my actual project, with actual production assets and everything. And things are going fine -- I've got my basic crossings set up and the roads that they connect too -- except... every time I place an instance of one of my custom crossings, it works, but it throws this error. Sorry, long stack trace:

    It seems to be just a GUI error -- the crossings work fine otherwise...
     
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    No errors are thrown on our end when placing an instance.

    For this model too the scaling had to be adjusted. What is your scaling and what are the exact steps you take to create the prefab in the Custom Prefab Editor window? Or can you email the generated prefab in /Assets/EasyRoads3D/Resources/custom prefabs/ so we can check the error?

    Thanks,
    Raoul
     
  11. DonkeyPotato

    DonkeyPotato

    Joined:
    Mar 23, 2018
    Posts:
    28
    re: the backup prompt - after choosing 'no' my scene file size has shrunk by an order of magnitude and save times are instant again, so it does appear to affect the edit/build mode backup as well.

    For the scene 'dirty' flag, even if I save, while the road network is selected, it constantly gets marked dirty. I do have a custom editor base class that forces use of ReorderableList for all lists in the editor. I'll try disabling that and see if there's an interaction there that's causing the behavior. It does occasionally cause some weirdness.

    The other thing that's worth noting, is that I have the EasyRoads3D files relocated to a subdirectory because I don't want my 'Assets' directory polluted with every asset package I download. Maybe there's a hard-coded full path that's not being found and causing bad behavior?

    Update: Custom editor has no affect. Also tested in an empty project, no path modifications, and I get the same behavior.
     
    Last edited: Sep 4, 2019
  12. forzabo

    forzabo

    Joined:
    Aug 28, 2015
    Posts:
    64
    Hi Raoul -- both of these prefabs in the attached zip generate the same error when instanced using the crossroads placing tool...
     

    Attached Files:

  13. o1o101

    o1o101

    Joined:
    Jan 19, 2014
    Posts:
    639
    Hi Raoul,

    For # 2, I have tried selecting the marker that connects to the intersection and modify all the curve values but they seem to be completely overwritten by following the intersection.

    For # 3,I manually moved that marker much lower as an attempt to force the curve with no luck, if I move it to a more natural position it’s the same result, I’ve tried moving it all around but again it seems to be overwritten by following the intersection.

    For # 1, This sounds like it could be the solution, so from my understanding the intersection uses the indent value as a guideline for the distance that the road follows the intersection? Is there a way I can lower this or greatly reduce it without changing my actual indent settings for terrain deformation? (shoot me a PM if preferred)

    Cheers!
     
  14. raoul

    raoul

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

    I just double checked this by starting a new scene and dropping an existing terrain in the scene. After that I added a new road network object. This will chgeck for terrains in the scene, when a terrain object is found that does not yet havce the ERTerrain component attached it will show the dialog box asking to backup the terrain.I selected "No" saved the scene and checked the scene size. Then I removed the ERTerrain component and selected the road network object, again it showed the dialog box, this time I selected "Yes". The backup is created outside the assets folder, the scene file is exactly the same size. I am not sure how to recreate your situation?


    Like mentioned before, this can happen in Unity 2018.2 and previous versions. Please let me know if you feel there is more EasyRoads3D related here. It doesn't show the "scene has changed" on our end after selecting the road network.

    Changing the directory should be fine, I cannot see how this affects scene file sizes and scenes getting marked as changed.

    Thanks,
    Raoul
     
  15. raoul

    raoul

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

    The prefab you first send is called xing.fbx. I was under the impression this is the one that is causing problems? The prefabs in the new zip are called "basic_intersection" and ''street_4way". I do not have the original fbx models used to create these prefabs so I cannot test them. If these are the two prefabs that cause problem, can you please also send the required fbx files.

    Thanks,
    Raoul
     
    forzabo likes this.
  16. raoul

    raoul

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

    I would think there will at least be a slight difference when selecting marker 1 and set Curve Strength all the way to the left, value 0. If that is not the case, it means that the additional smoothing overwrites it.

    This too is a result of the additional smoothing.

    I think it is a combination of 1 and 3 where 3 is the safest solution. I will prepare a build with options to adjust the additional smoothing. Which version of Unity do you use?

    Thanks,
    Raoul
     
  17. forzabo

    forzabo

    Joined:
    Aug 28, 2015
    Posts:
    64
    Hi Raoul -- I was getting so many weird errors I figured something must've gotten corrupted so I ended up deleting Easy Roads from my project, inc the folder that sits outside of assets, trashing the library, and reimporting the whole shebang. So far, so good.
     
    raoul likes this.
  18. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    I see exactly the same error in my project and have for quite some time now. V3.2 beta. Things had been working nicely, but now I can no longer add new roads and connect to my existing network. If I add a new road, it won't connect, if I drag a road out from an existing road, it a) immediately disconnects from the source road and b) won't allow me to drop a control point for the other end of the road. When I do drop it with shift-click, any other operation I attempt (and I mean _any_ not just ER3D operations) results in the marker becoming un-attached and following my cursor around. I suspect something has become corrupted, but I'm not sure what.
     
  19. DSamson

    DSamson

    Joined:
    Dec 17, 2015
    Posts:
    1
    Hi, Can you tell more clearly about generating waypoints
     
  20. raoul

    raoul

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

    Which exact same error do you see that forzabo reported? I am not sure if Forzabo is using the v3.2 beta and his questions were custom prefab related, importing models in the system. Is your situation related to the same or v3.2 Flex Connectors? Do you get error messages? Roads can disconnect when there are road type specific changes resulting in the road no longer matching the crossing connection. Could that be involved?

    If you want you can email the scene so we can look at it.

    Thanks,
    Raoul
     
  21. raoul

    raoul

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

    There are two ways to create waypoints, through the scripting API (coding involved) or through the side objects system (no coding involved). Also with v3.2 in mind with the option to define lane info for road types for both roads and crossings, what exactly do you need?

    Thanks,
    Raoul
     
    Last edited: Sep 5, 2019
  22. PhilipZelic

    PhilipZelic

    Joined:
    Aug 7, 2019
    Posts:
    2
    Hi Raoul,

    I am looking to render a scene in gameView to have the side objects of the road but without the actual mesh of the road. Is it possible to create a road like this and how? I will put the image into attachment as a reference. I can achieve this in the editor but in the gameView everything disappears. On the side note do you have any idea to render the grid from the editor to gameView. I want to achieve the image from the editor to be rendered like that in gameView. Thank you for any help. Cheers.

    The first image is from the editor and the goal to have in the visualization, and second image is the current view when I turn off Mesh Render.

    road.png roads2.png
     
  23. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    Sorry, didn't notice the error didn't get included in the quoted message. It's the "ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection" errors. I'll try to get an export of my scene tonight that I can email, along with the video I did of the road issue. The video covers specifically attempting to drag a new road out from an existing road, so, yes, using the 3.2 flex connectors. I felt it was relevant to post since I'm seeing the same errors (at least superficially) as @forzabo , even though I'm not using custom prefabs for connectors. I think, but can't be 100% sure, that I also saw those errors with 3.1.

    I will say that everything has been working great up until a short time ago when after I attempted to pull a new road out of an existing road when I started to see the issue of being unable to place the end (second) marker, after which, even though I exited Unity editor without saving the scene, I've been unable to connect roads, which is why I wonder if there might be some sort of corruption. Possibly relevant (you'll see when I email the scene), I have several side-objects defined on the road that initially displayed the problem.
     
  24. swnc

    swnc

    Joined:
    Aug 3, 2018
    Posts:
    35
    Hi Raoul,

    I want to be able to change start/end decal for a road type at runtime via scripting API, is it possible?

    Best,
    swnc
     
  25. raoul

    raoul

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

    Do you need the road mesh but just not render it, or do you not need a road mesh at all?

    The first situation can be achieved by disabling the Mesh Renderer component on the road in the Inspector.

    If no road object is required at all, then you can create a new object and mark it as Side Object before creating it. With that setup no road mesh will be created, instead the required side objects can be activated for this new object.

    I guess something similar as the Scene View grid must be done, drawing lines using Unity built-in options or an asset store tool that can do this.

    Thanks,
    Raoul
     
  26. raoul

    raoul

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

    I belief the issue forzabo specifically had was with adding new instances of custom connection prefabs based on his imported models. So that indeed seems a different situation then v3.2 Flex Connectors.

    First thing to check with the new v3.2 Flex Connectors is the road type status for the involved roads. Flex Connectors do require a road type setup.

    Indeed being able to look at a scene where this happens would be very much appreciated.

    Thanks,
    Raoul
     
  27. raoul

    raoul

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

    That is currently not possible through the scripting API yet. But it could be done by replacing the respective decal child object for that road using the same transform position and rotation. I will make a note though and see if this is easy to add for the next update.

    Thanks,
    Raoul
     
    swnc likes this.
  28. PhilipZelic

    PhilipZelic

    Joined:
    Aug 7, 2019
    Posts:
    2
    I need just lane lines and side objects without road mesh to optimize resources. I have disabled MeshRenderer but it also disables the SideObjects in the gameView.
     
  29. swnc

    swnc

    Joined:
    Aug 3, 2018
    Posts:
    35
    Hi Raoul,

    thank you! I have an issue that I am facing right now:
    upload_2019-9-5_15-55-4.png

    I have created this decal game object (it is a plane with same direction arrow material attached to it) but somehow it rotates the decal object 180 degrees on the end. I can fix it by subtracting 180 from the rotation but I was wondering if there is a reason for this? And It would be really nice if we can give start and end offsets for the decals.

    Best,
    swnc
     
    Last edited: Sep 5, 2019
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    The side objects are separate objects added as childs to the road object, they should be visible. Did you disable the MeshRenderer component or the road object itself?

    Thanks,
    Raoul
     
  31. raoul

    raoul

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

    In your case you may want the orientation to be the same but the reason why the Start End decal system was added is to deal with road type transitions and hiding seams. In that situation the current setup will work better.

    I will make a note to add an option to control the orientation and also the offset although that could already be done applying the offset in the prefab.

    Thanks,
    Raoul
     
    swnc likes this.
  32. forzabo

    forzabo

    Joined:
    Aug 28, 2015
    Posts:
    64
    Hi Raoul,

    I'm trying to get a railroad track set up, but when I create tracks based on this model, the normals of the resulting tracks that I drag out are reversed. What am I doing wrong?

    Screen Shot 2019-09-05 at 11.06.40 AM.png Screen Shot 2019-09-05 at 11.06.28 AM.png

    fbx attached...
     

    Attached Files:

  33. raoul

    raoul

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

    The normals are not so much reversed, it is more a problem with extracting edge vertices. If you look at the connection shape in the Custom Prefab Editor window in Front View instead of Top View you can already see this connection is not extracted the way it should.

    road_rr_xing_b.jpg

    Are the triangles marked with the red X required? It could very well they are interfering resulting in problems ordering edge detection which can have an affect on ordering selected vertices for connections. If these two triangles are required, can you then try adding two more triangles between this end and the two triangles at the other end, closing the gap?

    Thanks,
    Raoul
     
  34. forzabo

    forzabo

    Joined:
    Aug 28, 2015
    Posts:
    64
    Thanks, got that to work.

    But now a bigger problem -- the same thing that happened to me yesterday -- as I getting close to refining my road network, EasyRoads, just went off the rails. It seems to be triggered by deleting objects -- I've been careful to use the ER tools to delete rather than directly in the hierarchy, but it still goes nuts. It's happened several times. The first couple of times I was somehow able to stop this, but this time I'm baffled (and frustrated). With the road network selected in the hierarchy just mousing into the scene window causes a stream of errors, apparently having to do with GUI window repaint:

    Screen Shot 2019-09-05 at 3.03.40 PM.png

    here's a typical stack trace:
    arrrrgh....
     
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    This looks like a single error being repeated on each Scene View update.

    What exactly have you been deleting? How can this be reproduced?

    What was the causing this the first couple of times and how were you able to stop this?

    Is this an obnject selection issue? Does deselecting, reselecting the road network help? Or reopening the scene?

    Is it possible to have a look at this scene?

    It is safe to directly delete objects like roads and crossings in the hierarchy.

    Thanks,
    Raoul
     
  36. o1o101

    o1o101

    Joined:
    Jan 19, 2014
    Posts:
    639
    Thanks very much, I am on Unity 2018 LTS.

    Cheers
     
  37. Sam512

    Sam512

    Joined:
    Jan 13, 2019
    Posts:
    178
    Hey, do i need to remove the non-add-on asset for Add On - HD Roads?
     
  38. forzabo

    forzabo

    Joined:
    Aug 28, 2015
    Posts:
    64
    I was deleting road objects and crossings. Simply editing my layout!

    replicating the issue: I'm not sure, but It's possible that the it was triggered by deleting a crossing such that there is an unconnected section of road to the rest of the network, and then attempting to edit that (i.e. dragging one of the ends or something)

    see above -- maybe. Once I seemed to be able to fix it by deleting the orphan road using the hierarchy.

    once the error is triggered, the errors happen with every repaint cycle (scene view update) as long as the road network is selected in the hierarchy.

    Per above, no.

    When this happened before, I tried reopening the scene and the errors persisted. I ended up deleting all the ER assets from my project, rebuilding the library and starting over.

    This time, I quit the scene without saving my changes and reopened it to the previous state prior to when the errors occurred and I was able to continue from that point (although I lost the interim work).

    Attached as unity package.

    Thanks!

    --Bo
     

    Attached Files:

  39. forzabo

    forzabo

    Joined:
    Aug 28, 2015
    Posts:
    64
    Hi Raoul,

    another (unrelated) issue:

    For some reason this crossing mesh gets weird mapping artifacts when ER converts it to its clone version. See screen shots below. FBX & the texture it uses is attached.

    prefab after importing and assigning material:

    Screen Shot 2019-09-05 at 4.41.30 PM.png

    ER version of same mesh. Note weird UV stretching/ distortion/jankiness on left side of road at each intersection. I went in Maya and made sure normals were unlocked, edges were hardened, no non-manifold geometry, doubled vertices etc... it all looks good to me.

    Screen Shot 2019-09-05 at 4.42.11 PM.png


    Thanks,

    --Bo
     

    Attached Files:

  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi deverolirc.

    I will prepare a build tomorrow with that option.

    Thanks,
    Raoul
     
    o1o101 likes this.
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hello unity_c1ndWE1Nn46iPg,

    I am not sure what you mean with that? What exactly is the problem with the HD Roads package.

    Thanks,
    Raoul
     
  42. Sam512

    Sam512

    Joined:
    Jan 13, 2019
    Posts:
    178
  43. Sam512

    Sam512

    Joined:
    Jan 13, 2019
    Posts:
    178
    I don't see any HD road, only the same old road
     
  44. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Thanbk you for the scene. Have you tried the package? Can you recreate the problem? Because I had a quick look and it include limited assets, no EasyRoads3D created prefabs etc. I do get an error but different then the one you posted. This is just to double check. I will have a closer look tomorrow but it is always appreciated to include the EasyRoads3D and email the package so we have a situation as a close as possible as on your end.

    Thasnks,
    Raoul
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Please check the manual in the assets folder or the video (second on the asset store page), it shows how to import the HD Roads presets in your project. Or open the demo scene and select, deselect the road network object. This will refresh the project log with all road presets and side objects in that scene.

    Thanks,
    Raoul
     
  46. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I will have a look at the prefab tomorrow. Is this related to UV settings?

    Thanks,
    Raoul
     
  47. forzabo

    forzabo

    Joined:
    Aug 28, 2015
    Posts:
    64
    I have been able to replicate the problem now.

    1) select a crossing object that is connected to other road objects.

    2) delete it (I deleted it using the ER inspector, not via hierarchy)

    3) attempt to adjust an adjoining road.

    Ka-blammo! (as David Hobbs liked to say)

    I'll resend the package with the ER assets. I thought I'd remove them to save size.
     
  48. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Is that with the package you sent yesterday and imported in a new project? Do you see the road network marker and crossing handles when selecting the road network object?

    Yesterday I imported both your package and the full EasyRoads3D package in a new project. The problem was that no EasyRoads3D scene view handles are shown at all, probably because it throws an error already in OnEnable() (different from the one you posted) perhaps due to missing assets in the package. Selecting a crossing in the hierarchy and moving it does update the road network though, so indeed your initial error is perhaps more Scene View related.

    All crossings are responsive, the road network does update after selecting them in the hierarchy and moving them. There are two crossings though that are very close to eachother, that is something to be carefull with regarding terrain deformation because they are not at the same height.

    Removing a crossing and moving a crossing connected to the other end of one of the involved roads does still update the road network correctly, no error messages.

    But once again, this is all done from the hierarchy because no handles are shown when selecting the road network itself.

    I will await the new package, please email it, unless you confirm yesterdays package does show the problem correctly.

    Thanks,
    Raoul
     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    This is what it looks like on our end. The texture/material for the attached roads was not included in your post but it seems in your image this is more crossing related anyway.

    street_4way.jpg

    Perhaps we can see the problem when you send a new package including these assets?

    Thanks,
    Raoul
     
  50. Sam512

    Sam512

    Joined:
    Jan 13, 2019
    Posts:
    178
    That line along the road is really bothering. I use tga format. How to get rid of it?
     

    Attached Files:

    Last edited: Sep 6, 2019