Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

[RELEASED] Highroad Engine - Arcade Racing solution

Discussion in 'Assets and Asset Store' started by reuno, Jan 19, 2017.

  1. ostrich160

    ostrich160

    Joined:
    Feb 28, 2012
    Posts:
    679
    Hi Reuno, having a few more problems
    I'm trying to adapt my minimal scene (Demonstrator manager, Gravity Manager, Skidmarks Manager, the cameras and the solid controller car) to multiplayer, but Im having problems controlling it and the demonstrator manager is having trouble finding the car.
    I've added a network manager to the scene, as well as Network Vehicle Controller (and all its dependencies) to the scene.
    I've seen in the documentation something about a network lobby manager, but after trying it out I'd much rather stick with the default network manager. I dont use a lobby and would much rather script all the UI myself. I'm not using this asset as a race manager or anything like that, Im simply using it for the solid controller.

    Thanks in advance
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @ostrich160 > Does the problem happen in any of the demo scenes? If yes, where?
    And the documentation explains how to setup stuff. You can of course decide to deviate from it, but it's up to you then :) If you have a specific question I'll be happy to help, but I'm not sure what to do here.
     
  3. ostrich160

    ostrich160

    Joined:
    Feb 28, 2012
    Posts:
    679
    It doesnt happen in any of the demo scenes because there arent any non-racing/solid controller demos which have multiplayer. I'm essentially setting up a version of the Solid Playground scene with multiplayer.
    I have read through the documentation and as I said I've added the scripts to the player that the documentation lists (here: http://highroad-engine-docs.moremountains.com/vehicles.html), the only other pieces of documentation I can find relating to multiplayer are specifically about racing (or in the API, but I cant imagine I'd have to edit the scripts if Im just using the controller as a normal controller).
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @ostrich160 > Well I'll need more details if you want help on this. It's hard to guess what the problem is without any info. There are tons of things you could have setup wrong. And please use the support email for support questions, thanks!
     
  5. ostrich160

    ostrich160

    Joined:
    Feb 28, 2012
    Posts:
    679
    I dont really know what more details you need. Its just the Playground scene with the components added from the link I gave you (right at the bottom) to the car as well as a network manager (the default UNET one) and some spawn points. Its certainly not a problem with my UNET setup as I've transitioned all the parts over (other than of course the NetworkVehicleController) from a test I did earlier with just a basic character controller and it worked fine.
    As I said, the problem Im having is that I cannot control the vehicle and the cameras from the demonstrator manager cannot find the car with the components added.
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    The link you gave me just lists classes, not sure what to make of it. Again if you don't want to follow the documentation or change stuff that's fine, but I'm no magician and I can't guess what's in your scene, or why you're making these changes.
    And once again, please use the support email, thanks!
     
  7. ostrich160

    ostrich160

    Joined:
    Feb 28, 2012
    Posts:
    679
    I'll send an email now then
     
    reuno likes this.
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @ostrich160 > Thanks! And please try to explain exactly what you're trying to do. I've read your messages multiple times but it's not clear for me. Stuff like "Im just using the controller as a normal controller" doesn't make much sense to me, sorry. From what I gather you're trying to have multiplayer while getting rid of all the multiplayer classes, and expecting it to work. So yeah any more info you can give me will hopefully help!
     
  9. ostrich160

    ostrich160

    Joined:
    Feb 28, 2012
    Posts:
    679
    To put it simply, all I want to do is make the Playground scene (for the solid controller) multiplayer.
    To clarify on the 'using the controller as a normal controller', what I mean is that I want to use the Solid Controller script as essentially just a character controller. I dont want any racing or anything like that, I just want to use the Solid Controller as if it were any other way to control an objects movement.
     
  10. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    To all those out there that may have a similar question (how to setup network mode without using the Race related managers), here's the answer :

    Right now, the lobby and the network race manager are mandatory to setup the connections, initialize objects properly (input included), and setup all the prerequisites so that network play actually works.
    Without these, network won't magically happen. That's what they're here for. You can use the playground mode, included since v1.1, to test a car without having to setup a RaceManager.

    But what you want to do is definitely possible, but it'll require you to implement that network scene initialization. For example, the NetworkVehicleController disables controls at OnStartLocalPlayer. You'll need to modify (or better, extend) this class to have the specific behavior you're after. This alone should solve the input issue.

    As for the camera, the DemonstratorManager looks for the vehicle on scene Start. As the cars aren't yet instantiated by network, it can't find any. So again, you'd need to modify (or again, extend) that class to refresh the car list, for example by searching for local network objects, or by adding an option from the NetworkVehicle class to add it to the Demonstrator.
     
  11. JohnDraisey

    JohnDraisey

    Joined:
    Jul 28, 2013
    Posts:
    17
    Hey Reuno, how's it going? I've been diving into the Highroad Engine, and managed to get 8 players on the track at once. But an issue i'm having is that they all bunch up together and hog the AI race line instead of avoiding each other. Is there anything I can do to prevent this behavior?

    And are multiple AI routes (say in parallel, or for split paths) possible?

    Thanks! FYI, I love the Solid vehicle controller, it's a blast to play with.
     
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @JohnDraisey > The current AI doesn't have any behaviour to avoid other AIs. This can be done by extending the VehicleAI class, and using (for example) raycasts to make sure that if another car gets too close you get further away from the race line. I wouldn't say it's a super easy task, but it's doable. Same goes for multiple paths.

    These are good ideas though, and they're already on the todo list, along with "personas" for the AIs, so you have one that's more aggressive than the other, etc.

    And I'm really glad you like the Solid controller :)
     
  13. JohnDraisey

    JohnDraisey

    Joined:
    Jul 28, 2013
    Posts:
    17
    @reuno Oh ok, I did see some ray-casting examples in the car controller script. I'll study the VehicleAI script and see if there's anything i can figure out over the next few months. I'll keep you posted. The fact that you commented every line is a godsend!
     
    reuno likes this.
  14. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hey Reuno, just another minor suggestion for a couple of boolean toggles on the RaceManager so that you can disable player/bot test vehicles. I did this myself and it has been great for when you want to quickly test player or bot vehicles without having to set the array count or drag-and-drop prefabs all over again.

    Oh yeah, I totally sorted the Respawn with the Tiny Cars and have just implemented my own collision sparks solution. Hehe, only a few more hard things to conquer and then I can really start to move forwards with this project.
     
    reuno likes this.
  15. Apposl

    Apposl

    Joined:
    Nov 27, 2017
    Posts:
    50
    I meant to attempt to bribe you and say I'd buy this package if you'd let me be a beta tester for the upcoming adventure/roguelike (oh be still my heart), but I got carried away with spending $ and purchased this package before I could attempt said bribe. Er, negotiation. ;)

    Anyway, look forward to putzing around in this, hoping to have a fun little something setup for my daughter when she comes back next weekend.

    Weird my username here must be different than the asset store login stuff, hm... Anyway just bought your kit. Great work on all your stuff. Look forward to maybe sharing a few little things I've had ideas about and your kit makes possible.
     
    reuno likes this.
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @unity_0r0EAf1VsCjXKw > You don't have to bribe me for that, you just have to ask, I'll be happy to add you to the beta list (just don't be to impatient) :)
     
  17. fancyferret

    fancyferret

    Joined:
    Feb 4, 2017
    Posts:
    31
    There's an adventure/roguelike coming up??! Sign me up too please!
     
    reuno likes this.
  18. Apposl

    Apposl

    Joined:
    Nov 27, 2017
    Posts:
    50
    Haha, I'm an old Army vet, hurry up and wait has been my entire life, no impatience here. :) My 10yo daughter is LOVING this kit. It's a bit of a problem because I want to work on it, and she wants to play it. :)

    I'm going to fix my username and stuff here, I signed up via Google or something because my unity asset store ID doesn't work on the forums apparently (?) - I'm not as temporary as the username suggests, I'll be a regular around here. I started playing with Unity a year ago and recently upgraded PCs and have been devoting more time to the hobby. Going to ignore how much I spent on Black Friday and Cyber Monday and just enjoy learning and building and playing.

    Sorry to ramble, I'd love to be on a list as a beta tester!
     
    reuno likes this.
  19. ninth_art

    ninth_art

    Joined:
    Aug 26, 2016
    Posts:
    2
    Hi, I cannot find the Solid folder under Demos after imported the package.
    The package version showed in Unity AssetStore download manager is 1.1, and no update information.
    My Unity version is 5.6.3f1.

     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
  21. ninth_art

    ninth_art

    Joined:
    Aug 26, 2016
    Posts:
    2
    reuno likes this.
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    MudPuppet likes this.
  23. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hey Reuno, I just noticed a situation with the Respawn functionality where if two AI vehicles get stuck at around the same position and then respawn within a few milliseconds of each other that the last one to respawn could actually fly off the track - generally into areas that they should not go (like outside track scenery in my case). From what I can tell this is because the latter vehicle respawns on top of the former vehicle, and physics goes crazy-ape-bonkers. Can you please advise on whether or not you accounted for this scenario in your Respawn method? I guess that I kind of want to double-check that it's not something to do with how I implemented the Respawn into the Tiny Cars game type. It has been working flawlessly for the most part though and I haven't touched your code.
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @MudPuppet > Well, the respawn point being just that, one point, if 2 vehicles respawn there at the exact same time (or close to the same time), they'll collide and this will likely cause glitches.
    The current implementation lets you know how to handle that based on your gameplay. Here are a few solutions :
    - remove collisions from the car when respawning (the NetworkRaceManager handles these btw)
    - add a delay when a respawn happens
    - modify the respawn code to have a specific offset per car, so they'll never respawn at the same spot
     
  25. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hey Reuno, sorry for the late reply. All of your solutions were exactly along the lines of what I had been thinking. I will look into it and see what I can do. As yet I have not touched anything to do with network play or even tested it so I will have to take a look.
     
    reuno likes this.
  26. animaguy

    animaguy

    Joined:
    Dec 10, 2015
    Posts:
    32
    Hello Reuno, I just started working on HighRoad. I want to know if I could get some help creating a vehicle that is connected to another gameobject with a hinge joint.

    When I add a rigidbody to a gameobject nested inside a car controller gameobject, I have problems. Any help would be appreciated
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @animaguy > That's not a feature of the engine, I'm not sure how I can help on that. I can add that to the todo list if you want.
     
  28. animaguy

    animaguy

    Joined:
    Dec 10, 2015
    Posts:
    32
    Thanks for the quick reply.

    I code and am looking at the scripts. I would appreciate if you put that on a todo list.

    Which script or scripts do you believe need to be extended for me to be able to do this action?
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @animaguy > I don't know, I have never tried to do that. I can add it to the todo list, but so far nobody's requested something like that, so unless more people do, it won't be high priority, sorry. It's quite unusual too, nesting a rigidbody inside the controller, I'm afraid I don't have any recommendation for that, that kind of goes against Unity good practices.
     
  30. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hey Reuno, dunno if you ever had a chance to look into this but quite a long time ago I mentioned something about bot vehicle wobble/flickering with the Tiny Cars setup. Finally I have tracked this down to the CarBehaviour script and the CarBodyRoll() method. I did some tests last week and found that if the body roll amount is much greater than 8 (with 15 being a nice looking tiny-car roll amount) then the wobble/jitter occurs. Note that this only happens with bot vehicles and not the player (weird!). So I then went and did more tests by dialling down settings on the VehicleAI component. No luck with that either. Anyway, I thought that I had better mention the issue again and find out if it can be fixed or if I should start to look into trying to come up with a lame alternative solution to body roll.

    Also, for ages I have been making failed attempts at getting the game UI to have just the player race position shown and not all vehicles etc. Basically I was just trying to hook up some text to your score (etc) code in the Update method of the RaceManager class. Long story short, today I managed to do exactly what I wanted using a 3rd party tool that I also use for easy/quick checkpoint creation. However, I am still curious... if you have a list of players like in playersRank which you are using for sorting score stuff, then how would you specify, access or target just the actual 'player' from within that list? Or is there perhaps some really super easy way to hook up a text object to do what I wanted. Sorry if that seems more Unity related but I couldn't even think of what I should use in a Google search whilst trying to sort this out and anything I did see would require replacing whole chunks of the engine.

    Oh yeah, on NYE I somehow solved all performance issues with my game project. So that's about 5 months of going around in circles with optimisation stuff to end up solving it all in a matter of minutes. Anyway it's really freaking great to play on the phone now with a rock solid 60 FPS on all track types and weather conditions. To summarise I got sucked in to optimisation info, bad info, and light mapping info too quickly in too shorter time so this resulted in me going around in circles doing further optimisation along the way but never being able to track down why the game didn't perform as I would thought it should be. Hehe, a bit like trying to find a needle in a haystack but people keep changing the shape of the haystack whilst you are looking for the needle.
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @RTSlang > I'd suggest updating to a more recent version of Unity maybe? These errors seem related to Unity native functions, so that'd make sense. I'd start with that.

    @MudPuppet > There's indeed a difference in behaviour between bots and human player vehicle. The AI simulates a wheel without lerp, while the "human" InputManager does. The following fix adds this lerp when calculating the body roll :

    // New private var
    private float _steeringBodyRollValue = 0;

    /// <summary>
    /// Manages the car's body roll
    /// </summary>
    protected virtual void CarBodyRoll()
    {
    // new line added here
    _steeringBodyRollValue = Mathf.Lerp(_steeringBodyRollValue, _carController.CurrentSteeringAmount, Time.deltaTime);
    CarBody.transform.localEulerAngles = _steeringBodyRollValue
    * MaximumCarBodyRollAngle
    ......

    This will make the vehicle's rotation more fluid whatever the control. This fix will be included in the next update, thanks for your feedback!

    As for the "game UI to have just the player" thing, it really depends on what you mean by "the player". In network mode, that's the current implementation that shows the local player score. For a game with only a single human player and bots, at Update, you can filter to only keep human players. When getting the PlayersRank list (in the RaceManager's update), add a control like this during the foreach : "if (!p.GetComponent<VehicleAI> ().Active)" then this vehicle is human.

    And I'm really glad about your progress, that's good stuff, congratulations :)
     
  32. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hey Reuno, much thanks for that info. All sorted out now. With the player position text thing I was just missing the !p. part. I still haven't had a chance to look into network play yet (although I have started to look at some of the network associated scripts as you mentioned them in a previous post) but hopefully that will be something that I can start to look into sometime soon. It was suggested to me to just release the game and then add multiplayer at a later stage but I can't see single player mode being exciting or interesting enough without having achievements or adding in things like mods to vehicles etc; so as much as it's just an arcade race game I think that multiplayer will be the one thing that attracts some interest from potential customers.
     
    reuno likes this.
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @MudPuppet > I'd agree that releasing something first to jauge interest would be a better solution.
    Multiplayer can get very complex, especially at scale.
     
  34. animaguy

    animaguy

    Joined:
    Dec 10, 2015
    Posts:
    32
    Hello Reuno,

    Still working on the Engine.

    I wanted to know if there is any documentation on how to use the SaveManager.
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @animaguy > No there's not, it's not used in the Highroad Engine.
    It's pretty simple though, there's a Save method and a Load method, that's all there is to know about it :)
     
  36. animaguy

    animaguy

    Joined:
    Dec 10, 2015
    Posts:
    32
    On a completely separate topic, I am interested in building a store in the HighRoadEngine for my customers. Is your Inventory Engine for Corgi compatible with the HighRoadEngine?
     
  37. animaguy

    animaguy

    Joined:
    Dec 10, 2015
    Posts:
    32
    And thank you for the quick response.
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @animaguy > The Inventory Engine can work with anything, it's an independent solution. It's just included in the Corgi Engine as a gift. That said, using it to create a shop seems a bit odd. It's good for inventories, not shops.
     
  39. IvyKun

    IvyKun

    Joined:
    Sep 28, 2013
    Posts:
    130
    I know this post is old but... Is this on the roadmap for a future release?

    I just bought the engine and this is one of the first things I noticed. AI cars all go trough the same route at the same time and they even crash with each other.

    I saw on other engines or unity examples that the AI cars follow the waypoints but with a random offset, so it looks less predictable and it also works as "difficulty level". If they follow exactly the waypoints the game will be more difficult for the player and if they go further it will be easier. Maybe that's easier that having multiple waypoints.

    Other than that everything it's awesome! Great job!
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @IvyKun > Yup, it's still on the roadmap :)
     
    MudPuppet and IvyKun like this.
  41. CryptidGames

    CryptidGames

    Joined:
    Jun 9, 2017
    Posts:
    2
    Salut Reuno !
    Hi from Ottawa.
    Quick question for the Solid Vehicle... How can we add sound to it ?
    I've looked around in the assets, but no luck.

    Merci !
    Francois
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @CryptidGames > I'll add sounds to the Solid vehicles in the next update, there's no "simple" way to plug some right now.
     
    MudPuppet likes this.
  43. michalides

    michalides

    Joined:
    Jan 9, 2017
    Posts:
    15
    Hi reuno, please do you have any roadmap anywhere where i can see what you plan to add next? Thank you :)
     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @michalides > I don't announce stuff in advance anymore, people get way too angry otherwise :)
    There's a new update coming soon, that's all I can confirm!
     
    MudPuppet likes this.
  45. michalides

    michalides

    Joined:
    Jan 9, 2017
    Posts:
    15
  46. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    408
    Hey reuno, amazing work there! A quick question (haven't read the thread so, sorry in advance): for the past 2 decades i'm trying to recreate SEGA arcade racing physics feel from the 90s, so... Daytona, Sega Rally, Outrun C2C, Possible? Or at least Ridge Racer... or Storm Racer-G?

    Thanks in advance ;)
     
    Last edited: May 11, 2018
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @nukeD > The engine goes for a more arcade feel than that. I guess it could be used as a base though.
     
    nukeD likes this.
  48. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    408
  49. izam

    izam

    Joined:
    Nov 14, 2017
    Posts:
    16
    Hi @reuno I am stuck at the part where we can use the SolidBehaviorExtender script to turn on lights as well as add a car sliding sound. I could possibly add the sound when the car skids by modifying the main SolidController script... right?
    Can you give me a clue as to how to best implement this? I have seen @MudPuppet adding a headlights button on his screenshots.
    What I would like to do is to turn on brakelights when the car is braking. How do I make use of the SolidBehaviorExtender script to do this instead of modifying the main SolidController script?
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,787
    @izam > You can do that easily by adding (for example) 2 Lights on your model, one for the brakes, one for the reverse, and add the following class to your project :

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. namespace MoreMountains.HighroadEngine
    4. {
    5.     public class SolidBrakesLightBehaviour : SolidBehaviourExtender
    6.     {
    7.         public Light brakesLight;
    8.         public Light reverseLight;
    9.  
    10.         public override void Initialization()
    11.         {
    12.             brakesLight.enabled = false;
    13.             reverseLight.enabled = false;
    14.         }
    15.        
    16.         public override void Update()
    17.         {
    18.             brakesLight.enabled = false;
    19.             reverseLight.enabled = false;
    20.  
    21.             if (_controller.CurrentGasPedalAmount < 0)
    22.             {
    23.                 if (_controller.Forward) {
    24.                     brakesLight.enabled = true;
    25.  
    26.                 } else {
    27.                     reverseLight.enabled = true;
    28.                 }
    29.             }
    30.         }
    31.     }
    32. }
     
    izam likes this.