Search Unity

iRDS - Intelligent Race Driver System Available on Asset Store

Discussion in 'Assets and Asset Store' started by rhodnius, Mar 18, 2013.

?

What you prefer (features are, Transmission, differential and Engine as separate component)

Poll closed Nov 12, 2019.
  1. Release new physics at it's current state and do new stuff on next releases?

    0 vote(s)
    0.0%
  2. Wait for all the new stuff on physics to be implemented then do the release?

    100.0%
  1. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Sounds like you may be trying to use the car directly on the scene? the system should instance them and initialize what the AI needs to work, if you could give me a bit more detail on how you are setting up your scene it would help me to point you on the right direction.
     
  2. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Hi, thanks for the reply. The cars are spawned via your system and it's all set up the normal way that was working with your physics. I'll post more detail tomorrow as I'm out of the office as its evening here.
     
  3. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    I have been doing a few tests and seems to be working fine, can you please make sure the wheels have the Wear option enabled? it is on the CarSetup script on the tire settings just bellow Debug toggle
     
  4. speedy19802

    speedy19802

    Joined:
    May 10, 2016
    Posts:
    53
    Hello. thanks for the answer, yes is activated. I have also created a new project, the same. only after pressing set Tire something happens
     
  5. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Hi, I've sent you an email with a video.
     
  6. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Sent you a response on the email.
     
  7. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Sent you a PM so we can check this out together
     
    derkoi likes this.
  8. rhodnius

    rhodnius

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

    Just want to give a heads up that Unity 2019 have a bug that wont run the API Updater on Editor dlls if the Unity editor is installed on a path that have spaces on it (anything like "C:/Unity 2019/" as install path would cause this issue.

    So you could either install Unity on a path without spaces, or create your project on Unity 2018 and import iRDS there so the API Updater runs as usual, and then after that upgrade the project into 2019.

    Cheers!
     
  9. MK1_Dev

    MK1_Dev

    Joined:
    Sep 7, 2018
    Posts:
    104
    Hi! Is it possible to set the number of AI opponents via script? I've had a look through the Helper Methods section in the PDF but couldn't see anything relevant. Cheers.
     
  10. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Yes you can do it with the LevelLoad object, which is of type IRDSLevelloadVariables and adjust the field numberOfAiCars. Make sure to do this before loading the scene that have the track and IRDSManager
     
  11. MK1_Dev

    MK1_Dev

    Joined:
    Sep 7, 2018
    Posts:
    104
    Hi. Thanks for that. I am now trying to instantiate a player car using IRDSPlaceCars.AddNewPlayerCar. The car that I am adding is controlled via NWH physics. Could you please tell me what I should be entering as the 2nd parameter relating to controls? Cheers!
     
  12. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Just pass what you have on the LevelLoad object for the player controls, i would put that to be optional in a future update.

    Cheers
     
  13. MK1_Dev

    MK1_Dev

    Joined:
    Sep 7, 2018
    Posts:
    104
    Sorry I don't understand. Could you please give me an example?
     
  14. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Sure, the levelload object have a field called firstPlayerSettings, just pass it on that method call and you should be good :)
     
  15. MK1_Dev

    MK1_Dev

    Joined:
    Sep 7, 2018
    Posts:
    104
    That did it! Thanks.
     
    rhodnius likes this.
  16. MK1_Dev

    MK1_Dev

    Joined:
    Sep 7, 2018
    Posts:
    104
    Another question... I have been updating IRDSLevelloadVariables prior to loading IRDSManager. When setting numberofAICars or trackToRace this works as expected.

    However if I try to update any of the firstPlayerSettings (for example, gridPosNumber or playerName) prior to loading IRDSManager the race doesn't appear. I can see that the firstPlayerSettings have taken effect in the LevelLoadVariables but no cars are instantiated. I also see the message "
    IndexOutOfRangeException: Index was outside the bounds of the array.
    IRDSPlaceCars.GetOtherPlayersPositions " in the console.

    Any ideas? Cheers.
     
  17. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    This could be related to the number of the grid position you are trying to use is greater than the amount of grid positions you actually have on the track, can you try without setting that value and just adjusting the firstPlayerSettings?
     
  18. MK1_Dev

    MK1_Dev

    Joined:
    Sep 7, 2018
    Posts:
    104
    Facepalm! :) Thanks!
     
    rhodnius likes this.
  19. parvez-sulemaan

    parvez-sulemaan

    Joined:
    Dec 9, 2015
    Posts:
    9
    Hello,

    The same plugin can be used to developed bike racing games
     
  20. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    You would be using another physics or with iRDS? You should be able to use it with another physics (bike physics) without issues, I have not tested bikes on iRDS for a while now, but it also should be working fine.

    Cheers
     
  21. rhodnius

    rhodnius

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

    An update of the physics refactoring work, you would be able to see exactly how you are setting up your car's suspension, so you could accurately set things up on your vehicles, which would also get you a better behavior on it too.

    Here is an screenshot of how you would be seeing stuff at editor time, while not running and when running it.

    upload_2019-6-2_16-1-59.png

    This is when at editor mode, without running it (not in play mode) the wire cube is the actual anchor of your suspension, which you can change now with the value you set on Tire Center field (pretty much what you have on the default Physx WheelCollider), as you can see on this picture the actual anchor is not really where it should, on this Truck it should be a bit up, where the Chasis is.

    So something like this would be the best way to set it up:

    ScreenShot.png

    Even I was unable to see this properly before, now it's way easier to get it done properly.

    And here is how you would see it at runtime, notice how the actual "Setup" is aligned properly with the actual Tire model, which gives you a way better interpretation of what's going on.

    upload_2019-6-2_16-9-36.png

    The Disc at the bottom is exactly where the Tire is hitting the ground, according to what you have setup for that tire.

    Hope all this new tools help you guys to get a better experience with the tool overall.

    Note: As always, any feedback is more than welcome for sure, and if you want to participate on testing this out, let me know!

    Cheers!
     

    Attached Files:

    Last edited: Jun 2, 2019
    MK1_Dev likes this.
  22. speedy19802

    speedy19802

    Joined:
    May 10, 2016
    Posts:
    53
    good Morning . wow, super. that would make everything a little easier. good job . I would like to participate
     
  23. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Awesome, I would write a PM then to see the details.
     
  24. Mojo-Game-Studio

    Mojo-Game-Studio

    Joined:
    Sep 18, 2015
    Posts:
    111
    Hi, we have a very large city map, that we need to load in a procedural way (so after driving for say 1km, in the background we load the next 1km*1km tile), I'd like to use irds for the player car controller and your traffic system together, initially I just need to know if it's possible to achieve this, for the moment we probably won't use any AI cars in the system, but may need the option to use them down the line.

    We are thinking of using the asset world streamer for the streaming of the different tiles, this works by splitting the whole scene into parts and loading them asynchronously, we already have irds (source version) so happy to make edits there to facilitate this. (we may need some pointers tho')
     
    Last edited: Jun 21, 2019
  25. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334

    Hello @Mojo-Game-Studio the loading of the map can be independent of the actual traffic system loading, if you also move things to the center of the world to avoid floating point precision errors, iTS have a global offset you can set to also move the lanes accordingly to that movement the world streamer does.

    iRDS and iTS are supposed to work together, you need to add the iRDSObstacle to the traffic cars in order for the iRDS cars to see them and put the layer and tag player into the iRDS cars so the traffic cars can see them too.

    about iRDS with worlds streamer, you just need to move the IRDSManager to make all the waypoints and stuff on it to move accordingly to the world streamer movements of the world tiles.

    Let me know if you have any further questions.

    Cheers
     
    Mojo-Game-Studio likes this.
  26. Mojo-Game-Studio

    Mojo-Game-Studio

    Joined:
    Sep 18, 2015
    Posts:
    111
    What is the best way to import the 2 systems 'its' and 'irds' together as they both overwrite the project settings?
     
  27. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Imnport iTS first then iRDS and that should do it.
     
  28. Mojo-Game-Studio

    Mojo-Game-Studio

    Joined:
    Sep 18, 2015
    Posts:
    111
    Hiya,
    About the obstacle system
    I've added both layers obstacle and obstaclesensor to the project
    IRDS AI cars & Police cars set to layer obstactlesensor
    IRDSObstacle script added to all ITS vehicles and stationary (marked static) obstacles and set their layers to 'obstacle'

    But the AI cars ignore this and drive into anything on the racing line and if a stationary object is (off track) say on a corner, they drive into those too

    Have I missed something?
     
  29. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hmm you don't need to change the Cars layers to obstaclesensor layer, only the object (child) that have the obstacle sensor script (which also needs to have a collider set to trigger on this object class is IRDSObstacleSensor).

    Then all the obstacles that you want to detect, needs to have the Obstacle script IRDSObstacle attached to it and set the layer to obstaclesensor of this object and its tag to obstacle. this would make the AI cars to detect those obstacles.

    Then go to the physics settings and make sure the obstaclesensor only can see obstaclesensor layer like this:

    upload_2019-6-25_10-22-30.png

    Let me know if you have any questions.

    Cheerts!
     
  30. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    here is the car with the obstacle sensor:

    upload_2019-6-25_10-23-50.png

    and the obstacle is like this:

    upload_2019-6-25_10-24-33.png

    EDIT: The correct way would be having the obstacle sensor use the obstaclesensor layer and creating a new layer named obstacle that can collide with all other layer and make the obstaclesensor to only collide with obstacle layer, then put to the obstacle sensor the obstaclesensor layer and to the obstacle the obstacle layer
     
    Last edited: Feb 3, 2021
  31. Mojo-Game-Studio

    Mojo-Game-Studio

    Joined:
    Sep 18, 2015
    Posts:
    111
    But setting the tag of the iTS cars would override, the 'TrafficCar' tag ?, or should I create a separate box collider on them and set it's tag to 'obstacle'?
     
  32. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    ohh i see, yeah in this case you could do that, and make the boxcollider the same size of the car.
     
    Mojo-Game-Studio likes this.
  33. Mojo-Game-Studio

    Mojo-Game-Studio

    Joined:
    Sep 18, 2015
    Posts:
    111
    Another I hope quick one regards iTS,

    Is there a way, say if I crash into a car and turn it sideways it will block the lane, causing a traffic jam (realistically so :) ) to have that vehicle respawn as it would if it were upside down?
     
    rhodnius likes this.
  34. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    yes sure, i think there is already an option for that :) check TSTrafficAI on the car inspector, if not the fastest way is just to make an script that checks if it is upside down and disable the car, that would make the pool manager to pool it and respawn it somewhere else.

    Cheers!
     
  35. Mojo-Game-Studio

    Mojo-Game-Studio

    Joined:
    Sep 18, 2015
    Posts:
    111
    Sorry I probably didn't explain well, what I meant was to have the car respawn if it's facing the wrong way etc, not necessarily upside down, or if it's stuck for any length of time?
     
  36. Mojo-Game-Studio

    Mojo-Game-Studio

    Joined:
    Sep 18, 2015
    Posts:
    111
    For the most part the Obstacle avoidance is working, except in the situation where the track is blocked by traffic, then the ai will just keep reversing and then speeding toward the same vehicle, is there a way I can force them to go off track in this instance, for example drive on the pavement to find a way through.
     
  37. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Ah ok, well is pretty much the same, you can put into it an script that checks that and disables it if the check is true, then the pool manager would do its job (when the car is disabled), you can check if the CurrentPoint field of the TSTrafficAI script which is the current point the car should be moving towards, is behind, if it is, then disable the car.

    Let me know if this helps.

    Cheers!
     
  38. Mojo-Game-Studio

    Mojo-Game-Studio

    Joined:
    Sep 18, 2015
    Posts:
    111
    Do you have any settings to make the player cars driftable, I've used the BMW drift car as a base, set the tires to arcade and added 800hp and 600ft/p torque, but it hardly spins the rear wheels (even giving it full gas from standstill). I guess what I'm looking for here is a preset setup. We are using an xbox controller as input so fine control over throttle is not a problem, we have that mapped to the right trigger. What we need is a setup so we can drift the cars sideways around corners
     
  39. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334

    Sounds like you may have Tracton control on, try going to levelload object and on the control assistance settings under player settings, look there for TCL and disable that and try it like that to see how it goes.
     
  40. Mojo-Game-Studio

    Mojo-Game-Studio

    Joined:
    Sep 18, 2015
    Posts:
    111
    Yep, that did it :)

    I'd removed it on the car setting, but didn't realize it was in level load too.

    One other hopefully quick one, the demo cars all take a long time to stop, even from relatively low speeds, I've increased the brake torque for both front and back wheels, but it doesn't seem to slow them down any quicker
     
  41. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334

    This could be the ABS settings on the cars i think, check the value there and let me know

    Cheers
     
  42. Mojo-Game-Studio

    Mojo-Game-Studio

    Joined:
    Sep 18, 2015
    Posts:
    111
    Yep, that did it.
     
  43. Legendary_keith

    Legendary_keith

    Joined:
    Apr 21, 2015
    Posts:
    20
    Hello,
    I have a question about the rewired asset integration. I placed the irds player controls rewired script on my car and changed the control type under settings to external but nothing works. I tried to steer and push buttons on my gamepad but nothing is working. Does anyone have an idea on how to fix this?

    Thanks,
    Keith
     

    Attached Files:

  44. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334

    Did you changed the control type on the car or the levelload object on the player settings tab? if you are using the AI system to spawn your cars, all the settings for the player on levelload object will override the settings you have on the car. :D
     
  45. Legendary_keith

    Legendary_keith

    Joined:
    Apr 21, 2015
    Posts:
    20
    Yeah, i just placed my car prefab on the scene and i changed the control type to external on the car and level load object. This pic is from the Levelload object.
    upload_2019-7-3_1-16-1.png
     
  46. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334

    I see, but if you place the car prefab on the scene, then it is not instantiated by the system, so in that case the option should be changed on the car prefab on the player control script too.

    If you are using the AI system, you don't need to place the car prefab on the scene, as this would be done by the system for you at runtime :)
     
  47. Mojo-Game-Studio

    Mojo-Game-Studio

    Joined:
    Sep 18, 2015
    Posts:
    111
    Hiya,

    Where would I get the rollbar coefficient values from, I've looked on IRDSDrivetrain and IRDSWheel but don't see a method or value for it.
     
  48. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Oh is because it is a different class, IRDSAntiRollBar, you should have one per each pair of wheels
     
  49. Mojo-Game-Studio

    Mojo-Game-Studio

    Joined:
    Sep 18, 2015
    Posts:
    111
    Is there a relationship from IRDSWheel/Drivetrain, or should I just get the components from the car gameobject?
     
  50. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    You can get them directly from the root GameObject of the car