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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

[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,332
    But this should be pretty easy to achieve, since all the data you needs is on the iTSManager, which have the lanes, connectors and the points of those elements.

    Let me know if you need a bit more info to achieve that
     
  2. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    109
    Thank You for the quick reply. When I try to save the road data i get this error .Im on unity 2017.4.24f1
    upload_2019-4-1_22-35-1.png
     
  3. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    will look into it asap
     
  4. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    Hi
    I dont know why lights dont change.
    And i have an error but dont know why;

    IndexOutOfRangeException: Array index is out of range.
    TSTrafficLight.ChangeReservation (.TSPointReference point, Int32 ID, Int32 lID) (at Assets/iTS/Traffic System/Scripts/Main/TSTrafficLight.cs:291)
    TSTrafficLight+<PlayLights>c__Iterator0.MoveNext () (at Assets/iTS/Traffic System/Scripts/Main/TSTrafficLight.cs:239)
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    TSTrafficLight:Start() (at Assets/iTS/Traffic System/Scripts/Main/TSTrafficLight.cs:180)
     
  5. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Hi there!

    This is because the lanes the traffic light is pointing at does not exists, did you deleted some lanes? if you did, you need to setup those traffic lights connectors so they point to existing lanes once again :)

    Cheers!
     
  6. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    Hi thank you
    it works now.
     
  7. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    I have a similar issue but with pedastrians, they loose path or sometimes sudenly dissapears.
    Did you resolve this problem?.
     
  8. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Im looking at this, since it could be a settings missing or not properly setup
     
  9. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    109
    Hi Rhodnius,Will you be upgrading ITS to use Unitys ECS? I could imagine way better performance
     
    Meceka likes this.
  10. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    this is definitely something i would like to do with it, but, if done so, i wont be able to support older versions of unity, since they would be pretty much totally different systems, so there would be like a cut, where iTS would remain the same for older versions of unity.

    Cheers
     
  11. waqastariqkhan

    waqastariqkhan

    Joined:
    Nov 11, 2019
    Posts:
    1
    Hi, The Project is Great!
    Can anyone help me finding the documentation for this project, i am troubling understanding the system, i opened the link above of the drop box but it showed a 404 error. Looking forward to your help. Thanks in Advance
     
  12. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Hello! Which documentation are you looking for? Inside the package is a PDF called readme which have the documentation, not sure if that's the one you are looking for?
     
  13. GTJamesdad

    GTJamesdad

    Joined:
    Jun 12, 2019
    Posts:
    1
    Hi there,

    I am writing an application that shows vehicle to vehicle communication. Cars are travelling parallel along a 2-lane highway, and the right lane is blocked. (I just use a static object (cube) with the tag set to "Player" for this). Cars in the right lane need to move to the left lane.

    I have something that is close to working. I set up a trigger box-collider, and when a car in the right lane enters it I call:

    TSNavigation.LaneChange(left)

    which makes them try to move into the left lane.

    The problem is that cars near the front rarely get a chance to move into the left lane because cars further back move first and block up the lane. Is there a way I can have the merging occur smoothly (like a zipper).

    The two lanes are linked, but there is no opportunity to set "Priority" for lane changes like there is for junctions. Can I create diagonal junctions between the two linked lanes? Would that help?

    Thanks for any insight you can provide.
     
  14. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    I understand what you exactly mean, is this something that needs to be dynamically done or is something that is setup statically at an exact point of the road? if it is static, you could just make the lanes to actually be split there (where the roadblock is) so you actually do a lane merge with connectors like if it is a junction, if it is not static but you know the places where this could be taking place, you could do the same on several parts of the highway and have fake junctions there in case needed to be used.

    Another way could be to place some triggers on the lane the cars are merging into and when a car enters that trigger make them slow down (this needs to be some distance before the roadblock) so they wont take/reserve as much lane points as they would if they are going faster, giving those other cars more chance to actually do the lane change.
     
  15. limegreencow97

    limegreencow97

    Joined:
    Apr 6, 2020
    Posts:
    2
    Hi there,

    My team and I are writing an algorithm to implement an intelligent traffic system. Therefore, we are trying to look for some simulator. However, we have a few concern about this application.

    First, can the Unity ITS support dynamic traffic light control? More specifically, we would like to change the traffic light timing based on the traffic load. We had implemented a RSU with a camera, which can detect the traffic load (generated by Unity and displayed on the screen). How can we send a control message to Unity for changing the traffic light timing?

    Thanks for your attention. I’m looking forward to your reply. :)
     
  16. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332

    Hi yes, you can control each traffic light individually and change the light timings at runtime for sure, since that is public on the TSTrafficLight script.

    Cheers
     
  17. limegreencow97

    limegreencow97

    Joined:
    Apr 6, 2020
    Posts:
    2
    Thanks for the reply!
    I have noticed there are two versions of the application. However, I am not sure about the differences or which is the one I suppose to use. Hopefully can get some information about this.
    Thanks!
     
  18. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Hi @limegreencow97 , the difference is one have all the source code (pro version) and the other have the Core of the AI on dlls and some scripts as source code.

    Cheers
     
  19. appsscity1

    appsscity1

    Joined:
    Feb 6, 2020
    Posts:
    20
    hi @rhodnius

    We are using your iTS PRO since a long time but here we are facing a weird issue where suddenly AI traffic car stopped at the time of spawning and we can see that their break is pressed. so can you tell me what could be the possibilities behind this issue?
     
  20. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Hello!

    I have replied to you on Skype, lets see whats going on and do the proper fix to it if needed.
     
  21. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    Hi @rhodnius
    If I make multiple connectors then my traffic gets stops. how to solve it? I am using unity 2018.3.8 and iTS - Intelligent Traffic System v 1.1.5. What I am doing wrong.
     
  22. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Hi @MFKJ not sure i understand your issue, if you create with the ITSManager multiple connectors on a junction? or where else?, can you please post an image to be able to understand a bit more the context of the issue, thanks!.
     
  23. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
     
  24. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    Here is the same square with traffic jam
     
  25. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Thanks for the videos, for what i can see your connectors resolution is too high, lower them so you have more points on the connectors, making it possible for the system to mark points near as Reserved when a car is crossing the junction, after that make sure you process the road data.
     
  26. iqbalgoh

    iqbalgoh

    Joined:
    Oct 8, 2019
    Posts:
    2
    Hello, I have this error with TSTrafficLight script. The error said this:
    Screenshot_3.png

    I wonder why this error showed up. I use Unity 2019.2.8f1.
    Thank you.
     
  27. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    This sounds like you had your lights setup, then you removed some lanes and added new ones, so the lanes indexes the traffic ligths had set are no longer valid one, just re-assign the lanes to the traffic light that is having the issue
     
  28. iqbalgoh

    iqbalgoh

    Joined:
    Oct 8, 2019
    Posts:
    2
    Okay, thank you for the solution.
     
    rhodnius likes this.
  29. umermohammed95

    umermohammed95

    Joined:
    May 5, 2019
    Posts:
    3
    I am about to buy the this asset. Before i buy this..i want want to know if this asset can be integrated with realistic car controller.
     
  30. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    If integrating with RCC means using RCC as player car, then yes, it would work out of the box, just make sure to set the RCC car collider game object tag as Player.
     
  31. umermohammed95

    umermohammed95

    Joined:
    May 5, 2019
    Posts:
    3
    So i am making a 3rd person shooter type game...i will be using its for traffic system and rcc for the car....so when the player enters the car the rcc must be used for driving it...is it possible to do that?
     
  32. umermohammed95

    umermohammed95

    Joined:
    May 5, 2019
    Posts:
    3
    hey there,
    the traffic spawner which spawns the traffic is it being spawned is it a fake null object(not a addcomponent object)?

    because when I add a script to the prefab which is being spawned..any reference to those scripts are not giving null reference exception at runtime even though I can see the object being referenced through public.

    in simple words the scripts on cloned cars cant be refrenced.
     
  33. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Hi @umermohammed95 , Sorry for the late reply, i didnt got any notifications of new posts on this thread.

    The spawner would instantiate all the cars you have referenced into it on the inspector, and those are going to be clones of the prefabs you referenced. So they are not fake, but clones of what you had referenced in the inspector.

    Make sure the prefabs are the ones referenced on the spawner and that the references you have on the prefab are on the same prefab (you can not reference another object from another object prefab, is a Unity thing and not allowed to do)
     
  34. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Hello guys,

    Wanted to let you know I'm currently working on Refactoring the entire system to make it easier to add new features and also improve performance, stay tuned.
     
    Meceka likes this.
  35. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    420
    Great news. Have you just started, and is there any ETA?
     
  36. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    have started a few months ago, already deep in the rabbit hole :D

    No ETA at the moment, but want to have it as soon as possible for sure
     
    kns1966 likes this.
  37. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Hello everyone,

    Some progress on iTS refactoring (closer to a release)
    Also while doing the refactoring I got contacted by the creator of CiDy 2 which is a procedural road and city generator to see if we could integrate the two assets to work together and we have just started on it and so far we got lanes and connections auto created for the city you generate with Cidy, here are some videos:



     
    AGregori likes this.
  38. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    iTS integration with EasyRoads 3D would be also included on the major next release

     
    Meceka and hopeful like this.
  39. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,605
    Looks great.
     
    rhodnius likes this.
  40. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Here is a test (iTS upcoming version) on Android (Huawei Nova 5T) with 200 cars
     
    Meceka likes this.
  41. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    420
    That's great. :) What kind of wheel physics do they use? Or is it box collider physics?

    How much FPS do you think we could get with the older version with the same amount of vehicles and the same device? So I wanted to know how much the performance is improved.

    Will it be easy to upgrade to the new version? Will the lane info be kept?
     
  42. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    I did a test on the editor, same unity version 2019.4.6 and the demo scene, first the version currently on the asset store, made it to have 300 cars on the scene, it was getting at 250+ cars about 14fps, then upgraded the same project with the refactored version, and got for same 250+ cars about 45-55 fps on same computer same unity version same project upgraded to the refactored iTS version.

    The upgrade is just transparent to you, just import the new version and you are set, the only thing to do is set the layer for the Player detection sensor which have changed completely from the previous version, you set it on the inspector for each car on the TSTrafficAI class on the Player Sensor section, and make sure only the player have that layer set to avoid the system from querying other physics objects on the scene which could cause performance degradation.
     
    Meceka likes this.
  43. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    One thing to consider is that XML save and load of the road networks have been changed to the Unity Json serializer, if someone needs to load an Old XML, what could do is have it loaded on the current version and then when the refactored version is released, upgrade and save it on the new Json format.

    Just a heads up about it, still don't think is an issue as you can simply upgrade your current projects and the road data would remain on the TSMainManager.
     
  44. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    109
    Hi @rhodnius ,
    Is it possible to add iTS to modular road prefabs instead of having to redo path everytime making a new map?
     
  45. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Hi @TonismoGames Not quite sure if i understand, if you mean that if you could have iTSManager on a prefab that contains a map (roads and environment) yes you can do it, you can have the road network on a prefab without issues and instantiate it
     
  46. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Hi guys heads up that the Refactored and new version of iTS with integration of CiDy 2 (Procedural city generation) and with Easyroads have been already uploaded to the asset store for the Pro version of iTS (Source version), the lite version is getting ready and should be uploaded in 1 day or 2 pretty much.

    Cheers!
     
  47. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Hello guys!

    Both version are now released on the asset store with integration for CiDy and Easyroads and refactoring
     
    hopeful likes this.
  48. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    A heads up that you must set the player sensor layer to "Player" and have the player use this layer in order for the player sensor to work, also to avoid performance issues since this layer is used to filter out objects on your scene that you don't want the AI to check on :)
     
    hopeful likes this.
  49. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    109
    What I meant was having iTS on road prefabs pieces. I can then use the prefabs to make a city without having to set up paths all over again.
     
  50. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,332
    Thanks for clarifying, iTS have its lanes all in a single manager that contains them all, so is not possible currently to have it for separate pieces, however you could create an script that holds "markers" that then you could pass to iTS to create the roads using the API
     
    hopeful likes this.