Search Unity

easy roads in unity

Discussion in 'Assets and Asset Store' started by raoul, Mar 18, 2009.

  1. jdurnil

    jdurnil

    Joined:
    Dec 26, 2013
    Posts:
    16
    I have reimported water package, material keeps saying "none available!"
     
  2. jdurnil

    jdurnil

    Joined:
    Dec 26, 2013
    Posts:
    16
    I am attempting to create a river going down a mountain but no matter what I set it maintains the same y position and brings the terrain up to it as the mountain slopes downward. I have tried force y position on and off and with low and extreme values, is it possible to get the river to follow the slope of the mountain? I am getting the same result each time, I am getting an inaccurate raycast warning, check river surface geometry. Don't know if that has anything to do with it or not
     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi jdurnil, I am unfamiliar with water plus. But I assume it provides a set of materials and scripts,

    EasyRoads3D itself can "see" the default Unity water materials, water scripts etc. For other water solutions it is a matter of either attaching the materials and scripts to the generated river surface object or, alternatively, you can try exporting the generated river surface to .obj using the build in export option (I can also provide a scripts that creates a mesh asset) and simply assign the mesh component of the exported object to the Meshfilter of your specific water prefab. This is also the recommended workflow for Unity's water 4. It is probably the easiest/ way for quick results.

    Let me know if you need more help with this!

    Raoul
     
  4. ConjureScape

    ConjureScape

    Joined:
    Feb 14, 2013
    Posts:
    445
    Hey Raoul
    Is it possible to get the source code of Easy roads as with many other plugins on the store?
    I would like to modify the system to suit my project's needs.
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi 3d_Game_Ready, there are indeed many plugins with source but also many without source or at least the core code being not clearly exposed, EasyRoads3D being one of them. That is the way we set it up in the beginning, EasyRoads3D is part of our main project, the Asset Store versions are compiled automatically from that code.

    That said we give a high level of additional support. Depending on the changes you want, we may incorporate that in the tool or otherwise, if it is not a huge amount of work, we can do that specifically for you. Just let me know (you can send an email or pm if you want).

    Raoul
     
  6. ConjureScape

    ConjureScape

    Joined:
    Feb 14, 2013
    Posts:
    445
    No worries. I can certainly understand and respect your need to protect your code.

    What I am looking to do is to adjust the amount of terrain deformation applied per marker. I'm making an offroad game and want sections with smooth road and sections with more rough terrain and anything inbetween.

    It looks like I can butcher your code to work if I insert method calls inside your scripts that call the DLL. Using terrainData.GetHeights I capture the terrain before your script applies deformation and then calculate an intermediate value based on the distance to the nearest marker (and that marker's adjusted fade value) in order to apply an adjustable terrain deformation value per marker.

    If this is something you can quickly implement your side and you think others will benefit from I will appreciate it..if not don't worry.
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi 3d_Game_Ready, terrain deformation is not done per marker so it is not that you can easily adapt the code to achieve what you want. The easiest way to implement this is probably indeed capture all original heights before doing the terrain deformation. Afterwards you compare the heights. When the height of a terrain point has changed, get the closest point on the road, check between which markers that point is and at what distance. With that info you can assign a specific deformation weight value based on the values you assigned to the corresponding markers. With this weight value you can set the final terrain height.

    You can add this new marker option “Terrain Deformation Weight” in markerScript and markerEditorScript which is all exposed. If you want I can help with all this.

    But I guess you are not using a road mesh, do you? Because that will not work well.

    Btw. V3 has something like this implemented including adapting the road mesh but at this moment it is not possible to set the smoothness value per marker, I could add that.

    Raoul
     
  8. ConjureScape

    ConjureScape

    Joined:
    Feb 14, 2013
    Posts:
    445
    Hi Raoul

    Yes, that's exactly my approach! I've almost got it working but I will shout if I get stuck. Since it's an offroad game I don't use a mesh, just terrain deformation.

    On your website it mentions:
    COMING IN EASYROADS3D V3 (included in a Pro license)
    What do you mean by: included in a Pro license?

    Best
    Jake
     
  9. raoul

    raoul

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

    Ok, great, I just wondered regarding the road mesh because we do use the road mesh with offroad textures for this type of tracks. Anyway, just let me know if you need help on this...

    EasyRoads3D Pro includes all future versions for free, so if you have a Pro license you will have access to v3 and you can already try the v3 betas.

    Thanks,
    Raoul
     
  10. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
    I have a few bugs that complicate my work with the asset.

    - Problem with sideobjects: when click on edit road again, sideobjects setup on the road was reset.
    - Road Resolution always reset to one or zero value, despite of differend value showed in settings.
    - When I click on the road or sideobject in the scene by mistake, the road switch to edit mode, and I lose settings of sideobjects, resolution and material of the road(but road mat. is not from list of easyRoads materials) , and i have to set it all again. I'm little frustrated.
    - When sideobjects is switch off on road segment, the side object collider is still there. I have to move with them on x or y axis to remove collider.
    - When create roadObject with the name e.g. "myroad01" and delete it later, I can't create roadobject with the same name again. Road object already exists.

    Other than that, it's good asset.
     
    Last edited: Feb 21, 2015
  11. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi 4crash,

    - Problem with sideobjects: when click on edit road again, sideobjects setup on the road was reset.

    In v2 side objects are created in Build Mode and indeed removed when switching back to Edit Mode. But the side object settings are not reset. Is this what you meant? In v3 Side Objects can be added / adjusted in both Edit and Build Mode.

    - Road Resolution always reset to one or zero value, despite of differend value showed in settings

    V2 has two road resolution settings, one for Edit Mode to improve performance on long roads in scene view and the resolution of the final road in Build Mode. When you set the resolution for Build Mode to, for example, 5, this resolution should be preserved and the next time you Build the road this resolution should be applied. Does that not work for you?

    - When I click on the road or sideobject in the scene by mistake, the road switch to edit mode, and I lose settings of sideobjects, resolution and material of the road(but road mat. is not from list of easyRoads materials) , and i have to set it all again. I'm little frustrated.


    Yes, that behaviour is not ideal but this only happens after script changes or after playing the scene. When you are ready creating the road, you can finalize the road. This will remove all the scripts, when you select the road afterwards it will no longer switch back to Edit Mode. In v3 all this is improved, the road network will only switch back to Edit Mode when you chose to do so. However, as mentioned in the first point, side object are only removed when switching back to Edit Mode. The settings should not reset, and rebuilding them should look similar as before.

    - When sideobjects is switch off on road segment, the side object collider is still there. I have to move with them on x or y axis to remove collider.

    I just double checked that. You are right, something is wrong with this, the Mesh Collider is not updated. It will update after Toggling Off/On "Add Mesh Collider" in the Inspector after selecting the specific side object. I will have a look at this.

    - When create roadObject with the name e.g. "myroad01" and delete it later, I can't create roadobject with the same name again. Road object already exists.

    EasyRoads3D stores specific data (road splatmaps, exported .obj files, etc.) in a folder named after the specific road name outside the assets folder ([your project]/EasyRoads3D/[road object name]). When you remove this folder as well, you will be able to re use the road name. This is not longer the case in v3 where the full road network is exported.

    By the way, this is the very first EasyRoads3D thread posted when I started experimenting with roads and Unity about 6 years ago. Check the first post in this thread for all other EasyRoads3D forum threads including the most recent v3 WIP thread (betas available).


    Thank you,
    Raoul
     
    Last edited: Feb 21, 2015
  12. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
    I work with easyRoads V2.
    My work with EasyRoads is probably different. I setting up the scene for a long time and I have to do a lot of tests, therefore I switch between modes very often.
    Maybe when I done everything in the scene for a first time I will have no problems, but this scenerio isn't real for me :)

    -resolution of road I mean resolution(num of faces) of finished road mesh.
    - Problem with sideObjects reset is when i click on a Sideobject in a scene and road switched to edit mode, then sideobjects isn't set individually on each marker how I sets them before. Sometimes when I edit roads the way that I click on the Icon, the settings keep up.

    Can I update to V3 EasyRoads, without pain in the scene where I have V2 Road objects?

    Thanks for your support.
     
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Which version of EasyRoads3D are you using? I double checked the latest 2.5.6, after you change the resolution to another value then 1, the resolution does not reset back to 1 when switching between Edit and Build mode.

    Do you mean a side object is for example not active for a specific marker, then after you switch back to Edit mode it is active for that marker? Can you provide a simply example project (by email)? Because, I have done this sort of thing literally hundreds of times in the past 4 years or so, I have never seen that happen. This also has never been reported before. I cannot replicate this. Or is this related to some specific settings?

    V3 is an entirely new system, currently v2 projects do not update to v3 but if there is demand for that I can add that feature. Also, please send me a PM or email if you like to try the v3 betas.

    Thanks,
    Raoul
     
  14. Black-pearl

    Black-pearl

    Joined:
    Mar 20, 2014
    Posts:
    55
    Hey everyone not sure what im doing wrong but this did work but Ive started to make a new road and unity wont put the road markers down on my terrain, is there a mandatory component I need which I may be missing?

    I haven't changed anything and tried reimporting the addon doesn't make any difference

    If it helps the roads I have, are now disappearing through the floor :eek:

    Help! lol thanks
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Black pearl,

    It looks like your scene has more then 1 terrain object.

    In v2, terrains are handles separately with regard to adding markers and building the final terrains.

    General Settings > Multile Terrains, activate this

    Further below select the terrain you are working on from the dropdown or ctrl+alt+click the specific terrain in scene view. You can now add markers and the middle Terrain tab will affect this specific terrain. Roads will not disappear below or float above this specific terrain object.

    All this is improved in v3, no need to select terrains when adding markers and you can build all terrains at once or select a specific terrain (faster during testing). http://forum.unity3d.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/

    Or is the issue you are having not related to this?

    More links, the active v2 thread: http://forum.unity3d.com/threads/82331-EasyRoads3D-v2-is-out--Road-rivers-procedural-geometry-for-Unity

    Thanks,
    Raoul
     
  16. Black-pearl

    Black-pearl

    Joined:
    Mar 20, 2014
    Posts:
    55
    Hey thanks for replying, nope ive already tried that

    For example

    If i create a new road object, now i add road markers onto my terrain, it will not add the road markers, but it did used too and i dont think i have changed anything

    Ive tried in another scene, same bug :(

    EDIT :- only using one terrain also
     
  17. Black-pearl

    Black-pearl

    Joined:
    Mar 20, 2014
    Posts:
    55
    ** FIXED **

    Found that installing the latest version of unity worked and then deleting and then reimporting my terrain worked perfectly

    Thanks for looking :)
     
  18. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Yes, indeed the only known other reason when things like adding markers or terrain deformation doesn’t work is when there are package import issues. For example, when importing the full version in a project with the free version already imported and not removed prior to importing the full package. And now also with Unity 4 and Unity 5 requiring different packages. I didn’t think of this since you mentioned it worked before and that should also raise errors.


    Anyway, glad to hear you sorted it out! :)


    Thanks,

    Raoul
     
  19. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
    I work with version 2.5.6, problem is that the number in form didn't change, but I see that the real resolution of the road changed to 1 or another low number. Next error is when I switch current indent in settings of the road, then I change this value for each marker, after I recreate road geometry default indent will set to high number again.
     
    Last edited: Mar 3, 2015
  20. raoul

    raoul

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

    Can you give exact steps how to replicate the resolution issue? As mentioned in my previous post, for me the resolution level remains the same after switching back and forth between Edit and Build Mode?

    The indent values are used to make sure the terrain (grid based) near the road is leveled at the same height as the road. The minimum value depends on the heightmapscale of the terrain in the scene. You can manually increase the values but you cannot go below this minimum value, it will result in the road floating above or below the road. You can increase the terrains heightmap resolution or use a smaller size for the terrain if you want lower minimum indent values.

    Thanks,
    Raoul
     
  21. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
    Do you have still the same real resolution of the road or only the same number in the settings?
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi 4crash,

    1. I create a new road object, add markers and switch to Build Mode, the resolution is set to 1
    2. I change the resolution to 5
    3. I switch back to Edit Mode and Build Mode again.

    The resolution is still set to 5 and the actual road resolution is created accordingly.

    This is also the case after adding markers in Edit Mode or after changing "Geometry Resolution" in General Settings which is used for Edit Mode only and can be used to improve performance on long tracks when editing the road.

    Thanks,
    Raoul
     
  23. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
    Hi
    1. I create a new road object, add markers and switch to Build Mode, the resolution is set to 1
    2. I change the resolution to 5
    3. I switch back to Edit Mode and Build Mode again.

    The resolution is still set to 5 and the actual road resolution is HIGH.

    Before editing:
    1NormalState.jpg

    After switch to edit and build mode again:
    2AfterEditToBuildModeSwitch.jpg

    After I change the resuliton in the settings then settings = real resolution.
     
  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi 4crash,

    So you took exactly the same steps as I did.

    I tested this in the development project. Which version are you using, the latest asset store version or our website version? And is this on Unity 4 or Unity 5?

    Thanks,
    Raoul
     
  25. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
    I have unity 4.6.1.p5. Now I found one EasyRoads object in the scene where is resolution switching OK.
    It's not significant problem for me.
    Your reacts and support are great, thanks for that. When I have a moment I try to find out where is a bug.

    BTW.
    Will my current Version of EasyRoads 2.5.6 works with unity 5?
    Thanks
     
    Last edited: Mar 5, 2015
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Strange, I also did some further tests as I saw you are using the splatmap feature. But I haven't been able yet to reproduce this (also testing on the latest 4.6 release).

    The current asset store version includes a "Unity 5" folder with a beta package for Unity 5. Please back up your project first! It should work just fine but we always do this, just in case... Last week I also uploaded the Unity 5 package through the Unity 5 editor. I think it is still pending review, but once it is accepted, the download should automatically be the Unity 5 version when Unity 5 is the active editor.

    Thanks,
    Raoul
     
  27. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
    Hi,
    I have a another problem with terrain update, and I don't know how to solve it. In editing mode, I have a flatten terrain under the road, when I switch to build mode the terrain under the road is bumped.
    Nothing helps. Recreate near markers or change splatmap, indent data.

    In Edit mode:
    InEditModeBumpedTerrain.jpg

    After switch to build mode

    1BumpedTerrain.jpg
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    You wrote that the first screenshot is in Edit Mode. I cannot see the white surfaces which should be visible in Edit Mode.

    Could you show the two screenshots a little bit more zoomed out and ideally with the same cam angle?

    Thanks,
    Raoul
     
  29. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
    White surface is not visible because I'm unchecked Display Object in General settings (For better view), You can see this in screenshot..
     
  30. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
    Strange interruption in white surface
    InEditModeBumpedTerrain2.jpg
     
    Last edited: Mar 5, 2015
  31. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    There is a gap between the white surfaces which could cause the issue.

    Do you see more gaps and is that where the bumps occur? What happens when you move this marker a little bit so the white surface updates? Does this gap disappear?

    Or, the white surfaces are a child object of the specific marker. It should not be possible to select these surface objects in the Inspector. Can you select them? If so, what is the positon of the two white surfaces near the gap? They should be at (0, 0, 0). If you cannot select it, can you comment out the code in /EasyRoads3D/Editor/SurfaceEditorScript.js, two lines in OnSceneGUI(). Now, you can select these objects. Are they positioned at (0, 0, 0)?

    Thanks,
    Raoul
     
  33. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
    The Gap doesn't disappear when I move markers.
    When I select the surface, selection automatic jump to parent marker.
    The little moment when surface is selected I see that position of surface is 0,0,0.
     
  34. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
    Maybe the problem occures when I delete or Insert markers.
    The marker before this gap was first and I inserted new markers to extend the road.
    When I delete near markers the gap is still there.
     
    Last edited: Mar 5, 2015
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    This part of the system has not changed since the release of v2 in 2011. I have not seen this before and I don't think it is related to deleting or inserting markers. Is the gap exactly at the same position when you delete a marker?

    Does inserting a marker near that spot tell more? What happens when you do that, is the gap moved to the left or to the right, or does it result in two gaps?

    Is this a closed track and are the surrounding markers the first and last marker? This shouldn't affect the white surfaces, just looking for a direction what could cause this.

    Would it be possible to email me the this so I can have a look at it? Project stripped down to terrain and roads only if you want.

    Thanks,
    Raoul
     
  36. 4crash

    4crash

    Joined:
    Sep 11, 2013
    Posts:
    13
    I don't remember where I was delete the marker.
    When I insert new marker, the gap appear in front of and behind the inserted marker.
    will be enough if I send you only the EasyRoad Object?
     
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    You could try duplicating the scene and in the duplicated scene remove all objects except the road object with that gap, and send this scene to me. I will probably be able to check the gap but I will not be possible to properly test the terrain deformation.

    Thanks,
    Raoul
     
  38. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    Hi. I followed the video tutorial for EasyRoads3 Beta for adding intersection prefabs and succesfully aded one but how do I extend it? In the video you just dragged on the handle to make it longer but when I try and drag the handle on my prefab nothing happens.
     
  39. raoul

    raoul

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

    After adding the prefab to the scene, do you see the yellow rectangles when moving the mouse over one of the green handles positioned in the center of a crossing connection?

    Click on the rectangle and drag will create a new road attached to that connection. Does that not work for you?

    This is the first EasyRoads3D thread. For more info on v3 please check this thread:
    http://forum.unity3d.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/

    Thanks,
    Raoul
     
  40. allpay

    allpay

    Joined:
    Mar 28, 2012
    Posts:
    32
    When loading scene getting 15 x errors like this:

    ArgumentException: GetLocalizedString can only be called from the main thread.
    Constructors and field initializers will be executed from the loading thread when loading a scene.
    Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
    TreeEditor.TreeGroupLeaf..cctor ()
    Rethrow as TypeInitializationException: An exception was thrown by the type initializer for TreeEditor.TreeGroupLeaf
    UnityEditor.DockArea:OnGUI()

    When I remove roads and side objects, all errors gone.

    What should I do?

    Pls help,
    Thanks
     
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
  42. allpay

    allpay

    Joined:
    Mar 28, 2012
    Posts:
    32
    You are right... Its about side objects shaders. Problem fixed. Thank you.
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Glad to hear you got that working :)

    Raoul
     
  44. klund

    klund

    Joined:
    Mar 21, 2011
    Posts:
    33
    Hi Does EasyRoads generate a mesh in the editor that i can later export to fbx ?
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Last edited: Sep 24, 2015
  46. klund

    klund

    Joined:
    Mar 21, 2011
    Posts:
    33
    Thanks
    The new quetions is how to i add to the beginning. Say you started in the middel af the terrain to create a road going to the right. When that is done how will you add to the beginning going left ?


    Skærmbillede 2015-09-24 kl. 14.13.31.png
     
  47. raoul

    raoul

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

    V2 does not support adding markers to the beginning of the road. As a workaround you could insert markers between the first and second and move the first marker to the new position.

    V3 however does support adding markers at the beginning, simply select the first marker, newly added markers will connect to the first marker.

    Thanks,
    Raoul
     
  48. FlyAnvil

    FlyAnvil

    Joined:
    Aug 14, 2013
    Posts:
    9
    Please tell me how you fixed this problem?
     
  49. raoul

    raoul

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

    No more additional info was given related to this particular post. Could you pass more details about this problem?

    I am asking this because the error message mentions TreeEditor.TreeGroupLeaf so I guess it is related to Unity trees used as side objects. Is that the case?

    And is this EasyRoads3D v2 or v3 beta related?

    v2: http://forum.unity3d.com/threads/ea...d-rivers-procedural-geometry-for-unity.82331/
    v3: http://forum.unity3d.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/

    Thank you,
    Raoul
     
  50. Guats

    Guats

    Joined:
    Aug 11, 2015
    Posts:
    6
    Hi Raoul,

    I've really been putting Easy Roads through it's paces this week. An issue you may or may not know about is causing me some trouble but I can work around it. Basically when you have a single cross piece and you shift drag a road from it, the road will not inherit it's road segment amount from the road defined in the settings of the cross piece. I've attached an image.

    My solution to get the first road started is to create the road disconnected then connect it. Otherwise the road inherits this 'high segment' default geo setting. I have also made sure that this high segment setting is not attached to any of the prefabs I have made, so I can only assume this is a bug?

    Anyhow, this is by far the best Roads plugin out there, when you have ironed out the kinks I'm sure it will be used as the premiere road tool in Unity.

    We are using this for the roads in our game Hurtworld. Our modding community are using it also. They have been getting pretty good results.

    Keep up the good work.
     

    Attached Files: