Search Unity

[RELEASED] iTS - Intelligent Traffic System

Discussion in 'Assets and Asset Store' started by rhodnius, Dec 11, 2014.

  1. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    I think it could be that the game objects (cars) that are waiting in the pool get deactivated and the when respawned they get activated, if the car structure is complex the activation and deactivation could be the slow down. I will do some more tests about it to check if thats the issue.

    Rhod,
     
  2. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    Thanks! After this traffic is finished, it will be great! Well, is there a way I can just spawn once a number of vehicles, then not check for the player.. just so I'm not spawning all the time bcause right now the number I have is perfect, just don't need it to be respawning for positioning?
     
    Last edited: Mar 22, 2015
  3. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    In this case, you could just disable the Spawner when you have all the cars you need on the scene, or just make the spawning area super big, so there aint any cars that get outside the spawning are and wont get respawned at all.

    Cheers!

    Rhod,
     
  4. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    That worked perfectly, thanks! Performance is much improved.
     
  5. fabio1955

    fabio1955

    Joined:
    Nov 11, 2009
    Posts:
    72
    I need help because my cars seem to sink. Wheels are half way in the asphalt..
    ITSSink.jpg
     
  6. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    You're using the simple physics. The box collider needs to be extended all the way to bottom of the wheels.
     
    fabio1955 and rhodnius like this.
  7. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    So I'm now turning off the SimpleCar, TrafficAI, and Navigation scripts of the traffic vehicle when it's too far from the player to save resources. It helped quite a bit, but sometime, it can screw up the traffic's navigation effectively because it's turned off. Is there a better way to do this?
     
  8. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    You need to check the code from the Spawner, and see how it handles when respawning a car, since the system needs to assign the values of the Navigation system of the car in order for them to work again.

    Or you could make (force) the cars to completely stop, maybe by constraining the rigidbody movement, and see if that helps.

    Rhod,
     
  9. erdoganuguz

    erdoganuguz

    Joined:
    Oct 7, 2013
    Posts:
    25
    Hello.
    I want to control the red light. I want to activate the red light lights up objects. Example; red light lights up box to get active. Where should I check? Which should check the script file? A little complicated.
     
  10. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    Put your 'box' as a child of the light and it will appear and disappear.
     
  11. erdoganuguz

    erdoganuguz

    Joined:
    Oct 7, 2013
    Posts:
    25
    Thanks ..
     
  12. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    You could also take a look at the script TSTrafficLight.cs to see how the traffic lights work.

    Cheers,

    Rhod,
     
  13. pinchmass

    pinchmass

    Joined:
    Jul 2, 2012
    Posts:
    156
    Hi Rhodmius,

    Just wondering did you ever look into my request for parked cars, in its simplest, just spawning static vehicles (parked no physics) and removing them form the scene too.

    ideally it would be nice for cars to pull out of parked spaces into traffic lanes and visa versa ?
     
  14. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi pinchmass!

    Sorry for the late reply, i was out for these last 3 days, without internet connection :D

    I have that feature on the ToDo list, but i haven't yet started to work on it, I'm currently working on iRDS update and then would be working on iTS for sure ;)

    Rhod,
     
  15. pinchmass

    pinchmass

    Joined:
    Jul 2, 2012
    Posts:
    156
    no stress, looking forward to the new physics in iRDS
     
    rhodnius likes this.
  16. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Just in case someone else experience and error when trying to load a saved XML road data, the error that could occur is the following:

    ArgumentException: Encoding name 'ks_c_5601-1987' not supported

    This is because the XML file header has a wrong encoding, so you just need to look for the first line of the file that would look something like this:

    <?xml version="1.0" encoding="ks_c_5601-1987"?>

    And change it to:

    <?xml version="1.0" encoding="Windows-1252"?>

    Currently I'm not sure why this could happen, and just have been reported once today, so let me know if someone else have the same issue.

    EDIT: I have already fixed this bug, and it would be available on the next update.

    Cheers!

    Rhod,
     
    Last edited: Apr 8, 2015
  17. erdoganuguz

    erdoganuguz

    Joined:
    Oct 7, 2013
    Posts:
    25
    Hello.
    There is a problem.
    1st and 2nd image does not follow the line of cars. Other pictures in all normal.
     

    Attached Files:

  18. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi erdoganuguz!

    Thanks for your purchase, please send me your invoice number to josegarrido@dagagames.com and ill get back to you asap with support!

    Rhod,
     
  19. erdoganuguz

    erdoganuguz

    Joined:
    Oct 7, 2013
    Posts:
    25
    i send it.
     
  20. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Thanks!

    In this case there are 2 things to check first:

    1. Check that you have pressed the "Process Junctions" button
    2. Check the setting on iTSManager on the settings tab called "Lane Curve Speed Multiplier" and "Connector Curve Speed Multiplier" set both to 0.7 and press "Process Junctions" button

    Let us know if this solves the issue.

    Thanks again!

    Rhod,
     
  21. erdoganuguz

    erdoganuguz

    Joined:
    Oct 7, 2013
    Posts:
    25
    very well.. ;)
     
  22. BLI

    BLI

    Joined:
    Aug 28, 2013
    Posts:
    1
    Will this be updated to make use of Unity 5 car physics?
     
    rhodnius likes this.
  23. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi BLI, it already is Unity5 compatible ;)

    Cheers!

    Rhod,
     
  24. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Posted by error in the wip thread. Rhodnius, it feels super polished, super smooth. Great work!
     
    emergki and rhodnius like this.
  25. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Thanks Pulov!

    And more would come on future releases!

    Cheers!

    Rhod,
     
  26. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi guys!

    A new version of iTS has been released, this version has an important performance improvement on the Traffic Spawner code, which improves the memory usage and should give you a few more FPS on Mobile and smoother play on other platforms.

    Cheers!

    Rhod,
     
    Last edited: May 22, 2015
  27. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Guys!

    In case someone is having an issue were the traffic cars collide with each other on the junctions, it is related to the default settings the iTSManager has about the "connector resolution" which you can find in the settings tab of the iTSManager, by default this value was set to 4 (on the next release it would be updated to 2.5 by default) this was causing the traffic cars not to detect each other on some junctions because there were few points on the connectors, just set it to 2.5 and hit the "reprocess connectors points" buttons and then the "Process Junctions" button to update the network data and solve this issue.

    Also, if you see an issue were the traffic cars goes too fast on the corners, you need to adjust in the same tab on the iTSManager (settings tab) and change the value of the lane and connector corner speed multiplier from 1 (default value) to 0.7 and hit the "Process Junctions" button to apply those new settings.

    Let me know if you need anything else,

    Cheers!

    Rhod,
     
  28. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Guys!

    I was wondering if any of you have tried iTS on iOS and Mac? if you did, would be really cool if you could confirm thanks!

    Rhod,
     
  29. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    I used on IOS, not the latest version of the asset but previous version @rhodnius
     
    rhodnius likes this.
  30. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Thanks for the feedback!
     
    hakankaraduman likes this.
  31. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Guys!

    Just tried today a WebGL build and it worked, just to let you know ;)

    Cheers!

    Rhod,
     
  32. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Guys!

    Now you are able to upgrade from dll version to the full source code version via the asset store, i just had added the upgrade option to it.

    Cheers!

    Rhod,
     
  33. Mikeedee

    Mikeedee

    Joined:
    Jan 5, 2015
    Posts:
    42
    Hello rhodnius, this looks pretty cool but I have a question before I can buy it.
    Can you have specific cars have specific destinations ?

    Cheers !
     
  34. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi @Mikeedee !

    Thanks for your interest in iTS, currently there is no built-in path finding integrated on the system, the cars for now just select randomly their path. I think im going to be adding this request to the ToDo list, since this is the second or third time that has been requested now.

    Cheers!

    Rhod,
     
  35. Mikeedee

    Mikeedee

    Joined:
    Jan 5, 2015
    Posts:
    42
    Awesome, once (and if) this feature is added it will be instant buy for me, and imo would make this extension so, so much useful for a lot of people.
    Do you have any ETA?

    Cheers!
     
  36. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi @Mikeedee !

    Currently im finishing up the update for my other package (iRDS - Intelligent Race Driver System) and then i would be working on this, so it would be for the next few months, since the update on iRDS is pretty big.

    Cheers!

    Rhod,
     
  37. Assets-Reporter

    Assets-Reporter

    Joined:
    Jul 4, 2015
    Posts:
    79
    rhodnius likes this.
  38. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Assets-Reporter likes this.
  39. pinchmass

    pinchmass

    Joined:
    Jul 2, 2012
    Posts:
    156
    another request (i like to keep you busy) would be nice if the destination could be the player (so a car could follow you through the traffic (or chase you !)

    keep up the good work , looking forward to the new UI in iRDS
     
  40. Mikeedee

    Mikeedee

    Joined:
    Jan 5, 2015
    Posts:
    42
    Okay then, will anxiously wait for that update :)
     
  41. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Guys!

    I have just made a Big performance improvement on the Lane Editor tool, now it won't lag your scene view if you have a lot of lanes already placed on the scene (off course if you zoom out to see all the lanes, it would slow down) but would for sure improve your experience on editing the lanes, connectors, and points.

    I would be uploading this today to the asset store, and it should get approved withing a couple of days (about 3 to 5 days)

    Cheers!

    Rhod,
     
    Mikeedee and emergki like this.
  42. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Guys!

    Version 1.0.6 is live on the asset store!

    Includes the improved performance of the lane editor tool.

    Cheers!

    Rhod,
     
  43. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    Amazing asset. Thanks for the great sale price!
     
  44. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Your welcome ;), and thanks for buying!
     
  45. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hey, few questions - 1 will different car physics systems be able to be used? I have edy's and randomation and in the event of a car in traffic electing to interact you it would be great that the physics were the same

    Secondly are there plans to implement easyroads3's waypoints when they are fully developed into your system for the traffic behaviour? A user has already created a system using easyroads to patch between set destinations. Particularly if easyroads compatibility is a consideration you have a buy

    Alternately, i'm using a 3ds max plugin called GhostTown for city generation (its excellent and well worth a look, an example of functionality from an older version:
    ) and have already talked to the dev about how he wishes to implement road data (he intends a simple traffic model anyways) - would something like this be supported if the relevant data was imported along with the fbx of the city?
     
  46. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Can i use this also to make some kind of space city traffic where the vehicles fly in the air like in the movie the 5th element (around minute 1:33 to see the traffic
    )?
     
  47. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi @lazygunn !

    Thanks for your interest on iTS, here are the answers to your questions:

    1. Yes you can use different car physics, but some code would be needed (for making the interface script that sends the inputs (outputs of the AI) to the other physics you want to use). But be warned that this could lead to performance degradation due to the more complex physics taking more CPU power, would be more noticeable on mobile off course.

    2. Yes there are plans to do this integration with easyroads, but this would take some time, I have already talked with Raoul and he is totally interested on doing this integration, so i think this is a yes.

    3. Yes that could be some how possible, i didnt know that some data like that could be attached on the FBX file, good to know, if so we could seek for doing this too in a future. The system currently works with splines too, but some info is needed to be able to know at least the lanes direction, and were the junctions are, so the junctions could be rebuild on the road network that iTS uses. Also i like the final look of the streets and buildings done with this tool is really awesome! In a future release we are going to definitely improve the look of the demo scene, i know right now is not the best at all.

    Hi @RandAlThor !

    Currently the system wont control the steering of the vehicle for the up/down axis, as long as the cars wont need to steer in those directions, it would work (if the flying cars can keep the altitude by themself) i would implement in a future release the option of using that other axis for the steering too.

    Cheers!

    Rhod,
     
  48. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi guys!

    I'm currently working on some performance improvements (may not be noticeable but i did them just in case) some are just avoiding memory allocations (some calls to some list functions were causing them). Also i just added a few features and little fixes to some features that were already there, so here is the list:

    • Fixed the forced stop to make the cars now always stop on any junction with a connector marked as forced stop (since this are for simulating Stop signs) before only the first car made the stop and all the others that followed the first didn't until there were a bigger gap between the cars following.
    • Fixed the priority pass, now the cars on higher priority pass connectors would wait for the lower ones to pass first, unless there is a chance to go for it.
    • Added new variables to the length margin between the cars, so now it can be on between 2 values to make it more random like the position offset on the lanes, this make it more realistic when the cars stop one behind the other waiting to cross in a junction, since the length between them wont be exactly the same as before.
    • Added the ability to make the traffic AI script play one sound or one random sound from an audio clip array, to make them i.e. sound the claxon if the player is going to collide with them frontally. This can also be used for peds, for making them yell at the driver that is going to hit them, and stuff like that.
    • Added the ability to also play an animation, either from Animator (mecanim) or from the legacy Animation component, this is really useful for making the peds react when the player gets closer to them frontally. The animations can be played from a list of Animations and the timing between them can be set with a min and max value to make it more random.

    Also here is a little animation example of the reaction of the peds.



    This would be available on the next update :D

    Cheers!

    Rhod,
     
  49. pinchmass

    pinchmass

    Joined:
    Jul 2, 2012
    Posts:
    156
    all good, I know I'm nagging but was spawning static parked cars and removing them still on the to do list.

    was thinking I could set a unique traffic / lane type and just spawn cars with the speed/motor setting to 0 so it does not move (but would be a bit inefficient I presume)

    anyway great work as always
     
  50. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Yup it is, just that I'm taking out first some new features that are more easier/faster to implement, but yep it is definitely on the to do list, also the path finding.

    Cheers!

    Rhod,