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

► Racing Game Template ◄

Discussion in 'Assets and Asset Store' started by Stephen_O, Sep 9, 2015.

  1. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Notice:

    Arcade Racer: Racing Game Development Kit is being submitted for review; once it's accepted the Racing Game Template will be deprecated and removed from the store.

    -

    I know there were a lot of people asking about the beta, well, it's here.. come and try it, provide some feedback and let me know what you're thinking about using it to make!

    Arcade Racer Discussion Forum: https://forum.unity.com/threads/arcade-racer-racing-game-development-kit.380924/


    --
    --
    --


    Racing Game Template
    is a powerful framework that has everything you need to start building a racing or driving game. Add new car models to the car prefabs provided, add your own race tracks and environments then layout the waypoints along the track for the AI and player to follow. Framework is based on core Unity components including: uGUI, Unity Networking, Scriptable Objects, Customized Inspectors, and PlayerPrefs to save data. New features and optimization updates are still being made.
    Key Features:
    • No programming required to start, written in C# with full source code provided
    • Project editor window to quickly manage project settings, prefabs and variables.
    • Unity Interface (uGUI)
    • Unity Networking (uNET) multiplayer ready prefabs
    • Unity Rewarded Video Ads (Mobile)
    • Mobile ready controller with tilt, UI buttons or UI joystick for mobile steering.
    • Inverse Kinematics animated driver responds to player input
    • AI opponent drivers use an advanced sensor rig for detecting other drivers or obstacles.
    • Open world scene ready for programmers and developers to create unique game design concepts.
    • Vehicle material customization & performance upgrades
    • Advanced way-point system for player arrow way-pointer, AI path finding, & racer position tracking
    • Race lap & position tracking, time system and wrong-way detection
    • Adjustable race laps & number of opponents system
    • Options, pause and garage menu systems
    • Currency & reward system, unlock races through purchase or progression
    • Mini-Map
    • Rear and side view mirrors
    Unity Networking (UNet) Features:
    • Unity Multiplayer Services
    • Tested on Windows, Android
    • Lobby system
    • Create or join games
    • Custom match name and size
    • Open world scene selection
    • Full car controller prefab synchronization
    • Networked IK driver procedural animation
    • Multiplayer race modes coming soon...
    Racing Game Template now includes an Edy's Vehicle Physics integration package that will prepare the scripts, prefabs and scenes to use the EVP car controller and camera as an alternative to the included car and camera controller. NOTE: EVP Multiplayer is being finalized and will be released soon.
     
    Last edited: Nov 17, 2019
  2. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.02 released.


    New custom editor layout coming in 1.03, preview below.
    The system is also being configured to use scriptable objects to make accessing and editing data easier.
     
    Last edited: Feb 23, 2016
  3. wilxr

    wilxr

    Joined:
    Jul 29, 2013
    Posts:
    16
    Hello, I found a small bug you reach the last waypoint of the race. The race does not end and does not unlock the next level.
     

    Attached Files:

    • img.png
      img.png
      File size:
      103.6 KB
      Views:
      2,322
  4. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Hi wilxr, thanks for pointing this one out to me; I missed assigning a scriptable object to the race scenes after reconfiguring the new editor layout. You'll need to assign the Race Data scriptable objects to the Race Scene Manager in each of the race scenes. Just turn on debug Mode for the inspector to assign the scriptable object.

    Also I noticed I did not follow my own naming system for the race scenes with this update, they should be named as follows.

    Version 1.03a has been submitted. These fixes will be included in update 1.03b
     

    Attached Files:

    Last edited: Oct 15, 2016
  5. wilxr

    wilxr

    Joined:
    Jul 29, 2013
    Posts:
    16
    Everything works great. Thanks for the quick reply
     
  6. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.03a is now available and additional videos covering scriptable object use and mobile settings are now posted in this forum thread
     
  7. JohnDraisey

    JohnDraisey

    Joined:
    Jul 28, 2013
    Posts:
    19
    Hello, does your template allow for drifting?
     
  8. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Hi, by adjusting the Sideways Friction values on the rear wheels you can achieve some drifting effects. The cars used in this template are the same as the standard assets car, and there are many options to configure for different vehicle drive types.
     
    Last edited: Apr 8, 2016
  9. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    71
    Hello,

    My Name is Alberto. I am currently developing a racing game in unity and I got very interested in the AI from your Racing Game Template.

    I would like to know if it's possible to adapt your AI system to my own car physics. These physics are not based on wheel colliders, I use raycasts and forces to drive them.

    I use just 4 inputs for the whole control of the car, regardless of the controller being used (keyboard or gamepad). It accelerates, steers and brakes.

    Please let me know how likely it is that an adaptation can be done. If you need more information about how I made my physics in order to give me an answer, just let me know and I'll do my best to explain what you need to know.

    Cheers,

    Alberto Mastretta
     
  10. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Hello Alberto, this should let you know a bit more about the AI.

    This is an older video I made (not from this project) but it demonstrates the functionality of the AI I'm using. This is from the older sample assets in 4.6, I used the updated standard assets AI vehicle which you can download from the store and try to see how the implementation process would go. So if you can swap the AI vehicle in Standard Assets with your own then it should work fine for you.
     
    Last edited: Jan 15, 2019
  11. wilxr

    wilxr

    Joined:
    Jul 29, 2013
    Posts:
    16
    Hello,
    Any chance for the following?
    -more race type like Lap Knockout, sprint, checkpoint
    -replay of the race that has just finished
    -improve speed, acceleration, handling in garage
    Thanks!
     
    Stephen_O likes this.
  12. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Hi

    I've been working on designing a cleaner UI for the garage scene and making room for player upgrades, which is almost ready. I also have been tweaking the car controller settings to make the player cars feel more fun-to-drive, and bringing it to a point where it's easy to map some performance upgrade values to the garage scene, then back to the player cars. So car upgrades will be the next update I add.

    After I finish car upgrades I'll move to start working on adding more race types and challenges.

    I will look into this, I can't say yes or no yet. I'm not sure how much work this involves or if more desirable features will have priority. If I add a feature like this it will be sometime down the line.
     
  13. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.04 is now available.

    Version 1.04a will be submitted today with a Nitro feature added to the car controller.
     
    Last edited: Feb 23, 2016
  14. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Working on version 1.04b, I'm adding player car upgrade options. Each car can have 10 upgrades in each category, the price for each type of upgrade can be different and the values for these upgrades will be unique for each car and configured on the car controller.
     
    Last edited: Feb 23, 2016
  15. RTSlang

    RTSlang

    Joined:
    May 3, 2013
    Posts:
    58
    When I start the scenes it appears only Mobile controls are available. How can I switch this to Keyboard or Joystick?
     
  16. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    You can enable/disable mobile controls from the "Window/RGT Settings/Input" menu.
     
    Last edited: Oct 15, 2016
    RTSlang likes this.
  17. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.04a is now available.

    Version 1.04b will be submitted today.
     
  18. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.04b now available.
     
  19. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    I've been working on version 1.05 and have started testing with Unity 5.3 WebGL builds. The demo performance on WebGL has improved greatly. The new version should be available in about a week.
     
    Last edited: Feb 5, 2016
  20. cl9-2

    cl9-2

    Joined:
    May 31, 2013
    Posts:
    417
    Hello,

    I tried the WebGL demo, which works quite nicely, although the AI cars swerve quite a bit more than I was expecting. Is there a way to reduce the amount of swerving by the AI cars?
     
  21. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Hi,

    There are a lot of options for customizing the AI cars, but honestly I have just not taken the time to focus on configuring them properly or expanding on their features.. This is the new demo for 1.05 that I'm preparing to submit and it's about ready. Before I do I will adjust AI to not swerve, you can check the demo later I'll keep it updated.

    If you bought and wanted this version now just email me with invoice number.
     
    cl9-2 likes this.
  22. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    A new demo is up with tighter AI, it can still be tweaked to perform better or in different ways. In one of the next updates I'll focus a nice amount of time on AI.
     
    Last edited: Dec 14, 2015
  23. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Final changes have been made and 1.05 has been submitted. WebGL demo has been updated to reflect submission.
     
    Last edited: Dec 21, 2015
  24. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.05 is now available.
     
  25. wilxr

    wilxr

    Joined:
    Jul 29, 2013
    Posts:
    16
    Good job with the ui, I like it so much, keep it up !!!
     
    Stephen_O likes this.
  26. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Networking progress update, the lobby is coming along nicely.​
     
    Last edited: Jan 15, 2019
  27. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    3 days ago I decided to start on a new racing game using the racing game template I'm working on. This will help me to improve the overall quality, feature set and usability of the template by allowing me to test and improve various features, as well as test the upcoming UNet features I've been working on.

    I've started a dev log as I go through this process, my hope is that it helps to inspire newer developers as well as provide some more insight into what I'm working on. Here's my first log entry.
     
    Last edited: Nov 17, 2019
    Alex_V likes this.
  28. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Dev Log #2 - After about 2 days working on the car controller I have made some progress in bringing it more to life. I've made the primary camera more dynamic, added a basic interior helmet camera, improved car sound FX, and adjusted car controller to be more drift-able.
     
    Last edited: Jan 15, 2019
  29. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Dev Log #3 - I've put in some work on the interior view of the car controller to add rotation to the steering wheel and configured some IK targets for the driver's hands. A rear-view mirror has also been added.
     
    Last edited: Jan 15, 2019
  30. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Dev Log #4 -

    I've added more IK targets to the car controller for the driver avatar. The targets I have on the controller are now as follows:
    -Look target(changes dynamically as the player drives)
    -Steering wheel targets for left and right hands
    -Gear shift target for right hand
    -Feet targets(still need logic)
    These settings allow the car to look pretty good from both an interior view as well as an outside view. I'll work more on cleaning them up over time, but for now I feel most IK functionality can be considered good enough to move on to another area.
     
    Last edited: Jan 15, 2019
  31. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Dev Log #5 - IK Driver Testing.
    Just a recording of some testing I'm doing before I finalize the IK configurations. I want to smooth out the right hand shift and add more steering wheel IK hand targets, currently there are only 4.

    The hands and feet are switching targets dynamically based on car controller input the following IK targets are configured:
    -steering wheel(4 will add 4-8 more)
    -left foot clutch
    -left foot idle
    -right foot brake
    -right foot gas
    -right foot idle
    -right hand shifter

    This IK Driver is almost done, he will be added to the racing game template when he's finished.
     
    Last edited: Jan 15, 2019
  32. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Last edited: Oct 15, 2016
  33. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    IK Driver is ready and is being added to the racing game template to be submitted today. I've prepared some demos for Android and WebGL, links are below.

    A complete car controller and procedural IK Driver with 15 configurable IK hand, feet and look targets. The Ik Driver is powered by reading the horizontal/vertical input axis values used to power the car controller and complimenting it by applying the appropriate procedural IK animations for looking, steering, shifting, brake, gas and clutch pedal animations.

    WebGL Demo: http://www.turnthegameon.com/#!ik-driver-demo/mk29s
    Android Demo: https://play.google.com/store/apps/details?id=com.TurnTheGameOn.IKDriver
     
    Last edited: Jan 15, 2019
  34. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    I'm changing the car model included in this template from standard assets vehicle to a model that includes an interior so I can properly configure the IK driver for the racing template.
     

    Attached Files:

    Last edited: Oct 15, 2016
  35. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    I fell behind and will need another day or so to finish before I submit.. I decided to add some additional features to go with the new car model as well as improve the UI layout a bit. The new update will allow for customizing the car in the garage scene. Players will be able to set rim color, brake color and glass color/tint.. as long as your cars have the appropriate materials configured for each car part.
     

    Attached Files:

    Last edited: Oct 15, 2016
  36. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    version 1.051 has been submitted.
    -Created new demo video
    -Added IK Driver
    -Replaced standard assets car model with a new model that has an interior and additional materials for visual customization in garage.
    -Added rear-view mirror
    -Added helmet cam, interior car view
    -Added camera switch button
    -Added rim color customization
    -Added brake color customization
    -Added glass tint and color customization
    -Improved brake light script, material now turns white when going in reverse
    -Improved demo scene lighting
     
    Last edited: Apr 8, 2016
  37. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.051 is now available, try the IK Driver today!
     
  38. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Working with the Unity Motors Race Track and testing the car controller, this track will be worked on a bit and replace the current circuit hills race track. My hope is to wrap this up and then go back to do finishing touches on lobby system and add an open world scene to the template as the first multiplayer gameplay option.
     
    Last edited: Jan 15, 2019
  39. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Added the new car controller to a race scene to test the helmet camera in a race for the first time.
     
    Last edited: Jan 15, 2019
  40. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Hi is there anywhere that tells you what settings to add to your project for this? I want to import this but not wipe out my existing settings, so I guess I need to avoid importing your settings.
     
  41. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Hi,

    When importing a complete project you can uncheck the project settings you don't want to be imported.

    You can also import the asset into an empty project, which I would always recommend if you're unsure, as well as make a backup. Then right click to export the contents of the assets folder as an asset, this will not take project settings. You can then import that asset into your project as well.
     

    Attached Files:

    Last edited: Oct 15, 2016
  42. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Ah ok, and things will still work? I assumed something must be needed from them like the tags and layers etc?

    Also what settings would I adjust to make the car more and less responsive to my key presses? It's a lot of settings would be great if it shipped with quite a few different handling preferences.
     
  43. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    The only tags used so far are for the collider object on the car prefabs. I've used layers only for culling on some cameras, there's not much use of these either. You should not have any problems after configuring the tags.

    Thanks for feedback on this area, I do plan on creating different prefabs for vehicle types so it will be easier to find a starting point when configuring the physics for your game; I'll work on doing this after I get some more gameplay features added. Here's another screenshot, I've marked the most influential variables for quick adjustments.

    Rigidbody - Try lowering Mass and Drag to increase car speed.
    Car Controller - Max Steer Angle controls turning radius, Full Torque is engine power, Top speed can also be adjusted.
    Wheel Colliders - Take wheel mass into consideration, try lowering or raising these values to see the impact on physics. Forward and Sideways friction values can be used to create friction when the wheel is moving forward or sideways, this can be used to create unique effects as well. Here's some more info on wheel colliders http://docs.unity3d.com/Manual/class-WheelCollider.html
     

    Attached Files:

    Last edited: Oct 15, 2016
  44. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    1.052 has been submitted. New Android and WebGL demos are posted. Merging my UNet lobby framework into this project will be next update for 1.053 .
     
  45. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Thanks for the great answer, love this pack :)
     
    Stephen_O likes this.
  46. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I got it into my game (and added the player an AI layers) but I'm getting the following errors at runtime:

    NullReferenceException: Object reference not set to an instance of an object
    UnityStandardAssets.Utility.WaypointProgressTracker.Update () (at Assets/Sample Assets/Utility/WaypointProgressTracker.cs:98)

    NullReferenceException: Object reference not set to an instance of an object
    UnityStandardAssets.Utility.WaypointProgressTracker.OnDrawGizmos () (at Assets/Sample Assets/Utility/WaypointProgressTracker.cs:149)
    UnityEditor.DockArea:OnGUI()

    It looks like "circuit" should get assigned to the drivers at run time but doesnt. The cars sort of skid on the spot and mine rolls back. Any thoughts on what to do?

    edit: Just noticed my RG Scene Manager doesnt have the nice icon like the fresh install does. I think there was conflicts with the Waypoint stuff from other assets. It would be good really if you could rename your scripts so they dont conflict, as I assume you have made slight alterations. Not sure why but it seems to bring in 2 copies of WayPointCircuit and WayPointProgressTracker, then even when I delete it still has the issues. Will keep trying.

    Upon a fresh import it all seems to start with:
    Assets/TurnTheGameOn/Racing Game Template/Scripts/Editor/Editor_RG_SceneManager.cs(170,40): error CS0433: The imported type `UnityStandardAssets.Utility.WaypointCircuit' is defined multiple times

    I also see this error when I click on Race Scene Manager:
    MissingReferenceException: The object of type 'WaypointCircuit' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    Editor_RG_SceneManager.OnInspectorGUI () (at Assets/TurnTheGameOn/Racing Game Template/Scripts/Editor/Editor_RG_SceneManager.cs:21)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1231)
    UnityEditor.DockArea:OnGUI()
     
    Last edited: Feb 6, 2016
  47. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    There are some related scripts that have been customized from standard assets, I'll start to work to create unique versions of the scripts and move all the code to its own namespace in 1.053 to avoid future conflict. If you like, you can contact me by email and we can fix through skype screen sharing in a few minutes. One of the errors is coming from there being multiple "WaypointCircuit" and "WaypointProgressTracker" scripts, the other is coming from the editor script trying to read the original script.. the racing template is trying to use the customized script but it's not there or not compiling because of duplicate scripts. This might happen if you import standard assets after the racing template.

    These are the scripts used from standard assets, check your project for them and if not using delete these before importing. For now, if you import standard assets after racing template, try to avoid re-importing these scripts as they'll be overwritten and may cause errors.
     

    Attached Files:

    Last edited: Oct 15, 2016
    radiantboy likes this.
  48. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    So my main issue right now is that the 4 leading cars teleport back to the start of my race for no apparent reason. I can't seem to track down where this is happening in the code to work out why.
     
    Last edited: Feb 8, 2016
  49. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    AI cars have a script called RG_AIHelper to help keep the AI in check, this script will teleport an AI car to the target waypoint if they have not reached it in the specified time (check the "Reset After" variable, it's set to 45 seconds). Ai might miss a collider of a waypoint then hit the time limit to teleport to next waypoint so it can continue on the path properly.
     
  50. UnityGTAKing

    UnityGTAKing

    Joined:
    May 31, 2013
    Posts:
    4
    I have a huge issue, I have been developing my racing game and have run into a problem while testing where variables reset back to default and give null for car glow it's really making me angry considering I have come up with names and prices for all the cars. I turned off the update in editor mode part of script, I think it has something to do with system sterializable functionality in unity from what I have been reading.