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. Dismiss Notice

Road & Traffic System

Discussion in 'Assets and Asset Store' started by wireddev, Aug 25, 2014.

?

Wondering if this is something that people are interested in purchasing?

  1. Yes

    88 vote(s)
    86.3%
  2. No

    14 vote(s)
    13.7%
  1. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    483
    The mysterious blue box appears to be related to the R&T + City Gen integration. It exists to delineate the distance not to place buildings when the city-gen does its thing. It needs to be either less opaque, or a lighter color devs.

    Mark
     
  2. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,624
    Ah! Thanks @Mad_Mark for clearing that up. :)
     
  3. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,624
    @wireddev - Yeah, this compile error will prevent any build.
     
  4. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Hi guys, there is an issue with the Left Turn Arrow in version 2.1.0 and we have submitted a fix for it. For all those who need it (which would be most using the system) you should replace the file "TrafficSystemIntersection.cs" located in the Traffic System\Scripts with this file ( http://www.wireddevelopments.com/trafficsystem/downloads/TrafficSystemIntersection.cs ) until version 2.1.1 comes out. Save the page as "TrafficSystemIntersection.cs" if it doesn't download the file straight away.
     
    hopeful likes this.
  5. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,624
    Thanks!
     
  6. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Thanks for the update hopeful!

    The correction should be this (but yours will work also)

    #if UNITY_EDITOR
    ShowRenderers(true);
    #else
    ShowRenderers(false);
    #endif

    This is also in the update.
     
    hopeful likes this.
  7. quesadillas

    quesadillas

    Joined:
    May 1, 2015
    Posts:
    23
    Just to update everyone on my issue, I found out that my problem is based on something very simple. The offset that's given to the sphere collider is a global offset! So, for example, if you give the sphere an offset of 1.5 in the Z direction, you can see in my picture on the previous page that the same offset leads to the sphere being in a different position with respect to the car depending on what direction the car is pointing in!
    Feels very silly typing it out now, but it was driving me crazy before, haha.
     
    Last edited: Dec 16, 2015
    hopeful likes this.
  8. TwoWholeWorms

    TwoWholeWorms

    Joined:
    Jun 28, 2013
    Posts:
    25
    Does anyone know if there's a simple way to make one-way roads using this asset? There doesn't seem to be a tutorial for it, and I'm trying to make a one-way 4-lane road (recreating a real city) and haven't managed to get it to cooperate yet.

    Ping @wireddev. :)
     
  9. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Hi, at the moment we do not have any road pieces that are one way only sections (except offramps). They can definitely be done but out of the box, we don't have prefabs for these. If you want to create them you'd need to create your own road prefabs. You can find the tutorial for this here: http://wireddevelopments.com/trafficsystem/documentation.php#14
     
  10. GandiniS

    GandiniS

    Joined:
    Sep 9, 2015
    Posts:
    3
    I tried the Pedestrian System, everything run fine in the editor. But some errors popups when building. error-scene.jpg error-msg.jpg
     
    John3D, hopeful and emergki like this.
  11. mobgato

    mobgato

    Joined:
    Nov 20, 2015
    Posts:
    19
    fixed .............

    BTW, could you please tell me that which building & tree assets u used on city generator demo?
     
    Last edited: Feb 4, 2016
  12. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    483
    Now that I have kicked this asset around, I am pleased with it so far. Thanks WiredDev!
    So, one question though, how do I not show the pink and blue traffic nodes in play mode?

    Mark
     
  13. John3D

    John3D

    Joined:
    Mar 7, 2014
    Posts:
    441
    @wireddev
    I have some errors in Unity 5.3.0 when I try to export to Android:

    Assets/Pedestrian System/Scripts/PedestrianNode.cs(16,36): error CS0103: The name `renderer' does not exist in the current context
    Assets/Pedestrian System/Scripts/PedestrianNode.cs(17,41): error CS0103: The name `renderer' does not exist in the current context

    How to fix this pls?

    This is the code with problems:
    Code (CSharp):
    1. void Awake ()
    2.     {
    3.         #if !UNITY_EDITOR
    4.             if(Application.isPlaying)
    5.                 if(renderer)
    6.                     renderer.enabled = false;
    7.         #endif
    8.  
    9.         CleanupNodes();
    10.     }
    11.    
    Thanks!
     
  14. John3D

    John3D

    Joined:
    Mar 7, 2014
    Posts:
    441
    Use this code to solve the above problem (answer from wireddev):
    Code (CSharp):
    1. #if !UNITY_EDITOR
    2.             if(Application.isPlaying)
    3.                 if(GetComponent<Renderer>())
    4.                     GetComponent<Renderer>().enabled = false;
    5.         #endif
     
    hopeful likes this.
  15. jawadzeb0000

    jawadzeb0000

    Joined:
    Nov 16, 2015
    Posts:
    3
    Hi, I have purchased this asset and want to know that is there any way that i can change the road driving side to left? please help
     
  16. dsach

    dsach

    Joined:
    Oct 31, 2015
    Posts:
    1
    Hello,

    @wireddev : I need to randomly (seeded) generate street networks. Is this possible? I don't need to manually create streets in the editor.

    Thank you!
     
  17. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    There is no real-time generation in the package, only through the editor.
     
  18. PandaDriver

    PandaDriver

    Joined:
    Feb 15, 2015
    Posts:
    7
    I hope in the future we will get also bicycle paths beside the roads like in the Netherlands

     

    Attached Files:

    John3D likes this.
  19. daivers

    daivers

    Joined:
    Aug 23, 2015
    Posts:
    1
    Hello. I have problem. Missing icons Edit and Anchor and not work buttons "Select as Edit" "Select as Anchor" "Go to Traffic System" Screen Shot 2016-10-18 at 6.05.48 PM.png
     
  20. l8njacobs

    l8njacobs

    Joined:
    Dec 12, 2016
    Posts:
    5
    Is there a function to drop the nodes to mesh/floor? Is it possible to create my own road mesh with different elevations in my 3d software and still use this node and traffic system?

    Most of the examples I've seen have just been flat or used the included prefabs.
     
    John3D likes this.
  21. AJ-Design

    AJ-Design

    Joined:
    Nov 1, 2016
    Posts:
    15
    Would anyone be able to answer these two questions?

    1) How do you rig a semi-truck with a trailer hitched using a Configurable Joint? I tried using wireddev's YouTube tutorials, bit they don't work for trucks with trailers. They work perfectly for my other cars, but I can get the semi trucks working. I have to have trucks on my roads, it's not an option. I can rig them just as one piece, but it looks horrible when they turn.

    2) Is there any way to make the cars push the FPSConroller around when they collide instead of the FPSController stopping the car? This is such a great plugin otherwise. There's got a be a way to make the traffic more realistic when colliding with the FPSController (or any other player in the game).
     
    John3D likes this.
  22. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    526
    Asset is most probably abandoned. I wish the developer would return to reply questions and especially to update the obsolete asset.
    Buyer beware.
     
    John3D likes this.
  23. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,624
    If you need support, be sure to use the support email. While the forum is handy and helps make other users aware of issues, the thread owners don't always receive notifications of new posts.
     
    John3D likes this.
  24. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    526
    Well, did you get the asset work seamlessly with 5.5? I mean it wasn't updated for almost a year.
    It's more than a support email that I need: a major update is needed as of 2017.
     
    John3D likes this.
  25. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,624
    No, I haven't tried this asset in awhile, as I've been off onto other things. And I can certainly see your point, in that typically something in a plugin needs a tweak each time Unity issues a new version.

    Email is just the official way of getting support (like asking if there will be an update for Unity 5.5), and forum threads are more informal (but very useful to the community).

    @wireddev hasn't been on the forum since July 2. Maybe they lost notifications when Unity changed the forums in the summer, or maybe they aren't supporting the plugin any more.
     
  26. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    526
    I think it's pretty obvious that he gave up on the asset. These forums are the lifeblood of the asset store: he never revisited his forum in 7 months to reply the array of new questions. Too bad, it was an elaborate plugin, and reasonably priced.
     
  27. Tonismo

    Tonismo

    Joined:
    Oct 7, 2016
    Posts:
    29
    Damn i should have read this forum before buying the asset
     
  28. Tonismo

    Tonismo

    Joined:
    Oct 7, 2016
    Posts:
    29
    I have just made a build using 5.5 for android. Works with 20 fps. Im trying to optimize it. How do I make it where vehicles only spawn when close to player instead of running everywhere in the background?Or this has already been emplemented?
     
  29. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,624
    Probably what's slowing down your scene is rendering all the vehicles, not moving them, as moving them should be very cheap.

    Use a LOD and / or OC system, like the ones built into Unity, one of the ones in the asset store, or make your own. That way the cars only display if they are in view, but they keep moving around even if they are not displaying. Also, using LOD, you can have distant cars represented by meshes with fewer polys, like a cube stretched out to the dimensions of your car, painted the same color. Cars with fewer polys will render faster.

    Using LOD, you could do a simple test where LOD0 is the car mesh, LOD1 is a cube with the same color as the car, and LOD2 is no mesh. This should give you an idea of what your performance would be based on distance. If cars can be concealed from the camera view (camera is in the street versus being in the sky looking down), then some form of occlusion culling could reduce your car display cost by another 2/3 or so.

    There should be examples of this concept and scripts on the net. Search the forums and Google. There's a tutorial somewhere.
     
  30. Tonismo

    Tonismo

    Joined:
    Oct 7, 2016
    Posts:
    29
    Well I am planning on making a very big map and i dont want millions of cars running in the background. What Im talking about is a pool system that activates vehicle spawn when player is somewhere near around the city block. Otherwise nothing will be spawn then. Question is though, has this already been emplemented or do I have to emplement it myself?
     
    John3D and HeadClot88 like this.
  31. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,624
    I haven't used this in a long while, but IIRC, it doesn't spawn cars in relation to where you are. It's more like a waypoint system, where you can have cars spawn and despawn where roads enter and exit the map. I think you'll have to develop your own system for the spawning / pooling, and I can't think of any other traffic system in the store that does what you want.

    If you find a traffic system that does what you want, please reply back with the name of it. :)
     
  32. VenandiVatis

    VenandiVatis

    Joined:
    Dec 5, 2016
    Posts:
    17
    Found the most weird bug in the Road & Traffic System!
    (I am posting this here since i did not find a support link in the website.)

    The package causes Unity 5.5.0f3 to crash when using Windows 10 2nd monitor by wireless (Miracast/W10 Connect).

    It took me some time to identify this. This one w2as unexpected :)
    How i reproduce it:
    I created an empty (0 packages) Unity project. Everything works fine. I can use W10 Connect to use my 2nd laptop as a 2nd monitor. (Main pc is a Surface Pro3, W10Connecting to a Surface Pro2, both using W10, fully updated).
    Then I import the R&T sys from assets store, and restart Unity.
    If I am using my second monitor, Unity will not show any windows (hierarchy, inspector, etc), but the top menu works just fine. After a while it will crash if i keep clicking stuff.
    If I disconnect the miracast, everything works just fine.

    Losing my 2nd monitor does make a huge difference to me, any idea if this is solvable?

    Cheers,
    PA
     
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,624
    I would assume if R&T causes Unity to crash when using a second monitor, this is actually a Unity bug that is getting triggered by R&T. You might try scanning the forums for Unity bugs related to second monitors and see if there is an issue there.

    The support email for the Road & Traffic asset, which is listed on the asset store webpage, is: support@wireddevelopments.com

    If there is no answer from the Wired Developments devs on it, and if Unity gives a solution to the bug, maybe you can patch it yourself. If you do that, please post the patch here so other users running into the same problem can fix it.
     
  34. VenandiVatis

    VenandiVatis

    Joined:
    Dec 5, 2016
    Posts:
    17
    I though the same, but i searched all forums, and found nothing related to this. :(
    Thanks for the email, have have send them a copy of this.

    But bugs like this are very hard to locate. I would not be surprised if not solution is found. But if one is, i would post it here.

    I agree, this is some underlying issue with Unity, another package had "similar" issue, but that one was solved by resetting the windows layout of Unity to factory (after that i was able to change it again).

    PA
     
  35. Tonismo

    Tonismo

    Joined:
    Oct 7, 2016
    Posts:
    29
    Thank you for the reply! i dont want to waste anymore money on buying different traffic systems.I will just have to modify and upgrade this one:).It does have a lot of video documentation on youtube. A lot other traffic assets dont
     
  36. VenandiVatis

    VenandiVatis

    Joined:
    Dec 5, 2016
    Posts:
    17
    It does have a spawn control. And it can spawn vehicles wherever you want on fixed locations. It might be possible to have that gameobject follow your character around, but you will need to recode it.
     
  37. ImRex

    ImRex

    Joined:
    Feb 11, 2017
    Posts:
    3
    Hi :D I was hoping you could give an idea for this.
    How am I going to make those cars vanished while the application is still running. I made a play and pause button where when it's in a pause mode the car will disappear and by default in play it will continuously simulate.
     
  38. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,624
    You control what parts of the car you want to be active by selecting either the game object or its components and making them active or inactive.

    So you can turn off the mesh or the AI or the colliders, or the game object ... whatever it is that will do what you need.

    You will need to write a script that contains a function that does whatever it is that you want to your list of vehicles (turning off their meshes, or whatever), and you'll need to hook that script and function up to your pause button.
     
  39. ImRex

    ImRex

    Joined:
    Feb 11, 2017
    Posts:
    3
    Thank you so much :D I will try it :D
     
  40. ImRex

    ImRex

    Joined:
    Feb 11, 2017
    Posts:
    3
    So I have this traffic system simulator going on and I wan't to limit my AI Vehicles on a particular path. I'm trying to put traffic signs so that when the user assigns a "NO LEFT TURN" command on my vehicles, they'd automatically avoid that certain node. In this case, I'd try to set active = false; but when i try to activate the node again, it doesn't seem to work. I'm assuming that even when the node is already active , the links from one node to the other has also been removed thus making it impossible for the vehicles to pass through that path again ? Any ideas on what should I do? I've been thinking about this for weeks now. I hope someone could help . Thanks! btw, I'm using c#
     
  41. Anubis75

    Anubis75

    Joined:
    Jul 29, 2013
    Posts:
    24
    Just delete the MeshRenderer under the Node1a and Child also from Node2a and Child
     
    Last edited: Apr 20, 2017
  42. Anubis75

    Anubis75

    Joined:
    Jul 29, 2013
    Posts:
    24
    i use Unity 5.6 its works nice
     
  43. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Hi, sorry but we don't monitor these forums. As others mention if you need help please email us on support@wireddevelopments.com or go to our website for a support form.

    We are not actively working on this plugin however if there is something that you can work around (i.e the "renderer" to "GetComponent<Renderer>()" code change to remove the script error) please do, otherwise if you can't work around it either ask us or in this forum (as there are many helpful people who seem to know A LOT of answers) and we or others will try and fix things where possible.

    We understand everyone wants the system to do certain things but at a point the system can only do so much so please checkout the website HERE and make sure you are aware of what the system "can" do and ask if you are not sure it does what you need it to do.
     
  44. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Unfortunately you'll have to implement a LOD system yourself. If you need help understanding any of the systems to do this please get in contact with us.
     
  45. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    I would recommend looking at doing this on the Vehicle script itself and leaving the node path alone. You should be able to set a boolean for activating left or right turns within this script and the vehicle will avoid going left or right. If you have trouble finding the correct location on the script please email us and we will dig into the code to find it for you.
     
  46. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Thanks for the update, good to know as we haven't tried it on the latest. If anyone downloads our plugin and finds it isn't working on the latest unity release please email us so we can check it out and get it working for everyone.
     
  47. Anubis75

    Anubis75

    Joined:
    Jul 29, 2013
    Posts:
    24
    your welcome, i guess you resived my mail today thats why you are back here,, nice!
    I dont like this forum for asset support also. the overview is a horror, better is a own Supportsystem.

    Anyway, i spend also a lot of hours to unterstand the Asset. i found also some points.

    - There is no global function to hide the points in the game? I just removed the mesh renderer at the nodes
    - Obolute Code, but you wrote allready: GetComponent<Renderer>()
    - The "2 Lanes - Intersection + Traffic Lights (Connected) - ( Road V2 )" has a mistake, there is one side with left lane is right and the right lane is left. I fix it but for me its a bug.
    - To Change the Images for the footpath,At the "2 Lanes - Straight - ( Road V2 )" is nice solved under Models => road-2 =>footpath . But in "2 Lanes - Turn - Blue Outer - ( Road V2 )" is not consiquent solved, there is under Models => road-2. So with this solution its not possible to handle each foopath. not a big deal but also not logical :)

    Cheers
    Anubis
     
  48. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    V2.1.3 now has a complete culling system added.



    This allows you to specify the distance from your main camera to which you want the roads culled, the vehicles culled and the pedestrians culled. Each have their own primary cull distance meaning you can cull the roads 300 meters from the camera, the vehicles 100 meters from the camera and the pedestrians 50 meters from the camera.

    Disabling these elements from rendering at the distance you specify is aimed at increasing performance for your road networks, especially on mobile.

    We have also added a "Show Nodes" toggle in Unity Editor tools which means you can now toggle the nodes on and off within the unity editor. When you change the toggle (on or off) you need to move the mouse over the scene for the update to take effect.

    (the V2.1.3 update has been submitted and is now pending approval from Unity)
     
  49. John3D

    John3D

    Joined:
    Mar 7, 2014
    Posts:
    441
    Thanks for this update!
     
  50. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,210
    +1 thanks for the update. Very useful!