Search Unity

iTS - Intelligent Traffic System [WIP]

Discussion in 'Works In Progress - Archive' started by rhodnius, Jul 28, 2014.

  1. rhodnius

    rhodnius

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

    We are currently working on a new Traffic system, we are calling it iTS - Intelligent Traffic System.

    Here is a web demo:

    Web Demo!

    Super simple physics web demo (This demo does not use any wheel colliders on the traffic cars)

    Super simple physics with peds web demo (This demo does not use any wheel colliders on the traffic cars)
    Note: On the super simple physics demo, the cars have a single mesh, and the tires doesnt spin or rotate, but the super simple physics has the ability to also spin the tires and rotate them when steering is applied.

    We are the creators of iRDS - Intelligent Race Drive System.

    • The traffic systems is really on its final developing state, it currently supports multiple lanes, multiple lanes connections, any shape of junctions (T, Y, cross, more than 4 roads in a cross, etc.).
    • The traffic system can detect the player car and brake, overtake if necessary.
    • The traffic cars would avid each other and would respect the traffic flow to avoid collisions.
    • The traffic cars are removed and re-spawned at a closer distance from the camera/player, which is always giving the sense of more traffic around you, and this is configurable.

    Here is an early video of it working!



    And here is a little video of how you place the lanes and connections:



    Feedback is welcome!

    We would post more vids soon too!

    Thanks!

    Rhod, :cool:
     
    Last edited: Nov 21, 2014
  2. r8-Bit-Ape

    r8-Bit-Ape

    Joined:
    Jan 21, 2014
    Posts:
    20
    The framerate in that first video seems a little choppy? Nice work though! Did you create some custom Unity editor tools to achieve this?
     
    rhodnius likes this.
  3. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi 8-Bit Ape!

    Thanks for your comments, yep the video have some choppy parts, this was an really early video we took months ago, we have worked a lot more on it and it is way more faster giving better FPS.

    Yep we created all the custom editor tools to be able to achieve it.

    Rhod,
     
  4. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    Everything looks amazing. Just wondering have you tested it on mobile yet?
     
    rhodnius likes this.
  5. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    We have made some simple tests on mobile, we know it works on Android, should work as well on iOS.

    We are aware also that as it is right now it wont work on Windows Store or Windows Phone 8, because of some system classes that are different, but we would look into it to make it compatible.

    The system is multi-thread capable, so it can take the advantages of having extra CPUs, if not it works too.

    Rhod,
     
    Last edited: Sep 30, 2014
  6. pinchmass

    pinchmass

    Joined:
    Jul 2, 2012
    Posts:
    156
    SOLD! , love you RaceDriver System, support and development have been awesome, can't wait for this!

    Any ETA on submission dates ?

    Is their beta access ? (found your dropbox support very efficient for updates/fixes)

    great news to see it looking like it handle a cityscape
     
    rhodnius likes this.
  7. rhodnius

    rhodnius

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

    Thanks for your comments!

    we are currently working on it while working on a client project implementing it among other things, so we are actually developing it in parallel and testing it right in the way, we should be able to be releasing it in the next months, August -September, but can't promise yet a fixed date.

    Yes the iTS traffic system can handle any city shape, and as you already know us, we would be improving it on the road, including more features and so on.

    Thanks again!

    Rhod, :cool:
     
    Last edited: Sep 30, 2014
    ZiadJ likes this.
  8. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Looks good rhod!
     
    rhodnius likes this.
  9. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    Great news! We were searching for an affordable traffic system since 6 months.

    In physics system that we are using (unitycar) and when I increse wheel counts of vehicles, or if more vehicles are available, it begins to slow performance badly after more than 12 wheels are available. We have also tested edy's physics and it was almost same. (Testing on lumia 520 and a 512mb android phone)

    Is vehicle physics heavy on calculations? If so, can you please include ways to reduce performance cost of vehicles so we can increase vehicle count on mobile phones. In euro truck simulator 2, before some newest updates, traffic vehicles didn't have wheel calculations and it's body was a static body. Their front wheels weren't rotating while manuevaring. I believe they made it so to improve performance when there is lot's of traffic. Can you please make it so that we can reduce performance with some toggles? In example, a toggle that would make wheel calculations cheaper, or a toggle to turn of all wheel calculations, and move car just like a rigid box.

    Our game is only available in windows phone right now and it's very popular. Please make it compatible with windows phone.

    I would like to be in beta testing if it will be available. Thanks.
     
    rhodnius likes this.
  10. rhodnius

    rhodnius

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

    Thanks for your comments, we would include a really simple physics which is indeed really similar to what you just described, using no raycasting nor wheelcollider so it should be pretty fast and performance wise on physics side.

    Thanks again!

    Rhod,
     
  11. rhodnius

    rhodnius

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

    We are currently working on performance improvements to the code, to make sure it runs as smooth as possible on mobile devices.

    Soon i would be posting some more videos of the progress we are making on the tool, also any feedback, suggestions or stuff you may want it to have included are more than welcome!

    Rhod,
     
  12. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    I am using Halo lights as brake light and reverse light. I would like traffic to have halo lights aswell. In my game they work with enabling/disabling light gameobject with setenabled(true/false). Can traffic have brake lights, and also turn signals? They should enable turn signals when they are moving towards to a corner. I believe it wouldn't be hard to implement.
     
  13. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Meceka,

    Indeed one of the options for the brake lights is enable disable the renderer to make that effect of turning them on and off, we could add also the ability to disable enable other components as well to make what you said.

    Also we are going to implement turn light for them, indeed we have already a enum to select if a junction connection is straight, left or right for this porpouse.

    Rhod,

     
  14. rhodnius

    rhodnius

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

    Here is a screenshot of the traffic lights group editor, it is for editing the traffic lights timings, we would improve it more in the future.

    upload_2014-9-4_12-39-52.png

    Rhod, :cool:
     
    Meceka and Marceta like this.
  15. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    857
    This looks really really cool, something Ive been either searching for or just researching how to do on my own for a long time. Glad someone is finally making it happen!
     
    rhodnius likes this.
  16. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Thanks! You would see it's evolution here. :D

     
  17. Marceta

    Marceta

    Joined:
    Aug 5, 2013
    Posts:
    177
    I was working on same project, but unfortunately i didn't had time to finish it. Lane placing is similar as mine was (inspiration from TrafX), when you finish it just don't place to big price for customers as they did :D . Also i like your traffic lights editor, nice job.
     
  18. rhodnius

    rhodnius

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

    Yep indeed ours is inspired on trafx too, and for sure it won't be that expensive, we are thinking more for indies budget.

    Rhod,

     
    ZiadJ, Meceka and Marceta like this.
  19. pinchmass

    pinchmass

    Joined:
    Jul 2, 2012
    Posts:
    156
    any ETA/news ?

    one question / idea, would I be able to use the system for pedestrians too ?
     
  20. rhodnius

    rhodnius

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

    For now the system would be for vehicles, we would be implementing pedestrians on a later phase (when we have already released the system), this shouldn't be that hard to implement, since the core system would be there already, and for pedestrians we could use it more or less as it is.

    About the ETA/News, we are closer to finishing it to start the tests and fine tune anything as needed, we are working on some current known issues (minor ones) to start the full testing phase.

    Rhod, :cool:
     
  21. pinchmass

    pinchmass

    Joined:
    Jul 2, 2012
    Posts:
    156
    good news, keep up the good work (you have set a high standard with iRDS, long may it continue).
     
    rhodnius likes this.
  22. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Thanks pinchmass! and we keep improving it on the way :D

    Rhod,
     
  23. rhodnius

    rhodnius

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

    Here is a new video, showing up how the system handles the spawning of the traffic cars, so it makes all the cars to be near the spawner object(in this case it is child of the camera).

    You would notice in the video 2 green wire spheres, one bigger than the other, the spawning area is between this 2 spheres and beyond the bigger one is the outer limit, so all the cars that are outside this bigger sphere are pooled and respawned inside the respawn are.

    Also for this video we are using 100 cars at the same time.



    Rhod,
     
    HeadClot88 and ZiadJ like this.
  24. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    Hello, sphere system looks great. Are we able to tweak diameters of both spheres as we wish?

    In my game roads aren't levelled uniformly, there are some roads with high slope, you can see it in below image, also in high slopes with tight curves road is a little bit bumpy. Would traffic run on these roads without any issues?

    I can send you a demo scene if you wish. Road (with blue markers) is made with road architect.

    DeliverySimulator.png
     
    rhodnius likes this.
  25. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Maceka,

    Yes you cam change the diameter of each sphere by adjusting two values, distance and offset on the traffic spawner inspector.

    For sure the traffic can run on those roads without issues, the lanes gets adjusted to the collider's height.

    Rhod,
     
  26. emergki

    emergki

    Joined:
    Oct 15, 2007
    Posts:
    422
    Very cool my Friend!!! Nice video.
     
    rhodnius likes this.
  27. emergki

    emergki

    Joined:
    Oct 15, 2007
    Posts:
    422
    Meceka, how do you avoid this type of problem? (and another problems with the road going inside of the ground)

     
  28. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    It's not a good place to talk about road architect, sent you a pm ;)
     
  29. emergki

    emergki

    Joined:
    Oct 15, 2007
    Posts:
    422
    Sure, lol. :)
     
  30. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Thanks for the comments my friend!
     
  31. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Maceka,

    Would be really helpful to have a scene like that one for testing, you can email me at josegarrido@dagagames.com

    Rhod,
     
  32. rhodnius

    rhodnius

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

    Here is a picture of the meshes created with Road Architect that you sent with the lanes created, you would notice how the iTS lane placement models the shape of the road including the height.

    upload_2014-9-26_12-16-48.png

    Rhod,
     
  33. rhodnius

    rhodnius

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

    Here is a video of the test on the high slope roads:



    Rhod,
     
    Meceka and emergki like this.
  34. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    Looks great, but one more thing;

    "we would include a really simple physics which is indeed really similar to what you just described, using no raycasting nor wheelcollider so it should be pretty fast and performance wise on physics side."

    Can you test this map also with simple physics that you mentioned in above post?

    Did you ever test cpu cost of vehicles with normal physics(wheel collider)? How many vehicles can a moderate android device handle ?

    While testing it, if you are going to test in that scene, make pixel error 200 and you can use these cars in below link. They don't have seperate wheels, but they are fewer than 300 vertices. It means even if there are lot's of them they will still cost 1 draw call in total. You will probably need to add low poly wheels to them.
    https://www.assetstore.unity3d.com/en/#!/content/15490

    This way all cpu cost will be made by traffic and not draw calls.

    " you would notice how the iTS lane placement models the shape of the road including the height."

    Can we make it automatically place lanes on top of the road? Or any mesh?
     
  35. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Maceka,

    Yea sure we can do that test, just bought the car packs, and also the other one too from same author that are a little more complete to use those for a web demo :D

    Rhod,
     
  36. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Maceka,

    Here is a short video with the test of the cars using the simple car physics, made with a boxcollider a rigidbody and pushing it to accelerate/brake.

    The FPS on the test were 250+ with 50 cars, but usually using less cars is more than enough to simulate traffic for a game (around 10 - 20 cars).

    Here is the video:



    Rhod,
     
  37. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    " you would notice how the iTS lane placement models the shape of the road including the height."

    Can we make it automatically place lanes on top of the road? Or any other mesh?

    Does it currently support windows phone? And any estimations when it will be released? Or beta?
     
  38. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Maceka,

    What you mean with automatically place lanes on top of the roads or meshes? Yhe system would put the new point when you click on the scene view on top of the collider the raycast hits, so if this is what you are referring to, then yes.

    The system as it is right now does not support windows phone, as it uses multithreadingmultithreading and those are different APIs for windows phone and the other platforms, but we would make it work on all of them using platform dependet compilation code, so dont worry about it, it will be compatible with windows phone.:D

    Well, we estimate to be finishing it pretty soon, we have already covered almost it all, we are going to enter into a testing/tweaking phase and building up the docs and tutorials for wrapping up the package.

    Rhod, :cool:
     
  39. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    In the last video still feels a bit choppy. If you focus on a vehicle you will notice this, also the way they take turns also seems a bit artificial and also noticed a too hard slow down moments of vehicles.

    I used this plugin for 3dmax years ago. what I liked was how smooooth it felt. I thing you should focus on a similar thing.


    I've also used traffic software that even if they represent the cars in boxes every thing feels smoooth. I think that you guys should achieve this smoothnes feeling for the product to succeed.

    you could take some ideas from their site:
    http://rendering.ru/ru_en/citytraffic.html
     
  40. rhodnius

    rhodnius

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

    Thanks for your great feedback! Yep thats the idea of this thread, we are going to take into account all of it, and smooth all the inputs sent by the AI to the car physics (which ever it is) to acheive a good smoothness.

    Thanks again my friend we really appriciate your feedback.

    Rhod,
     
  41. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Glad you liked it.

    Men, I could not remember that traffic soft I used in the past.

    It is Paramics.

    Have a look here, I recommend to donwload the demo. It runs in realtime

    http://www.paramics-online.com/

    There used to be a sample city scene with literally thousands of cars (cubes) that was simply amazing. If you can make a cube look great, you've to simply change this for a car geometry and may activate simple spring physycs to the cars closer to the player withing a n meter range.

    __________________

    Another super duper traffic sim was the PTV traffic software whitch I could never test, may be now it is possible.

    Finally there is a pretty good loocking asset for unity but it is damm expensive and focused to be used with carX whitch is also damm expensive with stupidly high per hour support pricing policy.

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

    Edit:

    When you're close to release we could make a test in a real case scenario with this project I'm working on:



    Real road layout with pretty accurate slopes etc...

    We could arrange a limited time beta or limited car number or so.
     
  42. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Hey, just saw your urban area video, it feels muuch better than the mountain road video, muuch smoother. May be is the geometry what is making the behavior choppy?
     
  43. rhodnius

    rhodnius

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

    Ours is inspired on TrafX indeed, the urban traffic video, you are talking about the top down video? if yes, i think is also to do with the video recording im using, which is not that good, except for the video with the dummy cars with no wheel rotation, in that case, we need to be able to smooth it out further.

    The project you are working on is really great! and would be really good to test it out on it for sure!

    Rhod,
     
  44. rhodnius

    rhodnius

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

    You refer to choppy for the little back and forth movement when the camera is following the cars? that is caused because the rigid bodies have interpolation mode set to none, if we enable that option, the physics would eat up a lot of performance, suggestions are welcome, maybe it had to do more with the camera script.

    Rhod,
     
  45. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    I use fraps for recording, and to downsize the gigafile video I use a free soft called Handbrake that makes magic, then I delete the original file. This might help. WHatever you use, handbrake makes magic compressing video.

    Yes the top down video of the city.
     
  46. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi Pulov,

    Yep, we use fraps too, and moviemaker to shrink it, which actually does also a pretty good job, and also publish the video directly to youtube. :D

    Rhod,
     
    Last edited: Sep 30, 2014
  47. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    I think it would be better to just put a web demo, that way you guys can see it directly, for some reason i get some jittery when recording the video, making it seem to be the cars doing that choppy stuff :confused:

    I would put here a web demo really soon :D

    Rhod,
     
  48. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Great, I was about to sugest the same, but as it is WIP may be you guys wanted to keep it in the box till further, but will be wellcome and nice to test if there are strange things or not. Not rush anyway. Just snet you a pm.
     
  49. rhodnius

    rhodnius

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

    Here is another video, now the cars have turning lights ;)

    Also this video have 250 cars running on that scene :D



    Rhod,
     
    ZiadJ and emergki like this.
  50. ZiadJ

    ZiadJ

    Joined:
    Sep 3, 2011
    Posts:
    62
    Love the way this is starting to take shape:p I suggest you add the ability to randomize the steering and braking behaviors for some added realism.

    Also it would be nice if the car AI could adapt its path according to the situation because this is how we drive in real life. Ideally it would auto-generate the shortest and straightest path around it's core path. This would help make the turns look more natural and also make it possible for the cars to overtake autonomously eventually.

    A simpler alternative would be to be able to add several predefined paths, with predefined priority levels, along the main path which the AI would then choose according to obstruction levels.
     
    Last edited: Oct 1, 2014