Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

EasyRoads3D v3 - the upcoming new road system

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

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Beta 8.2 is now available for download from our website

    The Assetstore version will be uploaded today as well.

    New:

    - Side Objects > Import Side Objects: This can be used to import side objects from other projects into the current project / scene.

    - [WIP] General Settings > Scene Settings: Global Grid. When active markers and crossings will snap to the grid. This is useful in rectangular type of city environments and residential zones. This is added upon request and will be expanded further with additional local grid options (allowing local grid rotations).

    - Side Objects > Mesh type of Side Object > Bridge Object: This will display bridge specific controls to optimize the scene workflow when using a mesh prefab as a bridge side object. The below bridge prefab example has been added to the current 8.2 package. Please check the Side Objects section in the manual for further details



    Improved:

    - Side Objects > Connection objects: prefab childs control (through the dropdown) has been added to connection objects assigned to procedural or shape type of side objects. Just like for Mesh type of side objects you can now chose to have all child objects instantiated, one child object in sequence or a random child per instance. This can be used to add variation to, for example, fence posts.

    - Terrain deformation for custom prefabs with only one connection is now functional

    - Build Road Network Tab> "Selected roads only". This is useful during development whilst working on a specific road. It speeds up the build procedure significantly for scenes with larger road networks.

    - Scripting API: New ERConnectionData class and function: public ERConnectionData[] ERConnections.GetConnectionData(). This can be used to find which road objects are attached to a connection prefab.

    As always, please backup your project first before upgrading :)

    Thanks,

    Raoul
     
    Last edited: Oct 31, 2016
  2. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    About that new version. Did you add that "Flip textures" to API?
     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    The 8.2 builds were already prepared over the weekend. If you want I can send you a 8.3 alpha build after this is added.

    Thanks,
    Raoul
     
  4. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    I'd like that
     
  5. Justice0Juic3

    Justice0Juic3

    Joined:
    Apr 29, 2013
    Posts:
    185
    I just found this topic today. Looking great so far.
    I have only got two questions.
    1. I probably missed it, but will there also be a free version?
    2. If yes, will there be a basic side-object for the free version as well?

    P.S. It's been a long time since there was a tool for an affordable price. (budget...cough)
     
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi Justice0Juic3,

    Thank you!

    The free version will be updated but please be understanding that there will be limitations and it could very well be that side objects is one of them. It is the same as with v2, if too much would have been added to the free version no one would have gone for the Pro version, meaning that v3 would probably never exist.

    I hope you are saying that the current asset store offer of $45 is very affordable for what you get, it won't stay at that price :) It is meant as an incentive to get v3 now, start working with it whilst the tool is being completed for the official release with a lot more additional assets, a new demo project, new tutorials etc.

    Raoul
     
    Last edited: Oct 31, 2016
  7. James_FallenTreeGames

    James_FallenTreeGames

    Joined:
    Sep 30, 2016
    Posts:
    16
    Hi Raoul,

    I'm using v8.2 off the asset store and noticed the API has been updated to include connection data. I've been trying to get this to work and have got some ERConnection via ERRoadManager.GetConnections() , but whenever I access ERConnection.connectionData that field is always null. I've definitely got multiple roads into my connections.

    Do I need to call a setup function to get the data populated or is that an issue with the API?

    My previous work around of looping through all the roads to find the connections at the start + end of every road, to see if they match the ERConnection still works, so the roads are connected. But the API doesn't seem to be working.

    Any ideas?
     
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi James,

    What is the exact code you are using? Because, for example, ERRoadManager does not exist in the API.

    Below is an example of what was used to test this starting at a specific road.

    Code (csharp):
    1.  
    2. [MenuItem( "EasyRoads3D/Get Connection Info" )]
    3. public static void  GetConnectionInfo ()
    4. {
    5. ERRoadNetwork roadNetwork = new ERRoadNetwork();
    6. ERRoad road = roadNetwork.GetRoadByName("Default Road 0008");
    7.  
    8. int connectionIndex;
    9. Debug.Log("Start: " + road.GetConnectionAtStart(out connectionIndex) + " con index: " + connectionIndex);
    10. Debug.Log("End: " + road.GetConnectionAtEnd(out connectionIndex) + " conn index: " + connectionIndex);
    11.  
    12. GameObject go = road.GetConnectionAtEnd(out connectionIndex);
    13.  
    14. ERConnection conn = roadNetwork.GetConnectionByName(go.name);
    15.  
    16. ERConnectionData[] connections = conn.GetConnectionData();
    17. for(int i = 0; i < connections.Length; i++){
    18. Debug.Log(connections[i].road.gameObject.name +" "+ connections[i].marker+" "+connections[i].connectionIndex);
    19. }
    20. }
    21.  
    ERConnectionData[] connections = conn.GetConnectionData();

    This is mentioned in the 8.2 release notes in the doc :)

    This was tested in the development project. I will check this in the final build but I would think it should work the same.

    Thanks,
    Raoul
     
    Last edited: Nov 3, 2016
  9. James_FallenTreeGames

    James_FallenTreeGames

    Joined:
    Sep 30, 2016
    Posts:
    16
    Sorry I don't have a ERRoadManager either :) I was getting a bit confused when copying my code over.

    Um, that's strange I don't have ERConnection.GetConnectionData(), I just have a variable in ERConnection: public ERConnectionData[] connectionData;

    Code (CSharp):
    1.  
    2. ERRoadNetwork roadNetwork = new ERRoadNetwork();
    3. var allConnections = roadNetwork.GetConnections();
    4. for ( int i = 0; i < allConnections.Length; i++ )
    5. {
    6.   ERConnectionData[] connectionData = allConnections[i].connectionData;
    7.   if ( connectionData == null )
    8.   {
    9.     Debug.Log( "Connection data is null" );
    10.   }
    11.   else
    12.   {
    13.     // Do something with connection data
    14.    ...
    15.   }
    16. }
    17.  
     
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Ok, I thought perhaps you have your own ERRoadManager class :)

    Could you try changing line 6 into:

    Code (csharp):
    1. ERConnectionData[] connectionData = allConnections[i].GetConnectionData();

    Thanks,
    Raoul
     
  11. James_FallenTreeGames

    James_FallenTreeGames

    Joined:
    Sep 30, 2016
    Posts:
    16
    No I can't, that is what I said before, I don't have that GetConnectionData() function.

    My ERConnection looks like this:

    Code (CSharp):
    1. public class ERConnection
    2.     {
    3.         public static string str;
    4.         public ERConnectionData[] connectionData;
    5.         public GameObject gameObject;
    6.         public string name;
    7.         public ERCrossingPrefabs prefabScript;
    8.  
    9.         public ERConnection( GameObject go, string g_name );
    10.  
    11.         public static ERConnection Create( GameObject go );
    12.         public void Destroy();
    13.         public string GetName();
    14.         public ERConnectionData[] OCDQQCQDDD();
    15.         public void SetName( string name );
    16.         public void SetPosition( Vector3 pos );
    17.         public void SetRotation( Vector3 euler );
    18.         public void UnConnect( int connectionIndex );
    19.     }
     
  12. James_FallenTreeGames

    James_FallenTreeGames

    Joined:
    Sep 30, 2016
    Posts:
    16
    Have spotted the error, just trying it now using ERConnection.OCDQQCQDDD();

    .... yep that works fine. I guess your encrypting code has encrypted the wrong function :-o
     
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Yes, you are right :(

    I am going to prepare a new alpha build anyway today, if you want I can send it to you as well. Looking at your screenname, am I indeed usually in touch with Joe? Can I send it to him? Otherwise please pm your email address.

    Thanks,
    Raoul
     
  14. James_FallenTreeGames

    James_FallenTreeGames

    Joined:
    Sep 30, 2016
    Posts:
    16
    OK great thanks, if you could send it to Joe that would be awesome.
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Ok I will send an update to Joe later today.

    Thanks,
    Raoul
     
  16. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    One more annoying thing. When creating roads at runtime, Erroadnetwork / Initroad will write to Debug.Log.
    It's frustrating, when starting the game which have a lot of runtime roads and then you have to find
    log messages from your own debug.logs. Now I have my log full of "True x" lines ;)

    Could you add "ERRoadNetwork.LogMessages = messages.All / Important / ErrorsOnly / NOTHING" or something like that...
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hello Jari,

    I will check that.

    Can we keep it constructive, could you be specific, what are the other annoying things? Or is that related to James_FallenTreeGames post above?

    Did you receive my email yesterday with the alpha build?

    Thanks,
    Raoul
     
    Last edited: Nov 4, 2016
  18. JOKaija

    JOKaija

    Joined:
    Feb 8, 2015
    Posts:
    161
    Yeeeeeeep :)

    Haven't check yet. Busy with other code. Almost ready with multiplayer network test phase with attackings...
     
  19. Rouslan-Vodenitcharov

    Rouslan-Vodenitcharov

    Joined:
    May 1, 2015
    Posts:
    9
    Hi,
    How can I edit the box collider of side objects?
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hello Rouslan-Vodenitcharov,

    The Box Colider option will look at the bounds of each instance when generated in the scene. Are you looking for general x,y,z resize options relative to the bounds of the source mesh? That can be added.

    Thanks,
    Raoul
     
  21. Rouslan-Vodenitcharov

    Rouslan-Vodenitcharov

    Joined:
    May 1, 2015
    Posts:
    9
    But I do not want to scale the object. Just want to make the collider big enough, so the player can not jump over there.
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Yes, That is what I meant, if you have Box Collider selected instead of Mesh Collider, you will be able to set scale values separately for x,y,z, (default 1,1,1).

    Thanks,
    Raoul
     
  23. Rouslan-Vodenitcharov

    Rouslan-Vodenitcharov

    Joined:
    May 1, 2015
    Posts:
    9
    Ah, now I've got it. Thanks for the quick reply.

    All the best
    Rouslan
     
  24. mike_kennedy989

    mike_kennedy989

    Joined:
    Feb 5, 2014
    Posts:
    51
    V3 Beta question

    I am working with the V3 beta, we are a pro customer through the Unity asset store.
    While working with the road system there is a large white colored mesh on the roads sides that makes working with it a pain because I am creating a lot of roads in a small area. is there a way to turn that off, it's making it really tough to see whats happening. I know if i bake these roads that will go away, but I am not ready to bake the roads yet. A screen shot is here:
     

    Attached Files:

  25. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi Mike,

    These white surfaces visualize how the terrain will be flattened which is especially helpful for roads higher above the ground. In the marker settings you can tweak the shape of these surfaces per marker (Indent and Surrounding) which gives additional control over how the terrain will be flatened according the road shape.

    General Settings > Scene Settings, here you will find several options on how to visualize this. You can also chose to hide these surfaces completely.

    Thanks,
    Raoul
     
    Last edited: Nov 7, 2016
  26. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    507
    Hey,
    I got a short question:
    Can i use easy roads to scatter a road network over a random generated terrain?

    Cheers!
    Kev
     
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi Kev,

    That is currently not built-in but v3 includes a scripting API than can be used both at runtime and in the unity editor. You could use that to create your random road networks.

    Thanks,
    Raoul
     
  28. James_FallenTreeGames

    James_FallenTreeGames

    Joined:
    Sep 30, 2016
    Posts:
    16
    Hi Raoul,

    I'm using the latest Alpha build which you sent Joe (Fallen Tree Games) but I'm still having the problem I reported a few weeks back, that the ERRoad.GetRoadType doesn't seem to work correctly.

    I'm expecting a call like ERRoadType.GetRoadType() but the only call I have is public ERRoadType GetRoadType( ERRoadType[] roadTypes ); Why do I need to pass in a list of roadTypes to get the type back from a road?

    I've tried passing in a list of roads as per the API and on some roads I get an ERRoadType back, but most of the time I get null as the ERRoadType.
     
    Last edited: Nov 9, 2016
  29. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi James,

    The update I sent to Joe was related to GetConnectionData().

    Indeed that should be ERRoad.GetRoadType(), I will change that. ERRoad.GetRoadType(null) should work because the passed array of road types is not used.

    I am not sure why you get null sometimes for the returned road type. What is your setup? Are you creating the roads through the API by assigning the road type? Or are the roads created in Scene View? Can you see a pattern? For example, were the roads that do not return a road type created manually through the second tab from the left or pulled out from connection prefabs? In the case of the latter, which connection prefabs? Do the connections of these prefabs have road types assigned?

    Thanks,
    Raoul
     
  30. zinkins

    zinkins

    Joined:
    Jun 3, 2015
    Posts:
    16
    Hi, raoul!
    I'm trying to reimport EasyRoads v3 beta 8.2. I got this errors in log when I just click on "Road Network" object in Hierarchy in "scene main" scene.
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. EasyRoads3Dv3Editor.ODCQDDOOQD.ODOODQOOCQ (EasyRoads3Dv3.ERModularBase scr)
    3. EasyRoads3Dv3Editor.OOQODQOOQO.OnEnable ()
    I begin with importing "EasyRoads3D v3 Beta 8.2" file from EasyRoads3D Pro.unitypackage. Then importing all folders except Standart Assets.
    After that I load "scene main" scene from "EasyRoads3D scenes".
    Then click on "Road Network" object in Hierarchy.

    I got Unity 5.4.0p4 on win7-64.
    I tried to reimport all after removing all Easyroads folders (except files in Standart Assets) and Editor script and importing package again but with no success.
    Could you please help resolve this issue?
     
  31. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi zinkins,

    It sounds like you imported the new package in a project with an older version already imported?

    You mentioned that you deselected the Standard Assets folder in the Import Window. When importing the package in a project with the full version imported the Standard Assets folder is not displayed in the Import Window because there are no new or updated assets in this folder. Or does this folder not exist in your project at all?

    Anyway, I just tested the 8.2 package in an project and in a new project by not importing the Standard Assets folder. Assets in the Standard Assets folder are used in "Scene Main", so indeed some warnings appear and the terrain does not look as it should. However, I can select the Road Network without issues and everything is functional.

    The error seems to appear in OnEnable(), so I wonder whether the EasyRoads3D folder hierarchy is complete and all EasyRoads3D assets are imported. I will make sure the error handling is a little bit more descriptive when something is not right with this. If you want I can send you an update so we can see what exactly goes wrong on your end. Please send me a PM with your email if you like to do that.

    Did you try the package in a new project, does that work for you?

    Thanks,
    Raoul
     
    Last edited: Nov 11, 2016
  32. Mr_Dan_O

    Mr_Dan_O

    Joined:
    Oct 12, 2013
    Posts:
    347
    Good, Could you please add "extrude" feature so that we can use it instead of "raising roads". When you extrude a road, it wouldn't look like a road which is floating on air. (For optimizing reasons, only LOD 0 better be extruded).
     
    toto2003 likes this.
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi D4N005H,

    That will be added, it is not too complicated but the dynamic crossing system needs to be adapted to this as well.

    But you can already do this using custom connection prefabs. The current demo scene includes an example of this, the single lane road that connects to the custom T crossing.

    Regarding raising the road network, unless your cam positions are very close near the ground, raising the road up to 0.05 or so is hardly noticable. On reasonably flat terrains 0.01 or 0.02 should already by sufficient if you do not use the EasyRoads3D offset shaders.

    Thanks,
    Raoul
     
    Mr_Dan_O likes this.
  34. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,030
    Hi raoul,
    I like how the road makes surface under it to flat. I need to do same with my building (I need to match building with terrain), can you please help? is there an script for that?
     
  35. zinkins

    zinkins

    Joined:
    Jun 3, 2015
    Posts:
    16
    Hi! Thanks for your answer!
    Was the first import successful or not, I don't remember. I had moved EasyRoads folders into my Tools folder and after that it started to raise this error I mentioned. I've tried to remove all EasyRoads folders except Standart Assets ('cause it has other required assets) and reimport into the root Assets folder without Standart Assets but I got that error.

    I tried this on new project (removing and reimporting) and at first it raised this error message but then it's gone and reimport became successful. I can't reproduce it. So I believe I got some undeleted files, settings or scripts on game objects in my working project that prevent reimport but I may be wrong.
    Also I see that names of Road Types are quite messy, just sets of digits and letters, 44656661756c7420526f61642031 for ID = 0 for instance. So maybe it's a serialization bug. Reimporting all assets didn't help.

    Maybe this info helps.
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi ksam2,

    Check the TerrainData class, GetHeights(), SetHeights(). Then it is up to you how to change the height data, for example get the bounding box of your buildings and adjust the matching terrain cells accordingly.

    Thanks,
    Raoul
     
    Last edited: Nov 14, 2016
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi zinkins,

    Yes, as already mentioned in my previous post my first thought is that something is wrong in the assets folder, missing assets? Since you mention that you put the EasyRoads3D folder somewhere else in the Assets folder It is a bit hard to debug your situation without being able to look at it.

    I mean when you reimport the package, it will be imported in the default location, so at that point you have duplicated versions. What did you do next? Certainly when you have your own road types and side objects you probably do not want to delete the original folder completely, this data is stored in the resources folder.

    The only thing I can suggest is to send an update that will output warnings in the OnEnable() code, this may give more info.

    Those digits and numbers is a known Unity issue, it is indeed related to asset serialization. Your project probably uses Text Mode for Asset Serialization. The Troubleshooting page in the manual includes a workaround to deal with this. In short, import the package in a new project using the default Mixed Mode for asset serialization, switch to text Mode afterwards, export the package and import this package in your working project.

    Thanks,
    Raoul
     
  38. zinkins

    zinkins

    Joined:
    Jun 3, 2015
    Posts:
    16
    Yes, my project has Text Mode for Asset Serialization. I've done that workaround with serialization you suggested and now import in my project is ok!
    Thanks!

    Steps I can reproduce the bug:
    0) Prerequisites: Unity 5.4.0p4, win7-64
    1) create new project
    2) set Mode to Force Text for Asset Serialization
    3) import EasyRoads3D v3 Beta 8.2 from package, then import all
    4) open "scene main" scene
    5) click on Road Network object and got error
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. EasyRoads3Dv3Editor.ODCQDDOOQD.ODOODQOOCQ (EasyRoads3Dv3.ERModularBase scr)
    3. EasyRoads3Dv3Editor.OOQODQOOQO.OnEnable ()
    4.  
     
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi zinkins,

    Yes, Force Text for Asset Serialization indeed seem to cause that issue in OnEnable() in Unity 5.4

    I will look into this, thank you!

    For those who are using Force Text, the workaround mentioned at the bottom of my previous post is required anyway and will solve that problem as confirmed by zinkins.

    Raoul
     
  40. Himanshuchahar

    Himanshuchahar

    Joined:
    Apr 15, 2016
    Posts:
    42
    First of all thanks for the great package, your package has made it very easy to create amazing roads for the games of almost all genre.
    I will buy the package today, but have couple of doubts:
    Below is my requirement:
    I have created a terrain with big mountains, and I want to have road on that terrain something like hairpin roads. Is it possible with EasyRoads3D?
    My understanding is, EasyRoads3D is capable of creating roads on mountain terrain. EasyRoads3D will automatically blend well on terrain and will create a road. Please correct me if I am wrong.
    For example:
    http://www.unityterraintools.com/temp/road_cliff2.jpg (this is taken from you thread, I want to create almost same like this)
    Or will I have to create a path by myself and then will have to place the road texture on that?

    My problem is I am not able to create a smooth path on terrain, whenever I try I end up with bumps and uneven road.
    And this is where EasyRoads3D will do the magic.

    Cheers!!!
     
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi Himanshuchahar,

    Glad to hear you like it!

    Big mountains / steep height differences and hairpins is the most complex situation to deal with when creating roads on the Unity terrain object. The higher the heightmapscale (terrain size vs terrain heightmap resolution) the less flexible you are with sharp bends, there simply will not be enough terrain points available to adjust the terrain nicely to the road shape.

    The terrain in that screenshot is a 2000x2000 terrain, heightmap resolution 513. There is no way to get a smooth terrain shape that close to the road using the terrain object by itself. What you see are terrain mesh overlays automatically generated with the side object system. The workflow is described in this post as a reply to this post:

    https://forum.unity3d.com/threads/e...g-new-road-system.229327/page-50#post-2712437

    Meanwhile in the latest beta builds, the final step at the bottom of that post, adjusting the terrain deformation can be done automatically by marking the side object as "Terrain Surface Object" in the Side Object Manager, this saves a lot of time.

    I am not exactly sure what you mean with this? In v3 you can create road types and assign materials to these road types. The package comes with example road types, the final version will have a lot more road types and materials. When you create a new object of a specific road type in the scene, the associated material will be assigned automatically.

    Thanks,
    Raoul
     
    Last edited: Nov 17, 2016
  42. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    507
    hey, thanks. so i played a lil' bit around with it and it looks pretty good. there is one thing in the API which i dont understand:

    Code (CSharp):
    1. Vector3[] markers = new Vector3[4];
    2.         markers[0] = new Vector3(200, 5, 200);
    3.         markers[1] = new Vector3(250, 5, 200);
    4.         markers[2] = new Vector3(250, 5, 250);
    5.         markers[3] = new Vector3(300, 5, 250);
    6.  
    7.         road = roadNetwork.CreateRoad("road 1", roadType, markers);
    8.  
    9.      // road.SetResolution(float value):void;
    10.  
    11.  
    12.         // Add Marker: ERRoad.AddMarker(Vector3);
    13.         road.AddMarker(new Vector3(300, 5, 300));
    14.  
    15.         // Add Marker: ERRoad.InsertMarker(Vector3);
    16.         road.InsertMarker(new Vector3(275, 5, 235));
    17.     //  road.InsertMarkerAt(Vector3 pos, int index): void;
    18.  
    19.         // Delete Marker: ERRoad.DeleteMarker(int index);
    20.         road.DeleteMarker(2);
    21.  
    so the markers Array is the actual road network/line, right?

    but what does AddMarker/Insert Marker actually do? and why are the Vectors (300-5-300 & 275-5-235) not the same as markers[0] for example?
     
  43. Himanshuchahar

    Himanshuchahar

    Joined:
    Apr 15, 2016
    Posts:
    42
    Thanks a lot Raoul for your quick response.
    I got my answer and I am going to buy it for sure :)
    In case I stuck somewhere, will drop a message for your help :)
    One more help please, I am targeting mobile platforms only, so just wanted to ask how is the performance on mobile? Do I need to focus on particular settings for mobile platform? My game is a more like a bus simulator and is all about nice terrain effects and smooth roads.
     
    Last edited: Nov 17, 2016
  44. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi Kev,

    The markers array defines the shape of that specific individual road of the road network.

    When you create a road manually in Scene View, Shift + Click is used to add new markers at specific positions. That array represents the same, that is why all Vector3 positions in the array are different.

    AddMarker() does the same as Shift + Click in Scene View, it will add a new marker at the end of the road. InsertMarker() does the same as the I key in Scene View, which inserts a marker at a specific position between the neareast two markers.

    Thanks,
    Raoul
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Hi Himanshuchahar,

    The roads can be customized, you can set the resolution or use the Angle Threshold option to reduce the triangle count.

    As mentioned you can optimize the roads. But "Big Mountains", "nice terrain effects and smooth roads" targeting the mobile platform, that is a challenge whether you use EasyRoads3D or not :), it will probably be a matter of finding a balance between the two.

    Yes, just let me know if you have further questions.

    Thanks,
    Raoul
     
    Himanshuchahar likes this.
  46. Himanshuchahar

    Himanshuchahar

    Joined:
    Apr 15, 2016
    Posts:
    42
    Thanks Raoul :)
    Your package is so awesome that it automatically creates nice and smooth roads :D
    Is there any setting which I need to keep in mind so it runs perfectly on mobile? I am asking from EasyRoads3D perspective.
     
  47. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Whether it runs perfectly depends on so many other factors as well, there is no magical setting for that.

    As mentioned, it is a matter of finding a balance that works well for you scenes. I would first experiment with different settings, mainly the Road Resolution and Angle Threshold controls.

    Once you figured out what works well for your scene you can adjust the road type settings in General Settings > Road Types. Every new road you create will now inherit these settings.

    Thanks,
    Raoul
     
    Himanshuchahar likes this.
  48. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    507
    ah, thanks! the runtime generation is pretty nice actually. good job!
    still, more questions are raising over my head :D

    so.1) can i snap the road to the terrain and raise the terrain at the same time?
    (when i have an offset on the snap to terrain method)

    2.) can i add a junction somehow? so that this doesn't happen:
    kreuzung.jpg
     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,211
    Building road networks through the scripting API works the same as when you create the road network in Scene View.

    So you add crossing / connection prefabs in the scene and attach roads to them.

    Not all the scene view functionality is available yet in the API but you can instantiate crossing prefabs in the scene and attach roads.

    http://unityterraintools.com/EasyRoads3D/v3/html/scriptingAPI.html

    As a start you want to look at:

    ERRoadNetwork.LoadConnections()
    ERRoadNetwork.InstantiateConnection(ERConnection sourceConnection, string name, Vector3 position, Vector3 euler)
    ERRoad.AttachToStart(ERConnection connectionObject, int connectionIndex)
    ERRoad.AttachToEnd(ERConnection connectionObject, int connectionIndex)

    Always updating the terrain after every change can be a time consuming process, especially on terrains with a low heightmapscale and dense vegetation. That is why the Scene View functionality works by switching back and forth between Edit Mode and Build Mode with the latest option in beta 8.2 to only build the selected road during testing.

    You could try building / restoring the terrain after changes. This will probably work well on shorter roads and not too complex terrains.

    Thanks,
    Raoul
     
  50. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    507
    hey, thanks!
    maybe i got something wrong, but, my points/markers ( road=roadNetwork.CreateRoad("road1",roadType,points); ) will be generated on startup. random.
    so i guess i have to figure out. somehow where two roads are overlapping and "InstantiateConnection" where they overlapp? can you even check that?
     
unityunity