Search Unity

  1. Click here to receive a gift with your purchase of Unity Pro or Unity Enterprise.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    71
    I had a simelar problem soo maybe: did you set your spawnpoints befor or after the first node of your track? they need to be befor the first node because otherwhise you will see at the race competitor after the race start a big negative value at track driven or something like this. this was the case i had.
     
    Ian094 likes this.
  2. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,527
    I'm not sure what you mean here. The competitors are always kept in memory:
    Code (CSharp):
    1. RaceManager.raceCompetitors
    This is a bug to do with the distance tracking, this bug will be fixed soon. We definitely wont be seeing this in the final release.
     
  3. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,527
    Yes, the Physics settings (i.e DynamicsManager.asset).

    This contains the Collision Layer Matrix which sets what layers can collide with others.
     
  4. Ian094

    Ian094

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

    Are you using v1.1.0a?

    If so, please ensure that the finish line tag is set to "Finish".
     
  5. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,527
     
  6. jaberwocky

    jaberwocky

    Joined:
    Nov 28, 2016
    Posts:
    102
    I was passed by two competitors and yet the ranking still showed me as #1. When those two passed the finish line before me, nothing happened. When I finished it said I had won when actually I was third.
     
  7. Coray_Designs

    Coray_Designs

    Joined:
    Jun 23, 2016
    Posts:
    7
    Thank you for the suggestion, however, I have all my spawn points before the finish line as you suggested and everything is tagged correctly the finish line is called FinishLine and is tagged under Finish as the instructions state. I am using version v1.1.0a to build my game.
     
  8. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,527
    Again, this is a distance tracking bug. One way this bug is triggered is when the vehicles spawn too close to the first node.

    Does this happen in every race or just sometimes?
     
  9. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,527
    In that case, it must not be registering that you have passed all the track nodes.

    Please open the Statistics.cs script and comment out the "[HideInInspector]" attribute above the "passedAllNodes" variable as follows:
    Code (CSharp):
    1. //[HideInInspector]
    2. public bool passedAllNodes;
    3.  
    When in play mode, select the player vehicle and watch the "passedAllNodes" checkbox to see if it ever becomes true.
     
  10. jaberwocky

    jaberwocky

    Joined:
    Nov 28, 2016
    Posts:
    102
    Just sometimes. Glad it is a known bug. Although I have not tried to build a track yet, so far I am really happy with the Beta.
     
  11. Coray_Designs

    Coray_Designs

    Joined:
    Jun 23, 2016
    Posts:
    7

    Thank you for the suggestion, tried it but did not work. I think I have solved it but it is a long process to fix. I looked at the cars that came with RGSK and they worked fine with crossing the finish line so I tried duplicating one of the cars, removing its body to leave the wheels and colliders and then adding my own car bodies on top and realigning the wheels, driver and cameras. This seems to work with creating the cars for crossing the finish line but it takes about an hour a car and I have 30 to do! thank you for your support, no doubt I may run into other problems. I will publish a link when I have published my game.
     
  12. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    71
    That did it, thanks ;)
     
    Ian094 likes this.
  13. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    @Intense_Gamer94 One thing I'd like to see changed for the final version is to decouple the AI from the race mechanics. Right now, the only way an AI car is going to work is by providing references to the various race components like RaceManager, having spawn points, etc. And they'll only start following the path once the race starts. While this is a race game and that all makes some sense, I'd like to be able to use AI cars for other types of car games such as a pursuit game where the player is a police car and he's chasing down speeding cars. I don't necessarily want a start/end race or car spawn points. I'd just like to plop an AI car in the scene, assign a path and tell the car to Go()!. Can you make that possible for the final version?
     
    Neviah likes this.
  14. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,527
    That seems very tedious.

    Is there any difference between your cars and the demo cars - like the tag, layer (including children), etc?
     
  15. Ian094

    Ian094

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

    I'm pretty sure this will be possible.

    I want separate the systems as much as possible so that none of them are strictly dependent on each other.

    I would like RGSK to target development of racing games and other types of driving games.
     
    AbhishekRaj, magique and Neviah like this.
  16. Track505

    Track505

    Joined:
    Dec 26, 2017
    Posts:
    7
    But how can I assign a driver name for the car? They are randomly distributed, right? Or did I miss something? ;)
     
  17. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,527
    Yes, they are randomly distributed.

    To assign a driver name for a car, select the car and fill in the competitor information in the RaceCompetitor component.

    Remove the "AI Competitors" reference from the Race Manager to ensure the name wont get overwritten when the cars spawn.
     
    Track505 likes this.
  18. Track505

    Track505

    Joined:
    Dec 26, 2017
    Posts:
    7
    Thanks!
     
  19. Emile97

    Emile97

    Joined:
    May 28, 2017
    Posts:
    105
    Hi, :)
    What about now? any big progress?
     
  20. Ian094

    Ian094

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

    I still haven't been able to make big progress hence why I haven't posted anything here. I've been working on a separate project since the start of the month leaving very little time for me to work on RGSK.

    The biggest improvement I've made is to the camera system - It's been completely reworked.

    In the beta, you only get "Follow", Interior" and "Mounted" cameras that are shared between perspectives. Now you have the option to set as many cameras for as many perspectives as you want. With this method you have a lot more power over what you can do with the vehicle cameras in your game, for example, you could create follow cameras at varied distances e.g follow near, follow far as seen in pretty much every racing game. Each camera will have it's own individual properties giving you alot more control over how each camera perspective behaves.

    By the end of the week I should be done with the project I've been working on and get back into developing RGSK full time.

    Thanks!
     
  21. Emile97

    Emile97

    Joined:
    May 28, 2017
    Posts:
    105
    oww that's really cool. i was even working at understanding cinemachine today + time line was about to create my own camera system lol .
    hope you finish soon
     
  22. mitis

    mitis

    Joined:
    May 21, 2013
    Posts:
    26
    All greetings can help I translate it into Russian but I can not find where it will be written in which place
    I will be happy if help thanks in advance Безымянный.png
     
  23. Ian094

    Ian094

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

    In the Race Panel you can configure how the position is displayed:

    PositionDisplayMode.png

    "Default" will display the position and the total competitors e.g 1/5

    "Position Only" will display only the position e.g 1

    "Ordinal" will display the position as an ordinal number e.g 1st

    I'm not sure if this what you mean but I hope it helps.
     
  24. mitis

    mitis

    Joined:
    May 21, 2013
    Posts:
    26
    Yes, I almost forgot here too
     

    Attached Files:

  25. mitis

    mitis

    Joined:
    May 21, 2013
    Posts:
    26
    Look, the rival finished 2 there is written
    (2ND) if 1 then I do not need this I want to make it to the example (Sabina Finished 1) and that's why I'm asking which script it's written so I can change
     

    Attached Files:

  26. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,527
    At the moment, it is hard coded to display competitor finish positions as ordinal numbers.

    To change this, open the RacePanel.cs script and under the ShowCompetitorFinishMessage() function (line 325), remove the part of code that makes the position ordinal:

    Code (CSharp):
    1. message +=  " " + Helper.Ordinal(competitor.position);
    Change it to:

    Code (CSharp):
    1. message +=  " " + competitor.position;

    To remove the position completely, you can uncheck "Add Position To Finish Message" under "Opponent Messages" in the RacePanel component.
     
    Last edited: Aug 3, 2018
  27. jaberwocky

    jaberwocky

    Joined:
    Nov 28, 2016
    Posts:
    102
    So, I was playing around and did a Android build just to see if I could show the game a bit to friends on my phone and I was actually surprised how well it worked. A bit slow on my cheap 2014 phone, but looks playable. I was wondering if anyone had minimum specs for Android anywhere?

    One problem I had was the throttle with the RGSK for mobile wasn't working for me in any of the various set-ups. Is there some setting I am missing? Steering worked as soon as I dropped it in. Brakes? This is a hovercraft, we don't need no stinkin' brakes! :)
     
    JamesArndt likes this.
  28. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,863
    Not sure on minimum specs but I do know Google just announced they require a minimum API of API 26 now for apps submitted to Google Play. So I would research what the most common device specs are that are running that minimum OS (I believe it's Oreo). I usually just look at whatever devices specs are the most widely used amongst consumers out there right now...i.e. CPU spec, screen resolution, RAM, etc. Here's a pretty decent chart I came across. Now you might have to cross compile what the average performance spec is across these top 25 devices or so and then the spec on those lower 25 devices (considering if you want to support lower spec devices).

    https://www.androidbenchmark.net/popular_chart.html

    In my karting project using V1 of RGSK I get 60fps, with hiccups here and there. I am not using any real-time lighting on the world, just the kart. I am using a lot of vertex color shaders that accept lightmaps. I am using a faked real-time shadow (just a texture on a plane that moves dependent on the distance from the "sun"). I'm not using the Standard shader in any way or real-time global illumination. I'm batching as much as I can by sharing materials and texture maps. I'm intentionally not using a lot of overlapping transparency. The one thing for RGSK that would hurt mobile framerate is the UI canvas setup with a deep nested hierarchy. I think the UI could definitely use optimization in regard to how it's nested and read from to be drawn.
     
    Last edited: Aug 4, 2018
    user099, Ian094 and jaberwocky like this.
  29. jaberwocky

    jaberwocky

    Joined:
    Nov 28, 2016
    Posts:
    102
    I am getting no where near 60fps on my Samsung s5 but I was happy to see it working at all and gave me hope that I would be able to optimize it to work on mobile. Until I tried it, I assumed that my game would not be able to go mobile at all. Thanks for the tips for optimization, James. I already took you advice and turned off shadows and realtime lighting, but I have been focusing mostly on getting the game to work and then will try to optimize it.

    As far as the mobile controls not working, my physics package uses Input.GetAxis and as I understand it, the RGSK mobile buttons are using Input.GetButton but it is very hard for me to follow the code. Any help would be appreciated.

    New game link: http://hoverhero.website
     
  30. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,863
    Yeah and the Android hardware I'm testing on is an S2! Very old hardware. I think the problem is here is Unity by default is now set up for higher end PC games. Just switching over to Android build target doesn't do nearly the optimizations to the editor and build settings you'd need for ideal performance. I remember a time when the engine was very balanced and worked fast between PC and mobile builds, but that's not the case today. I gave the webGL build a play and it was running about 22 fps on a high end PC. That tells you something is wrong and checking the profiler might be a good start. I could tell you are using real time global illumination too, the entire level is dark because the real time GI was not baked out for the scene (usually when you call Application.LoadLevel or whatever the new API is for that). You need to bake the GI and direct lighting to lightmaps and only light your moving objects with real time lighting or light probes. You should see a large improvement in performance from this. Subtractive baking mode for lightmaps is the most lightweight for mobile.

    I've implemented and converted custom vehicle physics input that use axis vs. buttons as well, so if you need guidance I can help with that. I would need to see code to help, so if that's an issue I understand.
     
    jaberwocky and Ian094 like this.
  31. Ian094

    Ian094

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

    Use the RGSK Input Manager to get input for your vehicle physics.

    Declare a reference:

    Code (CSharp):
    1. private IInputManager inputManager;
    Assign it in the Start function:

    Code (CSharp):
    1. inputManager = InputManager.instance;
    Now get all your inputs from it. For example, to get throttle & brake input:

    Code (CSharp):
    1. throttleInput = Mathf.Clamp01(inputManager.GetAxis(0, InputAction.Throttle));
    2. brakeInput = Mathf.Clamp01(inputManager.GetAxis(0, InputAction.Brake));
    Ensure that an Input Manager exists in the scene. You can create one via the Scene setup window (Window / Racing Game Starter Kit / Scene Setup).

    Let me know how it goes.

    RGSK 2.0 is not as optimized as it will be, so expect significantly better performance in the final release.
     
    jaberwocky likes this.
  32. jaberwocky

    jaberwocky

    Joined:
    Nov 28, 2016
    Posts:
    102
    Yeah! Throttle works now. Now I just have to figure out why the steering doesn't (only turns right).

    Edit: Figured it out! steerInput = Mathf.Clamp(inputManager.GetAxis(0, InputAction.Steer), -1.0f, 1.0f);
     
    Last edited: Aug 6, 2018
  33. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,056
    Hi, any more progress with this? :)
     
  34. Ian094

    Ian094

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

    Yeah, I've slowly been making progress.

    Over the past few weeks, I've mainly been reworking most of the systems to make things more performant and easier to use.

    The workflow is a key aspect that I've been working towards improving for quite some time now. I really want RGSK 2.0 to provide a good environment for creating racing/driving games by making everything clear and user friendly for developers (both beginner and experienced).

    I'll have a development update ready for everyone soon.

    Thanks!
     
  35. jaberwocky

    jaberwocky

    Joined:
    Nov 28, 2016
    Posts:
    102
    Just wanted to give feedback on my experience on configuring a track. For some reason for me, the button to navigate in the scene view of Unity would lock up when I was placing nodes. That was annoying. The placing of the nodes and the configuring of the track went otherwise surprisingly well My rack has variation in elevation, loops around on itself, goes under and over bridges and tunnels, yet RGSK automagically figured it all out, however it doesn't recognize the finish line that I placed and the AI is a bit slow. In general, everything works basically great, but tweaking is needed to get things working 100%.
     
    Ian094 likes this.
  36. Ian094

    Ian094

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

    Thanks for your feedback, its very much appreciated.

    I've gotten reports of the scene view lockup from another beta tester. I'm unable to reproduce this on my end but I know it has something to do with the way I set the hotControl. A quick fix for this is entering and exiting playmode.

    Talking about track configuration, I have been working on a new configuration method. The new method uses a beizer spline. This makes it much more accurate and much easier to define your track's layout.

    Whenever I was testing the current beta version, the thing that used to annoy me the most was the track configuration process. Not any more though ;)

    I have also been working on a checkpoint based race system so RGSK can also support open world racing games too. If you look at games like Forza Horizon, Need For Speed, The Crew, GTA and other open world racing games, you'll notice that they all use checkpoints to track race progress.

    On the flip side, games like Forza Motorsport, Gran Turismo, Grid, Assetto Corsa and other track-based racing games all use some kind of spline solution to track race progress.

    RGSK 2.0 will support both of these methods to push the limits of what kind of racing game can be developed using RGSK.

    Thanks!
     
  37. Emile97

    Emile97

    Joined:
    May 28, 2017
    Posts:
    105
    oww really interesting , does it mean that you also updated the Ai from what it used to be ?

    I think that we will get a full release somewhere around December:rolleyes: .
    Thanks for the good work
     
  38. Michealfame

    Michealfame

    Joined:
    Dec 11, 2017
    Posts:
    11
    can someone help me with this code error?? the camera

    Error CS0120 An object reference is required for the non-static field, method, or property 'Camera.depthTextureMode
     
  39. Emile97

    Emile97

    Joined:
    May 28, 2017
    Posts:
    105
    here and here or even here ; by reading these .. i think you'll be able to understand ?.... i hope so....
     
  40. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    71
    Is the distance tracking bug maybe fixed in the next update?
     
  41. Ian094

    Ian094

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

    Yes, the AI will receive an update. The AI's driving line wont be baked into the track layout anymore, it will be a separate component. This way you can define as many driving lines as you want, useful for when you would like the AI to take alternate routes.
    We'll see.

    Thanks.
     
  42. Ian094

    Ian094

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

    What script is causing the error and what Unity version are you using?
     
  43. Ian094

    Ian094

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

    Yeah, this bug has been fixed! :)
     
  44. jaberwocky

    jaberwocky

    Joined:
    Nov 28, 2016
    Posts:
    102
    This will probably be covered by your new updates, but just in case it isn't - I have one section of the track that crosses over a bridge that spans another section of track that comes up later in the race - that is, the track crosses itself. When I placed the nodes, it had no trouble dealing with this, but the AI tries to take a jump off the bridge every time. Maybe add some maximum Z setting for nodes? i,e if the next node that the AI sees is too far above or below, then the AI will ignore it and look for another node?
     
    Last edited: Sep 2, 2018
  45. Ian094

    Ian094

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

    What happens is that the AI look for the closest node pair to them and set their follow target accordingly. So when track sections overlap there's a possibility that the nodes below (or above) are closer than the ones ahead hence causing the issue.

    This issue has been fixed by looking for the closest point on track instead of the closest node pair.
     
  46. Treacle-Games

    Treacle-Games

    Joined:
    Aug 24, 2015
    Posts:
    23
    Hi
    Do we have a date for the next beta, it's been a while since the last one?
    Even better a full release date?

    Will you be releasing the add-on packs for multi-player and full menu at the same time as version 2?

    Regards
     
  47. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,835
    @Intense_Gamer94 When can we expect AI that is decoupled from race mechanics?
     
  48. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    71
    If the next release is still taking some time, ok no problem. But do you think you could post some lines i could copy/past to fix the distance tracking bug or is it more complex? thx ;)
     
  49. facundogalella

    facundogalella

    Joined:
    Mar 5, 2016
    Posts:
    57
    This could be great to begin to use this awesome asset in my game, waiting the final release of RGSK.
     
    Ian094 likes this.
  50. Ian094

    Ian094

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

    Given the amount of things I have to work on, I dont want to give an ETA. Over the course of developing RGSK 2.0, I've learnt it's best not to give release dates unless I am 100% certain.

    The add-on packs will be released after v2.0. The idea is to finish v2.0, release it, then work on the add-on packs.

    I'm really excited for the new Unity multiplayer features. RGSK 2.0 multiplayer will be powered by these new features.

    Thanks!
     
    Treacle-Games and AOEIII150 like this.
unityunity