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

[v2.0 soon] Racing Game Starter Kit - Easily create racing games!

Discussion in 'Assets and Asset Store' started by Ian094, Jun 30, 2015.

  1. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    I can confirm this as I did away with the idea of currency or credits. Got rid of the UI for it and removed references in the code to it. I also reworked the customization part to get rid of the rims, simplified the paint color part (because of no purchasing or credits), and added a section and code support for decals over the paint. It was easy, but did require some grunt work hunting down references and removing them. That's all it was really. I was even able to use his boilerplate code for the track selection and make an entire 3D earth map, where you move around the earth and select tracks that way. All using his menu code and my own additions to it.

    If you have any interest to see what that looks like in a very early state, here is a video of it



    Also want to add Intense_Gamer94 (the developer) has gone above and beyond in support for this asset. He has not only supported me once, but multiple times, usually replying with a a couple of hours. This support wasn't just within a week's time either. He has supported my issues over a period of time. Simply put: This is a stellar asset, that comes with stellar customer support!
     
  2. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Wanted to share what I have so far using your kit. I've extended and modified quite a few things, so you will see some stuff that adds to what's there already. This is running about 50-60fps on a low end Android device (Galaxy S2), but the Google Games screen capture tool is killing about 10-20fps off the framerate.

     
    antoripa and Ian094 like this.
  3. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    Hi,
    Nice camera shake :) what you use to check fps on this movie? This is the same "tool" from RGSK?
     
    JamesArndt likes this.
  4. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Yeah it's the built-in FPS counter from RGSK.
     
  5. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    Any news about progress RGSK 2.0? :)
     
    JamesArndt likes this.
  6. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    v2.0 is going well.

    I've spent most of the week making improvements and fixing bugs. I was hoping to have the beta released by now but there are a few more things that I still need to work on - it's been quite hard managing my time lately.

    One of the key improvements in v2.0 is performance, during development I've been keeping track of the profiler to make sure I don't write code that causes major spikes.

    Another big improvement is workflow - it's a lot easier to setup a scene and everything in it such as the spline, spawnpoints, race triggers, UI etc.

    The main things (v2.0 beta blockers) that I am working on at the moment are:

    1. AI - the overtaking / obstacle avoidance logic is a bit messy at the moment and needs some serious work. Due to performance reasons, the AI do not use raycasts to detect vehicles around them, this is done using a trigger.

    2. Vehicle physics - some aspects of the vehicle physics need some work - mainly in the way they handle.

    3. Race Logic - i need to figure out a few things here such as the best way to handle events and UI management based on race state and type (I'm not happy with how this is handled in v1.1.0)


    One cool feature that I've added is a time of day system, this will allow for day/night races. Configuring settings for this will be pretty straight forward as seen below:

    timeofday_WIP.png

    This is still a work in progress and could change with the release of v2.0.
     
    NeoUnity, antoripa, Neviah and 2 others like this.
  7. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    Day and night system. Superb addon. So it will possible to turn off/on the car headlights?
     
  8. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Yep :)
     
    Neviah, magique and Max1982 like this.
  9. AOEIII150

    AOEIII150

    Joined:
    Jun 22, 2014
    Posts:
    9
    Hi Intense_Gamer94

    Great job!

    What about multiplayer features?
     
  10. facundogalella

    facundogalella

    Joined:
    Mar 5, 2016
    Posts:
    59
    The physics will include option for 4WD traction?
     
  11. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Multiplayer is a feature that I'm really excited to work on and will be introduced some time after the release of v2.0.
     
    Max1982 and AOEIII150 like this.
  12. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Yes, FWD, RWD & 4WD options are included.
     
    facundogalella and Max1982 like this.
  13. AOEIII150

    AOEIII150

    Joined:
    Jun 22, 2014
    Posts:
    9
    Thanks :)
     
  14. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    Summary, the RGSK 2.0 has great features, and this is good information :) The bad information is that we have half a year since last update (1.1.0) and theres still no new update :(
     
  15. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    Yeah, I understand that it's been a long time.

    It's been quite hard managing my time over the last few months so I haven't been able to push v2.0 as soon as we all wanted.

    I left a post above with the main issues that I'm working to resolve for the update. Not too long left till a beta will be ready.

    I really appreciate the patience everyone has had and I know the update will be worth the wait for sure.
     
    NeoUnity, antoripa and Mayureshete like this.
  16. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    I use Time of Day for my day/night cycles, will it be possible to plug that in somewhere rather than use your built in stuff?
     
  17. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,
    Yes, the time of day system isn't tied to any part of the race system so that would be possible.
     
    derkoi likes this.
  18. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    dude this asset goes way beyond his scope, and it took looooot of time to perfect and test that especially knowing the amount of features that the author want to put, so just relax and be patient. i d rather wait than getting something broken and waste a day of work or more.
     
    derkoi, Mayureshete and Ian094 like this.
  19. srikanth-timuz

    srikanth-timuz

    Joined:
    Jul 30, 2015
    Posts:
    2
    Hi, I want to purchase this asset but when i play Offroad Demo then my car strucks at borders. can you pls solve these type of issues...
     
  20. Arts-Apu

    Arts-Apu

    Joined:
    Nov 7, 2015
    Posts:
    56
    It takes too much time. When will it release?
     
  21. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    Have some patience.
     
    Ian094 and JamesArndt like this.
  22. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    I have started doing a side-port to Xbox One and everything is working great, with the exception of one thing that may have been covered somewhere in this thread already. Xbox input is working for the vehicle, but I don't see it working for any of the UI buttons in the menu or to start the track events. Did I miss something or do the menus not support the Xbox controller at the moment?
     
  23. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    Yeah this is a known issue that I'm working to resolve. I haven't quite figured out how to use the UI system with a controller. From what I understand, it revolves around the InputModule in the EventSystem.

    I've noticed that if you manually select a button, and move the joysticks and press A to select you will see that it works off the bat but a lot more logic is required to extend it to work properly.

    Here's some things I've been looking at regarding this issue:
    https://docs.unity3d.com/Manual/EventSystem.html

    https://docs.unity3d.com/Manual/InputModules.html
     
    JamesArndt likes this.
  24. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    You're on the right track. It's the Event System that this revolves around. I have some of it working right now. So the key is to make sure a button is always assigned into the Event System Manager in the "First Selected' slot. This ensures that a game pad/controller always has a button that is highlighted to start with and navigate from. Then on the StandAlone Input Module you set if you want the joystick or game pad to navigate up or down your buttons vertically or horizontally. You also set those default "Submit" and "Cancel" buttons to be the Xbox versions, i.e. A for Submit, or B for Cancel. For your "Back" buttons in RGSK I've set those buttons to have no navigation in the StandAlone Input Module, so they act as single buttons which I then just map their actions to your included inputs in the Input Manager for Xbox "B" button. You end up just putting a sprite on that button with the little red Xbox "B" button icon, so players know that button will go back.

    This works for the most part, but still far from fully functional. When disabling grounds of UI elements, the Event System doesn't pick up a default highlighted button again, so you're stuck without being able to do any button input. I really feel like Unity should put out an official tutorial or online guide to getting their UI system to work with game pads and controllers like the Xbox One controller. If anyone in this thread knows of a good tutorial or guidance document, please share.
     
    Ian094 likes this.
  25. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Thanks for the info! I'll definitely be trying this later on.

    Yeah, I think so too. It's a bit complicated to get working at the moment.

    The new input system looks very cool. It looks like Unity have worked on UI navigation with "Menu Actions".

    https://forum.unity3d.com/threads/welcome-new-input-system-resources-and-info-please-read.397153/

    I'm not sure when this will release but can't wait to try it out.
     
  26. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    I've been using rewired and it makes control of the UI via controllers very easy. Check it out.
     
    magique and JamesArndt like this.
  27. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Oh sweet. I have read good things about that system. Time for a purchase. Make this Xbox UI input porting easier on me.
     
  28. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I was going to recommend Rewired also but someone beat me to it. Since you also do mobile you might be interested in the new touch controls included in Rewired 1.1.0 release that recently came out.

    This is probably part of the documentation that you might want to read about is this for controlling Unity UI using Rewired.

    http://guavaman.com/projects/rewired/docs/RewiredStandaloneInputModule.html
     
  29. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    71
    Hey guys! I've used the unity UI with gamepad for quite a bit now. Currently I have a rewired setup, and here are some tips from the top of my head for using uGUI with gamepad.

    Consider to setup a method to get a default button every time a new screen or menu opens up. Otherwise, you'll get no selection, therefore no navigation.

    Consider creating a basic "cancel" function to go back or cancel actions. On gamepad, adding a go back button on the screen is redundant, so mapping a cancel action to a button is a lot more UX friendly.

    Consider creating a "screen" class, that holds basic navigation info, like previous screen (in case you know who opens that screen or menu), a previous button, to know what to select after going back, or stuff like that.

    Disable input during transitions. This can be done by setting the "Send Navigation Events" boolean on the Event System to false. This is very helpful, since it blocks input like cancel or pause while you are transitioning. Unlike mouse or touch, some functions can live on the gamepad, even if there are no buttons on the screen at the moment.

    Using rewired is very nice for multiplayer purposes, and i Highly recommend using it if that is the case.

    For now, that's it. If you guys have specific case questions, I'll happily share my thoughts with you guys.

    Keep up the good work with RGSK! Im looking forward to 2.0!
     
    JamesArndt and Ian094 like this.
  30. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    It's a great system. I was working with the developer for native PS4 controller support a while back too.
     
  31. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    hello, is there a way to track if all tracks are unlock? so i can show a congratulations you finished the game!
    thanks
     
  32. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    You can loop through all race tracks and check if they are unlocked returning a bool:
    Code (CSharp):
    1. public bool AllTracksUnlocked()
    2. {
    3.     for(int i = 0; i < menuTracks.Length; i++)
    4.     {
    5.         if(!menuTracks[i].unlocked)
    6.             return false;
    7.     }
    8.  
    9.     return true;
    10. }
    To use this, you would simply do something like this:
    Code (CSharp):
    1. if(AllTracksUnlocked())
    2. {
    3.     //Show congratulations screen
    4. }
     
    toto2003 and antoripa like this.
  33. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    Ok, so lets wait :)
     
    Ian094 likes this.
  34. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    hi there,
    i got an issue with collision and layer, i have two box collider attach on the car, they re setup on their own layer, i go to physic panel to ignore their layer from ignore raycast layer so at the finish line it didn t trigger. it work fine when i finished the race, but when i press respawn it s where the issue appear, my two box collider are set back to default layer, so i can t continue the race after getting to the finish line.
    any idea?
     
  35. Atzig

    Atzig

    Joined:
    Jul 17, 2014
    Posts:
    157
    RGSK changes your vehicles layer when it's respawning, in the RaceManager script you can find the Respawn function/method. There, you'll find:

    Code (CSharp):
    1. ChangeLayer(racer, "Default");
    Just replace Default with the layer you want your vehicle on.

    Code (CSharp):
    1. ChangeLayer(racer, "YourLayerHere");
    Not sure if that will switch every racer to a new layer though.
     
    Ian094 and toto2003 like this.
  36. toto2003

    toto2003

    Joined:
    Sep 22, 2010
    Posts:
    528
    oh i see, thanks dude, that fix my issue! :)
     
    Ian094 and Atzig like this.
  37. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    Sorry for not getting back to you sooner. My PC decided to stop working so I had to spend the last 2 days trying to fix it. Windows 10 can be such a pain to work with sometimes...

    I'm glad you managed to resolve the issue though.

    Thanks.
     
    toto2003 likes this.
  38. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
  39. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    That camera looks really cool. It looks like he posted the code with references to his own project because I get errors when I try to import to Unity.

    At the very bottom of the ChaseCamera() function, add the following (copied from the link):
    Code (CSharp):
    1. RaycastHit wallHit = new RaycastHit();
    2. if(Physics.Linecast(target.position, transform.position, out wallHit))
    3. {
    4.     transform.position = new Vector3(wallHit.point.x + wallHit.normal.x * 0.5f, wantedPosition.y, wallHit.point.z + wallHit.normal.z * 0.5f);
    5. }
    This should give similar results with the camera not clipping through walls.

    I'll look into this feature for the v2.0 camera system.

    Thanks.
     
    Max1982 likes this.
  40. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    Hi Intense_Gamer94,

    I tried to it but after that I have a lot of red errors in console

    PlayerCamera.cs



    Code (CSharp):
    1.  
    2.  
    3. //CHASE CAMERA
    4.  
    5. RaycastHit wallHit = new RaycastHit();
    6. if(Physics.Linecast(target.position, transform.position, out wallHit))
    7. {
    8.     transform.position = new Vector3(wallHit.point.x + wallHit.normal.x * 0.5f, wantedPosition.y, wallHit.point.z + wallHit.normal.z * 0.5f);
    9. }
    10.  
    11.         void ChaseCamera()
    12.         {
    13.             wantedHeight = target.position.y + height;
    14.             currentHeight = transform.position.y;
    15.             currentRotationAngle = transform.eulerAngles.y;
    16.             if (!lookLeft && !lookRight && !lookBack) wantedRotationAngle = target.eulerAngles.y;
    [/code]
     
  41. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Code (CSharp):
    1. void ChaseCamera()
    2. {
    3.     //...
    4.     RaycastHit wallHit = new RaycastHit();
    5.     if(Physics.Linecast(target.position, transform.position, out wallHit))
    6.     {
    7.         transform.position = new Vector3(wallHit.point.x + wallHit.normal.x * 0.5f, wantedPosition.y,wallHit.point.z + wallHit.normal.z * 0.5f);
    8.     }
    9. }
     
    Max1982 likes this.
  42. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    Works. Thank You!
     
  43. spirits-king

    spirits-king

    Joined:
    Apr 24, 2017
    Posts:
    2
    hi
    how ADDING RACE TRACKS??
    i cant find menu track in list.
     
  44. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    To add race tracks using the menu system, select the MenuManager gameObject and in the MenuTracks list add your new race tracks.

    menutracklist.png

    Ensure that the "scene name" matches the name of the corresponding race track scene and that you have added the scene to your project's build settings.

    Thanks.
     
    spirits-king likes this.
  45. spirits-king

    spirits-king

    Joined:
    Apr 24, 2017
    Posts:
    2
    hi
    What should I do after race I get my award
    to unlock new car and new track
    Sorry is not good Anglysm
     
  46. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    The Race Manager component has a "Race Rewards" section. Fill in your currency, track and car rewards for a finishing position here.

    racerewards.png

    The track and car strings must match the name of the corresponding car/track in your menu scene.

    Let me know if you have any issues with this.

    Thanks.
     
    spirits-king likes this.
  47. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    71
    Hey @Intense_Gamer94!

    I how are things going with V2?

    I'm curious what the changes to the AI will be. Would you mind sharing? I'd like to start working on a modification to the AI so that I can "record" information about the lap that it can try and replicate, particularly speed at different points of the track, so that it's easier to get a fast lap with it.

    But before I start working on that, i'd like to know if the V2 AI will be similar or very different to the V1 AI. I'd like to have the newest and best version before I modify it, so that it includes any possible optimizations or improvements.

    Cheers!
     
  48. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Hi,

    The AI has been one of the more difficult things to tackle in v2.0. I've tested lots of different navigation solutions to make the AI as smart and competitive as I can. A while ago I tried a NavMesh solution and the good thing about this is that obstacle avoidance is done internally and works like a charm but there were many downsides such as not following the racing line meaning the AI would be slow around corners therefore NavMesh wasn't good for racing games. I believe it would work for a few racing games but since RGSK targets the development of most racing games I opted not to use it.

    The AI navigation is based off the same idea as v1.x - chase the rabbit.

    The AI are constantly following a target that moves along the spline. The target will always be a certain distance ahead of the AI - this distance is based on the AI's speed. So on straights it will be further away and closer on corners.This helps the AI not to cut corners or crash when going around a corner. The target is independent from anything else unlike v1.x.

    The AI will be VERY different from v1.x. Each node on the spline will have a target speed variable and a left/right width to define how wide the AI can go when trying to overtake or choosing a different line. This helps when it comes to overtaking other vehicles because it will know it's bounds and choose the best way around the vehicle/obstacle.

    Here's how the spline will look in v2.0 (WIP):

    splineWIP_.png

    The target speed of a node is the speed the AI will try to reach. This eliminates the use of brake-zone triggers because you can simply set a low target speed on nodes that are located around corners. I'm currently working on an option to auto generate the node speeds. The track width on each node is something that users will have to do themselves because I can't figure out a way to automate this.

    A feature that was requested in v1.x was that the AI would stop somewhere on the side of the track at the end of a race if "Continue After Race" is set to false in the Race Manager. The AI can now do this.

    The AI still need some work and I'm working to get them done as well as other aspects of v2.0 as soon as I can.

    Thanks.
     
    derkoi, antoripa, Mayureshete and 2 others like this.
  49. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    71
    Hey @Intense_Gamer94, thank you for the detailed reply!

    It sounds very very good so far, it has more than I was imaging. I really like the left-right width feature, as well as the target speed. It is exactly what i believe was missing to make it truly competitive.

    When I get my hands on it, i'd like to try and implement a way to record the target speeds using a lap of my own. That would make it very easy to create a competitive lap I think.

    I also like that the target object is now independent. Is it controlled by the AI script itself? I really like the approach of creating isolated components as much as possible, I think its great.

    Do you have a time estimate, or is it hard to say at the moment?

    Thank you for your work! I'm looking forward to V2.
     
  50. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    The target is self controlled. It keeps itself some distance away from the AI based on the AI vehicle's speed. The min and max distances of the target can be changed within the AI Target component.

    Nice idea! This would definitely be the best way to get the fastest target speeds for the AI.

    It's hard to say to say at the moment but I will be sure to post any updates here. v2.0 has gone through some phases where it was close to a beta release but then I opted out of it because I wasn't entirely happy with the state of it. I'm continually working towards making the workflow, optimization and reliability better.

    I'm also really looking forward to releasing v2.0.

    Thanks.