Search Unity

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)
    85.4%
  2. No

    15 vote(s)
    14.6%
  1. VenandiVatis

    VenandiVatis

    Joined:
    Dec 5, 2016
    Posts:
    17
    Glad to know this is still active and kicking :) @wireddev
    Is there any written documentation you can make available? That would explain what things like "Ignore Traffic System Editor" or "Ignore Children" do.
    Sometimes in the code there are some info, but most of the time I find that I need to spend huge amounts of time trying to find out how things work.

    Ty
     
  2. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    The website should contain everything you need to produce your road and traffic networks but for things like "Ignore Traffic System Editor" and "Ignore Children" these are specific to the editing tools themselves. I highly doubt anyone will use them as they are only for showing or hiding Anchor and Edit "Reveal" and "Select" buttons in the UI. Also for finding child node renderers.
     
  3. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Version 2.1.3 has been released so please let us know what you think of the new auto culling feature. Interested to hear how performance increase (or perhaps decreases - HOPE NOT!) for everyone.

     
  4. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    That update is cool, but I feel like the asset needs more love -- to "feel" 2017 and to be up to par with Unity 5.6 in general. Do you by any chance plan to do a full 2.2 update?
     
  5. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    We are open to everyone's suggestions for new and updating features / functionality. Please make suggestions and we will consider them for the next update.
     
  6. VenandiVatis

    VenandiVatis

    Joined:
    Dec 5, 2016
    Posts:
    17
    Hi WireDev, thanks for the reply, but the website has mostly just videos. The code does have several comments that explains perfectly what some variables do, but some important ones are a mystery.

    I asked about those two variables, because I created my own models and prefabs, I tried to keep to just moving things around and replacing models, but in some cases I needed more nodes (e.g. i have a long turn), and somehow I broke the Editor. that is, my pieces no longer link automatically using the editor, so i need to manually connect the nodes between pieces.

    I also need to tweak or fix some areas, but I havent review this last version, so maybe there are comments now for the missing variables.
    Some of the areas I am trying to fix are:
    1) on my long turns the cars detect a car on the opposite lane and break suddenly. I suspect the raycast is seeing a car on the outside of the urn and think it is going to crash.
    2) I want my vehicles to slow down when they approach other vehicles, instead of near breaking to a stop.

    btw, you still trying to do a range on a bool, Unity no longer supports that.
    [Range(0.0f, 1.0f)] <- you need to comment out that range.
    public bool m_ignoreCanFitAcrossIntersectionCheck = true;
     
  7. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Great updates. Just played with this asset again. Excellent culling feature!
    Does the pedestrian system have a forum? I'm trying to figure out how to get peds to stop and wait for the lights at crosswalks. I tried enable pedestrian crossing, but it doesn't seem to do anything. The little samurai just j-walks into on coming traffic.

    After enabling ped crossing, is there something else that I need to do to identify the position or direction of the X-ing or something?

    Cheers!
    Mark
     
  8. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Did you check out this tutorial on how to create your own custom road piece? That should be the basics on creating what you need? http://wireddevelopments.com/trafficsystem/documentation.php#14

    You can manually add nodes into the correct array on the script if need be but following that video should be the easiest way.

    Yes that sounds like the case indeed. I would suggest making your long turn further apart as the cars do raytrace a certain distance to detect other traffic. You could shorten the raytrace length also on the vehicles but then your intersections will need adjusting also since they are configured for the default tile length to avoid getting stuck in the middle of an intersection if there is a lineup of cars on the other side.

    The code for this is in the vehicle script "TrafficSystemVehicle.cs". If you need more help determining what to change please feel free to send in a support ticket here: http://www.wireddevelopments.com
     
  9. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    There is no forum for the pedestrian system so feel free to post here.

    The " TrafficSystemIntersection.cs" script takes the pedestrian nodes in an array called " m_pedestrianNodes". You add these via the editor. These nodes should be the ones that sit on the sidewalks where pedestrians wait to cross. The bool for each of these nodes called "m_waitAtNode" is set to true if they are not to walk across the intersection. Once the intersection deems it safe for pedestrians to walk across the intersection the bool is set to false and away they go.

    Be sure to assign your pedestrian nodes to your intersection otherwise the pedestrians will walk into oncoming traffic as you describe above.
     
  10. izuboii

    izuboii

    Joined:
    Jun 30, 2017
    Posts:
    3
    The Explanation on the pedestrian system that you gave here i rather difficult for me to understand. i have the same issue and i would appreciate a more detailed explanation. Thank you
     
  11. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    It seems clear to me. Possibly there is a language / translation issue?

    The traffic system intersection script has an array where you add the crossing points for your pedestrians. These points or nodes are places on the sidewalk where the pedestrians will wait till it is safe to cross.

    When the "wait here" bool for the node is true, pedestrian crossing is prohibited. When the intersection decides it is safe for pedestrians to cross, this bool is set to false, so pedestrians are no longer told to wait and may proceed across the street.

    The script is called TrafficSystemIntersection.

    The pedestrian wait point array is called m_pedestrianNodes.

    The bool or flag that signals when it is safe to cross is m_waitAtNode. True means wait, and false means don't wait.
     
    Last edited: Jul 15, 2017
  12. izuboii

    izuboii

    Joined:
    Jun 30, 2017
    Posts:
    3
    I understand you clearly but the issue here is am i supposed to edit the TrafficSystemIntersection script? to add the crossing points for the m_pedestrian array? because it seem s just adding and linking the nodes at the intersection points is not working for me
     
  13. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    If you are following the directions and it still isn't working for you, make a tiny project with no third party assets that shows it isn't working and send that along with a note explaining the situation to the support email address.
     
  14. izuboii

    izuboii

    Joined:
    Jun 30, 2017
    Posts:
    3
    Thank you. but the PedestrianVehicleCheckTrigger.cs is supposed to be enabled for the TrafficSystemIntersection.cs to carry out its routine. the problem now is how do i enable it?
     
  15. GGforJ

    GGforJ

    Joined:
    Sep 26, 2017
    Posts:
    2
    Is there any video or guide about the Principle of Vehicle Collision Detection
     
  16. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Pre-Sales question:

    Your traffic system looks like what I need, however I am using EasyRoads3d so it seems that I can manually place your marks at the places I need, because my road meanders left and right and gentle vague curves. Right? I looked at youor videos and the closest thing to what I need is this one:
    Except I don't have a specific prefab. I know it will take me longer to manually place this blocks/points/whatever you call them, and I am okay with that, but I just wanted to make sure that my need was possible.

    Thanks for your time and have a great weekend
     
    Jbs_GameZone likes this.
  17. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    If you do give this a shot (using the R&T System on EasyRoads), please report back.
     
  18. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Of course, however I need to get some assurance that it is possible. Anyone?
     
  19. shahzaib

    shahzaib

    Joined:
    Dec 14, 2013
    Posts:
    32
    does it work with Edy's Vehicle Physics or Unity's Standard Vehicle? This looks really promising.
     
  20. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    It uses a very efficient form of movement, which is important for its role in providing background traffic.

    If you want vehicle physics, for performance it is better to restrict that to just a certain few vehicles at a time.

    For instance, you might create vehicle prefabs that have both methods of control and toggle between them as needed.
     
  21. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    I purchased the asset this morning and have spent the day getting it working with Easy Roads 3D. I found that I can get the Pink and Blue nodes and simply copy n paste, with some additional work. (code below) Each node has a List of connected nodes (called "m_ConnectedNodes") So each node has a reference to the node that follows. ie: "Node 2" follows "Node 1"

    In my example the first node is called "Pink (0)", so each copy-n-paste adds an increment to the value. The function GetPreviousNode() uses this naming pattern to get the previous node.

    So within TrafficSystemNode.cs, in the Awake function I added the following code just below the "//HACK - END"



    //JAMES ROSE CODE
    //This is because I am using Easy Roads 3D and just want to copy n paste the Traffic System Nodes
    //and have them connect to the previous node as well as have that node connect to this new node.
    if (!Application.isPlaying)
    {
    try
    {
    TrafficSystemNode previousNode = GetPreviousNode();

    if (previousNode != null)
    {
    if (!previousNode.m_connectedNodes.Contains(this))
    {
    previousNode.m_connectedNodes.Add(this);
    }
    }
    }
    catch
    {
    //Don't care, just don't screw up the original code/process
    }
    }
    //END OF JAMES CODE

    ---------------------------------
    There was no Update() function in this class, so I added one. This gets the previous node (that code function is at the bottom of this post) and points it at this node.

    void Update()
    {
    //This is to point the previous node at this node.
    if (!Application.isPlaying)
    {
    if (transform.hasChanged)
    {
    transform.hasChanged = false;
    TrafficSystemNode previousNode = GetPreviousNode();

    if (previousNode != null)
    {
    previousNode.transform.LookAt(transform);
    }
    }
    }
    }

    --------------------------------------------------

    private TrafficSystemNode GetPreviousNode()
    {
    TrafficSystemNode returnNode = null;

    string sName = transform.name;
    int iStart = sName.IndexOf("(");
    int iEnd = sName.IndexOf(")");
    int iValue = System.Convert.ToInt16(sName.Substring((iStart + 1), ((iEnd - iStart) - 1)));

    sName = sName.Substring(0, (iStart - 1)) + " (" + (iValue - 1).ToString() + ")";
    GameObject trafficSystemNode = GameObject.Find(sName);

    //Just in case it does not exist
    if (trafficSystemNode != null)
    {
    returnNode = trafficSystemNode.GetComponent<TrafficSystemNode>();
    }

    return returnNode;
    }
     
    Last edited: Nov 8, 2017
    Jbs_GameZone likes this.
  22. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    Just to be clear ... you're saying you DID get it to work, right? :)
     
  23. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Yes, I did get it working. So far I spent the day working out how to make the process easier, so I only have one road done, and only with the pink, not blue yet. But that should be easy now. The intersections may have to be manual, but that's a small thing. Now I can copy, paste and then move the new node and the previous node is attached and pointed at the new node. So I'm happy.
     
    hopeful likes this.
  24. shahzaib

    shahzaib

    Joined:
    Dec 14, 2013
    Posts:
    32
    That's what I've in mind as well, but the question is, that is it easy to get it working with Edy's Vehicle Physics or Unity's Standard Vehicle? Both EVP and Unity Standard Vehicle have exposed float (-1 to 1) variable for both steering and acceleration, if this traffic system allows some way to control them, it would be a lot easier to make it work.

    If you've prior vehicle AI experience, it'd be easier for you to understand what I'm talking about.

    Kind Regards
     
  25. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Ok, so while my code has made it easy to add the road markers, when I start the game they are still visible. See: https://imgur.com/a/y6utv

    There is also one of your road pieces placed and it too shows the markers. I assume that they are supposed to be hidden. Thoughts?

    EDIT: Ok, I'm just stupid, sometimes, there is a checkbox for "Show Nodes" It was just that easy. doh!
     
    Last edited: Nov 8, 2017
  26. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    It's been probably a year or so since I last used this, but I believe the markers are supposed to be scene view / editor only. Try to contact the devs via email?
     
  27. LTPStudioXR

    LTPStudioXR

    Joined:
    Nov 1, 2016
    Posts:
    11
    I'm looking to scale the system DOWN to 1:200. however the grey Sphere/yellow Block links stay at scale 1:1. Is there a way i can make the entire system scale down with visuals intact?
     
  28. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    I don't have an answer for you, but just the note that changing the default scaling in Unity usually creates difficulties. If there's a different way to achieve your goal while preserving natural scaling, that's often the best course to take.
     
  29. ahussain02

    ahussain02

    Joined:
    Oct 3, 2017
    Posts:
    2
    Hi ,
    I just bought this asset to simulate a portion of my city which is an area of 3 miles by 3 miles. I have just started building the roads, and my computer system ( 16 gb ram , quad core latest gen core i5 processor) has become extremely slow ,and it hangs .I am not able to build the whole network. Any advice? or suggestion ?
     
  30. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    You'll probably have to troubleshoot this on your own. Try temporarily turning off some of your layout, use the Unity profiler to find out where your processing time is going, etc.

    It sounds like your simulation could be too large to accomplish without figuring out ways to optimize the scene.
     
  31. ahussain02

    ahussain02

    Joined:
    Oct 3, 2017
    Posts:
    2
    you mean to say 3 miles by 3 miles is a large area ? just to create 6 roads out of few hundred roads in the network, it took me around 1200 road pieces to build and system is extremely dead slow,,in short I can not move further.....Also one more question, I have to simulate my city in the unity along with the roads and intersection and traffic lights and stop signs .. could you please suggest me some optimized solution for this? Instead of manually constructing the roads one by one , can I just not build the whole networks of roads in the city in very short span of time using some asset or tool??
     
  32. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    3x3 miles certainly could be an extremely large area, in that it depends on what you've filled it with.

    It could also be very small if you don't have much in the scene. If you are using a small number of very simple road pieces and just a few vehicles, I think it wouldn't be very demanding at all.
     
  33. AJ-Design

    AJ-Design

    Joined:
    Nov 1, 2016
    Posts:
    15
    Does anyone know how to make the cars stop at an intersection with stop signs? My project requires intersections with stop lights and some with stop signs. I figured out the stop lights, but I don't know how to make the cars stop at stop signs.

    Thanks in advance.
     
  34. tjoshi

    tjoshi

    Joined:
    Nov 1, 2016
    Posts:
    6
    I am thinking to buy this asset but is this asset compatible with Unity 2018.2 (The latest update)?
     
  35. BettoSan

    BettoSan

    Joined:
    Dec 7, 2017
    Posts:
    57
    Yes, it works perfectly.
     
    hopeful likes this.
  36. seanovak

    seanovak

    Joined:
    Apr 4, 2018
    Posts:
    1
    Is there a way to create obstructions to traffic flow?
     
  37. trafalmejo

    trafalmejo

    Joined:
    Sep 29, 2018
    Posts:
    3
    Hi, I am interested in this product. It seems really powerful.
    Two question:
    1. Is it possible to generate roads during run time?
    2. Is it possible to autodetect crossed roads and creating road intersections?
    Best!
     
  38. muthugamer

    muthugamer

    Joined:
    Mar 5, 2018
    Posts:
    1
    hi , i am using this asset but i had a doubt that my drew my roads but the nodes have mesh filter i dont want to show in my game i need actual road scene. How to do that
     
  39. nirbod

    nirbod

    Joined:
    Feb 4, 2018
    Posts:
    1
    Good day! I want to buy this miracle! But I would like to know, is it possible to change the speed of cars depending on whether there is a car on the road?
     
  40. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    I'm not a dev for this plugin, nor am I actively using it at this time. But you would have to figure out how to adjust that yourself. Changing the speed of a vehicle in code is easy, but where it might be tricky is figuring out where your other cars are ... are they close? Are they on the same road or not? Anything you would do in that regard would be unique to your implementation.
     
  41. seanNovak

    seanNovak

    Joined:
    Aug 12, 2013
    Posts:
    12
    Is anyone else suddenly having trouble with vehicles going at warp speed on OSX only??
     
  42. Jbs_GameZone

    Jbs_GameZone

    Joined:
    Dec 14, 2018
    Posts:
    118
    Hello,

    Got the asset but cannot build for IOS.

    In a nutshell (this is the most simplified setup just to show it isn't running out of the box):
    1) New unity project
    2) Import Road & Traffic System
    3) Open Demo-New Scene
    4) Build for IOS

    Error(s) :
    ErrTraffic.png
    stderr:
    Corlib not in sync with this runtime: expected corlib version 82, found 1051100001.
    Loaded from: C:\Unity\TrafficAI\TrafficAi\Temp\StagingArea\Data\Managed\mscorlib.dll
    Download a newer corlib or a newer runtime at http://www.go-mono.com/daily.

    Tested & works well on Windows.

    I use Unity 2018.3.0.f2

    Looking fwd for your feedback.
     
  43. Master_civil

    Master_civil

    Joined:
    Jan 27, 2019
    Posts:
    2
    hi. when i run my game and i go to game window, the nodes are still appear. how can i fix that?
    i use ver. 2.1.2 package.
    thank you.
     
  44. Master_civil

    Master_civil

    Joined:
    Jan 27, 2019
    Posts:
    2
    i have the same problem. could you fix that?
     
  45. ManhimYeung

    ManhimYeung

    Joined:
    Feb 12, 2018
    Posts:
    1
    Click on your traffic system
    On the traffic system script, you can uncheck the "Show Gizmos" and "Show Nodes", then they should disappear even before you run it.
     
  46. Jbs_GameZone

    Jbs_GameZone

    Joined:
    Dec 14, 2018
    Posts:
    118
    Really guys ?

    No reply for almost a month to a user who purchased this asset and said he cannot use it at all, even the demo scenes shipped with it cannot be built !

    Things seem to be consistent on the support@wireddevelopments.com email, no reply there either.

    I'll let this simmer for another week before the 1 star review. Hopefully this hasn't been a total waste of money.
     
    Last edited: Feb 9, 2019
  47. Jbs_GameZone

    Jbs_GameZone

    Joined:
    Dec 14, 2018
    Posts:
    118
    I've found what was the issue and want to share it with others that may run into it : Although with the newer versions of Unity (2018.0.3f2 in my case) the ScriptingBackend defaults to IL2CPP for IOS builds, you need to set this as well under Project Settings > Player > Settings for PC, Mac & Linux Standalone. There it defaults to Mono.

    TrafficSystem.png
     
    hopeful likes this.
  48. Wothanar

    Wothanar

    Joined:
    Sep 2, 2016
    Posts:
    122
    its this outdated? i bought the city generator and its works fine , now im wondering if i should buy this or not, im doing a rts game its a kind of remake of old game Gangsters Organized Crime thats how the game its called , if you can check about this game and see how its made its really fits this plugin i think but it would need some features like we can buy cars and move the cars with people in to another points then drop them out like rts game ... should be great , but its updated or not? should i buy or not?
     
  49. Wothanar

    Wothanar

    Joined:
    Sep 2, 2016
    Posts:
    122
    did this plugin worked for you? im having a long fight with it to get a decent road i just cant connect the roads well the cars start to return ... i need a big road network but easy with intersections all intersections and straight roads and i need alot of blocks for put some buildings nice... but damn this plugin it made it harder to connect the things and spawn them,. the autolink stuff some time just put it wrong , and it just spawn wrong and i have to manually check node by node a completelly nightmare to follow this ...
     
  50. Jbs_GameZone

    Jbs_GameZone

    Joined:
    Dec 14, 2018
    Posts:
    118
    Hi Wothanar,

    I'm still 2-3 weeks away from adding traffic to my project so can't really provide feedback at this moment. Only tested it (successfully) on a small scene with an oval road and no intersections. Have to dive deep into this asset to see if I can map it to my needs and the lack of support (so far, when I had the previous issue) isn't boosting my confidence. Nonetheless, we'll see what's what when we get there, the first project is always the hardest

    Regards,
    Jbs