Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. Weendie-Games

    Weendie-Games

    Joined:
    Feb 17, 2015
    Posts:
    75
    Hi @raoul is possible to export all the road network 'top view' as texture?

    Also, is possible to project a texture onto terrain to use as reference to create the road network?
     
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi Weendie-Games,

    Exporting the road network as a texture is not possible, it will be massive. Or do you need this in viewport size?

    To show the map over the terrain , the map can be added as a texture prototype with the tile size matching the terrain size. But this will be problematic if you already have a splatmap. Perhaps there is another way? Or duplicate the terrain and use the map on the duplicated temporary terrain? With "Duplicate", I mean duplicate the terrain the project folder and add this terrain to the scene as well. Please do not duplicate the terrain in the hierarchy, the same terrain object will be edited!

    We have this implemented in a way that the terrain splatmap and texture prototypes can be swapped.

    Thanks,
    Raoul
     
    Last edited: Jul 30, 2018
    Weendie-Games likes this.
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    @Weendie-Games, just in case you already saw the reply, this is to make sure you get a notification... Please see my post above, I edited the part of the duplicated terrain.

    Thanks,
    Raoul
     
    Weendie-Games likes this.
  4. Weendie-Games

    Weendie-Games

    Joined:
    Feb 17, 2015
    Posts:
    75
    Thank you! For the projection part, i'll be using the global color map from the terrain shader (micro-splat), so i can use as a blue print of the city/road network, just wanted to know more how people are doing that.
    colormap+roads.jpg

    I already made some streets in-game that is not in my "blue print" above that's why i asked about export the whole road network relative to the terrain size, so that way would be possible to merge with my blue print in Photoshop

    Anyway i know that is not the focus of ER, thank you for replying :)
     
    raoul likes this.
  5. iichiversii

    iichiversii

    Joined:
    Nov 23, 2011
    Posts:
    139
    Two questions-

    1. where are the prefab roads or are we just stuck with 1 default road?
    Im aware its in the demo project level however its not available when i just want to use it on my own terrain

    2. Any tutorials on how to import OSM data and use it?
    I managed to import osm data however i could not apply it to the terrain.
     
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hello iichiversii,

    This is related to a similar question on the previous page. Below is a copy of my reply:

    The demo package is primarily intended to get familiar with the tool which involves working with the road network in the demo scene. Did you do that? Because selecting / deselecting this road network will trigger updating the project file with available road types and side objects.

    This data is not available in the package after the import because that will mean that importing an update at a later stage will possibly overwrite changed settings, newly added road types and / or side objects.

    We get this question more often and will make some changes so these road types and side objects will be available in other scenes without first having to use the demo scene.

    When importing OSM data, the extracted data will by default be parsed relative to the bounds of the terrain object in the scene. All that is needed in "General Settings > Import Road Data" is press "Open OSM File" and select your OSM data file. Optionally EasyRoads3D road types can be assigned to OSM road types and only specific OSM road types can be parsed.

    If the terrain lat/lon bounds do not match the OSM lat/lon bounds you can enter the terrain lat/lon bounds in the Global Terrain Coordinate fields. The OSM data will be parsed relative to these bounds.

    In what way did you manage to import OSM data and were not able to apply it to the terrain? Does the above answer your question?

    Thanks,
    Raoul
     
  7. iichiversii

    iichiversii

    Joined:
    Nov 23, 2011
    Posts:
    139
    Here in this image you can see all the roads imported with osm to easyroads, i assigned the default road to all roads for testing and i set the terrain boundaries however i dont see any roads on the terrain, am i doing this wrong?
     

    Attached Files:

  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Roads are being generated.

    Can you show a screenshot of the Import settings? What data is entered for the terrain bounds and what are the OSM bounds? Are the roads visible when the terrain coordinates are kept empty?

    Can you include the OSM file so we can test it?

    Thanks,
    Raoul
     
  9. iichiversii

    iichiversii

    Joined:
    Nov 23, 2011
    Posts:
    139
     

    Attached Files:

  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    What about the other question, are the roads visible when keeping the terrain coordinates empty? Or could you include the OSM file? Or send it in a PM or by email?

    Thanks,
    Raoul
     
  11. FewGears

    FewGears

    Joined:
    Dec 7, 2016
    Posts:
    5
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi FewGears,

    Which version are you using? Does this happen on a single terrain or multiple terrains?

    By itself I cannot see how the length of the road can affect terrain deformation. But other factors might be involved here?

    Also, 27km is rather long for a single road. V3 is more road network optimized. By adding crossings the road will be split in sections, separate game objects. For a single road this can be done by inserting I Connectors. This option is available in the Inspector near the bottom of the marker section.

    Thanks,
    Raoul
     
  13. iichiversii

    iichiversii

    Joined:
    Nov 23, 2011
    Posts:
    139
    No roads visible, i will forward the OSM file by email
     
  14. FewGears

    FewGears

    Joined:
    Dec 7, 2016
    Posts:
    5
    This solution helped solve the problem. Thank you.
     
    raoul likes this.
  15. Drivecity324

    Drivecity324

    Joined:
    Aug 2, 2018
    Posts:
    8
    Hello. I noticed when I create a 6 lane road then create a 2 lane road, one of the 6 lane road turns into the 2 lane road. After that I changed the 2 lane road back into the 6 lane road and the roads I want to be 2 lanes turned back into 6 lane roads. Am I doing something wrong?
     
  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Thank you, I will test it once received and report back.

    Raoul
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hello Drivecity324,

    How are these 2 lane and 6 lane roads created?

    Are they separate road types set up in General Settings > Road Types?

    Thanks,
    Raoul
     
  18. Drivecity324

    Drivecity324

    Joined:
    Aug 2, 2018
    Posts:
    8
    I created the roads with Gameobject > Create other > Easyroads3D > New Easyroads3D object. I'm not sure why only that road changed.
    Picture 1.png Picture 2.png Picture 3.png
     
  19. iichiversii

    iichiversii

    Joined:
    Nov 23, 2011
    Posts:
    139
    I cant attach file in PM, do you have an email i can attach file to?
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    How large is your file? You can attach a file in PM.

    Thanks,
    Raoul
     
  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722

    Hi Drivecity324,

    Which version of Unity do you use?

    Gameobject > Create other > Easyroads3D > New Easyroads3D object

    This is how new roads are created in v2. In v2 each road object use the same material, but you can duplicate this material in the project folder, change the texture and assign the new material to the road.

    As mentioned in my previous post, in v3 (this thread) you can create road types with road types specific materials.

    Thanks,
    Raoul
     
  22. Drivecity324

    Drivecity324

    Joined:
    Aug 2, 2018
    Posts:
    8
    I use Unity 5.1.4.
     
  23. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    That is why v2 is imported. V3 works on Unity 5.3 and up

    Please try what I suggested, all roads in v2 share the same material. To change this, select the material in the Inspector, it will point to the material in the project folder. Duplicate this material and assign it to the road. The road can now have a different texture.

    Thanks,
    Raoul
     
  24. Drivecity324

    Drivecity324

    Joined:
    Aug 2, 2018
    Posts:
    8
    Thanks, it worked!
     
    raoul likes this.
  25. parzival123

    parzival123

    Joined:
    Jun 8, 2017
    Posts:
    6
    Last edited: Aug 4, 2018
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hello parzival123,

    That is a shader in the demo package. This demo package is primarily intended as a resource to get familiar with the tool. It includes various more complex assets.

    That shader in the screenshot is a more complex terrain related shader. The current demo package includes a simplified version that can be used instead if you get this error message.

    In any case, to fix this error for your build, please remove this shader from the project folder:

    /Assets/EasyRoads3D/shaders/Misc/ER Terrain Mesh Tesselation

    Thanks,
    Raoul
     
  27. GOLDY00

    GOLDY00

    Joined:
    Mar 16, 2013
    Posts:
    139
    So wondering how long till is it 3.2 with the y intersections just wondering
     
  28. StonedLover

    StonedLover

    Joined:
    Apr 16, 2014
    Posts:
    47
    Its appear after importing and trying to follow the Tutorial video I might try it with the new version from unity 2018.2.2f1 this week Will head back via website contact if it still appear :)
     
  29. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi StonedLover,

    Perhaps the package didn't import well? In any case please provide full steps so we can test :)

    Thanks,
    Raoul
     
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi GOLDY00,

    Flexible Y crossings similar to the current X T crossings are almost fully implemented. Sidewalks are not supported yet because that will get an upgrade too in 3.2. Just like 3.1, 3.2 will be released in betas. A first beta could be released once Y Crossings is fully functional. But in that case, this will be without support for sidewalks. And more options for Y crossings are planned but that can be added afterwards as well.

    Thanks,
    Raoul
     
  31. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    84
    i whish me a native support for World Streamer
     
  32. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Raoul,

    I am having an odd issue, and I could use some help.

    The following problem occurs when I make a change to the existing road design. Imagine a T intersection that I want to remove and just have an L shaped corner. So I delete the intersection, then delete the excess roads. Then take the remaining road and connect it to the next available intersection. I have to disable the sidewalks for the intersections the remaining road is on before I can connect it to the intersection (sure, fine, that's ok) I then connect it and attempt to reactivate the sidewalks. However i get several issue when I attempt to do this;
    1) The sidewalks don't appear at all.
    2) The sidewalks render on the road surface
    3) The road LOOKS disconnected from the intersection.

    Here is a 1 minute video (77mb) that shows you the issues. (I didn't feel right uploading this to YouTube, but if you prefer I will) http://blissgig.com/downloads/EasyRoadsIssue.mp4

    I am using version 3.1 and this is reproducible.

    EDIT: I just noticed that the moment I press the green sidewalk sphere I get a number of Warnings:
    EasyRoads3Dv3 Warning: The geometry structure of the connection at the start does not match the geometry at the end, road update aborted: HBC 10 00174

    I get 8 warning, each with a different Road Name.


    So, happy Monday.
     
    Last edited: Aug 6, 2018
  33. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    raoul likes this.
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi James,

    What I see in the video is a standard situation. When a road is connected to a crossing on both ends of the road and these crossings share the same road/sidewalk shape, toggling on / off sidewalks should auto update the sidewalk status on the other end of the road.

    I just double checked this in the main demo scene by adding two crossings, an X and T crossing in the scene and connecting a road in between the two. The sidewalks do update.

    Also because you mention there are errors, it seems more is involved here. How is this reproducible?

    Thanks,
    Raoul
     
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi Noa3,

    Like James mentioned the pivot points of the road objects are by default not what you want for World Streamer.

    Additional to the github link James posted, the scripting API can be used here:

    ERRoadNetwork.CenterPivotPoints()

    This will work for the final road network build.

    Thanks,
    Raoul
     
    Noa3 likes this.
  36. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    I covered what I am doing to cause the issue in my post, is there more detail you need? I'm happy to create a video if that helps. Basically each time I delete an intersection and attempt to connect the remaining road to another intersection this happens. But yea, just let me know what other details you need and I'll be happy to get them to you in whatever form you need.
     
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi James,

    This is what I did in the main demo scene of the EasyRoads3D Pro package:

    1) add an X crossing and two T crossings to the scene
    2) pull out a road from the x crossing and add two markers (four in total like in your video)
    3) attach this road to the middle T crossing
    4) pull out a new road from an other connection of this T crossing and attach it to the other T crossing

    All roads and crossings have sidewalks

    5) removed the middle T crossing and the second road
    6) attached the 4th marker of the road that is still in the scene to the remaining T crossing

    Toggling on /off sidewalks on both remaining crossings is fully responsive

    How are these steps different from your steps? Or otherwise, can you try this in the main demo scene?

    This is v3.1.1

    Thanks,
    Raoul
     
  38. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Noa,

    Also, as for using ER3D within the Active Management code, here is what I did: Added to the START() function

    ERRoadNetwork roadNetwork = new ERRoadNetwork();
    List<ERRoad> ERroads = roadNetwork.GetRoads().ToList();
    var roads = GameObject.FindGameObjectsWithTag("HBCRoad");
    foreach (var road in roads)
    {
    ERRoad erRoad = ERroads.Find(x => x.GetName() == road.name);
    var centerPoints = erRoad.GetSplinePointsCenter();
    var activeSetting = new ActiveSettings(road.transform, 750, centerPoints[(centerPoints.Length / 2)]);
    activeItems.Add(activeSetting);
    }


    //NOTE: I had not known of the: ERRoadNetwork.CenterPivotPoints() so that might be a better way to go. As you can see on the "new ActiveSettings" line I am finding the center point based on the spline points for that road.
     
  39. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Hello Raoul,

    I'm writing to tell you I'm an idiot. Thing is, the reason why I could connect existing intersections and not a new one was.... that the sidewalk on the new intersection was not set as wide as the road and the existing intersections. <big sigh> I simply had to set the new intersection's sidewalk width and everything was fine. I am SO sorry for bothering you.

    Hopefully my various scripts that support your asset are in some way helpful for the time I take up. If there is EVER, ANYTHING I can do for you, just ask.
     
    hopeful likes this.
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722

    I belief ERRoadNetwork.CenterPivotPoints() looks at the mesh bounds and center of the bounds and rebuilds the mesh accordingly. This could also be used to further optimize meshes for World Streamer, break meshes that cross different tiles apart.

    Thanks,
    Raoul
     
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    So this is working now? In your scene the roads / crossings look similar but indeed what you describe and what is visible in the video is usually a result of a shape mismatch. That is why I wondered if more is involved here. Only different widths however should not really cause issues though apart from this not looking too good because of the sidewalk width transition on the road at the connection point.

    Due to changes in v3.1 with more flexible crossing options and crossing connection options, the sidewalk system is currently a little bit in a transition state between 3.0 and 3.2. This will be better scalable in v3.2. Whenever you run in sidewalk issues in v3.1, the first thing to check is whether the road / sidewalk settings on the crossings at both sides of the road still match.

    Please report whenever you run into issues. All this is fairly complex and can be used in different ways, bug reports are very welcome and appreciated. :) Your scripts are also very much appreciated. The AI project is working well now with your help!

    Thanks,
    Raoul
     
  42. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Raoul,

    So last night I showed my wife the issue, you know, to get a second set of eyes on the problem. It was then that I noticed that the NEW intersection's sidewalk size was not set as large as all the rest, so I set it and the road connected. YAY, I can go to sleep and clean it all up tomorrow.

    Fast forward to this morning, and DRATS... not working. I made another video to show you. In it I create a new intersection, set it to the proper sidewalk preset and attempt to connect it... only to be met with the damn Red Dot. (arg!)

    http://blissgig.com/downloads/EasyRoadsIssue.mp4

    I don't even know what to do next, or what information I can give you. Sorry, I'm just tired and frustrated. But whatever I can do to help, just let me know. In the meantime I will keep trying and report back whatever I find
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi James,

    Red connection handles means that the shape of the selected road does not match the shape of that crossing connection.

    All I can see in the video is that a sidewalk preset is selected, outer curb is toggled on.

    I assume the selected roads use the same sidewalk preset with outer curb toggled on?

    Another thing perhaps to double check is the status of the sidewalks. Initially they were turned off. After reselecting the road network, did you check all sidewalk corner handles of that crossing, are they all displayed in green / active or are they perhaps closed on the road side?

    Thanks,
    Raoul
     
  44. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Ok so maybe this is the answer. I have two sidewalk presets, both have the same settings (and I have no idea why I did this) But so far, if I go to each intersection and set it's sidewalk preset to #2 and then connect the road all seems okay. I am still making the updates, and it's taking some time (because of the time it takes to find and select the intersection in the Heirarchy. Correct me if I am wrong, I have to select the specific intersection, and not have the Road Network selected, in order to have access to Connection Settings, Sidewalk Settings, etc?

    In an case, it seems to be working, and I'll post an edit to this when I am completed. I want to make sure these notes are here for the next person who has this issue
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi James,

    If the settings of the two sidewalk presets are indeed exactly the same it should be possible to connect roads to both crossings using the different presets.

    With the road network selected you can "select" the crossing by pressing the center yellow handle. This will show a "Select Connection in Hierarchy" button in the Inspector.

    For an easier workflow, new dynamic prefab with these sidewalk presets already selected can be created. They will appear in the crossing connections tab. This way they can be reused quickly in the scene. No need to always set the sidewalks for new scene instances.

    In v3.2 this will be further optimized so sidewalk presets can be selected/changed without having to select the crossing in the hierarchy.

    Thanks,
    Raoul
     
    JamesWjRose likes this.
  46. BeautifulRiver

    BeautifulRiver

    Joined:
    Sep 19, 2016
    Posts:
    47
    How to find the orientation at any position on the road?
     
  47. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hello BeautifulRiver,

    The package includes a runtime scene example where are road is created at runtime and afterwards an object follows the road. The below is used for this:

    ERRoad.GetPosition(float value, ref int currentElement)

    currentElement refers to the previous splinePoint index, ERRoad.GetSplinePointsCenter(). This could be used to get the orientation of the road.

    Thanks,
    Raoul
     
  48. trianglestudiosnl

    trianglestudiosnl

    Joined:
    May 24, 2013
    Posts:
    8
    Hi Raoul - I've got a new question for you. Something that has recently popped-up for us again after not being an issue for weeks / months. We see very narrow seams between every junction and the connecting road. It's a minor gap, but very noticable when driving on the roads.

    There appears to be a very minor height difference between the junction and the road, but this gap simply wasn't there before. Detaching and re-connecting the road usually fixes the issue, but since our world is getting quite big it will take us a lot of time to do this (and running the risk of causing the issue again because of not knowing what is actually causing this issue).

    Do you have any idea what might cause this, and how we can prevent this issue going forward?

     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi Remco,

    It looks like custom connection prefabs based on your own meshes are used here? Did anything change to this?

    Instead of detaching / re-connecting, does moving a marker (forcing a road update) fixes this? In that case, did you try General Setttings > Scene Settings > Refresh Road Network?

    Which version are you using?

    Thanks,
    Raoul
     
  50. trianglestudiosnl

    trianglestudiosnl

    Joined:
    May 24, 2013
    Posts:
    8
    We are using our own meshes, but we haven't seen the issue for quite a while now, so I thought I'd reach out to see if you had seen anything similar before.

    I'll try to force an update by moving a marker, but because there is an entire build process that takes place before I see the end result, it will take me a while to report back. Hope to have more information for you soon.

    I don't know for sure what exact version we're on, but the install notes mention the date 26/01/2018. Other than that all references are just to V3.