Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

EasyRoads3D v2 is out – Road, rivers, procedural geometry for Unity

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

  1. Gunhi

    Gunhi

    Joined:
    Apr 18, 2012
    Posts:
    300
    raoul, I'm not sure whether you have tested on Unity 4.2 or not. But there are some errors occurred when I try to "Build easy3D objects".
    My scene just has 10 Makers with no side objects. Some repeat error, this maybe the reason why I have to reopen Unity every time I want to Build road Objects.


    NullReferenceException: Object reference not set to an instance of an object
    at EasyRoadsEditorMenu.OQODQCCOCO (.RoadObjectScript target) [0x0003f] in /Users/myUser/Road3D/Assets/EasyRoads3D/Editor/EasyRoadsEditorMenu.cs:272

    This results crash Unity and nothing was built. Please, double check!
     
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    HI Gunhi, when you quit Unity and reopen the project and select the road object it should switch back to "Edit Mode" if it was saved in "Build Mode". So, yes, now you should be able execute EasyRoads3D Menu > Build EasyRoads3D Objects". But when the road is in "Build Mode" you can simply click the middle mountain tab again in the inspector to switch back to Edit Mode. There is no need to restart Unity etc.

    I just created a new project in Unity 4.2 imported the Assetstore version of EasyRoads3D, created a new road, added 10 markers and did "EasyRoads3D Menu > Build Easy3DObjects". I get no errors, the terrain is correctly deformed, the final road is created and the EasyRoasds3D editor object is removed from the scene hierarchy. So all seems fine. Can you give more info about the scene / road setup, are side objects involved? Can you send me a simple project so I can see this myself?

    Also, just to understand exactly when this happens, what do you mean in this case with "Build easy3D objects". Do you indeed mean "EasyRoads3D Menu > Build Easy3DObjects". Or do you mean, when you hit the middle mountain tab in the Inspector? I am asking this because you wrote that you have to restart Unity every time you want to Build Road Objects. So you are either referring to individual unique road objects for which this error always appears, or you are refrring to the middle tab in the Inspector. Because after you did "EasyRoads3D Menu > Build Easy3DObjects" The EasyRoads3D object doesn't exist anymore, you can only run this once on a road object. As both options work fine for me and I have not received any other reports regarding this lately, it seems unlikely that this happens for you with every new road object you are creating, does it?
     
    Last edited: Sep 1, 2013
  3. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    i have a flat terrain. on the road i want to place some boxes. on scene view box looks ok. in game window box looks under road. when i rise my box until it look all. this time box looks flying on the road. it behaves like road object blocks some vertices to render that close to it. how can i correct this?
     
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Atmuc, I am not entirely sure if I understand the problem correctly also because you mention that everything looks good in scene view. That sounds strange to me. What is the size of the boxes? Are they relatively small and is this happening when the camera is nearby? If the boxes are small then it sounds like this could be caused by the offset shaders. You could try lowering the offset values in the shader or, as you say the road is flat, use a standard diffuse shader on the road material and raise the road a little bit above the terrain.
     
  5. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    i scaled object bigger and it looks better now. this size is better for me :) i will also try your other suggestions.

    also once you gave me road tracking script (Road Scripts) on this script you calculate points and distances. for example i have 8 markers. script adds 11 markers, 16.000 points, 8 distances.

    is there any easy way to get "road length" and position/rotation of a specific distance or percentage? for example. if road length is 100m, i want to know the position of 15m or %15 of the road. i want to place some props to road dynamically.

    Edit: i examined your code. it looks you implemented this formulas; http://www.dxstudio.com/guide.aspx?id=70a2b2cf-193e-4019-859c-28210b1da81f and you divided area between markers to 2000 lines and calculated these distances.
     
    Last edited: Sep 2, 2013
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Atmuc,

    That page doesn't load for me but the spline formula is at the bottom of the script you mentioned.

    Alternatively you could simply go through the generated points you mentioned, accumulate distances between points until you reach 15m. To get the point at exactly 15m, you look at the distance between the last point below 15m and the point that exceeds 15m. Subtract the total current distance from 15 and get the percentage of that against the distance of the last 2 points. Lerp between the 2 vectors using that percentage and you will get the point at exactly 15m.

    You can get the direction (dir) by subracting the two last vectors. Get the perpendicular vector of that, something like new Vector3(dir.z, 0f, -dirx).normalized, multiply that with the distance sideways where you want to position the object, add that to the point at 15m, Use Terrain.SampleHeight(pos) to get the correct y.

    Hope this helps...
     
    Last edited: Sep 2, 2013
  7. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    generated points are too much. 16.000 for 8 markers. i am learning spline formulas again. i am back to my high school/university years :)
     
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    The more points the more accurate the 15 meter calculation will be. That's why I wrote you can simply go through the points and accumulate distances until you reach 15m. That's the only thing you need, right?
     
  9. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    i finished my script. it uses roadobject directly and calculate position and rotation in runtime. so you do not need to import markers from road object. after i complete constant speed part i will share it.
     
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Atmuc, glad to hear you got that working and looking forward to see it!
     
  11. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    raoul, is easyroads3d compatible with phone 8 build? i get this error;

    Error building Player: Exception: Failed to run assembly preprocessor with command line "Temp/StagingArea/Data/Managed\EasyRoads3D.dll" -injectCtor -assemblyPath "Temp/StagingArea" -pdb.[Temp/StagingArea/Data/Managed\EasyRoads3D.dll]
    No symbols for Temp/StagingArea/Data/Managed\EasyRoads3D.dll
    Injecting ctor
    Error while in assembly preprocessor Temp/StagingArea/Data/Managed\EasyRoads3D.dll
    The given key was not present in the dictionary.
    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
    at AssemblyPreprocessor.ConstructorInjector.GetBaseConstructorMethodFor(MethodDefinition constructor, Dictionary`2 map)
    at AssemblyPreprocessor.ConstructorInjector.CreateBodyInvokingBaseConstructor(TypeDefinition parentType, MethodDefinition constructor, Dictionary`2 map)
    at AssemblyPreprocessor.ConstructorInjector.InjectConstructorsForTypesIn(ModuleDefinition moduleDefinition)
    at AssemblyPreprocessor.Program.Main(String[] args)
     
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Atmuc,,

    The end result is geometry only using ordinary Unity game objects with Meshfilters attached etc. So that should work just fine on phone 8. But I can't test that phone 8 builds myself and I cannot really see where the bit after "The given key was not present in the dictionary." comes from.

    It seems this is related to building the phone 8 build, not regarding creating the roads etc.Is that right? In that case and to solve posible build issues,, EasyRoads3D is an Editor tool. , There is no need to include the EasyRoads3D.dll in the final build. Just make sure to bake the final roads (EasyRoads3D Menu > Build Road Objects) or do this manually by removing all EasyRoads3D script components from the editor game objects.

    Does that work for you?

    Raoul
     
  13. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    Hi Raoul,

    to get this error it is enough to just import easyroads3d pro package to the project even i did not add any road object to the project. phone 8 addon is free. if you have windows you should be able to test it. maybe it is related how you build EasyRoads3D.dll. i also use Playmaker. it has it's own dll files. it is ok for phone 8 build.

    i will try bake/remove suggestion.
     
    Last edited: Sep 9, 2013
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Atmuc,

    I primarily use Unity on the Mac. I have a Windows machine with Win 7. It doesn't allow me to build for Windows phone 8.

    A while ago I received feedback from people using Windows 8 Metro. Importing EasyRoads3D resulted in errors regarding HashList and ArrayList because apparantly these are no longer supported on Windows 8 Metro. This was dealt with in EasyRoads3D v2.5.3

    The error message you posted is indeed another error message.

    Last week I actually received an email from someone who also had problems building for Windows Phone 8. My reply was almost as my reply to your previous post. I received an email back from him that he was able to build for Windows Phone 8.

    What if you create your roads etc. with something like webplayer selected as the build platform. You bake the objects like I mentioned in my previous post and then you select Windows Phone 8 as the build platform? Do you still get errors? In that case, what happens if you duplicate the full Project (so you have a backup of the original project) and also remove EasyRoads3D folder (as it is no longer required after building your roads) from the project folder and then select Windows 8 Phone? Will that get you going...?

    Remains the question, where that dictionary error comes from. It seems related to HashList which was previously used in the MeshCombine class which I rewrote so it no longer uses HashList. So I guess I have to double check that bit...
     
  15. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    I know, that is why I mentioned that that solution will at least get you going for now regarding the Windows 8 Phone builds. Could you send me an email or PM if you receive a response on that bug report? Meanwhile, I am also looking into this and I will send you a test version when ready.
     
  17. shoo

    shoo

    Joined:
    Nov 19, 2012
    Posts:
    67
    Can it be used runtime on Android platform?
     
  18. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hello shoo,

    Yes, EasyRoads3D can be used on the Android platform. EasyRoads3D is not a runtime tool. It is an editor tool, the end result is a deformed terrain so it matches the road shapes and game objects for the roads and optionally additional side objects like walls, fences, rails etc. When developing for mobile you could consider converting the terrain to an optimized mesh object for performance reasons. This will allow you to use a reasonable heightmap resolution so you keep detail near the roads.

    In the case you are asking this in relation to the above discussion regarding Windows Phone 8, the only known issues at the moment are with Windows Phone 8 and the Wii U. The EasyRoads3D.dll raises errors if you set the build platform to one of these two. I am looking into this, but at this point you could still create roads etc by selecting another build platform, or create the road and side object assets in another project if you would want to develop for these platforms too.
     
  19. shoo

    shoo

    Joined:
    Nov 19, 2012
    Posts:
    67
    Hello Raoul!
    This is sad, that is such a useful plugin doesn't work on runtime. Sorry, but I have one another question! Is this package good thing to make something based on? I neeed runtime road maker to my strategy game, but I too weak to implemented it from scratch. If I buy EasyRoads3D, can I use it as source for my own runtime component or it impossible becouse of closed structure/licence agreeent of EasyRoad3D?
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Building roads at runtime is being worked on an will run on Android as well. The current package is based on editor scripts and the core code is inside two dll's so it is hard to create your own runtime version from it.
     
  21. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    432
    hello raoul. have a problem with showing side objects. actualy they wont be shown and i got message when i try to choose what object to place. happens every times. tell me what information you need to fix that problem.

    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[UnityEngine.Vector3].get_Item (Int32 index)
    EasyRoads3D.OQDOCCDCDD.OCQCCQODDQ (System.Single[] distances, System.Boolean[] splineActive)
    EasyRoads3D.ODDOOCQDQQ.OODOQQQCQD (EasyRoads3D.ODODDQQO so, System.Collections.Generic.List`1 ODODCCDOQD, UnityEngine.Transform obj, EasyRoads3D.OQDOCCDCDD OQOOCQODQO, System.Collections.Generic.List`1 param, Boolean OOQDOOQQ, Int32 sideObjectNum, Single raise, UnityEngine.GameObject goi, UnityEngine.GameObject ODCCOCDCQD, UnityEngine.GameObject OCOOQOOQQQ)
    RoadObjectEditorScript.OQDDOQDODO (EasyRoads3D.OQDOCCDCDD OQOOCQODQO, UnityEngine.Transform obj, System.Collections.Generic.List`1 param, Boolean OOQDOOQQ, System.Int32[] activeODODDQQO, Single raise, .RoadObjectScript target) (at Assets/ExternalTools/EasyRoads3D/Editor/RoadObjectEditorScript.js:1248)
    RoadObjectEditorScript.OOQDQDDDQD (System.Object target) (at Assets/ExternalTools/EasyRoads3D/Editor/RoadObjectEditorScript.js:1203)
    RoadObjectEditorScript.EasyRoadsGUIMenu (Boolean flag, Boolean senderIsMain, .RoadObjectScript nRoadScript) (at Assets/ExternalTools/EasyRoads3D/Editor/RoadObjectEditorScript.js:632)
    RoadObjectEditorScript.OnInspectorGUI () (at Assets/ExternalTools/EasyRoads3D/Editor/RoadObjectEditorScript.js:56)
    UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty) (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/Inspector/InspectorWindow.cs:888)
    UnityEditor.InspectorWindow.OnGUI () (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/Inspector/InspectorWindow.cs:243)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)


    ok. nwm. i had problem... deleted terrain from project but leaved it in scene. solved =)
     
    Last edited: Sep 18, 2013
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Zelmund,

    Ok, glad you already solved that. But for my own reference, you mentioned you deleted a terrain from the project. Do you mean you had multiple terrains in the scene and this error appeared after deleting one of the terrains and selecting the General Settings tab of a road object in the inspector afterwards?

    Raoul
     
  23. supernat

    supernat

    Joined:
    May 3, 2011
    Posts:
    45
    Hi Raoul,

    I am attempting to create a river using the River tool, but I have several issues. 1) the river comes out with the geometry splattered 5 to 10 times wider than the markers. 2) If I delete the river and then try to create a new object with the same name, it says it already exists. 3) If I just draw the river markers on the terrain, I always get an error about the terrain not being able to go below 0. I tried moving the entire terrain up to 100 in the Y axis, but the error still occurs. The only way I could get it to do anything was select all of the markers and move them up by 1 or 2 units.

    Thanks,
    Chris
     
  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Cris,

    1) This means that in those areas the river surface is actually slightly above the terrain. You can do two things. Raise the river bank height in in the General Settings tab, this will affect the whole river. Or, if this only happens at some spots, you could manually raise the terrain a little bit in these areas, but do this with the river object in Edit Mode otherwise your changes will be lost when switching back to Edit Mode!

    2) Everytime you create a new road object, a new folder with the same name will be created in the folder [your project]/EasyRoads3D (not in the Assets folder!). This folder is used to store exported .obj files and png files of the road shape. When you delete this folder as well, you can reuse a road name.

    3) Terrain height data in Unity is stored in decimals between 0..1 . These height values are then multiplied with the terrain y size. This 0..1 range means that negative values are not posible. The EasyRoads3D markers positions represent the water surface. If this marker position is the same as the terrain y value it meams that the river floor will be below terrain y = 0. It will be imposible to dig the river floor out of the terrain because that would require a negative decimal for the height value. So, to fix this you have to make sure that all markers are above the terrains Y value, which is what you did. If you build your terrains inside Unity it is good practise to set the height at a default value of 10m or so before you start sculpting the terrain. This way markers will always be above the terrains Y value.

    Let me know if you have further questions!

    Raoul
     
  25. supernat

    supernat

    Joined:
    May 3, 2011
    Posts:
    45
    Great, all working properly now, and I understand the mechanics better, thanks! I do have a few suggestions though. If you could make the Side Object manager have a random option for the Distance value and maybe even random (min/max settings) for the Sideways position, it would allow me to randomly place rocks in my river randomly from the center toward the outside, or with a Sideways position that applies to both negative and positive sides of the bank, I could place rocks along the bank, or sandbags, or any number of things.

    think you may already have this capability, but I haven't explored it yet, but it would be nice to have a set of multiple meshes to select so that varying rocks can be placed. I guess the last suggestion would be to allow us to randomize the scale of the placed objects too.

    I think these would make it more flexible, but it's still the most powerful tool I've found for roads and rivers, definitely worth the price. Thanks for your time!

    Thanks!
    Chris
     
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Chris, controls for random distance, sideways distance and rotation already exist. Select the side object in the hierarchy and have a look in the Inspector.

    Yes, the multiple mesh option also already exists. Simply create a new prefab with all your rocks centered at (0, 0, 0) as childs and assign that prefab to the side object. In the side object Manager you will see three options regarding placing the child objects "All", "In Sequence", "Random". I belief the side object package on our website actually includes a rock example for this.

    Raoul
     
  27. Goblox

    Goblox

    Joined:
    Nov 3, 2012
    Posts:
    178
    Raoul,

    Have you spent any time with Navmesh + easyroads? I was wondering how much effort it would be to give an option to produce the mesh as two halves (two meshes). This way it might be possible to use masks to force NavMeshAgents to use the proper "side" of the road.

    Also I'd be curious if you've ever done anything for exporting the splines for use as animations (e.g., for use with a train simulation) or any other way of further utilizing the roads with scripts.
     
  28. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    293
    I think you can easily do this using the "side objects"-feature. For example I created a rectangle box beside my road on both sides and added a transparent material (you can also disable the renderer I guess), after that I added a mesh collider and set isTrigger to true. This way I can recognize if the player leaves the road.
    So you can create any kind of mesh that follows your road.

    I'd be curious about the second question as well :)
     
  29. Goblox

    Goblox

    Joined:
    Nov 3, 2012
    Posts:
    178
    I'll check it out. I haven't messed with side objects at all. Assuming there is enough control over where they go it would likely be an easier workflow (bake and then delete) than splitting the mesh anyway... since really for the final product you wouldn't want a split mesh.

    Depending on how far along you are you might consider using raycast to detect if you've left the road. I've got a feeling it could be cheaper and easier to maintain. *Edit: You could setup triggers to allow a player to 'legally' leave the track in specific areas.
     
    Last edited: Sep 25, 2013
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi guys,

    I never really looked into Navmesh as it seems not really related to the things we are doing with Unity. I will check this out. But yes, if this is about creating invisible colliders you could indeed use side objects for that just like .Rattlehead suggested. To get the matching left and right sides of the road you just create two procedural side objects and position the nodes (in the geometry editor window) in the center of the road and respectively the left and right side of the road for each side object.

    I have a script that will export all markers to a runtime script and have an object follow the track. It was used to do the video demos on our website, it is not very optimized but you can use it as a starting point. Just pm me your email and I will send it to you.
     
    Last edited: Sep 25, 2013
  31. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    when i keep road and sideobjects delete other easyroads game objects, delete easyroads dll/scripts, it works on phone 8.

    if you split runtime and designtime objects it will be better that i will not have to delete easyroads dll and scripts.

    at least, even for now, there is a workaround :) i know you are making it compatible with windows store apps / phone 8
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Yes, meanwhile I am looking into this on a Windows 8 machine with the Phone 8 SDK installed. Once compiling the final build is error free I will send it to you so you can do a full test because I don't have a phone 8 device.
     
  33. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,125
    i tested new release candidate. it works fine on both phone 8, windows store apps and on editor. with this version i can directly build and publish my app. thanks.
     
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Glad to hear this is working now and many thanks for reporting that phone 8 issue!
     
  35. Goblox

    Goblox

    Joined:
    Nov 3, 2012
    Posts:
    178
    Is the Terrain Texture selection box for "Apply Splatmap" limited to the first 6 splats? I'm using Lars' Advance Colormap Terrain Shader and need to be able to apply the 7th and 8th texture (even though there are technically only 6 textures in use).
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Goblox,

    Texture 7 and 8 work well for splatmapping, I just double checked. But this is for the default Unity terrain shaders.

    It has been a while since I worked with the Advance Colormap Terrain Shader. Do you mean this shader works with 6 textures and now you want to apply texture 7 or 8 of the default terrain textures for the road on that terrain? I don't think that will work, If I am right the shader works with custom splatmaps, is that correct? In that case, when you enable Splatmapping, the shape of the road is also exported to png and available in the folder [your project]/EasyRoads3D/[the road object name]. So you can blend it with your terrain splatmap and choose any layer you want.

    Does that help?

    Raoul
     
  37. Goblox

    Goblox

    Joined:
    Nov 3, 2012
    Posts:
    178
    Oh weird; it looks like my dropdown was not being updated. I'm mostly working on a test scene and created a new road so I haven't looked into it much but at this point all 8 textures are listed now. I'll let you know if I find any more informaiton on the issue.
     
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Ok, so after adding the textures 7 and 8 to the terrain you only saw 6 available textures in the dropdown and that was the problem? Indeed the terrain texture info is checked only the first time you select a road object in the scene. I changed that for the next update, it will always check for new or removed textures when a road object is selected.
     
  39. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,266
    Hi raol. I'm crossing stitched terrain tiles with EasyRoads Full. It works well enough for road objects where I can select the target terrain (even if I have to be careful not to ruin the seams), but not with procedural mesh objects. I can't add markers for procedural meshes on all terrains (just on the first two, oddly), and there is no "Multiple Terrains" checkbox or terrain selection menu like there is for roads. When I use the "Add Marker" tool by shift clicking on the terrain where I want to add a marker, the inspector just flickers and nothing happens.

    How can I paint procedural meshes on any terrain in the scene?
     
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Marble, multiple terrains was implemented for the road object a wile back upon request of a specific customer. I can't remember but I guess he only needed it for the road object and that's why it is not available for the other procedural meshes type. Recently I get a lot of multiple terrain related questions which is probably because of many people using the popular Terrain Composer tool which often results in multiple terrains. I will add this support also for the Procedural Object type.

    Meanwhile, what you could do is open /Assets/EasyRoads3D/Editor/RoadObjectEditorScript.js and do a search for:

    col.Raycast

    Replace that full line with:

    if (Physics.Raycast (Camera.current.transform.position, ray.direction, hit, 3000))

    So now you are raycasting all objects in the scene and you should be able to place markers on all terrains. But the marker might end up on another object like a tree or so, so you may have to do some repositioning.

    But that should work...

    Raoul
     
  41. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,266
    Thanks raoul. That'll do just fine.
     
  42. jake-Kim

    jake-Kim

    Joined:
    Aug 15, 2012
    Posts:
    8
    $sideobj.png

    hi raoul.

    i use 2.5.3pro ver.

    if i turn on iOS platform then side obj(curve stone left ) has some problem.

    only appear when i turn on iOS platform checkbox.

    have any idea?
     
    Last edited: Nov 1, 2013
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
  44. vicciu5

    vicciu5

    Joined:
    Sep 4, 2013
    Posts:
    11
    Hi Raoul. Could you tell me when the stable version of EasyRoads v3 will come out? Also is it possible to use EasyRoads with custom Terrain(not the default one implemented in Unity)?
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi vicciu5, a new beta version of v3 was released 2 weeks ago. There is one more reasonably big change to implement to make the tool perform better / faster on longer roads and when many intersections are involved. This change will also deal with several crossing related bugs (for which there are workarounds in the current beta). After that it is a matter of deciding what features will be part of the first public release. There are so many different types of intersections and also different geometry layout options etc.

    Regarding the custom terrain question, do you mean your terrains are custom build terrains? Or should your final terrain be mesh based? In the case of the latter you can use EasyRoads3D with the Unity terrain object, build your roads, adjust the terrain heights etc. When finished you can export the terrain to .obj and optimize it. If your terrains are already mesh based and you want to simply snap the road to the terrain heights, that is not a problem. But adjusting the heights of a mesh based terrain to the road shape with the same functionality as EasyRoads3D has for the Unity Terrain object is a little bit more complicated. We use EasyRoads3D and a range of similar tools to procedurally create mesh based terrains. If there is enough demand for that we can implement something similar in the EasyRoads3D package.
     
  46. vicciu5

    vicciu5

    Joined:
    Sep 4, 2013
    Posts:
    11
    Hi Raoul. I was asking about the public release because I've bought EasyRoads 3D from the Asset Store and I don't have a Serial Number to download the beta version, so I was wondering when will I be able to add crossroads to my game.

    Thank you for your suggestion regarding the Terrain. I am using Unity Terrain now, but I want to convert it to mesh terrain because with the default terrain the quality of the textures is horrible on some mobile GPU's. I think that I will do as you said(build all the roads and then convert the terrain to mesh).
     
  47. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Regarding Assetstore purchases and the v3 beta, have a look at the _readme file in the root directory of the imported package...

    Yes, building the roads and terrain using a Unity terrain object and then optimize the terrain mesh works just fine for mobile. Just make sure to keep the detail near the roads otherwise the road might end up floating above the terrain and / or disappear below the terrain.
     
  48. DesertRaven

    DesertRaven

    Joined:
    Jul 15, 2012
    Posts:
    137
    Raoul, when creating a new Unity Terrain what height map resolution and other resolution specific settings do you recommend for Easy Road to perform the best? Or does this matter at all?
     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi DesertRaven,

    The heightmap resolution shouldn't matter too much unless you use a low heightmap resolution (below 512 on a default 2000x2000 terrain size) on a hilly terrain. There are simply not enough terrain points to smoothly match the terrain with the road in these hilly areas. If you want to keep detail near the road (like in the EasyRoads3D demo project) you can use a higher heightmap resolution. The terrain in the demo project uses 1024x1024. Obviously all this also depends on the target platform. We ourselves use the highest heightmap resolution for maximum detail but we convert the terrain to an optimized mesh afterwards.

    Another thing to check would be the terrains pixel error setting. The default settings should work just fine, the EasyRoads3D shaders should take care of it unless you use a very high pixel error value (for performance reasons) especially with cam positions high above the terrain. In that case I would test the full road and check the areas away from the cam.

    Let me know if you meant something else!

    Thanks,
    Raoul
     
  50. Goblox

    Goblox

    Joined:
    Nov 3, 2012
    Posts:
    178
    I'm excited to see what's going on in V3, I don't have a lot of time but I thought I would mention three things after a fair bit of EasyRoads use:

    When driving on a generated road, the car appeared to be going over bumps that I couldn't see. It turns out that the EasyRoads shader that is supposed to hide terrain that pokes through the road mesh was doing it's job pretty well; It took me a while to figure out what was going on. I find that I have to raise the roads fairly high (~4-5cm) to account for terrain pixel error and ensure no terrain pops through the road; it wouldn't be a perfect fix but would it be possible to optionally make a depression in the terrain under the road so that we wouldn't need to raise the road so high to avoid this? We would still have issues with the terrain near the edges but this would fix 75%-90% of the road!

    My second concern is that with the version I'm on I have some trouble with areas where a curve meets a straight stretch of road. If I lay down a few segments of road I intend to be straight, and then put the next marker down to form a curve to the right, my previous segment of road that I wanted to be straight actually curves to the left a bit before sweeping right. This can be pretty frustrating. I assume more control of the splines (e.g., adobe illustrator like) is a pretty big ask but... if there were some way to correct this issue it would make my life easier. Or maybe it's already in there and I just never found it? It seems like if you rotate a marker everything goes haywire although that seems like a good way to add the control I'm after.

    Last is another suggestion:
    How about an Auto Hill-follow function. Such that we could essentially lay down road in two dimensions and have EasyRoads handle height. At the very least we would need to be able to define a Filter/Smoothing amount, and a Max Slope (before easy roads starts building up or removing terrain). I found that it's extremely time consuming to try and set realistic road grades (I had some roads that were 45% grade or more) - I think this is something your users could get a lot out of.


    ...and one last tiny one - would it possible to produce ditches per segment? We'd need to be able to set width, depth per side. Adding a crown wouldn't be a bad idea either.
     
    Last edited: Nov 15, 2013