Search Unity

Template Mobile Racing Game Template

Discussion in 'Tools In Progress' started by Stephen_O, Oct 16, 2020.

  1. Stephen_O

    Stephen_O

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

    I've been working on preparing a Mobile Ready Racing Game Template for the Unity Asset Store. This asset will be available as a standalone package, and will also be included with Arcade Racer: Racing Game Development Kit as a free upgrade.

    Asset Store

    This post will be updated as additional content and information becomes available.







    A ready-to-edit game template that can be used to create mobile racing or driving games. Includes ready-to-use mobile UI menus and car controller. Customize the included scenes, player/AI prefabs, and UI with your own art, then add your own additional content to make the game yours.

    The template contains multiple game-ready scenes and project settings to provide a complete game flow, including: Main Menu, Garage Menu, Open World, Race (can be used as a base to create additional races), Race Victory, and Race Defeat scenes.



    Included Template Scenes

    Main Menu: Allows the user to load Open World scene, select and load a Quick Race, select and load an Arcade/Championship Series of races, load Garage scene, access Options menu, or Quit the game.

    Garage Menu: Allows the user to select/customize cars from their garage, or purchase new cars. Customization options included: changing body paint color, neon light color, rim color, and window tint color.

    Open World: A free-roam scene with no rules; the perfect sandbox to start adding your own unique content, building a driving game, or use for whatever your imagination desires.

    Race: A template scene that can be customized and used for creating quick races, or races for arcade/championship series.

    Race Defeat & Victory: A template scene that can be customized and used for creating unique victory/defeat screens to be shown after each race.



    Player Key Features

    4 Steering Types: UI Buttons, UI Joystick, UI Steering Wheel, and Accelerometer Tilt; selectable via options menu.

    4 Camera Types: Chase, helmet, hood, and look back.

    Automatic/Manual Transmission: Selectable via options menu.

    UI Mini Map: Toggle on/off via options menu. Toggle fixed or rotate with player via options menu.

    UI Rear View Mirror: Toggle on/off via options menu.

    UI Dashboard Canvas: World-space canvas for interior view that renders gear text, speed text, mph/kph text, nitro bar, mini map, analog speedometer, analog tachometer (RPM).

    IK Avatar Driver: Procedurally animated based on input.

    Mirrors: Rearview, left sideview, and right sideview for interior view.
     
    Last edited: Nov 7, 2020
  2. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Updated original post with new content and tutorials, preparing for submission.
     
  3. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.0.0 has been submitted.
     
  4. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.0 is now available.
     
  5. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.0.1 submitted.

    • Added new garage camera controller, allows the camera to orbit the selected car via touch and drag.
     
    Rontr0n likes this.
  6. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.0.1 is now available.
     
  7. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.0.2 Submitted.

    • Improved pivot for various UI screen elements to provide more accurate auto scaling.
     
  8. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.0.3 submitted.

    • Added 'Auto Throttle' option to player prefab, and a button to toggle the option to player UI canvas.
     
  9. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.0.3 is now available.
     
  10. daniel6839

    daniel6839

    Joined:
    Dec 16, 2017
    Posts:
    14
    I want to add some ai in the OpenWorld scene. I don't need anything complicated, just a few cars that move around the scene. I see there is an option to create an AI Route( Tools/TurnTheGameOn/Mobile Racing Game Template/Create/AI Route) but I can't get it to work. Does this kit has the same traffic system the pc version has? If not, do I have another option to set this up?
     
  11. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    If you have Arcade Racer, you can use the traffic from that asset (that's where that menu item came from). In general though, I would recommend Simple Traffic System for mobile since it's more optimized.

    Edited*
    That menu item creates a single AI route, that can be built manually, as opposed to the spline route creator which automates waypoint creation. Waypoint routes can be connected to create branching points via assigning waypoints to a waypoint's OnReachWaypointSettings.NewRoutePoints array.
     
    Last edited: Jan 8, 2021
  12. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.0.4 submitted.

    • Converted _RaceTemplate scene's environment to a prefab, located in DemoAssets folder.
    • Renamed PlayerVehicleManager to PlayerCarManager
    • Moved DashboardCanvas from UI to CarComponents folder.
    • Implemented canCycle option on player cameras, used to filter out registered cameras from being cycled with the cycle camera button, an example is the look back camera.
    • Fixed missing SplineRouteCreator example references in QuickRace scene.
     
  13. daniel6839

    daniel6839

    Joined:
    Dec 16, 2017
    Posts:
    14
    I've followed this tutorial:


    and tried to set up a race in a duplicated _RaceTemplate scene. Everything worked fine until I've imported the Simple Traffic System into the project.

    Now if I follow the same steps, I get these errors when I try to create ai waypoint routes or spawn waypoints:

    Screenshot 2021-04-08 193938.png
     
    Last edited: Apr 8, 2021
    Stephen_O likes this.
  14. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Thank you for reporting this bug.

    For now, you can resolve it by editing MRGTRefs:
    Assets\TurnTheGameOn\MobileRacingGameTemplate\Scripts\Static\MRGTRefs.cs

    change line 14 from:
    Code (CSharp):
    1. var guids = AssetDatabase.FindAssets("t:AssetReferences");
    to:
    Code (CSharp):
    1. var guids = AssetDatabase.FindAssets("t:TurnTheGameOn.RGTM.AssetReferences");
     
    daniel6839 likes this.
  15. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.0.5 submitted.

    • Fixed a bug where skid trails would not render properly.
    • Fixed a bug where template prefabs spawned by editor functions would not load if Simple traffic System was also in the project.
     
    daniel6839 likes this.
  16. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Version 1.0.6 submitted.

    • Fixed a bug where loading into open world without entering the garage would always load the first car instead of the last selected car.
     
  17. jouany

    jouany

    Joined:
    Aug 4, 2018
    Posts:
    19
    Hello !
    Does the race system allow to have the start and arrival point at different places on a map (mission like game, with race from point A to point B, and not # laps based) ?
    Is it or will it be possible to have an introduction scene (like mission briefing) before the race as to complete decribed option to have victory/defeat scene for each race (kind of story mode) ?
    Thank you
     
  18. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    Hi, currently races only work with sequential waypoints.

    The race has a pre race countdown timer, you could set that to the length of your introduction and display it on a different camera, once done the cars will be ready to start the race, but I don't have a dedicated scene like the victory/defeat scene.
     
    serega19921425 likes this.
  19. daniel6839

    daniel6839

    Joined:
    Dec 16, 2017
    Posts:
    14
    Hi,
    I've created some AI routes for a race scene using the Spline Route Creator and added a speed limit to certain waypoints. But when the AI cars get to those waypoints, they don't seem to be slowing down, causing them to crash.
     
  20. daniel6839

    daniel6839

    Joined:
    Dec 16, 2017
    Posts:
    14
    Am I doing something wrong, or is this a bug? Can you give me an answer, please?
     
  21. adnanahmad914

    adnanahmad914

    Joined:
    Aug 21, 2021
    Posts:
    1
    How can we make the controls both for mobile and PC in unity?
     
  22. JasonT4

    JasonT4

    Joined:
    Nov 19, 2018
    Posts:
    16
    The steering wheel control doesn’t work right, and switching between steering types only works if you do it from the main menu, it doesn’t work from the options menu.
     
  23. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    In a fresh project, everything works fine if I test:
    input.gif input 2.gif
     
  24. JasonT4

    JasonT4

    Joined:
    Nov 19, 2018
    Posts:
    16
    Hi there,
    Thank you for your quick reply.
    Tested on a fresh project running on an iOS device: If I only press the steering button it works, but if I press the steering button while pressing the acceleration button it does not. The problem occurs if I switch between steering types from the Pause menu.
     
  25. george_bacanu

    george_bacanu

    Joined:
    Oct 24, 2017
    Posts:
    16
    Hello, I was wondering if there is possible to add a custom controller for the cars. The asset permits this kind of customization? Thanks
     
  26. Stephen_O

    Stephen_O

    Joined:
    Jun 8, 2013
    Posts:
    1,510
    The template scripts are meant to provide a basic mobile framework. There are references between the included car controller and other scripts in the template - if you want to change to a custom car controller, you’ll need to find all references, and hookup those references to the a different car controller.