Search Unity

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

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

  1. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    Hi @Intense_Gamer94
    followed tutorial, read intructions and my first track is live ...
    Only one open points. Starting point is not on flat road .. but I have stepness... sometime a car goes ( player or AI ) go back until not started ... how can avoid that ?
     
  2. Ian094

    Ian094

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

    I'm assuming that you are using the default vehicle physics so you could tweak the code a bit so that the handbrake input is 1 if the race hasn't started.

    By adding the following code in the Car_Controller Update(), your cars should stop sliding down the slope
    Code (CSharp):
    1. if(!controllable)
    2. {
    3.     handbrakeInput = 1;
    4.     Brake();
    5. }
     
    antoripa likes this.
  3. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    It's cool .. it works .... thanks a lot .. I am gonna send a PM with one question ....
     
  4. Max1982

    Max1982

    Joined:
    Oct 16, 2014
    Posts:
    133
    Hello @Intense_Gamer94,

    it is possible that we will see v.2.0 before 01.01.2017? ;)
     
  5. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    haha I highly doubt it but you should see it sometime in January.
     
  6. Mayureshete

    Mayureshete

    Joined:
    Jan 18, 2014
    Posts:
    198
    I wish there was a beta release ;)
     
  7. user099

    user099

    Joined:
    May 29, 2015
    Posts:
    25
    Hi,
    today i would like to show you my new game based on racing game starter kit. if you like you can give it a try.

    play store link:

    Car Drift Racing
    thanks ian
     
    Last edited: Dec 19, 2016
    Ian094, Mayureshete and antoripa like this.
  8. antoripa

    antoripa

    Joined:
    Oct 19, 2015
    Posts:
    1,163
    One question .. is there any option to get manual shift for the gear ?
     
  9. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    The default vehicle physics doesn't include gear shifting.

    This is different in v2.0 vehicle physics - Gear shifting and many other features such as rev limiter, driving assists, backfire etc will be included.
     
    Mayureshete and antoripa like this.
  10. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    How customizable is the AI? I am writing a game that has vehicles that can collect powerups, including weapons for launching attacks at opposing vehicles. I also want the AI vehicles to be capable of ramming opposing cars if they get too close. Is it possible to add things like this without ripping the system apart?

    [EDIT] I played the web demo and see that it already has some of the things I was hoping for. I went ahead and made the purchase. I'll be using it with Edy's Vehicle Physics so I'm hoping that all integrates easily.
     
    Last edited: Dec 29, 2016
  11. Ian094

    Ian094

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

    The AI is fairly customizable - behaviors such as steering, avoiding and wandering can be set.

    The features you mention go beyond the scope of the current version of the kit so you would definitely need to make quite a lot of changes to achieve this kind of AI. All the AI logic is handled in one script so you wouldn't rip the system apart by adding these things.

    You may have seen that this kit is currently being re-written. The re-write will definitely be a better place to start with writing your game.

    Thanks.
     
  12. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    No, I didn't see that, but I'll have to make do with what it has right now because the timeline for this game's development is very short.
     
  13. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Ok, contact me if you have any questions.

    Thanks.
     
  14. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I'm having an issue. I'm modifying the demo car race scene to use Edy's Vehicle Physics, but I can't get a different car to spawn for the player. I select the Race Manager component and change the Player Prefab to point to a different car, but it always spawns the Sportscar_1 prefab no matter what I put in that field. Any ideas why this isn't working?
     
  15. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    The DataLoader component must be overwriting the Player Prefab on Start.

    Uncheck "LoadRacePreferences" from the RaceManager or clear the player prefs data by going to Window/RacingGameStarterKit/Utility/Reset Player Data
     
  16. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Thanks. That worked great. I'm back in business.
     
  17. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I'm having a new issue. I have a large mountain track where there is a guard rail along one side of the track for the entire way. There is a mesh collider for both sides of the track that is super tall. See green lines in image below.
    upload_2016-12-29_12-3-38.png

    However, this collider barely, if ever, stops the car from running off the cliff. They seem to bump it a little, but then very quickly just plummet off the cliff. How can I make sure that a car can never cross the collider?

    Here is a video.



    [EDIT]
    It seems if I put cube colliders along the rails then it works fine so maybe just something to do with mesh colliders and the physics system. If there is no other solution I can add invisible cube colldiers everywhere, but that'll definitely be a long and tedious process.

    [EDIT 2]
    Actually, I found that if I put the actual mesh colliders on the railings then that helps a lot. It takes quite a bit more to go over the cliff and that's fine because I want them to be able to do that.
     
    Last edited: Dec 29, 2016
  18. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    I think this could have something to do with the layer collision matrix. I suppose the layer that your vehicle is set to doesn't register collisions with the layer your collision mesh is set to ("Default").

    https://docs.unity3d.com/Manual/LayerBasedCollision.html

    Additionally, make sure that your track ( it's collision meshes ) are set to "Ground" layer.
     
  19. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    No, that wasn't it. The invisible walls are set to default and so are the cars and the collision matrix has default/Default collisions on. In addition, the ground colliders are set to Ground. I think I found a decent solution by putting the mesh colliders back on the rails themselves.
     
  20. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Ok, If your solution works then that's great.

    Just a thought, it could have something to do with the "Default Contact Offset" in your project's physics settings.
     
  21. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Ahhh, good thought. I'll look at that as well.

    Great job on this kit, btw. I love every bit of it so far. Integration with Edy's Vehicle Physics is a snap.
     
    JamesArndt and Ian094 like this.
  22. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Thanks.

    I've been hard at work on v2.0, looking forward to its release.
     
  23. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Another strange issue. I'm developing on the Wii U so my controller is not the same configuration as an XBox so I made modifications to the various buttons. Even though the input works when playing in the editor, I can't get input working on the Wii U. The car won't move in response to any input. When I press various buttons and move the joysticks, I get debug messages saying it's switching back and forth between keyboard and controller input modes.

    Code (CSharp):
    1. Switched to Controller input
    2.  
    3. (Filename: C:/buildslave/unity/build/artifacts/generated/WiiU/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)
    4.  
    5. Switched to Keyboard input
    6.  
    7. (Filename: C:/buildslave/unity/build/artifacts/generated/WiiU/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)
    8.  
    9. Switched to Controller input
    10.  
    11. (Filename: C:/buildslave/unity/build/artifacts/generated/WiiU/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)
    I also don't quite understand the Xbox controller input assignments. Vertical Axis is set to LT and Horizontal Axis is set to RT. Is that supposed to be for acceleration and braking?

    I have the RGSK Input Manager in the scene and my player car is set up for Edy's vehicle Physics. The Vehicle Standard Input component on the player car is disabled.
     
  24. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    When using other vehicle physics, the input manager is ignored. So for Edy's vehicle physics, all player input will be handled by the VehicleStandardInput.cs script

    To tie the input manager with Edy's you'll need to reference the input manager in the VehicleStandardInput, for example :
    Code (CSharp):
    1. InputManager inputManager = InputManager.instance;
    2.  
    3. float steerInput = Mathf.Clamp(Input.GetAxis (inputManager.xboxControllerInput.horizontalAxis), -1.0f, 1.0f);
    "Vertical" axis is accelerate, "Negative Vertical" axis is brake/reverse, "Horizontal" axis is steer.

    I guess both keyboard & xbox controller inputs are being detected. Try setting the "InputDevice" to XboxController and set "AutoDetectInputDevice" to false.
     
  25. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    That's confusing because the documentation states the following:


    Setup EVP Player
    • With the vehicle selected in the hierarchy, go to Window/RacingGameStarterKit/VehicleConfiguration/External Vehicle Physics/Add Required Player Components
    • Disable the car’s VehicleStandardInput.cs component.
    But now your saying it should be enabled, but modified?

    [EDIT]
    I think I'm just going to use RGSK vehicle physics instead. I don't need the headache of trying to make an integration work. I'm actually thinking your physics are better suited to the style of game I'm doing anyway.
     
    Last edited: Dec 30, 2016
  26. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Disabling the VehicleStandardInput script ensures that the player can't control the car once it gets spawned. The RaceManager enables the script once the race starts in the StartRace() function.
     
  27. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Sorry for all the issues, but now I have a new one. I am now just using the sportscar_1 prefab for the player and the InputManager. With this setup, when I press RT the car goes forward as expected. When I press LT the car slows down and then starts going backwards. However, even when I let go of LT, the car just keeps flying backwards. And no button pressing can get it out of this situation.

    [EDIT]
    Actually, the same thing is happening for RT. Once I've pressed RT, it just keeps accelerating and never stops. But if I press LT then it gets stuck in reverse and can't be unstuck.
     
    Last edited: Dec 30, 2016
  28. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    I think this probably is related to the Wii U input axes. Please try to revert the Input config by extracting the Assets\RacingGameStarterKit\Other\ProjectSettings.zip to your project settings folder.

    When this happens, are the Car_Controller input values stuck?
    Untitled.png
     
  29. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I can't revert the Input Settings because they have been custom edited to work with the Wii U. Although I did start with the provided settings and modified from there.

    I'll have to put some debug in to check for this. I'll let you know when I find out anything.
     
  30. Ian094

    Ian094

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

    It's quite strange because I haven't had this happen before. I just tried reproducing the issue but no luck.

    What version of Unity are you using?

    v1.1.0a hasn't been tested on 5.5
     
  31. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I know. This is very bizarre. I've never had input problems with Wii U before. I always simply change the mappings to the correct ones for Wii U and all is good. But not this time.

    5.4.2f2
     
  32. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Yeah, please let me know if you find anything.

    Thanks.
     
  33. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I think I know what the problem is. I haven't tried it yet, but I see that LT and RT for Xbox are fetched with getAxis, but on Wii U they are just buttons. So I'll see if that makes a difference.

    [EDIT]
    Yep, that was it. I changed PlayerControl.cs to use GetButton instead of GetAxis for acceleration and braking and now it works.
     
    Last edited: Dec 30, 2016
  34. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Awesome, glad to hear that.
     
  35. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I have a question regarding paths. Some race tracks have shortcuts and alternate routes. Is there a way to handle this with RGSK so that an AI car might take a shortcut or follow an alternate path?
     
  36. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Unfortunately, this isn't possible.

    This is something that's been mentioned here before and I think it would be a cool addition. Split paths will be integrated sometime down the line.
     
  37. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,260
    Hi, I'm using your kit with UnityCar 2.2 and the ghost car does not change layer when spawned so i can crash in to it.

    I've looked at your scripts and i can't find anything out of place. Any ideas?
     
  38. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I tried to test Time Trial on my own race course and when the level loads it complains that there is nothing assigned to Race Manager.timeTrialStartPoint. So, I looked at the Race Manager in the inspector and that field is not there. I checked the editor script and it doesn't include it. I went in there and added it myself. Once I did that then I could assign the starting point transform and get the time trial to begin.

    Now, I'm struggling with just how time trial is supposed to work. Where should I place the starting point? In the demo scene it's some distance behind the starting grid, but I just don't understand what the philosophy is behind that. Anyway, I did a similar thing and what happens is that the car starts off driving itself for about 50 yards and then it transfers control to the player. At that point it starts the clock. But the first lap doesn't count. Only after going a second lap do I then get the ghost car to race against on the third lap.

    Btw, I also see a collision issue with the ghost car as derkoi reported. For me it doesn't cause crashing, but when I hit the ghost car, the wheels pop up.
     
  39. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Unitycar2.2 by default has lots of car layers, "Car1", "Car2", "Car3" etc. This makes things complicated when it comes to switching layers. You can narrow these layers down to only 1 vehicle layer that all your vehicles share and disable collisions between this layer and the "IgnoreCollision" layer. Another option is to simply uncheck all the "Car" layers with "IgnoreCollision" layer as follows :
    uc2.2layers.png


    The goal of the time trial race type is mainly to set the best possible track time. The start point should be placed behind the finish line so that the car can get a speedy start.

    The ghost should always instantiate after the lap. Please try adding a Debug.Log in the Statistics.cs in the GhostVehicleLogic() function under the "if(firstLap)" statement. I just tried reproducing this issue with no luck (again) on my end. You said before that you went back to using the default physics? Perhaps try re-importing the package.

    Let me know how it goes.

    Thanks.
     
  40. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I understand the goal of time trial. I just didn't understand the reasoning behind putting the start point behind the cars before the finish line. I might be wrong on the ghost car not on second lap so I'll double check that.

    What about the issue where I had to add the time trial start point to the race manager editor script?

    As far as physics, I ended up solving all my EVP issues and am now using that exclusively.
     
  41. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Yeah, I checked on that right away, but it was already an option. I'm honestly not sure what could have caused it to disappear like magic.

    timetrail.png
     
  42. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Maybe I just didn't see it, but I looked at the inspector from top to bottom a dozen times and didn't see it there. I'll look again. Sometimes something is staring me right in the face and I miss it.

    [EDIT]
    OK, I see what happened. If you don't select Time Trial race type then you don't get the inspector field for start point. I remember trying that actually, but somehow I missed seeing it still.
     
    Last edited: Jan 6, 2017
  43. mentolatux

    mentolatux

    Joined:
    Nov 2, 2014
    Posts:
    240
    its any chance to add multiplayer to this great game ?
     
  44. Ian094

    Ian094

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

    Yes, multiplayer will be added to this kit sometime in future.

    This asset is currently being re-written. Multiplayer support has always been something I've been considering while re-writing the racing system.

    Multiplayer may not be supported in next version (v2.0). However, I do plan on creating a Multiplayer Add-on for this kit.
     
    Mayureshete likes this.
  45. mentolatux

    mentolatux

    Joined:
    Nov 2, 2014
    Posts:
    240
    i will wait to add multiplayer Photon than i will buy , Thanks
     
  46. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Does anyone know if anyone has made an integration with EasyRoads3D? Basically, I would like to be able to slap down an easy roads track and then have some tool to automatically create the RGSK path around that track. Then even if I need to tweak some of the positions at least I don't have to go around the whole track click by click to get the initial path.
     
  47. Mayureshete

    Mayureshete

    Joined:
    Jan 18, 2014
    Posts:
    198
    easyrods3D has its own path creator ...
     
  48. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    But how does that work with RGSK? Can it be converted to RGSK or used by RGSK?
     
  49. Mayureshete

    Mayureshete

    Joined:
    Jan 18, 2014
    Posts:
    198
    ok i did some R&D here it goes, hope i make points clear il assume u know how to auto create waypoint in easyroads.

    1. create waypoints in easyroads
    2. duplicate the road object containing the waypoint and separate it from the road object.
    3. now create path with racing game starter kit.
    4. drag all waypoints from easy roads waypoint into racing game Path game object and its done.
    from what i tried at my end it automatically renamed it... hope it helps

    Edit: you might not even want to duplicate road object, just drag all waypoints in path game object..
     
  50. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Thanks very much for researching this for me. It is much appreciated. That's kind of how I thought it might work or at least I was hoping it might work that way. I'm happy to hear that it can.