Search Unity

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

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

  1. onllm

    onllm

    Joined:
    Mar 4, 2011
    Posts:
    111
    ok 1 question, with unity3.4 release and the native terrain tool now support for mobile devices. What is the performance like on mobile devices using your system?
     
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    @kondrup, yes intersections is being worked on. Had a tough start implementing the WIP crossroads scripts into the main EasyRoads3D project but making good progress now...

    @onllm, EasyRoads3D itself is an Editor tool. The end result is a deformed terrain according the shape of the created road with a road mesh on top of it. The geometry resolution of the road mesh is customizable. Performance depends on the settings you use.
     
  3. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Hi,

    I've got a curious problem with EasyRoads and Objects placed on the roads. For one of my prototypes I need to pull back the camera to quite some distance. A nice thing with EasyRoads is that the roads stay visible even when at big distance.

    But this nice feature also causes my problems. In fact, when some object is placed "above" the EasyRoads road object, it "disappears" when moving the camera away. Here's a series of 3 images:


    Img 1: The camera is close to the objects and the road (the building on the road is for testing purposes with big objects).


    Img 2: I moved the camera back a little bit and the objects which were above the road level disappear under it. Only the turret of my tank is visible at this stage.


    Img 3: Backing off even more, the tank completely disappears and the building is half covered by the road object.

    This happens in both, the game and the scene view.

    Can anyone tell me how to avoid this effect? I've purchased EasyRoads and I'd like to use it in my game :)
     
  4. raoul

    raoul

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

    EasyRoads3D comes with a set of shaders (/Assets/EasyRoads3D/Shaders) that uses "Offset(Factor , Units)" just a couple of lines below "SubShader {".

    This allows you to keep the road positioned at the terrain level. The road will still be rendered on top of the terrain regardless the camera distance.

    The default values are set relatively high to make sure the road is also rendered on top of the terrain in hilly areas where the terrain height system can mess up things when the camera is further away depending on the pixelError setting of your terrain. If you have problems with this, try tweaking these "Offset" values in the shader, especially the first, the factor value which can actually be set to 0.

    Alternatively you can use a "normal" shader and raise the road above the terrain...

    What is the height of your tank? I did some tests and it looked fine at a reasonable cam height.
     
    Last edited: Jul 29, 2011
  5. ProtonOne

    ProtonOne

    Joined:
    Mar 8, 2008
    Posts:
    406
    @Metron: Also increase the near clip plane of your camera. A change from 0.1 to 1.0 will make a significant difference to the accuracy of the depth buffer. And only make the far clip plane as far as it really needs to be.
     
  6. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Thanks for the help. I rather work with the clip planes than messing with the shaders. I managed to get it right looking at the maximum distance I'll have in my game. I also tweaked the unit placement height a little bit, so it looks much better now.
     
  7. CrazySi

    CrazySi

    Joined:
    Jun 23, 2011
    Posts:
    538
    I just brought v2, is intersections included in this?
     
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    As mentioned on http://www.unityterraintools.com and the various threads about EasyRoads3D here on the forums, Intersections is still WIP.

    Had to reorganize the complete system but almost there regarding the first beta release. Intersections itself is implemented and so far so good (tested it the other day on 20 roads, 100+ intersections) but have to finish terrain deformation, prepare all scripts for the package and update the manual.

    I will be away for a week from August 11th. Most likely it will be released shortly after I am back.
     
    Last edited: Aug 1, 2011
  9. UnleadedGames

    UnleadedGames

    Joined:
    Feb 17, 2008
    Posts:
    242
    Can't wait raoul! Amazing product!
     
  10. General Jackson

    General Jackson

    Joined:
    Oct 31, 2009
    Posts:
    73
    Code (csharp):
    1. if (raoul.Crossroads)
    2.  paypal.Purchase(General Jackson);
     
  11. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    @ msken, thanks, glad you like it!

    @General Jackson

    In that case something like this should work:
    Code (csharp):
    1.  
    2. if(General Jackson){
    3.   Thread.Sleep(21 * 24 * 60  * 1000);
    4.   ...
    5. }
    6.  
    But you might want to break up the Sleep part in pieces and do some checking in between, you never know...

    ...also, personally I like to avoid using Sleep in this kind of situations... the new system will work with roads created in the current system. It will just be a matter of updating the imported package.
     
    Last edited: Aug 4, 2011
  12. glnhrrs

    glnhrrs

    Joined:
    Jan 17, 2011
    Posts:
    9
    Hi Raoul

    Will it ever be possible to create a spline shape that shapes terrain underneath it ?
    For instance imagine a road that is 5 m wide with 2m dirt pile on either side, say in Object manager make a spline shape 5m flat road with 3m pile of dirt on each side.
     
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi glnhrrs, you mean something like using the procedural object tool as a terrain deformation tool by itself? I can put this on the list if you want? In fact, if this is urgent, you might be able to already do this with a workaround:

    1. Create a Custom Object.
    2. Duplicate the markers of the road object and drag them to the newly created Custom Object.
    3. Create your terrain deformation shape (the pile of dirt) in the Procedural Object Editor.
    4. Assign the side object to the newly created Custom Object.
    5. Select the side object gameobject in the hierarchy, the one with the meshfilter attached, add a meshcollider and place it on layer 31.
    6. Build the original road object.

    The terrain will be deformed according the shape of all objects on layer 31 so your custom side object with the 3m pile of dirt on each side should be included... Just make sure there is enough space between the pile of dirt and the road itself for correct terrain deformation. keep the minimum indent values as a reference for this.


    This is untested, I am on vacation at the moment. Will do some tests when I am back...
     
  14. glnhrrs

    glnhrrs

    Joined:
    Jan 17, 2011
    Posts:
    9
    Hi Raoul
    Is there a possibility to add a prompt when selecting the main branch of the road in the scene. (ie. would u like to process this road?)
    I have lost count of the number of times I have accidently selected this and waited for it to process itself and it returns to the white road with markers.
    Cannot wait for the intersections. Really keen to see how they join roadway branches. I really need them now but our project is due next week.

    Cheers
    Glen
     
  15. glnhrrs

    glnhrrs

    Joined:
    Jan 17, 2011
    Posts:
    9
    Hi Raoul
    Just putting in some requests. Not sure if this has been posted before.
    Could there be a possibility of splitting lanes? A total overall width of road of say 20m but selecting a marker and adding a traffic island in centre.
    Giving ability to add a 2m width split in centre.
    Cheers
    Glen
     
  16. glnhrrs

    glnhrrs

    Joined:
    Jan 17, 2011
    Posts:
    9
    Hi Raoul
    I have been attempting to get the UV mapping to display correctly on side objects.
    For some reason I have tried all options in sideObjects editor and adjustments in the heirachy menu of the object, but the results still come up the same. I have attached an image to show how the uv mapping is essentially backwards. Is there a fix for this or am i missing the simplest option button that fixes this ?
    Cheers
    Glen
    $flip.jpg
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Do you mean the situation that the road is not being processed after clicking the middle tab when a marker is selected?

    I will look at that. But can't you simulate this using side objects?

    There is no button for this, I will look at it...
     
  18. Adrenaline-Crew

    Adrenaline-Crew

    Joined:
    Dec 14, 2010
    Posts:
    400
    at one point you gave me a script that would save the terrain data, so it wouldnt fall back to how it looked before the easy roads... its just i have to do 30 steps to achieve something... i dont know... just sucks i bought this thing and could never use it.
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Why were you never able to use it? Can you elaborate on that?

    I made several custom scripts for your project. But a script that makes sure that the terrain does not fall back to the original terrain? Do you mean the terrain to .obj script? That one was for T4M, it will not work for the Unity Terrain object neither is it needed if you want to use the Unity Terrain object for iOS.
     
    Last edited: Sep 29, 2011
  20. Adrenaline-Crew

    Adrenaline-Crew

    Joined:
    Dec 14, 2010
    Posts:
    400
    Great service!
     
  21. Cico

    Cico

    Joined:
    Aug 21, 2011
    Posts:
    11
    Awesome work good job:)
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
  23. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Could someone give me a step by step instruction on how to add side objects to my terrain? I've gone through the documentation and although it explains what each button is supposed to do I seem to be missing a step. I have EasyRoads 2.3.0 Full Version. I created a new terrain and added a simple road. Then I had EasyRoads carve the terrain to match the road. Next I opened the Side Objects > Object manager and set up a side object using some of the prefabs that came with it. But whatever settings I try with the Side Objects I don't see any thing. The Side Objects GO is empty. I've got to be missing a step but I just don't know where.

    Also, can I just add a new "string" of side objects without having a Road Object to assign it to? Such as a line of telephone poles over a mountain?

    Thanks! :)
     
    Last edited: Oct 19, 2011
  24. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Hey Raul, is it possible to add custom water shader to River tool? Also does river has movement on it by default or does river stream not moves?
     
  25. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    I tried following the side object video but EasyRoads has changed since that video was made and I'm getting errors. Anyone try using the side objects feature and can give me some hints on how to get it to work properly?
     
  26. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
  27. raoul

    raoul

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

    @bigkahuna, you first deformed the terrain and build the road and then created a side object. Then you clicked the build side objects button in the inspector and activated the side object that you just created. Is that right? If you took these steps then the side objects should be visible. Unless you unchecked "Default marker state for this side object is active". In that case you first have to select the markers where you want the side objects to appear and activate the side object in the inspector.

    If you want to use side objects individually and not assign them to a road object, then select "New Object" from the EasyRoads3D menu and chose "Procedural Mesh Object". Select the newly created object in the hierarchy, click the "General Settings" tab and enable those side objects that you want to use on this object. The objects will be created instantly when adding markers.

    @janpec, When adding a river object, the code searches for imported Unity water materials / scripts in the project and will list them in the Inspector. EasyRoads3D itself only creates the geometry. For water3 it also includes options to set the wave height. You can use your own custom materials on it, it is an ordinary game object with a mesh renderer attached.
     
  28. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Thanks Raoul, I'll give that a try. I was getting an error when I tried using "Procedural Mesh Object" yesterday but will give it another try this morning. Another thing I'm seeing is that even though I imported the EasyRoads and side objects package, the side objects don't appear in the EasyRoads menus like they do in the video. Do I have to assemble them manually or is something not working right?
     
  29. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Do they appear in "General Settings"? If not, then reopen the side object manager and just click save. Does that help?

    When you first create a road and deform the terrain etc. and then create the side object (the way you described your workflow), then the side objects will initially not appear in the inspector. After clicking "Build Side Objects" they will appear so you can activate / deactivate side objects for that object.

    Also. regarding the side objects package, did you also import the side objects file as described in the read me file of the zip? If not then don't pay attention to the first line above, the side objects have not been imported yet!
     
    Last edited: Oct 20, 2011
  30. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Here's what I've done:

    Created a new project.
    Created a new scene.
    Added a new terrain and deformed and textured it.
    Imported EasyRoads 2.3
    Imported the demo side objects package.
    Opened the Side Objects Object Manager.
    Created a new Side Object and then used "Import" to import all the demo side objects. (I missed that before, thanks for pointing that out!)

    Now I want to create fence:
    Created a new Object, setting it to Procedural Mesh Object.
    Clicked on General Settings to pick the "Bootcamp Fence" object.
    Clicked on the "Add markers" icon.

    Here's the problem:
    Every time I "shift click" on the terrain, I get the following error:
    UnassignedReferenceException: The variable surface of 'MarkerScript' has not been assigned. You probably need to assign the surface variable of the MarkerScript script in the inspector".
     
  31. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Thanks Raul for answer, however does river water moves in dirrection? I mean does water move from lets say left to right side of river (moving UVs) or it doesnt?
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I just tried this, you are right. That must have slipped in in the latest 2.3 release of last week. Procedural objects do not use the white surfaces..

    The error occurs when I add markers, not when I insert markers.

    Then after adding 3 or 4 markers I select one and move it slightly, the fence is created. Can you confirm that?

    I will fix that error...
     
  33. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    @Raoul - Another question: Do the roads and side objects work with the lightmapper? I'm getting UV errors in the console when I try to use Beast with EasyRoads objects. I've figured out how to export the generated meshes, but to have to export and then reimport would not be my preferred way to do this...

    Edit: I see where the problem is. The generated EasyRoads objects are using tiled UV's so they will need a second UV set for lightmapping. That means I will have to export them as meshes and then re-import them as new objects and add the 2nd UV map.
     
    Last edited: Oct 20, 2011
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    @janpec, as the river object uses the Unity water script, EasyRoads3D itself does not generate moving water. You could probably do that by adding a script that updates the uv offset.

    @bigkahuna, That's right, there are no lightmap coordinates added for procedurally generated geometry. Exporting / reimporting solves that, just like with tangents for the road mesh. Road lightmap UVs are generated according the bounding box of the terrain so you can use the terrain lightmap on the road. Regarding side objects, I will do some tests and see if there is a good way to do this automatically regardless the different types of geometry structures which is infinite for side objects. Right now you can indeed use the "Generate Lightmap UVs" option in the Unity importer settings.
     
    Last edited: Oct 20, 2011
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
  36. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Got it. I'll give it a try and report back. Muchas gracias! :)
     
  37. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    I gave the new version a spin and it seems to be working perfectly! :)
     
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    ok, good to hear that, thank you for reporting that issue!
     
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    An update for EasyRoads3D Pro is now available on the Assetstore. Note that it says v2.3.2 . It is the same as v2.3.1 on www.unityterraintools.com. I had to reupload using a new version due to issues with assetstore images with the original 2.3.1 package upload...
     
    Last edited: Nov 7, 2011
  40. Thomas-Pasieka

    Thomas-Pasieka

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    Any estimates on when you're going to fix the "Asset Server" related problems?
     
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Thomas, asset server issues are fixed in the latest release.
     
    Last edited: Jan 13, 2012
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    An update for Unity 3.5 is now also available in the Assetstore, v2.3.4

    I was a bit side tracked the last couple of months by other projects but am back on further developing support for intersections and the new version of the side objects modelling tool, http://www.unityterraintools.com/WIP_sideobjects2.php . Already added several new features to the last, a new beta will follow in a couple of weeks.
     
  43. malyna

    malyna

    Joined:
    Jul 9, 2010
    Posts:
    105
    Hi raoul,
    I just want to ask if there is a way to use Easyroads at runtime ? maybe for some really simple procedural meshes ?

    Thanks for replay.
    Cya.
     
  44. raoul

    raoul

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

    Things will not work at runtime out of the box.

    Do you mean the road system is not involved, only procedural geometry through the side object system? Especially when it does not involve deforming the terrain, it shouldn't be to difficult to make it work at runtime.

    What exactly do you want to do? Do you have a system in place to define / manipulate the spline control points? If not EasyRoads3D started a couple of years ago as a standalone tool for Unity with a marker system similar as in the Editor, So at that time everything actually did work at runtime. Is that what you need?
     
  45. malyna

    malyna

    Joined:
    Jul 9, 2010
    Posts:
    105
    What i want to do is to generate simple path based on couple transform points loaded from external source (daily changes in game).
    Like you thought I don't need to involve road system and terrain deform, just the procedural side object generation.
    If you have some hints on that, it would be great.
     
  46. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    If you want I can extract the scripts that deals with this bit. That will allow you to use it at run time.
     
  47. malyna

    malyna

    Joined:
    Jul 9, 2010
    Posts:
    105
    It would be really great.
    I need sth like
    void buildMesh(Transform[] points) { ... }
    but i dont know how i can pass proccedural geometry for it.

    I think you can maybe add to EasyRoads more advanced tool for runtime procedural geometry in the future.
     
  48. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I was thinking of something like:

    void buildMesh(Vector3[] points, int[] sideobjects) { ... }

    This way you do not rely on transforms and you can auto build a number of mesh objects based on the same spline shape simultaneously.

    Do you mean like mentioned above or with more options? In theory it could work just like it now works in the editor...
     
  49. malyna

    malyna

    Joined:
    Jul 9, 2010
    Posts:
    105
    For me, function like that would be enough, and ofc Vector3[] points is the right argument :).
    Looking forward for what you can do.

    PS. Maybe buildMesh function should return reference to mesh.
     
  50. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ok, I will look into this. If you need this soon you can also send me an email or PM and explain exactly what you want to do. Perhaps it is easier/faster to write a script especially for what you need...