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


    The road uses 3 side objects:

    1. On the inner side a Shape type of side object simulating terrain
    2. On the outer side a Shape type of side object for the wall
    3. A Mesh type of side object for the top bricks

    Instead of the outer wall you can also use a side object simulating terrain like on the inner side.

    The wall is a simple shape:

    1. Create a new side object > select “Shape Object” as the Object Type
    2. Click “Open Shape Editor Window”
    3. You can add nodes by double clicking on the stage. Start by adding a node near (0,0) add a node a little bit further to the right (width of the wall), to control the normals you can add an addition node slightly more to the right, add the last node vertically downwards. This is the wall shape. Click Apply to save and close the window.
    4. In the Side Object Manager select “Relative to the Right Side of the Road” from the dropdown below X Position. This will attach the side object to the right side of the road.

    Select the road and activate this new side object. Only activate it for the required markers. In the side object manager you can chose to deactivate the side object by default for all marker by unchecking "Default active state for each marker".

    Just like the wall, the mesh terrain overlay on the inner side is a shape side object:

    1. Create a new side object > select “Shape Object” as the Object Type
    2. Click “Open Shape Editor Window”
    3. Add nodes to simulate the shape of the terrain mesh overlay. The example in the screenshot uses 5 nodes at the folowing positions: (-7, 10), (-1.5, 6.5), (-1, 6), (-1, 0), (0, 0)
    4. In this case we snap the first three higher nodes to the terrain ("Snap to Terrain" checkbox).
    5. In the Side Object Manager select “Relative to the Left Side of the Road” below X Position. This will attach the side object to the left side of the road.

    Additionally, in the screenshot the generated mesh overlay partially uses a rock type of textures and partially a rock/grass texture. This is done by assigning vertex colours to the nodes and using a shader that will take these colours into account. The first two nodes for the grass/rock texture, the last three nodes for the rock texture. I am not entirely sure but I belief that the RTP shader package also uses vertex colours too blend meshes with the terrain. You could use this package to blend the overlay mesh completely with the terrain.

    So if you just want to use a rock type of texture, you do not necessarily need the second and third node unless you want to add more detail to the shape.

    The next step is to control the terrain deformation for the affected markers. You can do that by choosing one of the other options for “Right Indent Alignment” and "Left Indent Alignment" instead of “Align with the road”. You will see the white surfaces adjust.

    In Build mode you can fine tune the generated wall and mesh overlay positions by changing the start/end offsets.

    Let me know if you have further questions!

    Thanks,
    Raoul
     
  2. virgiliu

    virgiliu

    Joined:
    Apr 4, 2015
    Posts:
    46
    Indeed the road related features are more important than undo/redo :)

    Please send me the code when you can. I verify the road manually anyway to fix imported data in places that have tight turns on slopes.

    The variation in minimum indent happens on different scenes, on different scale terrains, it doesn't happen on same terrain.

    I've read it here: http://www.unityterraintools.com/EasyRoads3D/v3/html/quick_start.html
    "you can insert markers by hitting the P key between markers"

    Indeed, pressing "I" inserted a new marker.

    Thank you for the help.

    Edit: Thanks a lot for the steps on creating that scene :D
     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I just sent the script to your email.

    Ok, in that case the difference is probably indeed cause by a difference in heightmaps scale. The bigger the heightmap scale the more careful you want to be with the script I sent you. When the minimum Indent value currently is 7 and you set it to for example 1, for sure you will not get the desired results.

    Thank you! This is updated to I key.

    Raoul
     
  4. virgiliu

    virgiliu

    Joined:
    Apr 4, 2015
    Posts:
    46
    The side object technique you explained helped :) I managed to make some portions of the road much more beautiful, thank you!

    I imported a really long road and set the road resolution to 1 and I went over the 65k vertex limit (about 550k vertices) when building that road. Is there any way to split the mesh or road automatically? Or should I just import multiple segments and somehow connect them?
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Glad to hear that!

    V2 does have the option to split the road in segments. This has not been added to v3 yet, usually at some point there will be a crossing of some kind that will split the road in segments.

    But splitting the road in segments without creating new road objects has been requested before, I will add it. I am also about to add another small optimization option that will reduce the vertex count while maintaining the desired detail. It should be fairly simple to implement. When ready I can send a test version if you want.

    Meanwhile, if it is urgent you could split the road in multiple road objects ("Split Road at Selected Marker" button) at straight segments and, if necessary, export the individual segments to .obj and snap vertices where the segments connect.

    Thanks,
    Raoul
     
  6. virgiliu

    virgiliu

    Joined:
    Apr 4, 2015
    Posts:
    46
    Thanks for the info Raoul :)


    Is it possible to change the indent/surrounding value for multiple markers at once? I tried selecting multiple with shift-click but that didn't help.
     
    Last edited: Nov 16, 2015
  7. raoul

    raoul

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

    Updating the indent / surrounding values for all selected markers is not yet implemented.

    You could use the "Copy Left/Right Indent/Surrounding to All Markers" buttons for this. This will copy the respective values of the selected markers to all other markers.

    Thanks,
    Raoul
     
  8. GameTechnix

    GameTechnix

    Joined:
    Oct 5, 2015
    Posts:
    84
    Could this be exported back into 3dsmax?
     
  9. raoul

    raoul

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

    Yes, v3 has built-in options to export the full road network to .obj. Road objects and procedurally generated side objects can also be exported individually to .obj

    Thanks,
    Raoul
     
  10. virgiliu

    virgiliu

    Joined:
    Apr 4, 2015
    Posts:
    46
    Is compatibility with WorldComposer (https://www.assetstore.unity3d.com/en/#!/content/13238) something you will look into? I created a terrain with it and the road imported via OSM had an offset relative to the road visible on the map, about 10 meters, even if its general position on the terrain was correct. I've set the top/bottom coordinates the same as those used to generate the terrain.
     
  11. raoul

    raoul

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

    Is this purely related to importing OSM data?

    EasyRoads3D imports the raw OSM lon/lat coordinates, does importing the raw OSM data directly and importing the OSM data relative to additional lon/lat coordinates matching the terrain work well in general? That is what we always do and we do get accurate results

    If that is indeed the case but OSM imports do not match WorldComposer generated terrains using exactly the same coordinates something is different, perhaps the projection?

    Are roads generated across the whole terrain and is the offset always the same, about 10 meters, regardless the position on the terrain?

    Thanks,
    Raoul
     
  12. virgiliu

    virgiliu

    Joined:
    Apr 4, 2015
    Posts:
    46
    For coordinates I use same bounding box (top left & bottom right long/lat) in both EasyRoads and WorldComposer. The projection might be different, but I don't know how to check that. At the moment I fixed it by moving the terrain underneath the road so that it matches the position but the height of the road markers doesn't seem to respect the new terrain position, they go underneath.

    Is it possible to give the road an X, Y and Z offset after it's been created to manually fix the offset problem?

    The offset seems to be constant on different terrains and roads.
     
  13. raoul

    raoul

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

    If the offset is constant you can use the below script:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using UnityEditor;
    4. using EasyRoads3Dv3;  
    5. using EasyRoads3Dv3Editor;
    6.  
    7. public class ERAPITests : ScriptableObject {
    8.  
    9.   [MenuItem( "EasyRoads3D/Update Markers" )]
    10.    public static void UpdatePositions(){
    11.      ERRoadNetwork roadNetwork = new ERRoadNetwork();
    12.      ERRoad[] roads = roadNetwork.GetRoads();
    13.      foreach(ERRoad road in roads){
    14.        Vector3[] vecs = road.GetMarkerPositions();
    15.        for(int i = 0; i < vecs.Length; i++){
    16.          // Update according the offset
    17.          vecs[i] += new Vector3(5, 0, 5);
    18.        }
    19.        road.SetMarkerPositions(vecs);
    20.      }
    21.      Debug.Log("done");
    22.    }
    23. }
    24.  
    I see currently no API option exists to snap markers to the terrain height, I will add that.

    What you could do meanwhile is, toggle On/Off "Follow Terrain Contours" for each road. This will snap all markers of that road to the terrain at that position.

    Thanks,
    Raoul
     
  14. BigLouis1971

    BigLouis1971

    Joined:
    Mar 26, 2014
    Posts:
    107
    I'm a new user learning how to use the asset, but I'm having a hard time adding custom roads to my test project. I added a custom TCrossing successfully, but when I try to start some roads from the TCrossing, some roads from the standard prefabs appear instead of my custom road. How can I start my custom road from my TCrossing? Thanks in advance.
     
    Last edited: Nov 19, 2015
  15. BigLouis1971

    BigLouis1971

    Joined:
    Mar 26, 2014
    Posts:
    107
    Wait, that's not what's happening. The roads are following the same geometry layout as the TCrossing, but have the wrong texture applied and that's why they look like a different piece of road. Now I just need to figure out how to re-texture the road pieces and they will look awesome. Can somebody help me to do that?

    I'm struggling a little bit for now, but once I get the hang of it I know that I'll be building road networks in no time. This asset is really good. Thanks in advance!
     
  16. raoul

    raoul

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

    After you selected the vertices associated with a connection for your custom TCrossing, you can assign the material that should be used on roads connected to this new connection.

    You also may want to create a new road type for this new type of connection/road. This road type will be available when creating new roads, so roads created fromt that crossing will automatically inherit the behaviour for that road type, like side objects that will be auto activated and terrain deformation that will be automatically disabled for bridge segments, etc.

    Another advantage of creating road types from custom crossings is, when you have a set of custom prefabs all sharing similar connections, these road types will show up in the dropdown after selecting vertices that match an exisiting road type. No need to select materials, fine tune UVs etc over and over again.

    Check the below video starting starting at 0.45, a new connection is added, vertices are selected, the road material is assigned and afterwards a new road type is created. Later in the video you will see that the new road types are automatically selected for the additional connections matching the previous two.


    Glad to hear you like it!

    A new beta will be out soon, for custom crossings normal groups on the prefab are now preserved on the connected roads. This means more control over the shading and matching normals at connection points between custom prefabs and attached roads.

    Thanks,
    Raoul
     
    Last edited: Nov 19, 2015
    red2blue likes this.
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Forgot to mention that there is no need to start all over, simply open the Custom Prefab editor window and drag the specific custom crossing created in /Assets/EasyRoads3D/Resources/custom crossings/ on the Custom Prefab editor window stage.

    This way you can make changes to already exisiting custom prefabs.

    Thanks,
    Raoul
     
  18. BigLouis1971

    BigLouis1971

    Joined:
    Mar 26, 2014
    Posts:
    107
    I was able to make it work, but with some little defects. The textures from the extruded roads didn't align correctly, but I guess that with some practice I'll eventually improve the alignment. I'm glad that you mentioned the "normals" improvement for the next update because another little defect that my test had is related to "normals". I created a material consisting of the texture and a normal for the new road type that's supposed to be extruded from the custom crossing, but now the road looks all black. If I remove the normal, I'm able to see the road again but the shading doesn't match the one of the crossing. I guess that for now I'm stuck into using only the diffuse texture to texture my new road types. I hope that the new update will solve that problem.

    I also would like to ask if I can create any type of connection object and not be limited to only T and X crossings. For example just a piece of road with the start of a divider in the middle that will work as a divider start and end. That way I can place one piece at the start, another at the end and extrude a new road type in between. That will give me a road with a divider with start and end that will look awesome with some vegetation in the middle just like in some big cities.

    Another example of a connection object that I would like to ask if is possible to make is a piece of road with a ramp type entrance for a residence or store. I was hoping to place one of those in the front of a house or store and connect some roads on both sides to it and that way I can have a realistic looking entrance for a house or store just like in a big city or the like. Can that types of connectors be made too?

    Also, can I use Unity's editor or Pro Builder Basic to build the connection objects. Will easy roads work with similar tools as those? Again, thanks for your help and for such great asset!
     
  19. raoul

    raoul

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

    By default the texture UVs are distributed between 0 and 1 based on the distances between vertices. You can change this manually per connection node through the UV editor window. In this window you also have additional options, for example a button that will assign exactly the same value as the specific connection vertex. You would want to use this option when the connection vertices use the same texture (UV distribution) as the attached road.

    It sounds as if two things are going on here. You mention "normals" but you also mention roads rendered all black and only being able to use a diffuse texture. Are you referring to assigning a normal map texture for bummapping? That is something else I was referring at. In Unity 5 objects are rendered in black when using a normalmap texture on an object with no tangents available. Please make sure to switch on "Calculate Tangents" in the Build settings.

    What I was referring at is controlling the normals on the generated mesh. Right now the normals are always smooth. In the next update (probably available this week) "hard edges" on the crossing prefab will be preserved on the road.

    For dynamic crossings you are limited to what is currently offered (X, T crossings and roundabouts, more will follow). The custom crossing system however is mesh based, you can basically import any mesh you want, any type of crossing or connection prefab. You can do that example, just take the train rail in the video of my previous post above as an example. The train rails is a single object with two rails section. You can do the same with roads, have two parallel roads with terrain in between. The beta package also includes examples of something like this. The bit for vegetation between the two roads is actually part of the generated road object.

    That might be more tricky since for example entraces to a house usually move slightly upwards immediately at the start near the road. Due to the grid based nature of the Unity terrain object it will be impossible to get the terrain deformation nicely done. What you could do is for example include pavement to the main road or a section with a curb and some grass over a short distance and use this distance to move the entrance smoothly upards a little bit.

    Otherwise, if the entrance does not necessarily have to go upwards a little bit, this essentially could be seen as a X or T crossing.

    I guess the end result will always be a Unity mesh asset or mulriple mesh assets just like when you import a model. So I cannot see why that would not work. Just let me know if you are running into issues with this, you can always sent the source mesh to me in a package so I can look at it.

    No problem :) Thank you for the questions and feedback, we are in the final stages of beta so feedback is greatly appreciated!

    Thanks,
    Raoul
     
    Last edited: Nov 23, 2015
  20. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    Hi Raoul

    How do I add side-objects to already existing roads?
     
  21. raoul

    raoul

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

    When you create new side objects in the Side Object Manager, they should be added automatically to exisiting roads. Is that what is not working for you?

    Could you otherwise give more info what your situation is?

    Thank you,
    Raoul
     
  22. Atzig

    Atzig

    Joined:
    Jul 17, 2014
    Posts:
    157
    Do you have any plans to add a tunnel feature? Maybe just as a side object? And what about textures for intersections/snow covered roads?
     
  23. raoul

    raoul

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

    You can indeed create tunnel geometry following the road with the side object system. I will include some examples. Some time ago I did experiment with creating the actual holes in the terrain object but I wasn't able to get a solid solution for this that works well with every terrain heightmapscale and angle. I tried this without touching the terrain shader since many people already use a custom terrain shader. I belief the Unity developers have this on the list for new terrain object features and some packages on the asset store can already do this, like the popular RTP shader package.

    You can always use you own textures, but more textures will follow including a substance material with snow effects that someone made for the package.

    Thanks,
    Raoul
     
  24. yohan12

    yohan12

    Joined:
    Nov 26, 2015
    Posts:
    2
    On the newest v3 beta when I place a road system down it doesn't affect the terrain, it just passes right though it. I installed V2 and tried it on the same terrain and that affected the terrain. Starting a new project doesn't help either. Thanks for any advise you can give
     
  25. raoul

    raoul

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

    Just to verify, is this screenshot taken in Build Mode?

    If so, could you switch back to Edit Mode, select the road and check if "Terrain Deformation" in the Inspector is toggled on?

    In the latest build an option "Terrain Deformation" was added for roads and road types because sometimes you do not want terrain deformation, see the custom bridge type of roads in the main demo scene. I belief this option is currently toggled off by default for exisiting road types. You may want to switch that on. For sure this is the case in the next beta, probably available tomorrow.

    If this does not help, could you post a screenshot of this same road in Edit Mode with "Hide White Surfaces" in General Settings > Scene Settings, disabled so these surfaces are visible.

    Thanks,
    Raoul
     
  26. yohan12

    yohan12

    Joined:
    Nov 26, 2015
    Posts:
    2
    Hi Raoul

    The terrain deformation option seems to have been the problem, not sure how I missed that. Thanks for the quick reply
     
    raoul likes this.
  27. raoul

    raoul

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

    Beta 7 is now available and can be downloaded from the same link as the previous betas. As always, please backup your projects first.

    This update includes many improvements, normal groups on complex custom prefabs are preserved on connected roads, joining roads is now possible, a new optimization option for road geometry has been added, texture tiling has been added, the v2 terrain smoothing options are added and this update also includes many small bug fixes.

    Please let me know if you are running into issues or if you have any questions.

    Thanks,
    Raoul
     
  28. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    Hi @raoul
    I purchased the asset but when porting the game to windows 8. I get these following errors.
    Can you confirm whether this package supports windows 8 platform.
    • API System.IO.StreamWriter.#ctor(System.String) in SYSTEM.IO, PUBLICKEYTOKEN=B03F5F7F11D50A3A is not supported for this application type. EasyRoads3D.dll calls this API.
    • API System.IO.TextWriter.Close in SYSTEM.IO, PUBLICKEYTOKEN=B03F5F7F11D50A3A is not supported for this application type. EasyRoads3D.dll calls this API.
    • API System.IO.TextReader.Close in SYSTEM.IO, PUBLICKEYTOKEN=B03F5F7F11D50A3A is not supported for this application type. EasyRoads3D.dll calls this API.
    • API System.IO.Stream.Close in SYSTEM.IO, PUBLICKEYTOKEN=B03F5F7F11D50A3A is not supported for this application type. EasyRoads3D.dll calls this API.
    • API System.IO.BinaryWriter.Close in SYSTEM.IO, PUBLICKEYTOKEN=B03F5F7F11D50A3A is not supported for this application type. EasyRoads3D.dll calls this API.
     
  29. raoul

    raoul

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

    I belief your question is v2 related, is that right? I am asking because I just received a request for the v3 beta by email from someone with the same name as you. I just sent the v3 download link.

    V2 is Unity editor only, it does not include runtime functionality. This means you can remove all script components (the Finalize option) and remove the v2 scripts before building for Windows 8, this will also resut in a "cleaner" build which is probably what you want anyway.

    V3, discussed in this particular thread, does work at runtime and should support Windows 8. I haven't tested for a while but if you still have issues for Windows 8 with the v3 beta, please let me know and they will be fixed.

    Thanks,
    Raoul
     
  30. CastleIsGreat

    CastleIsGreat

    Joined:
    Nov 10, 2014
    Posts:
    176
    how effective would this be in creation of more of a witcher3/skyrim/fantasy styled roadway/pathing system?
     
  31. raoul

    raoul

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

    Are you specifically referring to the "look" of the roads/paths? The main functionality is the creation of the road/path/additional side objects geometry and flatten the terrain accordingly. This is the time consuming bit where EasyRoads3D can help. The currently provided textures are provisional, more will follow. But ordinary unity game objects are used for this so you can use any texture/material you want.

    Please let me know if you feel there is something specific you need that might not be possible to do.

    Thanks,
    Raoul
     
  32. CastleIsGreat

    CastleIsGreat

    Joined:
    Nov 10, 2014
    Posts:
    176
    I think that pretty much answered my question thanks.
     
  33. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    Is it possible to snap and connect two separate roads ?
    Snapping controls points not really joining segments
     
    Last edited: Dec 14, 2015
  34. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    Remove Trees in build terrain is not removing trees on road. How to fix it
    Noticed. Plugin is not removing trees from junctions
     
    Last edited: Dec 15, 2015
  35. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    To get the roads to snap together, select one end, hold down shift, and then select the end you want to connect to. Then you will see an option to join roads in the inspector. I noticed the issue with the trees too, I don't think its currently working.
     
  36. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    Hi, Is there a way to find the distance between two road points ? i would like to inform the player how far he is going to travel on road with two given points. Thanks
     
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Sorry guys, I didn't receive notifications of the last messages.

    Indeed two roads of the same road type can be joined by holding shift and selecting the markers of both roads that should connect. If the roads indeed can be joined you will see a button for that in the Inspector, alternatively you can do SHIFT + ALT + J

    But I am not sure if that is what you are after since you mention "Snapping controls points not really joining segments". At the moment there is no direct way to do this but you could first Join to a single road then cut the road at that marker, SHIFT + ALT + C or "Split Road at Selected Marker" in the Inspector. But that will only result in markers at exactly the same position not the left and right side of the road unless the road is perfectly straight at that point.

    Yes, indeed no trees are removed at crossings in the current beta. This is implemented meanwhile and available in the next beta.

    At the moment there isn't, I will add it. Meanwhile you can use ERRoad.GetSplinePointsCenter() which returns an array of Vector3. You can use this to find the closest point on the spline shape for both points and calculate the distance between these points.

    Thanks,
    Raoul
     
  38. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    Also Please Add Splatmap modifications at junctions as well.
     
  39. raoul

    raoul

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

    Yes that is on the list too. It is a bit tricky though to implement a solid solution that will work in every situation especially regarding custom crossings which can have any arbitrary shape and can be used for different purposes. Take for example the railroad crossing sample, ideally you probably had like to use different terrain splatmap textures for the area around the road and the area around the rail track.

    Thanks,
    Raoul
     
  40. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    Noticing a strange but serious issue in my terrain. Its a 2K terrain and moderate amount of road network. Once terrain is built after creating the roads, terrain becomes unusuable. Whole editor becomes unresponsive. its very difficult paint trees or update splatmaps. Is it expected or am i the only one facing this issue !
     
  41. raoul

    raoul

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

    In Build Mode all should work just fine. What exactly do you mean with a 2k terrain? Is that the size? What is the heightmap resolution do you have many trees in the scene? Which beta are you using?

    Does the editor become unresponsive/slow only when the terrain is selected? In that case, could you backup your project and in the backup try removing or disabling the script component ERTerrain attached to the terrain? Does that solve the issue?

    Thanks,
    Raoul
     
  42. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    Hi,
    Yes 2K is the size. Heightmap size is 2049x2049. Trees does not matter even without trees it hangs.
    Removing the ERTerrain Component resolved the issue but don know what i am going to loose if i remove it. Can i attach it back to restore the terrain once i finish editing ?
    And realized Easy Roads adds the same component again when selecting road network object. and issue repeats again. Now i am removing the component every time i want to make changes. That's serving ma needs for now. BTW i am using latest Beta 7
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    This component holds the terrain changes data when switching to Build Mode, that is why I asked to do this in a backup project. So please do not remove it from the original project!

    A 2049x2049 heightmap resolution is heavy. I just did a test on a big road network with this heightmap resolution and it does affect the editor after selecting the specific terrain object. I will optimize this.

    If the 2049 heightmap resolution is important, you want to go ahead with this right now and want to be able to edit the terrain in Build Mode, what you could try meanwhile is:

    1. Drop the same terrain object in the scene from the assets folder. So you have two terrain objects in the scene.
    2. Rename the new terrain object so you can easily identify it and disable it.
    3. In Build Mode disable the real terrain and enable the new renamed terrain.
    4. Apply the changes to this new terrain. Since both terrains point to the same terrain asset in the assets folder the original terrain will update accordingly.
    5. When done and before selecting the road network object again, enable the original terrain and disable the new terrain.

    You may want to experiment a bit with this but I think it should work.

    And again, please backup your project and/or simply duplicate the terrain asset in the assets folder so you always have a copy just in case...

    Thanks,
    Raoul
     
  44. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    I have some problems in beta 7:
    - Crossroadprefabs won't get instantiated, they get a hard copy of the mesh, so that each crossing has its own mesh. Is that intended behaviour?
    - Do you recalculate bounds on the copied meshes? My crossroad prefab gets frustrum-culled too early.
    - I think that normals or tangents for crossroads are wrong, or do they get calculated only when building the terrain? Roads look normal, but the light on my crossroads behaves strange. They get lighter when everything else gets darker.

    edit: if I look at directionality, it seems that normals are rotated by 90 degrees. The source object is an fbx-file, which are rotated automatically by 90 degrees. Could that be the reason?
     
    Last edited: Dec 18, 2015
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Carpe Denius,

    Yes, that is intended behaviour. Although it is recommended to create new dyamic crossings through General Settings > Crossing / Connection Prefabs) specific to you project so you can quickly "Instantiate" them, you may still want to customize individual objects in the scene slightly and disable/enable sidewalks. To avoid other "instances" being updated as well hard copies are used. They do however still share the same crossing ID so it will be possible in the future to apply changes to all other crossings sharing that same ID.

    I will double check that.

    Before beta 7 the option to calculate tangents indeed was only available in the Build options not in Edit Mode. In beta 7 please check General Settings > Scene Settings > Calculate Tangents in Edit Mode.

    Yes, for custom crossings the tangents are currently not recalculated when applying a rotation. Unity indeed often seems to auto apply rotation values to fbx imports which makes it necessary to add the rotation in the Custom crossing editor. That is why we always use .obj. The tangent issue for rotated objects will be fixed though. I could also simply add a Recalculate Tangents option just like the Recalculate Normals checkbox.

    Thanks,
    Raoul
     
  46. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I checked this, currently the bounds of the source mesh is used. So depending on the type of source mesh (multiple child objects?) and applied rotations this indeed may not be accurate. This is updated and the option to update the tangents is also added.

    Next week an update will be released with these changes, let me know if you already like to try it out, I can always prepare a build for you.

    The update will also include one last new feature for the public release, the option to change the road shape per marker. This can be used to change the width along the road but is also useful for fx type of tracks as these changes can be applied to any node of custom shaped road types.

    Thanks,
    Raoul
     
    hopeful likes this.
  47. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Sounds nice. You don't need to prepare a special build, I can wait, thank you.
     
  48. jdraper3

    jdraper3

    Joined:
    May 28, 2015
    Posts:
    117
    I'm trying to check out the free version of EasyRoads to evaluate it, but when I add the gameobject to my scene, Unity locks up and never starts responding again. I'm guessing that the ER script is doing something because Unity cpu usage is maxing out a full core. I've tried this twice so far with the same result (have to kill the unity process).

    Any ideas?

    EDIT: Forgot to add - using the latest Unity 5 version.
     
  49. raoul

    raoul

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

    What exactly do you mean with "when I add the gameobject to my scene"? The way to create a new road object is through:

    Top menu > GameObject > Create Other > EasyRoads3D

    Is that what you are doing or are you dropping the prefab/gameobject from the asset folder in the scene? This will not work well.

    Other than that I am no aware of any issues like you described with the current free version. Do you get error messages?

    Also, the current free version, is version 2. This is the v3 WIP thread, it is an enirely new road system and available in betas if you have a Pro license. The package will soon be part of the asset store download.

    Thank you,
    Raoul
     
  50. jdraper3

    jdraper3

    Joined:
    May 28, 2015
    Posts:
    117
    Hi, sorry for posting in the wrong thread - didn't realize this was a completely new system.

    Yes, I did mean adding the gameobject via the menu option (Top menu > GameObject > Create Other > EasyRoads3D). I think it may be an issue with my terrain size or perhaps because of the massive amount of vegetation in my scene, because I tried it in another scene with a smaller terrain and no vegetation and it worked just fine. I'm already sold just by trying out the free v2, so I'll definitely be picking up v3! :)