Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

    Legendary_keith

    Joined:
    Apr 21, 2015
    Posts:
    20
    Hey Rhodnius,
    I have an issue with how the AI is behaving, it's constantly braking and driving to slow (even when the racing line is green). What should I do? That white BMW in the video is the AI.
     
  2. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Are you using iRDS physics or third party? One thing that comes to my mind would be the AI settings on the levelload object you may have there, check for cornering speed factor which should be between 1.3 to 1.6 more or less
     
  3. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Hi.

    I was testing NWH Physics with IRDS in a new clean project, and I can't get the car to drive. The AI is working fine, but none of my inputs work. I looked at the IRDSCarControllInputNWH script and noticed it had this line

    Code (CSharp):
    1. if (carInputs.auto1 || carInputs.auto2 || carInputs.auto3)
    2.             {
    3.                 PlayerController();
    4.             }
    When the race starts, none of these booleans are set to true so PlayerController() never gets called and you can't control the car. How is this script supposed to work? What does auto1, auto2, and auto3 do? They named very weird instead of something more useful to be able to know what's going on.

    I'm using a work-around right now but I would like to get this script clean and working like normal.
     
    Last edited: Dec 3, 2019
  4. Legendary_keith

    Legendary_keith

    Joined:
    Apr 21, 2015
    Posts:
    20
    I'm using IRDS physics. I changed the cornering speed factor (see first picture) but the car is still driving slow.
     
    Last edited: Dec 3, 2019
  5. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Those are for some internal use but you are totally correct the naming is not good, and is going to be replaced soon to more cleancode ones.

    Hmm that should also just should run if the actual car is player controller which is checking the CarPilot bool from carInputs there, so you could just add something like:

    Code (CSharp):
    1. if (carInputs.auto1 || carInputs.auto2 || carInputs.auto3 || carInputs.carPilot)
    2.             {
    3.                 PlayerController();
    4.             }
    this way the above code would run if you are the player car.

    let me know how it goes
     
  6. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    your drifting throttle factor min and max seems to be a bit high, can you try using the settings from the demo levelload? which is at the InitialScene scene
     
  7. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Code (CSharp):
    1. if (!carInputs.GetCarPilot())
    2.         {
    3.             carController();
    4.         }
    5.         else
    6.         {
    7.             if (carAI.NavigateTWaypoints.GoPits)
    8.                 if (carInputs.GetCarSpeed() > IRDSWPManager.GetPitMaxSpeed())
    9.                 {
    10.                     //No way to limit the car speed on RCC
    11.                 }
    12.             if (carInputs.auto1 || carInputs.auto2 || carInputs.auto3)
    13.                 PlayerController();
    14.             if (IRDSStatistics.GetCanRace())
    15.             {
    16.                 drivetrain.Active = true;
    17.             }
    18.             else
    19.             {
    20.                 drivetrain.Active = false;
    21.             }
    22.         }
    Is the auto1, auto2, and auto3 necessary in the first part of your script? Because in PlayerController() you are already checking if auto1, 2 and 3 are true. So could I remove the if statement and just call PlayerController() and be fine? Because they are stopping PlayerController() from being called and are already being checked in the PlayerController() block.

    Code (CSharp):
    1.        if (carInputs.auto1)
    2.             drivetrain.input.Vertical = -carInputs.GetBrakeInput();
    3.  
    4. if (carInputs.auto2)
    5.             drivetrain.input.Horizontal = carInputs.GetSteerInput();
    6.  
    7. if (carInputs.auto3)
    8.             drivetrain.input.Vertical = carInputs.GetThrottleInput();
    9.  
    10.  
     
  8. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Yes that makes sense
     
  9. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi guys! Just wanted to let you all know I'm still working on the physics, I haven't post here much info/progress so far on it, but wanted to let you know I'm working on it everyday, i would be posting some videos here soon so you can take a look as how it is getting so far.

    Currently I'm on solving the axle differentials (locked one first which all the other would pretty much derive from), while i have been doing this, i had to go back to the tire physics and change stuff that i though were already correct(on the new physics), so it have been a back and forth from there several times and thus why it is taking time.

    Just wanted to let you all know I'm on it, about an ETA, is hard to tell a time estimate, as this pretty much is something i have to dig into and research and a cycle that goes back and forth tons of times to get things right, once this part is done, pretty sure it wont take long to get it overall done.

    Cheers!
     
    Havok_ZA, mthawley and Zaddo67 like this.
  10. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    your's welcome home :)
     
    rhodnius likes this.
  11. vyral13

    vyral13

    Joined:
    Sep 13, 2014
    Posts:
    18
    Yo!

    I have a quick question regarding the new physics / suspension your working on. Are the vehicle handling going to completely change with your new upgrades? Only reason i ask, is again your physics system currently once fine tuned is more simulation feeling and i love that. If you are removing all the old system please let me know as il upgrade to a copy of the current full source code as is.

    Anyway, I have spent 1 week working on a new project, using current IRDS physics :)

    Thanks!

     
    rhodnius likes this.
  12. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334

    In short answer yes, the physics would change the current handling of the physics, the good thing is, is yet more oriented to simulation feeling as the new physics tries to be more realistic than the previous one, still you can set it up to be arcade style too with some parameters.

    Cheers
     
  13. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi guys, here is a video showing the new locked differential and clutch, you can see on the video that when the car tires are slipping the engine rev up is still the same as when the car is in neutral gear, this is due to the new clutch.



    Another video with some tests on moving platforms and driving on 2 wheels

     
    Last edited: Jan 26, 2020
    vyral13 and Freznosis like this.
  14. mthawley

    mthawley

    Joined:
    Sep 7, 2018
    Posts:
    104
    Hi Rhodnius. I am looking for a way to have AI cars rev their engines during the race countdown and to have them at full throttle when the race starts. Where/how would be a good way to implement this feature?

    Also, I am using NWH physics for the cars and noticing that the AI cars are crashing into each other and into the player car despite the fact that I have set up collision distances as shown below;

    upload_2020-2-9_13-15-53.png

    Can you please advise? Cheers.
     
  15. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    How does your new physics handle jumps? A lot of physics packages on the asset store will completely mess up when bottoming out. I think it's because of the WheelCollider wanting to "pop" back up when it's outside of the suspension range. Especially lower suspension length values make it even worse.
     
  16. vyral13

    vyral13

    Joined:
    Sep 13, 2014
    Posts:
    18
    Hey Rhod,

    Im currently instantiating the cars manually. Adding to the list etc everything works as it should. Apart from the fact the AI smoke me! They are insanely quicker. Even with the exact same vehicle.
    I have a custom tuning script that can adjust bhp, trq etc,
    To get an even race im having to get the players bhp - bhp * 0.2 & same with torque so thats 20% less than the players power and torque and i just about keep up.
    Also if i enabled DAC on levelload, it throws an error :
    Index out of range
    Ai.DoDac();
    ProcessAICore();
    FixedUpdate();

    If i enable it manually when the cars spawn in, nothing seems to happen. AI Cars still pedal to the metal!

    Is there a setting for ai throttle? Or a setting i have missed?

    **EDIT: The AI cars were ignoring the disabled use Nitrous setting. I have simply set nos fuel to 0 and disabled nos on instantiating AI cars and i can keep up with them. They still have the advantage but i can adjust via bhp/trq on accordance to difficulty?

    Thanks!
     
    Last edited: Feb 10, 2020
  17. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    You need to make them set their gear into neutral to do so, by default for any 3rd party physics the code of the interface script just dont throttle till the race starts to avoid issues of AI just moving forward since usually those physics are set to automatic.

    About the crashing, can you pls check if they are even trying to brake?

    It handles it pretty good, but i would test it out and post some videos, but i have done some really big jumps out from those super big ramps you can see on the videos on my previous post and it handles just fine nothing weird happening really.

    You can play with cornering speed factor on the AI settings, lower values make them slower on corners and higher values makes them go faster on corners values from 1 to 1.6 should be ok.
     
  18. vyral13

    vyral13

    Joined:
    Sep 13, 2014
    Posts:
    18
    Working fine now as is, was the nitrous when manually instantiating cars. I will check the cornering out too, but as it is now its working great! Cheers!
     
    rhodnius likes this.
  19. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    here is a video:

     
    Freznosis likes this.
  20. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Looking good!
     
  21. siumanchun

    siumanchun

    Joined:
    Apr 7, 2013
    Posts:
    44
    嗨!
    iRDS-智能赛车系统

    版本3.2.6.1

    支持Unity3d 2017.4.11f1吗?

    谢谢 !
     
  22. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    是的,它支持它

    yes it supports unity 2017, 2018 and 2019
     
  23. vyral13

    vyral13

    Joined:
    Sep 13, 2014
    Posts:
    18
    Hey rhod!

    I'm trying to set the 2 default "Spoilers" Lift Coeff at runtime, but with no joy.
    GetWings() always returns 0 only If I add 2 IRDSWing scripts, it finds them no problem, but I now have 4 wings under the car settings.
    carControllerAI.wing.SetLiftCo works for the rear wing. I just need to find the front one.
    Cheers!
     
    Last edited: Feb 27, 2020
  24. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Are you using a 3rd party physics? wings are not supposed to be used with 3rd party physics, you can also use the GetComponentsInChildren from the root car GameObject to get all the "Wings" the car currently have, as they are just normal Monobehaviours.

    Cheers!
     
    vyral13 likes this.
  25. vyral13

    vyral13

    Joined:
    Sep 13, 2014
    Posts:
    18
    Using your physics. Under the Spoilers ("Wing")s tab in the Car Setup there are two standard wings. Front and Rear. Any added wings only add an extra Rear Wing? I have no IRDSWings on the car, just the Front and Rear default in the settings...

    carControllerAI.wing.SetLiftCoef () Sets the rear wing Lift fine..
    No IRDSWings scripts attached. Just the default Front and Rear, .I cant find how to change the Front Wing via code.

    My problem is currently, I have a RWD car, Front Wing Lift -1 and Rear -1.5...
    When I change the car to FWD the steering gets incredibly floaty, to counter that I need to adjust the front wing at runtime to 0.5 for example. It gets rid of the floaty steering.

    I have created a full custom tuning setup, All the car stats can be changed via the user...So all car bhp,trq,handling,suspension,drivetype etc are all set on runtime, meaning i use one car and remap it. So the Front Wing Lift is all I need to finish :D


    EDIT:

    Im a moron GetComponentsInChildren get the wings...I didnt realise they spawn on start up...Can be located on "GroundEffect" child of car.


    Thanks!
     
    Last edited: Feb 27, 2020
  26. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Sorry! I was about to tell you they are called GroundEffect under the car main gameobject, they should be there on the prefab too.

    Let me know if you need anything else

    Cheers!
     
    vyral13 likes this.
  27. bobAZ2019

    bobAZ2019

    Joined:
    Mar 28, 2019
    Posts:
    28
    hi,

    i just bougth iRDS and created a new URP project in Unity 2019.3.4f1. however, when i open the demo project, i got purple texture.

    my question.... does iRDS support URP? and what's the remedy to fix the purple texture?

    thanks in advance.
     
  28. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hey thanks for your purchase! the system works fine with any rendering pipeline, as its main thing is AI and physics, your meshes would look pink until you upgrade all your materials, you need to search on Google on how to upgrade a PBR project to URP or HDRP ;)
     
    Last edited: Mar 18, 2020
  29. fredastaire

    fredastaire

    Joined:
    Sep 10, 2017
    Posts:
    90
    Is there a way to have two sets of starting spots one for the start and one if a car crashes have a caution and just respawn cars single file?
     
  30. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi @fredastaire , not sure i got your question, you want to respawn cars that crashes, into the starting grid while the race is ongoing?
     
  31. fredastaire

    fredastaire

    Joined:
    Sep 10, 2017
    Posts:
    90
    To get around the caution laps not counting I thought maybe I can essentially respawn all the cars like the start of a race but I have double file starts and short track racing uses single file restarts so I want to have a race start points than a set of respawn points in single file order that if a car crashes it essentially restarts all cars in that set of spawn points to go green again.
     
  32. Paulo-Matias

    Paulo-Matias

    Joined:
    Jun 27, 2013
    Posts:
    31
    Hello, i would like to know if irds 3.1 is compatible with vehicle phisics pro from Edy's! thanks
     
  33. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    It is compatible, but not out of the box, since i have not yet made the interface scripts, but you could use the Edys VP scripts that are in there and change them to use with Edys Pro physics for sure.

    There is a teleport feature you could use that could work, it would "Teleport" the car to an specific waypoint on the track, so you could teleport cars leaving i.e. 5 waypoints between them to avoid moving them to the same spot.
     
  34. AgathaCrup

    AgathaCrup

    Joined:
    Jun 20, 2013
    Posts:
    27
    Hey I can't find anything on the replay system, should it just play after a race? Do I need to add a component? Thanks
     
  35. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    You can check how it is setup on the Mobile scene on the demo folder, the replay system is under MobileControlManager->Replay Buttons on the hierarchy view on that scene.

    Let me know if you need any more information

    Cheers!
     
  36. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    3d Tires physics test



     
    Freznosis and vyral13 like this.
  37. FrikkieRSA

    FrikkieRSA

    Joined:
    Mar 30, 2017
    Posts:
    27
    Hi @rhodnius

    I am using Unity 2019.3.9f1 with your latest version, 3.2.6.1.a.

    I am having issues with the splines being very blocky. Please see the below screenshot to see what I mean.

    Blocky Splines.png

    The AI do not seem to follow a nice curvy race line. As can be seen from the image, the racing line doesn't smooth between the control points, rather it snaps between them.

    When opening iRDS into an empty project, it works as per normal. I cannot understand what is different between the two projects.

    Can you please help me with this issue? Ok, nvm, I figured it out. I had the Number of Waypoints parameter on the Manager script set too low. Thought I'd post this anyway in case someone runs into the same problem.

    The AI are driving very nicely now and following the racing line a lot beter.
     
    Last edited: Apr 23, 2020
  38. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Yep not related to unity version, glad you got it sorted out!

    I'm thinking to add a feature for that, that auto sets that value based on a "resolution" value, so you don't have to be changing it if your track is huge or small, just like on iTS that it auto does that
     
  39. FrikkieRSA

    FrikkieRSA

    Joined:
    Mar 30, 2017
    Posts:
    27
    That sounds like a very good idea. Or at least maybe rename it to something that is more clear? For example spline resolution or something like that.

    If I may, I would also like to request if it would be possible to prevent the following Unity messages?

    Mobile Controls.png

    Or is there maybe I work-around to prevent these messages?

    Thanks again for your quick reply.
     
  40. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Sure, that most be a duplicate I have somewhere, would need to check it out
     
  41. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi guys, I've been working on refactoring the physics quite a lot, and one of the things i have been doing and also thinking about is putting smaller stuff into separated classes and also have their settings into a class named Settings on each of those "Systems" so everything is more consistent, what you think about it? sounds like a good idea or sounds like too much? for me it makes sense to have stuff like that, so you get settings in a class that only have that, easier to pass it, or to save them and load them and stuff like that, here is a screenshot of how the Wheel script inspector looks like so far:

    upload_2020-5-10_17-0-20.png

    Does that makes sense? or would make more sense to have a single Settings with everything in there? the good thing of having it separated is that you know what setting you are working with, since you need to access the system you want to change the setting for, but i could be missing the point of view of someone else. would be great to get some opinions about it.

    Cheers
     
    Last edited: May 10, 2020
  42. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    If you are doing it this way, I think it would be better to use ScriptableObjects. So you can store different types of things and just reference them in the inspector. That way multiple cars will share one ScriptableObject with certain settings on it. So you could have BrakeSettings, SteeringSettings, etc in their own ScriptableObject instead of having to setup each car with the same settings, etc.
     
    rhodnius likes this.
  43. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    I see, well what actually could be done is, having an scriptable object to store the settings, but keep the script on the wheel to have its own settings, but you would be able to create a settings applier that would take the settings on the scriptable object and apply it to the cars you want to have the same settings, so having the settings like separate for each subsystem would help you out to do a system as you described, but keeping also the ability to have cars with their own individual settings. sounds good?

    i.e. Tire settings, which sounds like a setting you may want to share across cars, that would be easy to have on scriptable object, as it would be pretty much to have there the grip curve setting.

    Edit: Thinking about it, could add an scriptableObject little system to help out on getting share settings across cars at runtime, and a script attached to the car to select which settings you want to apply to that car which would be like common settings (i.e. tire settings about their grip), not sure if all other settings may be really needed as i.e. suspension might be too vehicle specific as would be tire radius, inertia etc.
     
    Last edited: May 11, 2020
    hopeful and Freznosis like this.
  44. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Yeah that would make sense. Sharing settings between vehicles that are likely to be the same but also being able to override it if needed would make sense. I think the tires would make a lot of sense also. That would allow you to setup an unlimited amount of tires without having to load them all in the inspector. You could just drag in the tires you want to use on that car. It would really streamline the workflow!
     
    rhodnius likes this.
  45. jase66

    jase66

    Joined:
    Jul 23, 2015
    Posts:
    12
    1. I want to buy arcade kart physics, but I'm wondering can I pair it up with this template before I buy it?

    2. is there a online a online tutorial for multi players.

    just need to know before I pick up this template, I've already been burned before.
     
  46. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi @ABC123User

    Currently there is no interface script for those physics included on the package, but i don't see any reason for it not to work with iRDS, as long as it accepts inputs of -1 to 1 for steering and 0 to 1 for braking and throttle it should work just fine, I could help you out on this if you need so, but usually taking as example the interface scripts of Edys VP would do to make it work with another physics.

    Currently there is no online tutorial for multiplayer, but I do have the scripts and notes for helping on doing that too, so I don't see issues on this neither, the scripts are for photon and photon2, not tested with any other Networking Framework.

    Let me know if you need more info
     
    jase66 likes this.
  47. jase66

    jase66

    Joined:
    Jul 23, 2015
    Posts:
    12
    thanks for replay, well let me ask you this, does your engine (AI) wise, work with any type of controller, motorcycles(2 wheels), characters(no wheels), jet ski(no wheels) like wave racer? If it some how does, I'm guessing custom controllers are simply following the select waypoint? I'm more worried on how the ai works with custom controllers. Interesting to know your 2 cents on this.
     
  48. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    It have been used with water vehicles, motorcycles, cars, it should do fine with those, characters really depends on how the controller works, if it accepts the same inputs, should be fine too.
     
    jase66 likes this.
  49. FrikkieRSA

    FrikkieRSA

    Joined:
    Mar 30, 2017
    Posts:
    27
    Hi @rhodnius

    Ever since I updated Unity to 2019.4.0f1 the lap and position UI do not work. I am using your IRDSUILap and IRDSUIPosition scripts. It seems like the IRDSStatistics.Instance.onCurrentCarLapCompleted event never gets called. Any idea of why this issue suddenly appears?

    Thanks
     
  50. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    would have to check it out, does not sounds like something breakable with an Unity upgrade though, but would have to actually test it, what is the exact behavior you have noted? like the lap and position never changes? or is showing wrong information?

    Thanks for the feedback!