Search Unity

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Definitely 6.6.1. So here is what I originally had happen to me that led to it occurring:
    1. Created the roads, splitting them as necessary to hook up to the intersections later (about 6 in total).
    2. Hooked up the first T without issue.
    3. Went to hook up the "swappable" piece (the bottom of the 'T' if you will) and it went all crazy.
    4. Proceeded to hook up the others, with the texture never correcting itself. It wasn't until I unhooked a piece (any of them) that it had corrected itself.
    Sorry I can't be more specific given how bad of words random and intermittent are when it comes to troubleshooting and recreating it.

    Edit: Since there were 2 posts added before I hit submit, my upgrade procedure was actually to import the package in to a new, empty project and then removed the respective EasyRoads3D folder in my active project. Then with Unity closed, I moved the folder from the new project to the active one and let it run through the import process again (basically a clean slate if you will).
     
    Last edited: Jun 24, 2015
  2. raoul

    raoul

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

    Thank you for the info. I tried this also by splitting an exiting road into pieces at crossing positions but I do not get any glitches after creating the T crossings.

    Once you get into EasyRoads3D and start creating your own dynamic crossings and also custom crossings and materials you probably want to import package updates directly into your project without removing the EasyRoads3D folder. All these assets are stored in the Resources folder inside the EasyRoads3D folder. They will no longer be available when you remove the full EasyRoads3D folder.

    Thanks,
    Raoul
     
  3. woyehua

    woyehua

    Joined:
    Jun 10, 2013
    Posts:
    7
    Why I registered, according to this
    a.png
     
  4. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Hey Raoul,

    Hate to be the bearer of bad news, but I encountered a significantly more important issue/bug. After having built Terrain for my road network in a scene, after closing out the editor and coming back to it I found myself unable to edit the nodes - after enabling edit mode again. I can select the nodes, but moving them does not reflect on the road network itself; just the node being moved. After moving them and then building terrain again, nothing changes and the roads keep the same paths they had prior. I had originally changed the shader on the road material to the Unity 5 standard but have since reverted it back to the EasyRoads3D diffuse (even though using the Unity 5 shader just caused roads to appear all white when editing) with no ability to edit the road.

    Manually adding a new road to the network just allowed me to place the green nodes without ever actually showing a road. I even made a brand new scene, with brand new terrain and a brand new road network and still could not place roads; just the green nodes themselves. So I reverted back to EasyRoads 6.5 beta (removing the folder from my active project and replacing it with one from 6.5 with no luck). So basically as of now, my roads are set in stone (no pun intended) with no ability to edit them. :-(
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    To both woyehua and Besus,

    My sincere apologies but we have had what seems to a very suspicious situation where there literally have been hundreds of requests (I stopped counting) for the v3 beta download today, it is known where this request came from!

    As a result our website was locked down. I just spent almost two hours investigating this with the support department of our host.The website is still down but should be back up shortly.

    To Besus, this is very likely also why you are now experiencing problems.

    This is the first time in more then 5 years this happens, again my sincere apologies.

    Raoul
     
  6. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Seriously!? I can't edit my roads even after the plugin has been activated if it can't check-in with your server? This is going to be a serious problem if I'm looking to do some work without an internet connection...
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    That will work just fine. Can you try that and let me know if that doesn't work (restart Unity to be sure it doesn't interfere with the previous attempt). If that doesn't work it will certainly be fixed, and this server check is only temporarily during beta... Again this has never been an issue in the past 5 years.

    Thanks,
    Raoul
     
  8. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Disabling my internet connection did allow me to edit them again. DRM once again proves that it only ever seeks to punish and inconvenience legitimate users. :(
     
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I know, my apologies again for this. There are several sides to that. v3 is not out yet, and we are still here updating the tool 5 years later. The beta uses the previous v2 protection when purchased from our website. It was implemented at the time also as a test. At that time there was no asset store yet, the user base was a lot smaller. And the above mentioned workaround was implemented in case of issues...

    Again, this has never been a problem. I will look at that code and remove the check once the tool has been activated.

    Glad to hear the workaround got you going again at least. You can connect back to the Internet straight after selecting the road network game object.

    Raoul
     
  10. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Yes this happened again once to me today.
    Maybe due to using bumped materials or calculate tangents.

    Will try reproduce when more time.

    G.
     
  11. raoul

    raoul

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

    Calculate tangents is done during Build. I assume this error occurs after adding T-crossings and connecting roads in a single Edit session?

    Calculate Lightmaps (also done when switching to Build) can change the mesh significantly and mess with vertex indexes which can affect the result of bending the T crossing as that does use vertex indexes. But I tested that as well, it doesn't seem to cause an issue either in this particular case.

    Thank you for the feedback!

    Raoul
     
  12. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311

    Yes but I have noticed that once you build (I suppose it calcs tangents etc) and I can see road textures with bump no problem etc.

    If I click on a T connector the roads attached to this lose their textures and turn black. If I move a road marker this road will also turn black after build. However the T connector does not turn black and keeps texture!

    I have noticed that this happens on roads which are not using the default ER textures.

    So I thought this might have something to do with it and tangent calc get lost or similar.

    G.
     
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Roads turning black in Unity 5 has to with using a bumped shader and no tangents info being available which is the case in Edit Mode. Calculating tangents in Edit Mode can be added but one thing on the list to do and requested by several people is to bring back the v2 Edit Mode shaders, render the road on everything so the final road shape is clearly visible, also in hilly areas, which is useful when laying out the roads. This shader will not require tangent info, so that will deal anyway with this specific missing tangent situation in Edit Mode because that shader doesn't require tangent info.

    I belief indeed Tangents are calculated for crossings when they are updated, I have to check that. That would explain why they don't turn black after changes in Edit Mode.

    The above should certainly happen for the EasyRoads3D shaders and I think also for the new Unity 5 standard shader. Just as a note, the EasyRoads3D shaders will be replaced with an adjusted version of the Unity standard shader assuming it does accept the required Offset option.

    I don't think missing tangent info can result in the geometry of the T crossings becoming glitched.

    Thanks,
    Raoul
     
  14. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    Standard shader is heavy for mobile platforms, it's better to offer improved shader as an option.
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Yes, I meant replacing the currently provided shaders (mobile is not included) for the new Unity 5 standard shaders.

    You probably know that but in general,.you can download the Unity built-in shaders from the unity website. This way you can adapt any shader by adding that particular Offset line. I will add the mobile shaders to the package.

    Thanks,
    Raoul
     
  16. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    Hmm, I thought easyroads shader was something more complicated than just offset, the transparent shader has a fadeoff on the roads end, is it also easy to replicate that on a legacy shader?
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Yes, you are right, the transparent shaders are slightly more different then the Unity built-in transparent shaders. It shouldn't be to complicated to replicate if you compare the default transparent legacy shaders with the mobile shaders and the same default transparent legacy shaders with the the EasyRoads3D transparent equivalent.

    This will be done for the Unity mobile shaders anyway. Just let me know if you need it urgently, and I will send them to you so you can test/use them.

    Thanks,
    Raoul
     
  18. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    I'm sorry it's not too much relevant with easyroads but since you're talking about shaders, I generally use mobile/diffuse shader of unity for every single object in my scenes or the fps drops a lot. Is it even possible to have any faster shader than mobile/diffuse?
     
  19. raoul

    raoul

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

    We do test using the Unity mobile shaders, but we ourselves do not really develop for mobile at the moment. You could ask this in the graphics/shader forum?

    Thanks,
    Raoul
     
    hakankaraduman likes this.
  20. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    Sure, thanks. Sorry about it
     
  21. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    How do I create custom intersections? For example, take the "T" intersection and change it into "L" intersection.
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Sorry for need being of much more help here. Apart from making small tweaks, as mentioned, we are not that familiar with shader development for mobile.

    Thanks,
    Raoul
     
    Last edited: Jun 27, 2015
    hakankaraduman likes this.
  23. raoul

    raoul

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

    You could instantiate a T crossing in the scene, export to .obj, turn it into a L in a modelling app and import back into Unity. Or you could align two roads like L export the two roads and merge them into a solid L shape. In that case, addthe first markers are at the outer side, not at the corner position. this will make sure the UVs between the connected road and custom connection will match.

    In Unity follow steps like in the below video to add the model to the custom crossing prefabs



    Let me know if you need more help with this.

    Thanks,
    Raoul
     
  24. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    After exporting the "T" intersection to *.obj file, I imported the file into 3DS MAX and created a corner intersection, and exported it to *.fbx file. How do I use the Prefab Editor to create a new crossing? How do I remove items from the list of crossings? I'm hearing-impaired and I couldn't watch the video without closed captioning.
     

    Attached Files:

    Last edited: Jun 28, 2015
  25. raoul

    raoul

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

    The mesh looks fine but some triangles seem to point in the wrong direction.

    The list of crossings in the Inspector is read in from the assets folder:

    /Assets/EasyRoads3D/Resources/custom prefabs/
    /Assets/EasyRoads3D/Resources/dynamic prefabs/

    You can remove prefabs from this folder.

    The videos are still provisional and actually do not include narration. The video shows in the beginning how to create a new custom crossing:

    1. Open the Custom Prefab Editor window.
    2. Add the source model to the Custom Editor window. Simply drag the model from them assets folder on the stage or drop it in the Source Object slot in the top left. Click "Build Connection Prefab", this will generate the new prefab in /Assets/EasyRoads3D/Resources/custom prefabs/
    3. Add connections and select the vertices for these connections (Shift + Click + drag). Also assign road materials to these connections.
    4. Click Apply to save the changes.

    This process is later in the video repeated for another custom crossing model.

    With which step are you having difficulties?

    Thanks,
    Raoul
     
  26. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Its not the geometry, its the textures that get glitched not geom.

    G.
     
  27. raoul

    raoul

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

    Is this still related to the picture Besus posted? In that picture it looks like the geometry gets glitched and as a result the textures look wrong.

    Could you post or send me a screenshot of what this looks like on your end?

    Thanks,
    Raoul
     
  28. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    I need materials/texture files that are to be applied to my custom crossing model. Which materials/texture files are to be copied from the assets folder to the 3ds max folder?
     
  29. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    You can either select the crossing object directly in the hierarchy or select the instantiated crossing in the scene while the main Road Network is selected and click "Select Connection in Hierarchy".

    Afterwards scroll down in the Inspector, you will see the materials including the textures. Clicking the texture will point to the specific texture in the assets folder.

    Unless you changed these materials the textures will point to:

    /Assets/EasyRoads3D/Textures/roadsample_d
    /Assets/EasyRoads3D/Textures/sidewalk

    The associated materials are in:
    /Assets/EasyRoads3D/Resources/Materials/crossings/crossing material
    /Assets/EasyRoads3D/Resources/Materials/sidewalks/sidewalk

    Thanks,
    Raoul
     
  30. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    Which 3D modeling program did you use to create the crossings? Do I export the 3D model Y-Axis up or Z-Axis up?
     
  31. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    I can't create custom crossings anymore. Will you please take my 3D model and create custom crossing?
     

    Attached Files:

  32. raoul

    raoul

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

    The dynamic crossings are generated inside Unity through code. But you wrote "export"? Is this actually related to importing the model back into Unity? I have to double check the code if the local vertex positons are extracted or global coordinates.

    The beta package includes various examples you can use as a reference. At which stage are things going wrong for you? Or is there anything specific you do not understand?

    I will check the model to see if there are problems with it.

    Thanks,
    Raoul
     
  33. raoul

    raoul

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

    I looked at the conrer-section mesh. Could you look at the following:

    1. The mesh is not centered around the pivot point. Although this is not necessarily required, it is recommended to do this if you want it to rotate around the center of the actualy mesh bounds when changing roations inside the editor.

    2. Have a look at the below screenshot. When dragging the mesh in the custom prefab editor you will see black dots at specific vertex positions. These black dots represent those vertices you can select to create connections for the custom prefab. They should only be visible on the outer side of the mesh. In this case you also see black dots for vertices between the road and the sidewalk in the top left (those surrounded with a red circle). This is not good. The system expects a solid mesh, you can have different mesh groups like in your situation the road and two sidewalks but the seperate objects must share vertices at the same position on the outer side of the mesh (for example the vertices surrounded by the blue circle) up to 1 vertex inwards. In the screenshot I added two green lines, they end exactly on that specific vertex inwards that also must be shared between the two groups which is not the case at the moment, it is not used for the road triangulation.

    Can you change the road triangulation so these two triangles are part of it and check if that works better?



    Thanks,
    Raoul
     
    Last edited: Jun 29, 2015
  34. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I feel silly now, I found the waypoint button to be working as expected now I took the time to actually check. I'll try find the runtime api docs and should be able to work with that I think
     
  35. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Hello,

    Is it possible to use EasyRoads3D to build railways? If yes, how would I make a train (a locomotive and a couple of cars) follow it?

    Thank you.
     
  36. raoul

    raoul

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

    You can indeed create waypoints (empty game objects at x distance) using the Generate Waypoints button after selecting a road. It is useful for simple waypoint purposes.

    The API includes a lot more additional scripting options regarding all this. It is not yet documented, you can find info in /Assets/EasyRoads3D/scripts/runtimeScript.cs

    Thanks,
    Raoul
     
  37. raoul

    raoul

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

    At the moment railways can be build using the sideobjects system. It works similar as in v2, the demo project of v2 includes an example scene.

    In one of the next updates you will also be able to do this through the custom prefabs system which will be expanded so it also supports more complex shapes. Think of road / railway crossings where you can pull out both roads and railways or prefabs for railway switches.

    Having a locomotive with cars following it will be a matter of using the spline info which you can access through the API.

    Thanks,
    Raoul
     
  38. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Hi Raoul,

    Thanks for the quick response!

    Is this scene included only in the Pro version? Does it have an actual moving train? If not, are there any tutorials that show how to have a train realistically move along the railroad?


    Do you have an ETA for that?

    Many thanks. Great asset!

    Alex.
     
  39. raoul

    raoul

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

    The packages are scripts only (v2), but you can contact me through our website or by sending me a PM (Start Conversation). I will send you the demo project. It doesn’t have a moving train on it, it mainly is an example of other things you can create with EasyRoads3D. Also, v2 does not include a runtime API, scripts to move an object along a track are available but not a script for complete train moving along the track.

    This feature I mentioned is one of the last two features that will be part of the first public v3 release. I cannot give an exact ETA but it won’t be too long.

    Glad to hear you like it!

    Thanks,
    Raoul
     
  40. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    I thought that I fixed the mesh but I still have problems creating new crossing. How do I get two objects to share their vertices at the same position on the outer side of the mesh in 3DS MAX?
     

    Attached Files:

  41. raoul

    raoul

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

    The mesh by itself is correct now. But it has a strange scaling (0.01) on the child objects. It needs to be scaled up in the import settings. Also, after dropping it in the custom prefab editor, the default rotation is not correct. You have to use the z-axis for the trace option. After that it is displayed correctly and you can add connections.

    However, when instantiating the generated prefab in the scene the normals do not look right. This may have to do with having to select z-axis for the correct rotation and the normals not being recalculated. I will check that.

    I exported the model to .obj it imports fine now, the scaling of the child objects is 1 and no rotation changes should be necessary. You can add connections and the normals are correct.

    Thanks,
    Raoul
     

    Attached Files:

  42. woyehua

    woyehua

    Joined:
    Jun 10, 2013
    Posts:
    7
    Why do I have this problem scenes (pictured), indents and line around the middle of a fall into terrain, resulting in the formation of the canyon terrain, terrain I improve the accuracy still have this problem. 01.png 02.png 03.png
     
  43. raoul

    raoul

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

    The first screenshot looks normal. Is that a flat terrain with no textures? The road is positioned higher above the terrain and the white surfaces which represent how the terrain will be deformed snap accordingly to the terrain on the outer side. This is done to smoothly flatten the terrain according the road shape.

    In the next two screenshots it seems the same road is used but now the "real" terrain is active. It looks like this actual terrain is flattened according the shape of the white surfaces in the first screenshot.

    Could you give further details about your workflow? Are you indeed creating your roads using a different terrain object? In that case, after you activate the "real" terrain and deactive or remove the other terrain, moving a marker a little bit will update the road which will also update the white surfaces now snapping to the real terrain on the outer side.

    Or do you perhaps have another terrain still active in the same area? It seems there are several terrain objects in the hierarchy.

    Please let me know if this doesn't help and in that case, please also provide further details on your workflow, the steps you took resulting in the scenes in those 3 screenshots.

    Thanks,
    Raou
     
  44. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    Houston. We have a problem!

    ScreenCapture_162.5347.png
    It seems, that the road bump/normalmap are upside down. I don't know
    how to fix this, since that "circle" (doesn't matter is it just a plane mesh
    OR t-crossing prefab) is what it should be. The road itself is a problem.

    There is an one main road made by Er3-editor, an one side road by runtime
    and a plane mesh as crossing point. (Have to use this kind of method while waiting
    runtime crossings).

    EDIT: I found this problem after taking normal map in use. Before this I tested everything with diffuse shader only.
     
    Last edited: Jul 2, 2015
  45. raoul

    raoul

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

    There is a problem with normal maps. But the same issue should also happen for crossing objects.

    Roads should work now but crossings need more work. If you want I can send you a build with the fix for roads so you can check it.

    Thanks,
    Raoul
     
  46. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    Please send. The road itself is the problem now. I can live with my "circle-connectors".
     
  47. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ok, I will sent an update tomorrow morning!

    Thanks,
    Raoul
     
  48. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    Another toggle option for runtime roads required.

    I have to find closest MIDDLE point on road, what is under cursor position.

    The fastest way to do it, is taking vertex list from road and with
    lerp(v[x],v[x+1],0.5f) take a center points. Ok. Easy like riding a bike.
    I get perfect list and my new road will SNAP in to nearest lerped
    vector position. But then I'm in deep problems!

    Since you force roads to be as "Static", I can't get individual road vertexes.
    I get ALL vertexes. I know, that you have selected this kind of method for
    lowering draw calls, but it seems confuse mesh.vertices array too.

    So, could you make asap an alpha version where I can set "Static" on or off
    for runtimed roads. Editor made I can edit by hand.

    Picture below: The circled road is static. Every other are non-static (by editing
    directly from inspector). As you see, when I move a mouse over short sideroad
    coming from house, gizmos popups and shows vertices. However. That
    list includes static circled road aswell. (Gizmos are generated by that single
    vertice list)


    ScreenCapture_103.7135.png
     
  49. raoul

    raoul

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

    I belief I read something about not being able to access mesh.vertices for static objects a while ago. I will double check tomorrow (it is past midnight over here).

    A temporary hack:

    ERRoad road;
    ...
    road.roadScript.gameObject.isStatic = false;

    Does that work?

    Also, in the above example (API code) road.GetSplinePointsCenter() will return the exact center positions.

    Thanks,

    Raoul
     
  50. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    I know that.

    But I decided to use it anyway, even, that I have to search the road by
    name from road network now. But... it is working. I upload within an
    one hour an example roading scene to my server and write a link
    to it here.

    And. Yep, time is 01:48 AM here too, but who cares. My 1 month summer
    holiday started friday :)

    (btw. With isStatic=false I got that vertice list, but it seems, that it doesn't
    turn it totally off. Doesn't matter anymore).