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

    radimoto

    Joined:
    Aug 23, 2012
    Posts:
    257
    Hi Rhod, my vote would be for the UI first, and then later introduce the new physics
     
    rhodnius likes this.
  2. rhodnius

    rhodnius

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

    I'm now on the process of start to convert also the car selection menu scene to the new UI, and the championship code that shows the final scoreboard after the race when in championship mode.

    The in-game UI is being tested meanwhile. Sorry that this is taking a bit longer, but we want to be sure that it is working good for you all :D

    Cheers!

    Rhod,
     
    Last edited: Aug 4, 2015
  3. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Is it possible to add iRDS to an exisitng project which already contains a scene with the circuit + landscape?
    Thanks
    G.
     
  4. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi @gibmation !

    Yup it is possible, indeed it is needed, usually you get iRDS in the scene when you have all the stuff on it (roads, props, etc.)

    Cheers!

    Rhod,
     
  5. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hi again, Ok Ive added irds to my project now.

    I am starting of working on a sprint type race.

    1. Camera preview just rolls on at the end - is there anyway to stop the camera and move to race when it reaches end of track.

    2. Race is just player + 1 ai car, when car reaches a certain waypoint it either turns left or right, crashes against wall then respawns and continues to finish. I have removed terrain in case a collider was getting in the way but it still happens, always at same spot. I have redone the track with same result.

    3. I am also having problems with obstacle avoidance, I have created obstacle tag + layer + obstaclesensor layer.
    I have object with obstacle tag in obstacle layer.
    I have added irdscarconrollerAI script to obstacle object.
    I have added irdsobstaclesensor script to the 3 resources cars.
    UI then also changed physics to this...
    upload_2015-8-13_15-59-50.png

    But car will just drive straight into object if I place in race line.

    Thanks

    G.
     
    Last edited: Aug 13, 2015
  6. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    After looking more into this I have noticed that what is actually happening is that as race is a sprint, AI car accelerates but when it gets to around 140k/hr it appears to spin out of control.

    How could I fix this?

    Thanks

    G.
     
  7. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi @gibmation !

    Thanks for your purchase!

    Here are the answers to your questions:

    Definitely something that i have to look at, will do for the next release, if you need this ASAP please do let me know so we could arrange some patch for you or something, meanwhile you could do a little workaround, since you have the ability to start the race yourself, you could compare the position of the camera with some of the latest waypoints and when it reach there, start the race using IRDSStatistics.instance.StartTheRace(), for this to work the option start the race manually on the levelload object must be on, on the other hand you could also just use the IRDSCarCamera class and set false to the Initial view variable using the method IRDSCarCamera.SetInitialView(false); this wold disable the intial view and would start the race.

    This should be because one of the track limits at that point is over a barrier or something else than the track, since the Up direction of each of those points is set by the normal of the surface it hits on, it might be getting not an Up direction due to the surface not been flat, and since the system uses those track limits to know if the car is outside or inside the track and the Up direction is pointing not Up but maybe to the left or right the car thinks is outside of the track at that point and react in that way trying to correct its path, to fix this just move your track limits to more inside the track (just enough to be sure that it is not on top of another surface than the track). Im going to address this on an upcoming version by allowing to choose if you either want that Up direction to be just Vector3.Up or the surface normal, since that is more for stunts courses. where loops and twists are on the track, so the waypoints have the correct direction of the normals direction of the track surface.

    I was looking at this, and this is a minor bug i just fixed, im attaching here the script IRDSObstacleSensor so you can use it right away (you might need to rename the class in case it conflicts with the one included on the dll) then just attach this script to the main car object and just for the main object change its layer to obstaclesensor or create an empty child object on the car attach a collider component (sphere, box or capsule) and attach this script to it and change the layer to obstaclesensor just for this object and adjust the size of the trigger, that would be the sensor for detecting the obstacles.

    Sorry for the inconvenience.


    What you describe seems to be that your Look ahead factor and look ahead constant are one too low and the other might be too high, try these values look ahead factor = 2 and look ahead constant = 4.

    Sorry for the late reply, over here we had a thunder storm and was without internet for the last 6+ hours and still the service is down, so i just went to another place with internet to be able to post :)

    Let me know if you have any other questions.

    Cheers!

    Rhod
     

    Attached Files:

  8. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    No problems Rhod, thanks for the advice and patch, will apply and report back.
    Thanks
    G.
     
  9. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    OK I have been testing this - my values were already at look ahead factor = 2 and look ahead constant = 4.

    I tried changing other settings with no luck.

    I copied scene and removed all objects except iRDS manager and added a plane with roadtrack material.

    I then tried moving the plane at different heights to the racing line to check if the height values made a difference - Same result.

    I then leveled track and assigned same height to all waypoints to make sure racing line was completely at same height from the track - Same result.

    I then noticed that the number of waypoints was set to 1000.
    I changed this to 100 and success!


    AI behaves nicely on this track now.

    Will now look into the other items.

    Thanks again.

    G.
     
    rhodnius likes this.
  10. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334

    Oh yeah i missed to tell you that, the number of waypoints should be related to how long the track is, usually check that when you select the IRDSManager object the magenta cubes that are on the scene view (Gizmos) has a distance between them at least of 1 to 3 meters aprox.

    Great you had it sorted out!

    Cheers!

    Rhod,
     
  11. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
  12. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    @gibmation nice! if you are going to run it on mobile, i suggest disabling the visual racing line, you can do that on the general settings on the levelload object.

    Keep it up, looking great!

    Cheers!

    Rhod,
     
    gibmation likes this.
  13. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hi Rhod, I added script to project but getting this error...

    Code (CSharp):
    1. Assets/iRDS/Scripts/Main/IRDSObstacleSensor.cs(28,31): error CS1061: Type `IRDSCarControllerAI' does not contain a definition for `OpponentsVar' and no extension method `OpponentsVar' of type `IRDSCarControllerAI' could be found (are you missing a using directive or an assembly reference?)
    2.  
    Thanks
    G.
     
  14. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi @gibmation !

    I'll better send you the new dlls with the fix, please send me an email to josegarrido@dagagames.com to do so ;)

    Cheers!

    Rhod,

    Edit: I'm uploading a new version with only this fix, since it is a feature that could be needed for many of you.
     
    Last edited: Aug 15, 2015
  15. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    HI Rhod,

    I am having some problems with cars spinning and flying into the air when the collide with each other or a pavement, terrain well any other collider really.

    I have tried with physics, material and without these on objects.

    I have removed all colliders from the scene and left just the pavements and terrain.

    Track has track phys material
    Pavements have track phys material
    Terrain has sand phys material.

    I have made a video so you can check this out.
    Its too bill to upload in forum so here's a link.
    http://linares.gi/video/irds.rar

    Any ideas please?

    Thanks

    G.
     
  16. rhodnius

    rhodnius

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

    This seems to be related to the suspension getting hit from the actual car collider, to avoid this, put the collider of the car in a layer and on the tire settings set the layers to all except the one you assigned to the collider of the body of the cars, this way this would be avoided.

    Let me know if this solves the problem you are having.

    Cheers!

    Rhod,
     
    gibmation likes this.
  17. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Thanks for quick response. Will give it a try and let you know.
    G.
     
  18. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hi Rhod, I tried this but no luck.

    I also changed tire settings to no layers and still happens?
    Could it be this is not working as it should or am I doing something wrong?

    Thanks
    GUs
     
  19. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi @gibmation !

    Check your email, i have sent a new set of dlls.

    Cheers!

    Rhod,
     
  20. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hi Rhod thanks for the new dlls.

    I have added these but now all cars have lost their scripts.

    Will try create a new demo project and add car scripts based on these as I dont remember which they were.

    G.
     
  21. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hey Rhod, this has really destroyed all work so far man.
    All IRDS scripts are now missing in levelsettings, manager and cars.
    I tried replacing with a new IRDS level + manager but these are missing scripts too.

    Can you send a complete version not just dlls so I can upgrade my current one or something please.

    Thanks
    |G.
     
  22. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    OK I think I've sorted it.
    I removed irds.
    Then re-imported from asset store.
    Then replaced dlls before opening project.
    Scripts are back and most settings as well. Not a major issue now.
    G.
     
    rhodnius likes this.
  23. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Yo Rhod, cars are working much better now, thanks for the update mate!
    G.
     
    rhodnius likes this.
  24. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hi Rhod,

    OK there still seems to be some problems.

    1. The cars supplied with iRDS are now working fine. - actually seems they work well regardless if I set wheels to ignore car collider layer or not.

    However my own cars which I have rigged using iRDS are still spinning out of control like the others used to.
    These have colliders in own layer set to be ignored by wheels settings, but just dont work.
    Which leads me to think that the fix has been applied to these cars only and not to the "ignore layer" in wheel settings.

    I really need to use my own cars for this project.

    2. For obstacle avoidance. I can now see cars avoiding obstacles without having to setup trigger collider as you explained.

    I also see there is a sphere collider which is created by iRDS in car instance but does not seem to be assigned to the obstacle script. Could you please explain the complete procedure for adding obstacle avoidance.

    3. Which objects should be considered obstacles?
    ie are walls, fences and buildings on sides of race track obstacles or only objects that fall in the racing line? Should cars also be obstacles or are these avoided otherwise.

    4. After completing a racetrack in iRDS manager I then edit/change the racing line to account for road curves etc. Then if I decide to add more racing start points or camera points etc I have to "Process Track Data". This action resets the racing line elements back to the original track center.

    Is there any way of locking the racing line so this does not happen.

    5. In your demoscene when you use Esc to enter the pause menu, if you select Main Menu, you return to main screen but, Pause Menu stays on screen, if you use Esc to remove it you cannot select car and race. The screen has to be in pause in order to load then you need to hit Esc again once race starts to clear Pause Menu but this in turn starts the race.

    6. Is there an end scene or do cars just roll on endlessly when a race is completed?

    Thanks for your help.

    G.
     
    Last edited: Aug 17, 2015
  25. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi @gibmation !, yes sorry that i didnt sent you the instructions to upgrade the dlls, it is as you described, first close unity, then replace the dlls and then re-open unity.

    About your questions, here are the answers:

    In these casem just enter to the tire settings on your cars, and re apply the layer settings, since before the settings was just applied to one of the tires in front and one of the rear.


    By default the system creates an sphere of radius of the front coll distance of the car (this is set on the levelload object on the random AI settings, if you want you can assign manually the trigger you want to use for detecting obstacles on the IRDSObstaclesSensor script and the script should delete/remove the sphere collider.


    The system already detects the limits of the track (which are the yellow line you define when you create the virtual track) and other cars, so there is no need for using obstacle for those, just for any other object you may have inside the track, i always recommend not using a lot of obstacles, since that have an overhead on the performance. I'll be improving the obstacle avoidance in a near future (V3 release) so it is more performance friendly and easier to setup.

    Hmm this doesn't seem a normal behavior, if you could send me a video for seeing what is going on, in case I need to fix/modify something, haven't seen this before.


    Yes i understand, the Pause menu is a third party free plugin, in there are the scripts, so you can adapt/modify them for your needs :)

    You can know when the race has ended, by registering to the delegate onRaceEnd in the IRDSCarControllerAI script of the player, which is the car that has isPlayer = true.


    Let me know if you need anything else.

    Cheers,

    Rhod,
     
  26. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Thanks for reply.
    Yes I already did this today.
    As I reloaded iRDS it reset all project settings so I had to create these layers again today.
    I have added car collider to this layer then excluded it from wheels setting but upon collision unity just crashes.
    G.
     
  27. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    I see, what you could do to avoid the project settings to be overwritten is deselect them on the import window, before importing the package. This is because the asset is on the Complete Projects category on the asset store and this category automatically includes the project settings on the package, but you have the option to not import those settings, which are usually at the top of the assets on the import window.

    Also try disabling Damage on the levelload, this usually is not used on Mobile games, since it is a bit of performance unfriendly as it deforms the meshes in realtime when you crash.

    If you keep having the unity crash, please let me know.

    Cheers

    Rhod,
     
  28. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Thanks for reply.
    Yes I already did this today.
    As I reloaded iRDS it reset all project settings so I had to create these layers again today.
    I have added car collider to this layer then excluded it from wheels setting but upon collision unity just crashes.

    However I have moved all wheel and subobjects to a new wheel layer and excluded this via physics from car collider layer.
    And they are now working quite well.

    G.
     
    rhodnius likes this.
  29. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Thanks for clearing this up. It really helps.
    G.
     
  30. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Great you have it sorted out, but I'm not quite sure I understood what/how you did it, would be great if you could share it in a bit more detail, so I could see if there is something that needs to be improved on the code, or if it is just how it should be setup.

    Cheers!

    Rhod,
     
  31. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Rhod:
    Yes here it is.
    This is what I am doing.

    1. Select iRDS Manager/RacingLine/Waypoint_XX
    2. Move waypoint to desired location.
    3. Select iRDS Manager
    4. Click on "Process All Tracks Data"
    5. RacingLine moves to center line again.

    Thanks
    G.
     

    Attached Files:

  32. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    OK

    1st Attempt.

    I created layer - carcolliders.
    I moved collider of all car prefabs to this layer.
    I then went to car settings individually.
    Under wheel settings I un-ticked the carcolliders layer.

    I thought it would work at this point but - unity just crashes all the time.

    I tried this with front + back and with individual wheels x4 with same result.

    2nd attempt.

    I created layer - wheels.
    In car prefabs - I moved all wheel objects/subobjects to the wheel layer.
    Then in unity physics settings I set layer wheels to collide with everything except carcolliders.

    This now worked on my cars.

    However iRDS cars worked without having to do this method.

    G.
     
    Last edited: Aug 17, 2015
  33. rhodnius

    rhodnius

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

    Some points to consider about this:

    If you want to change the racing line position, you should do it with the built in tool for moving the markers not the racing line itself, you can do this by selecting IRDSManager then select the icon with the Racing line (second Icon on the Second row of the toolbar) and then with shift+right mouse click on the red dots on the track to select the marker you want to move and the racing line would move with it, this is because those Markers are the control points of the Spline that finally builds the racing line, this is how it looks:

    upload_2015-8-17_13-40-26.png



    Thanks for sharing this in more detail, I'm going to take a look at it and see if it is something on the code that needs improvement.

    Cheers!

    Rhod,
     
  34. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Hi Rhod sorry to be such a pain man.

    iRDS is turning out to be a great asset and I will write a favorable review on this as soon as I get it all working and setup.

    I'm not much pf a programmer just basic stuff, which is why I purchased iRDS which was classified as a complete project.

    I would really appreciate of you could provide some examples for...

    Ending and show scene with player and race stats.
    End camera at end of srpint circuit and moving to start race.

    The basic idea will do and I will ask you if I need more help please.

    Thanks

    Gus
     
  35. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Yup no problem.

    For showing the end results, you could use the built-in standing for the end of the race, which are on the IRDSManager on the Icon that says "Lap" in white with 2 green circles, in there go to almost the bottom and you should find there Statistics GUI settings, in there is a toggle for "Statistics GUI?" which is for the in-game statistics and another that is named "End statistics GUI?" enabled this last one, and then select the information you want to display, fonts position of the GUI, etc.

    About this one, you refer to the camera not continuing cycling the track, and stead start the race when it reaches the end of the track? if thats what you are looking for, let me do a simple script for this, that you could use for that purpose.

    Cheers!

    Rhod,
     
  36. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    For me this just adds another point.
     
  37. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Ok now I got it. There's no need to shift right-click as this just adds another point, when show handles is on just click on one of these then you can move.

    Thanks sorted.

    G.
     
  38. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Make sure is the right mouse button you are clicking with, not the left, since Shift+left mouse button add points, and shift+right mouse button selects the point.

    About the script for auto starting the race, here it is, just attach it to an empty object, and place that object on the track at the position you want the race to auto start if the camera reaches that point, if it doesn't auto start increase the "minDistanceToStartRace" to a higher value, default is 10.

    Cheers!

    Rhod,
     

    Attached Files:

  39. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    For me:
    Shift + Right Button - add points
    Shift + Left Button - selects points
    upload_2015-8-17_22-15-16.png

    Even your software says this...
    upload_2015-8-17_22-14-3.png
     
    rhodnius likes this.
  40. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Thanks for this Rhod, will give a try tomorrow and let you know how I get on.
    Rgds
    G.
     
  41. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    May bad, you are totally right, was my other right hhahaha lol :confused::eek::oops::D
     
  42. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Was confused enough as it was without you changing directions hahahah
    G.
     
    rhodnius likes this.
  43. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Yeah sorry about that, i got confused on my left and right hand and then confused your more! lol :D:D:D
     
  44. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Sorry Rhod another thing mate :(

    Most races I will make I would like to create a different race in either direction.

    Is there an option or a way to copy scene and just reverse direction of race within iRDS manager?
    Maybe an option that would reverse waypoint number order?

    Thanks and sorry for driving you crazy today.

    G.
     
  45. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    currently there is no direct way to do it, you need to duplicate the scene and change the markers order manually on the Waypoints GameObject that is child of IRDSManager.

    And dont worry to ask, it doesn't bother me at all.

    Cheers

    Rhod,
     
  46. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Good day Rhod,

    Ive been looking over how to make events happen at the end of a race but I cant seem to make this work or have a clear idea on how to start. And I dont have a lot of time left to complete this.

    Is it possible to use the included script "FinishRaceEventTest" as a basis to start events on end of race and if so where should I attach it to?

    If not and if you dont mind could you give me an example script like this one that I can add to an object and then assign my own functions to it that run at end of race.

    Just a basic (but not too basic) outline will do please.

    Thanks
    G.
     
  47. rhodnius

    rhodnius

    Joined:
    Apr 11, 2012
    Posts:
    1,334
    Hi @gibmation !

    Yes that is an example, but it needs to be attached to the cars, and it would detect which one is the player and run the code that is on the OnRaceEnd() method that is on that script.

    I'm also attaching another script which works if attached to any object, and would do the same (but you dont have to attach it to each car).

    Let me know if you need anything else.

    Cheers!

    Rhod,
     

    Attached Files:

  48. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Thanks for this Rhod you're absolutely great!

    I'll give a try tomorrow and let you know how I get on.

    Thanks again for your dedication to iRDS.

    Regards
    G.
     
    rhodnius likes this.
  49. gibmation

    gibmation

    Joined:
    Dec 1, 2014
    Posts:
    311
    Rhod working really well thanks.
    G.
     
    rhodnius likes this.
  50. aLeXmOrA

    aLeXmOrA

    Joined:
    Aug 23, 2013
    Posts:
    9
    Hello Rhod,

    I've purchased the iRDS system and been working with it, I have to say that it is a really good one. Thanks for it, btw.

    I have a simple question. Imagine this: There is one car and one track and in your scene, and also there is already the iRDSManager prefab. To "start" the system (move the camera to the back of the car, start initial counting, etc.) in mobile you need to click somewhere in the mobile screen (with the mouse while testing in the Editor). So, where I can find or what should I do to tweak that a little bit and make the system to start when pressing a button? Is that even possible?

    What I'm trying to do is this: I have a UI Panel with a loading screen running while in the back I'm loading the track and the car. The iRDSManager is already in the scene before the car and the track load, btw. After these assets are loaded into the scene, the Loading Panel shows a "Start" button (you only can see the Panel, nothing from the back yet). If you click that "Start" button, the panel is hidden and right there is when the iRDS system should start (move the camera, start the inicial counting, etc.)

    Can you help me figuring this out? I don't know if that's even possible, but I would appreciate some advice.

    Thank you in advance.

    Regards,
    Alex Mora.