Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    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. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,269
    Hmm would be good to know from which scene you are currently running it and which versions of Unity as there is an upload for different versions of unity (because of the API Updater issue unity have). The latest version was uploaded on Unity 2019.3.9

    One thing that could help out is a drifting assistant script that you can attach to the cars, that would help on the car stabilization (yaw stabilization primarily)

    Code (CSharp):
    1. public class IRDSDriftAssistant : MonoBehaviour {
    2.  
    3.     public float driftAssistanFactor = 1f;
    4.     public float maxAllowedAngularRotaionSteer = 3f;
    5.     public float driftingMinAngle = 1f;
    6.     public float maxAllowedAngularRotaion = 1f;
    7.     public float minSpeed = 15f;
    8.     private IRDSCarControlInput carInput;
    9.  
    10.     void Start () {
    11.         carInput = GetComponent<IRDSCarControlInput>();
    12.  
    13.     }
    14.     void FixedUpdate () {
    15.         if (carInput.AllTiresOffGround || carInput.BodyVelocity.z < minSpeed)return;
    16.  
    17.         if (carInput.Steering == 0  && Mathf.Abs(carInput.Body.angularVelocity.y) > maxAllowedAngularRotaion/4f)
    18.         {
    19.             carInput.Body.AddTorque(Vector3.up * -carInput.Body.angularVelocity.y * driftAssistanFactor, ForceMode.Acceleration);
    20.         }else
    21.             if (carInput.Steering <0 && carInput.Body.angularVelocity.y > -maxAllowedAngularRotaionSteer)
    22.         {
    23.             carInput.Body.AddTorque(Vector3.up * carInput.Steering * driftAssistanFactor, ForceMode.Acceleration);
    24.         }else
    25.             if (carInput.Steering >0 && carInput.Body.angularVelocity.y < maxAllowedAngularRotaionSteer)
    26.         {
    27.             carInput.Body.AddTorque(Vector3.up * carInput.Steering *driftAssistanFactor, ForceMode.Acceleration);
    28.         }
    29.  
    30.     }
    31. }
     
  2. Upri5e

    Upri5e

    Joined:
    Aug 12, 2020
    Posts:
    5
    Is there a way we can see the code for the DummyCameraPreview that the camera follows on the initial preview ? i want to change the condition of when the initial preview stops, and make it repeat after if i stop the preview and the race doesnt start for 5 seconds. So basically i want to make my own dummy object but with the same movement script for the dummy.
     
  3. vincespeed

    vincespeed

    Joined:
    Mar 8, 2014
    Posts:
    63
    Hello Rhodnius,
    I recently updated your package to v 3.2.6.1. First of all, let me say thank you once again for your amazing work, this new update solves a lot of issue I previously had. I would say it's almost perfect!
    I encountered two issues I couldn't solve, and I hope you can help me with them:
    1) It seems player car can only make one pit stop during the race: first time I enter pitlane, everything works perfectly (both if it's for a drivethrough or to change tire). But if I try to enter pits on the next lap (or the others as well), player car won't switch again to AI. It's like the "Pit Entrance Collider" won't trigger the car to make the pitstop again. As a matter of fact, I tried to debug the "GetComponent<IRDSNavigateTWaypoints>().GoPits" to see if it switches to True, but it stays false (setting it manually wont work either). I would appreciate if you can help me with this bug, as in my game I need players to enter pit lane as many times they want to.
    2) I bet this is easier :) AI cars tend to be too much aggressive with player when behind him. They won't slow down when they're right behind him if they can't overtake, instead they will force the player into a spin. Which parameter should I edit in order to solve this little problem?
    Thank you for your help, as always :)
     
  4. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,269
    sure, here it is, sorry for the late reply, some how I missed your post:

    Code (CSharp):
    1.         WaitForFixedUpdate waitForFixedUpdate = new WaitForFixedUpdate();
    2.         /// <summary>
    3.         /// Initials the race view.  This method is for internal use only.
    4.         /// </summary>
    5.         IEnumerator initialRaceView()
    6.         {
    7.             bool initialView = true;
    8.          
    9.             while (initialView)
    10.             {
    11.                 if (Input.anyKey)
    12.                 {
    13.                     initialView = false;
    14.                     lastDelayTime = Time.time;
    15.                     if (freeCamera == false)
    16.                     {
    17.                         if (IRDSLevelLoadVariables.Instance != null && IRDSLevelLoadVariables.Instance.startRaceManually == false)
    18.                         {
    19.                             IRDSStatistics.Instance.StartTheRace();
    20.                         }
    21.                     }
    22.                 }
    23.  
    24.                 if (IRDSWPManager.waypoints != null)
    25.                 {
    26.                     Vector3 RelativeWaypointPosition = IRDSWPManager.waypoints[currentWaypoint].InverseTransformPoint(target.position);
    27.  
    28.                     if (RelativeWaypointPosition.magnitude <= 15f)
    29.                     {
    30.                         velocity = Vector3.Lerp(prevVelocityTarget, target.InverseTransformPoint(IRDSWPManager.waypoints[currentWaypoint].position).normalized * initialViewSpeed, 300 / RelativeWaypointPosition.magnitude * Time.deltaTime);
    31.                         targetRigidbody.velocity =target.TransformDirection(velocity);
    32.                         prevVelocityTarget = velocity;                      
    33.                         targetRigidbody.MoveRotation(Quaternion.Lerp(targetRigidbody.rotation, IRDSWPManager.waypoints[currentWaypoint].rotation, Time.deltaTime * 8f));
    34.                         currentWaypoint = IncreaseIndex(currentWaypoint, IRDSWPManager.waypoints.Count);//this function just increases the index and if it is greater than waypoints count sets it to 0 to start over
    35.                     }
    36.                     else if (RelativeWaypointPosition.magnitude > 50f)//Just to travel the target if it is just too far away
    37.                     {
    38.                         target.position = IRDSWPManager.waypoints[currentWaypoint].position;
    39.                     }
    40.                 }
    41.                 else
    42.                 {
    43.                     initialView = false;
    44.                 }
    45.  
    46.                 yield return waitForFixedUpdate;
    47.             }
    48.  
    49.         }
    I would have to check that out, weird, I remember we fixed this issue of the pits together like a year a go? hmm maybe I didn't rolled it over the last release version, would check that out.

    About the AI being aggressive when behind the player, you can make the to try to overtake sooner, just make the OvertakingSpeedDifferenceMin and max a negative value, so they would try to overtake sooner, also increasing the LENGTH_MARGIN min and max would make them slow down earlier if they are closer to the player from behind.
     
  5. vincespeed

    vincespeed

    Joined:
    Mar 8, 2014
    Posts:
    63
    Thanks for the quick response :)
    At that time we had another kind of issue with pitstops: cars were entering the pitlane, and then suddenly began to slow down, start and stop, and it could take long before they would get out of the pitlane (sometimes they did not exit at all, just freezing there). This new update solved this issue brilliantly: I have 20 cars on track, tested it by making all them pitting at the same time... and even if a bit of traffic builds up, they all pit without any problem :)
    The problem I am facing now is that it seems in some tracks only one pit stop per car can be triggered in a race. If I try to enter again the pit lane nothing appens, the car control won't switch to AI.
    I've the DLL version of the Asset so I cannot do much to debug this strange issue, but navigating the code I've found the existance of listeners like this:
    Code (CSharp):
    1. IRDSNavigateTWaypoints.OnEnterPits
    So maybe they are not re-registered when the first pit stop finishes?
    [EDIT]
    After testing in depth more tracks, it seems this bug only affects some of them. Some other just work fine... some other else have a mix of the bug explained below and the one above.
    -On some track, when the car enters the pitlane for making a pit stop, there will be two laps accounted: the right one when the car crosses the starting line and another one when the pit racing line ends up again in the racing line. Once I could manage this bug by using “Set lap” of car controller ai, but now it has been deprecated, and the irdsnavigatwayponts.Lap can’t be modified (set is protected). I tried debugging the "OnLapChanged" function and here's what we have:

    Called function "On Lap Changed". Switched to lap 2 and a time of 134.9403 seconds
    UnityEngine.Debug:Log(Object)

    Called function "On Lap Changed". Switched to lap 3 and a time of 19.34 seconds
    UnityEngine.Debug:Log(Object)

    there's clearly something going on that I can't get. If it is any help (I don't know if length of the track or shape can cause some bug) the track we are talking about here is F1 Shangai GP (But it happens on Montreal, Monza, Melbourne and some other) The point where pit line and racing line encounters is a bit before the first turn of the track.
     
    Last edited: Jan 29, 2021
  6. vincespeed

    vincespeed

    Joined:
    Mar 8, 2014
    Posts:
    63
    Sorry to bump the thread with a second post. But every day that passes, my game keeps getting bad ratings because of these bugs and I need to release an update asap. I can imagine that you have a lot of work and therefore you cannot only focus on the bugs I pointed out. I would upgrade to the source code version of the asset, but I have 20 tracks in the game, and I should reprogram all scenes with a huge loss of time, since the source code version is not compatible with the dll version, so buying it is not an option. May I propose you give me access to the source code version (even just a part of it, the part where pitstop/lap update are handled) in order for me to test it and find out where the pit stop bugs originate? I would then pass you my findings so that you can fix the dll version and send me a fix.
     
  7. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,269
    Hi @vincespeed I understand, how you are explaining it sounds like might be an issue of how the track is rigged, lets better do a remote session to help you out and actually see what the issue is and get it solved :)

    And yes I'm busy but wont let people that is trusting on iRDS to get their games done down, so lets get it solved, pls PM me when you are available.

    Cheers
     
  8. vincespeed

    vincespeed

    Joined:
    Mar 8, 2014
    Posts:
    63
    I appreciate your cooperation, and most of all I really appreciate the commitment you have for your product and your customers. Let me fix some UI bug I've introduced (I've used the past week to redesign the UI, and I have some error :rolleyes:), will PM you to fix a meeting once done. Even if, from my findings, it hardly may depend on the tracks configuration.
     
    rhodnius likes this.
  9. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,269
    Just to let everyone know that the pitstop issue was found and fixed, still checking on the double lap count when exiting the pits, after that the fix would be then uploaded to the asset store
     
  10. aw6461

    aw6461

    Joined:
    Feb 2, 2020
    Posts:
    3
    Hi, I am currently trying to get the Obstacle Avoidance to work.
    Currently, I have:
    - obstacles tagged as "Obstacle" with the IRDS obstacle component on the layer obstacle
    - child trigger object on my AI cars with the IRDS obstacle sensor component on the layer obstacleSensor
    - obstacle layer hits everything, obstacleSensor only hits obstacle in the physics manager
    - using RCC physics

    when testing the cars do see the obstacles based off the debug raycasts, but do not seem to even try to avoid the obstacle. I tested with the obstacle as a kinematic rigidbody and without a rigidbody where both cases it would again see the obstacle but not avoid it.
    I also tried changing some values like the backToLineIncrement to a higher number, obstacleAvoidOffset values, and sideAvoidingFactor with no changes.
    I added IRDS car controller AI components to the obstacles, but nothing seemed to change.

    If there is any wisdom you can share with me about something I missed or am just assuming is right or something that will make it work that would be very appreciated.
     
  11. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,269
    Make the obstacle sensor trigger to huge like 50 meters width and 150 length and try again, let me know how it goes
     
    Last edited: Feb 8, 2021
  12. Andreas12345

    Andreas12345

    Joined:
    Oct 17, 2013
    Posts:
    436
    Hi,
    when i add Edys Vehicle Physics to iRDS, and want to select it in the Garage:
    upload_2021-2-6_16-22-16.png

    Is there a better tutorial to handle this?
    I followed the the steps for edys in the PDF added the front wheels.

    * When i add a new car and choose in the garage, i get not this car when i start the completeScene, from the demo

    Sorry this is not what i excepted, i re quest a refund
     
    Last edited: Feb 6, 2021
  13. vincespeed

    vincespeed

    Joined:
    Mar 8, 2014
    Posts:
    63
    Once again Jose thank you so so much for your help! You’ve been very kind to arrange a google meet and rule those bugs out! Once again, this wonderful and always improving asset proved to be a great time saver for me!
     
    rhodnius likes this.
  14. aw6461

    aw6461

    Joined:
    Feb 2, 2020
    Posts:
    3
    yea it was huge huge its 50 x 20 x 200 when i tested and i used multiple sizes too. Like I said, it does notice the obstacles, it just doesn't dodge them.
     
    Last edited: Feb 7, 2021
  15. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,269
    Hi @Andreas12345

    The issues is because the selection screen also uses other classes that third party physics does not have, just commenting those lines would get it to work without issues.

    I can do a call/remote session to get you in the right path really quick, just PM me your availability.

    I see, does the obstacles have the obstacle tag on the object that have the collider? Just a few days ago had another user getting a similar issue and was just the size of the collider, so in your case could be settings, make sure overtake offset increment is set to 0.01 or higher on their min and max on levelload object in Random AI settings, if still not working let me know, we could do a remote session to get you going faster for sure.
     
    Andreas12345 likes this.
  16. aw6461

    aw6461

    Joined:
    Feb 2, 2020
    Posts:
    3
    ok so I double checked the tag for the collider and the code that uses it to make sure they match, which they do. My collider is pretty big for the scale of my other things (3x4x10 obstacle) vs 20 x10x100 sensor. I tested with offset increments above 0.1f and went up to 10 for the max, 1 for the min with no change.
    If its not too much trouble a remote session would be very helpful. I will PM you.
     
  17. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,269
    Just answered your PM, I'm currently available if you want to do the remote session :)
     
  18. Slipangle

    Slipangle

    Joined:
    Jan 11, 2012
    Posts:
    26
    Glad to see it's been updated to work with current Unity release.
    Rhod, for some reason your website forum isn't working, maybe you should update some stuff on that end as well :)

    Also, is there a roadmap for upcoming features?
     
  19. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,269
    Thanks for the heads up about the website, would check it out, maybe an outdated stuff, but the link works (forum link on the webpage)

    Currently the main thing for iRDS is refactoring of the code and physics made from scratch pretty much.

    It would also include 3D wheel, yet it needs some work, currently it is using raycastings, but I would be trying to make one that works with actual mesh colliders for the tire, so is way more accurate on surface detection.

    At this very moment I;m finishing up iTS refactoring(Testing and multithreading implementation), so when thats finished i would be back on iRDS refactoring
     
    Slipangle likes this.
  20. Vancete

    Vancete

    Joined:
    May 3, 2010
    Posts:
    194
    Any updated documentation? I'm interested in RCC integration.

    Thanks
     
  21. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,269
    Hello @Vancete the integration of any thirdparty physics uses the same steps as the integration on the documentation for Edys physics, but just using the corresponding physics folder on the included compressed archive with all the third party physics integration scripts. :)
     
  22. fredastaire

    fredastaire

    Joined:
    Sep 10, 2017
    Posts:
    80
    I’m having an issue with the nwh physics cars not being auto controlled by irds
     
  23. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,269
    You mean the AI cars are not moving or you are trying to use the Auto steering/brake/throttle for the player?
     
  24. fredastaire

    fredastaire

    Joined:
    Sep 10, 2017
    Posts:
    80
    the cars on the rolling start dont get controlled by your system they just crash and the player car does not get controlled by your asset
     
  25. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,269
    I see, sounds like it does not have the implementation for auto controlling the player, would double check this
     
  26. Upri5e

    Upri5e

    Joined:
    Aug 12, 2020
    Posts:
    5
    Hello, is there a more detailed setup guide for the minimap ? ive been trying to change its size to fit my map sprite, but i cant seem to get it to work. i can only zoom in and out, but not letting me fit it with my image sprite
     
  27. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,269
    Hello i would make a video for it, is a bit more work than other features to get it working as it is not automated and depends on where on the world position is your track positioned, then you need to adjust the offsets of the minimap to get it to match. definitely a video would be easier to understand so i would be uploading one

    Edit: here is a video
     
    Last edited: May 11, 2021 at 4:53 AM
unityunity