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. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Thanks for the kind words Jackburf! Unfortunately we have a fair few feature requests so we can add it to the list but it won't be worked on for some time.
     
  2. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    Hey guys cool asset.
    I tested the apk on my LG G3 phone and noticed a bit low on frame rates 25-30. Was expecting more on this phone as its fairly high end. Is there any optimization that could be done. Possibly less calls in code or Lower poly car models , less cars on the road. Shadows were off.
    This would be more of a background asset. In a city environment so thats just to much draw.
    Im going to purchase this reguardless. But any ideas to get frame rate up would be appreciated. Thanks

    Edit: i must of had some background apps running tried it again and was 30-50. But ideally id like a solid 50 or more. So still give me any ideas.
     
    Last edited: Apr 22, 2015
  3. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    AFAIK it works with the irds etc assets and has the option to generate waypoints on roads automatically, and I assume specifying junctions in the api is there or coming, i do hope some of integration comes around as your system is nicely affordable. Alternately is it possible to create networks without attaching them to specific road sections?
     
  4. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    would be nice if integrated with easyroads3d and with map-ity

    also would be nice if could handle pedestrians as well (perhaps a separate asset)
     
  5. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    Hi, I just bought this asset today.

    I was just wondering when the cars turn they could turn little slower to towards the next target in corners (with slepr or something). It would look that they turn smoother. Turning is a bit edgy now.

    Anyway thanks for the asset! Learning the basics here.
     
  6. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    The number of vehicles and the size of the network will always play a part in the cost of rendering and processing so if you can't get away with a smaller road network, try reducing the number of vehicles.
     
  7. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Most definitely, the underlying system is a node base pathing system with traffic behavior ( a lot of traffic behavior :) ) built on top of it. If you check out "How to create custom road pieces" on our Road & Traffic System website you'll find out how to create the pathing nodes and link them together. The actual road tile pieces are really there for visual use... you don't need them at all.
     
  8. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Yes all this can be tweaked via the TrafficSystemVehicle.cs script. You can find the tutorial on the Road & Traffic System website under the "How to customize vehicles" tutorial.
     
    Nadan likes this.
  9. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    Ok, thanks! I will see that.
     
  10. Gruguir

    Gruguir

    Joined:
    Nov 30, 2010
    Posts:
    340
    I'd also like to have Edy's Vehicle Physics integration ;) It would make sense as it is a largely adopted asset.
     
  11. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    Is there anything built into the current system to set temporary stopping points along the road to simulate, for example, a school bus stopping to drop off/pick up schoolchildren, or for rubbish trucks going about their collection route?

    If not, is it possible to add this in? :D

    Thanks.
     
  12. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    This is really neat! Surprised I missed this pack in the store. Grabbing a copy now.
     
  13. Thomas4

    Thomas4

    Joined:
    Nov 19, 2013
    Posts:
    6
    As Nadan already pointed out the turning of the cars is a little bit edgy. I watched the "How to customize vehicles" tutorial but you don't explain what property or setting of the TrafficSystemVehicle script might help. Any other suggestions other than to put more points on the turn?
    Btw the "Offset Pos Val" in the script doesn't work properly. You forgot to take the direction of the car into account. As it is right now, the offset positions the car beside the lane, if you change the x or z value.
     
  14. rpanher

    rpanher

    Joined:
    Nov 10, 2014
    Posts:
    5
    Hi,
    I've tried to put on the scene my own cars to go automatically and it works with TrafficSystemVehiclePlayerAuto Script, but when my own cars are near from an intersection they stop (on the straight roads they work correctly). The prefab cars from the plugin do it well. I don't know the reason why my cars stop there and the others continue right. How can I solve it?
    I also want to add a vehicle controlled by the player, what script must it have? I tried with TrafficSystemVehiclePlayer, but it doesn't work.
    Thank you!
     
  15. Thomas4

    Thomas4

    Joined:
    Nov 19, 2013
    Posts:
    6
    You have to add the TrafficSystemVehicle script (not the TrafficSystemVehiclePlayerAuto script) to your AI vehicles.
    As for your player controlled vehicle the TrafficSystemVehiclePlayer script should work. For me it does. And according to the FAQs (http://wireddevelopments.com/trafficsystem/documentation.php#faq3) that is the correct way.
     
    Last edited: Apr 30, 2015
  16. rpanher

    rpanher

    Joined:
    Nov 10, 2014
    Posts:
    5
    Thank you for answering. I tried before with the script that you say, but when my cars go out of the spawner, as soon as they appear they dissapear, so it does less than with the other script. I don't know the reason or what I'm doing wrong...
     
  17. Thomas4

    Thomas4

    Joined:
    Nov 19, 2013
    Posts:
    6
    If cars are spawned and get despawned immediately that's because the spawner has no start node assigned. (The cars get null as next node and thus get despawned.)
    As a test you could try the "RandomVehicleSpawnPerNodes" option on the TrafficSystem script. Then you don't need seperate spawners. (Don't forget to assign your ai vehicle prefab to the vehiclePrefabs list.)
     
  18. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    grabbed this anyways, hoping it will work with easyroas over extened stretches of highway as much as dense ares im going to try and populate with the max plugin ghosttown
     
  19. rpanher

    rpanher

    Joined:
    Nov 10, 2014
    Posts:
    5
    That can't be the reason because there is a start node assigned in my spawners. In fact, the prefab cars from this system run well when they go out from the spawner, but mine appear and dissapear.

    With the spawner: When my own cars had "TrafficSystemVehiclePlayerAuto" script they started running but they stopped when the next node were from an intersection. When I changed that script for the "TrafficSystemVehicle" script is when they appear and dissapear from the spawner, so they do less than with the other script.

    With the "RandonVehicleSpawnPerNodes" I have the same problem, my own cars with the "TrafficSystemVehiclePlayerAuto" script run well until their next node is from an intersection (there they stop and they do nothing else). When I use the "TrafficSystemVehicle" script they don't run, they only start to "fly" a little like they were on the moon.

    I have seen that the in the console appear this:
    Vehicle Destroyed - No path node
    UnityEngine.Debug:LogWarning(Object)

    But I have more kinds of cars for the spawner and prefab cars of the TrafficSystem run and when it spawns one of my own cars it doesn't. It only appears when one of my cars is spawned, with the others cars it works correctly, so the spawner is well configured..
     
    Last edited: May 9, 2015
  20. Thomas4

    Thomas4

    Joined:
    Nov 19, 2013
    Posts:
    6
    How did you set up your car prefab? Try to compare them to the provided car prefab. As far as I know the TrafficSystemVehicle script must be on the top level of the prefab. If you add it to a child of the gameobject it does not work.
     
  21. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    Downloaded the new version, ran the demos. Looking good! Liking the performance and the turning arrows. :)

    Obviously, turning movements are still a bit rough. And there can be the occasional glitch, like where a car at the crosswalk stops on yellow, when (at least in the US) they will always go through on yellow.
     
  22. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    I'm not sure but maybe the car's pivot when the car is turning is a little off. Maybe adjusting it would make turning more natural.
     
    hopeful likes this.
  23. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    Maybe if the car tried to turn from the front axle instead of from the middle, it would look better ...?

    I tried something like this in the demo, and IMO the turns looked smoother because the front end wasn't sharply jerking.
     
  24. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    In 2.0.1 we have added this:

    - Cars will randomly enter an intersection on yellow to provide additional realistic simulation

    You can adjust this to your liking.
     
    hopeful likes this.
  25. John3D

    John3D

    Joined:
    Mar 7, 2014
    Posts:
    441
    Hello WiredDev,

    Is this a new update: Version: 2.0.1 (May 18, 2015)?
    What is the best way to update my project with your new RTS asset?

    Thanks!
     
  26. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    What is the version you are currently one? Version 1.0 to Version 2.0 has a lot of upgrades in particular the road pieces have been upgraded and also the TrafficSystemVehicle.cs script has a few more options you need to tweak (best to watch the new video on that one located on our website: http://wireddevelopments.com/trafficsystem/documentation.php)

    As to upgrading, should just be download the new package and install over the top. Like always, take a backup of your project before you do though so you can roll back in case anything goes wrong.
     
  27. adhdchris

    adhdchris

    Joined:
    Nov 13, 2013
    Posts:
    45
    Just got the asset yesterday but feeling pretty disappointed with it by now. I mean the cars are just sliding around and the turns look horrible no matter what speed you set them to. It makes this asset unusable in production games at this point, unless you're making something really cartooney and unrealistic.
    Don't get me wrong, I love all the extra options like spawning cars and having them drive through yellow lights, but if the core product doesn't work right, that makes everything else useless. Is there a reason you've decided to go with the node based approach as opposed to splines?
     
  28. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    @adhdchris, Try adjusting the car model so that the turning point is at the front axle instead of in the middle of the car. It makes the turning look a lot better (not entirely smooth, but better).

    Maybe moving to splines would fix the remaining jerkiness ...?
     
  29. adhdchris

    adhdchris

    Joined:
    Nov 13, 2013
    Posts:
    45
    Thanks @hopeful, that makes it somewhat better however it still looks pretty bad on wide turns. The main issue with this steering/AI system is that it rotates the cars based on rotation speed which is not in sync with the distance between the car and the next node. So on wide turns that consist of 3 or more nodes, the car rotates to its next node position and freezes way before it reaches the node and does it over and over again. That's what causes the most visible jerkiness from what I can tell.
    Has anyone managed to hook up a car physics controller to this?
     
  30. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    What you're saying sounds reasonable. My impression is that the devs' desire is to keep R&T as lean as possible, but if you can think of cheap and easy ways of making improvements, go ahead and make suggestions. The devs have implemented several suggestions already.

    Did you have a particular car physics controller in mind?
     
  31. John3D

    John3D

    Joined:
    Mar 7, 2014
    Posts:
    441
    I've bought this asset on 3rd March 2015 and it was labeled V 2.0.1.
    Thanks for your reply.
     
  32. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    I tried the same and it does look better.

    For people moving in the streets in my game I bought this other asset called Simple Waypoint System. I'm no expert but I think similar solution/code for the cars would do the trick for Road and traffic system as well. In this you also put nodes around and the characters/cars etc. and they turn really smoothly with splines.

    Here's demo:

    https://dl.dropboxusercontent.com/u/61299629/sws/WebPlayer/WebPlayer.html
     
    UnleadedGames likes this.
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    Simple Waypoint System uses a lot of tweening. Maybe that is the magic?
     
    UnleadedGames likes this.
  34. adhdchris

    adhdchris

    Joined:
    Nov 13, 2013
    Posts:
    45
    RTS has so much potential but it's so half-assed at the moment it's driving me nuts. The new road piece prefabs don't match each other seamlessly, the sizes are off as well as the textures. Spent over 10 hours fixing all the models and texture maps and trying to align the road pieces. Why @wireddev couldn't spend an extra hour or two to polish the road pieces and have A+ asset is beyond me...

    The same thing goes for the TrafficSystemVehicle, it contains both- vehicle AI and vehicle controller in one component, which is just lazy coding (also a lot harder to customize). With a separate AI & Controller logic hooking RTS up to a Edy's or UnityCar would be a piece of cake, but as of right now the whole component is just a giant clusterf***.

    @hopeful RTS updates vehicles location every frame, so tweening wouldn't work without rewriting the whole controller logic also it might be more resource-intensive. Anyway, I'll try to separate the AI & controller logic today and maybe then it'll be easier to come up with a solution that works better with this node based navigation.
     
  35. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    We have a solution for telling your AI car to start at one location and to navigate to another location of your choice. I will admit straight up that the solution does not pick the quickest route to take, it picks the first route it finds and uses that. Why does it do this, because of a number of reasons.

    Our pathing is randomized node based pathing which means you can place whatever types of road pieces into whatever layout you wish for whatever size you wish. This makes it very difficult to 100% always calculate the shortest route from one location to another. Sure it is easy for a closed circuit oval layout like a race car dome where they go around and around but with a random city block or large city layout, things get tricky. Think about all the twists and turns, multiple lanes, road dead ends... etc

    Also we needed to consider the speed in which the calculations must be done in order to find a path. We could find the shortest path from one location to another but depending on the size of the layout and how many 1 lane, 2 lane, 4 lane, 6 lane, roundabouts, traffic lights T and cross intersections and dead ends you have in your mega layout, determines whether you get the shortest route in 1 second or 1 hour as there could be many thousands of long combinations to check.

    This lead us to making a solution that would be less elegant but would fine a path for your AI car to navigate from and to fast. We say less elegant as really it can be spot on if you are close by form your start node to your end node or it can see your AI car go in the most unpredicted route possible but end up at the destination you chose.

    If people are still interested in something that at least gets the AI car from one location to another, regardless of what route it takes, we will drop this into the plugin for all to use. It is very simple to use, just pick the "primary" node you want the AI car to navigation to and either tick the "Use Node To Path To On Start" or call the "CalculatePathToTake( Node )" in your code and pass in the node you want to navigate to. Let us know if anyone is interested in it and we will add it in the next update and also post a video on how (cough) crazy the AI pathing can be verses how accurate it can be.

    If you don't care how the AI gets to their destination than this solution is for you. If you need them to take exact routes or the shortest route than unfortunately with our node base system it is near impossible while trying to maintain real-time calculations. This is not to say we won't make an editor function in the future where you can leave it run for minutes to hours calculating your city layout to find the quickest route for a given vehicle from node A to node B and allow you to store that for later use in real-time but this is not available yet.

    So, if anyone is interested in the current real-time solution outlined above, please let us know so we either put it in or leave it out of the next update.
     
  36. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    Put it in. It sounds like it'll work well enough for background AI simulation, and if people are wanting the AI to work out the shortest route then they'll have to come up with their own code :)
     
  37. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    @wireddev - Can't hurt to add the navigation feature, can it? So long as it can be disabled (with no additional overhead) if we don't want to use it.

    Besides, if the navigation is a little indirect, it could be the basis of a taxi driver simulation ... ;)

    @adhdchris - Any suggestions that help the plugin are good, IMO. I think many people will want to integrate some sort of outside AI with R&T (Behavior Designer, Edy's, etc.), so whatever you think will help facilitate that, go ahead and mention it.
     
  38. DTek

    DTek

    Joined:
    May 29, 2013
    Posts:
    15
    Is this still supported ? and does it work in Unity 5 ?
     
  39. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Sure is, and sure does ;)
     
  40. disny1234

    disny1234

    Joined:
    Sep 21, 2014
    Posts:
    23
    Is Road & Traffic System supported with unity 4.5.0 64bit build
    and unity 5.0 64bit build
     
  41. BoneyPile

    BoneyPile

    Joined:
    Apr 20, 2014
    Posts:
    15
    Hey I had a quick question.
    Is there a trigger or something I can make that would destroy vehicles on enter?
    So I can put a trigger volume at the end of their pathing and have it destroy them?
    I noticed that if I just end the waypoints they destroy automatically when they reach the end, but does this have any negative affects with garbage collection or anything? Would a trigger be better or should I just leave it to do it automatically?
    I have hundreds of cars on screen at a time, so I am just trying to find out the best way to handle this.

    Also is there a good way to handle collision? I remember in the old system I could just put my stuff on a certain layer and the AI cars would detect collision. It seems now that you need to add the player script to an object in order for the AI to see its collision. Is there a better way that I can make the AI sense collision?
     
  42. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    The solution that occurs to me is to use a teleport trigger to recycle your cars. Have cars that are headed outward off the edge of the map be teleported to a lane that is starting at the edge of the map. That way your garbage collection is zero.

    This should work smoothly so long as you have the same number of lanes entering the map as exiting.
     
  43. rpanher

    rpanher

    Joined:
    Nov 10, 2014
    Posts:
    5
    Hi,
    I just have read that Unity 4.6.1 or higher is required for this plugin. When did you put that? I mean, I bought this about two months ago, maybe April 21, 2015 and I didn't read that. Is it necesary for the version I have or was it put later? I use Unity 4.5.5.
     
  44. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    You should be fine with 4.5.5 rpanher. We updated to the latest Unity 4 and submitted but that older version should not be a problem.
     
  45. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Hi everyone, we have a big announcement to make for the Road & Traffic System.... .... .... it's getting a Pedestrian System as a FREE update! :)

    It's 99% done, we just need to put some documentation and videos together for you to make sure you know how to use it, then it is off to Unity for submission along with some additional updates as well. The Pedestrian System uses the Anchor / Edit technology for easy linking to, but the videos will explain it all.

    Hope you guys find it useful in your games and apps you create! Here are a couple of sneak peek videos.



     
  46. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    Very nice! Obviously some aspects of the system are a little glitchy right now, but with fewer pedestrians on the streets a lot of that won't show.

    Thanks, guys! :D
     
  47. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hello wiredev,

    I am really interested in purchasing this asset and also your City Generator for a project I am looking to start. I just wanted to know if both City Generator and Traffic System can be used together in Runtime for procedural gameplay.

    Thanks,
    jrDev
     
  48. wireddev

    wireddev

    Joined:
    Apr 22, 2013
    Posts:
    138
    Only City Generator is runtime at this stage.
     
  49. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    So there is no ETA for runtime setup for RTS as of yet?

    I guess I can get both assets now and create multiple different variations of RTS roads and then code my own logic to randomly load those road systems while using City Generator to do its normal runtime creation. Is this possible and a logical way to do this until the real runtime system comes later on for RTS?

    Thanks,
    jrDev
     
  50. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hello?

    I asked this question over a week ago with no answer? Could you respond please?

    Thanks,
    jrDev