First game - Reckless Driver: Urban

Discussion in 'Showcase' started by carking1996, Mar 8, 2011.

  1. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Hello, I started my first game about 4 weeks ago. It is a racing game, still in alpha stages. So, a lot things aren't done yet. :p This is my first time with a webplayer, so, tell me what you think. Controls are arrow keys, and 1 + 2 for cameras. I know the speedo is off, but, how can I fix that? I don't know how. I didn't make the car script, that was from a tutorial, but I edited it some. I made everything else. What do you guys think?

    Updated WebPlayer link:
    http://dl.dropbox.com/u/30521755/webplayer5/WebPlayer.html

    Have fun!
    Last edited: Nov 17, 2011
  2. RAWTalent

    RAWTalent

    New Member

    Joined:
    Oct 27, 2010
    Messages:
    32
    Couple of problems, the GUI doesn't fit in the web player, and if you fall of the road you can't get back on due to it floating a few inches off the grass. Having said that it's a good start :)
  3. bahamapascal

    bahamapascal

    New Member

    Joined:
    Feb 16, 2011
    Messages:
    23
    Hi nice game(still needs a little polishing;) ).
    It would be an big improvement if the player could press Esc to Quit to the main menu^^.
    And you can probably change the speed by going in to the script,than there should be something like currentSpeed(or similar).
    here an example how it could look:
    Just divide or multiply it till you got your desired speed^^
  4. 2dfxman1

    2dfxman1

    New Member

    Joined:
    Oct 6, 2010
    Messages:
    1,065
    Why does it say I'm driving at 0.1mph even if I'm standing still?
  5. RichBosworth

    RichBosworth

    New Member

    Joined:
    May 26, 2009
    Messages:
    325
    I like it... the control on the car suits the title! There were some issues with seeing through the green car though, which was a little bit distracting at times, but in general I forgot it when I started driving like a mad-man.

    You might want to round the speedometer to integer values, because I don't really care about 0.000001 of an MPH, unlike some of the speed cameras where I live (apparently).
  6. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Thanks guys. Bahamapascal, there is nothing like that in my car script. The MPH gauge works like this:

    Code (csharp):
    1. var mph = rigidbody.velocity.magnitude * 2.237;
    2.     mphDisplay.text = mph + " MPH" ;
    RockyBozzy, the green car isn't finished yet. ^^
  7. bahamapascal

    bahamapascal

    New Member

    Joined:
    Feb 16, 2011
    Messages:
    23
    Hey here is the Script for the car game (or test,because I am not planing on making a race game) that I am working on:

    First of all,this is not realy my work.I got it from a Tutorial,but changed it a bit for better performence^^.
    It is wary importent that you make the wheel collider exactly opothit from each other( something like flWheelCollider= -1,0.5,3 and frWheelCollider= 1,0.5,3)
    Also this is a Work in progress Script,so there might be stuff in there which is not jet completed.
    hope you can use this^^
    please let me know
  8. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Here is the one I'm using.
    Code (csharp):
    1. var mphDisplay : GUIText;
    2.  
    3. var resetTime : float = 5.0;
    4. private var resetTimer : float = 0.0;
    5.  
    6. // These variables allow the script to power the wheels of the car.
    7. var FrontLeftWheel : WheelCollider;
    8. var FrontRightWheel : WheelCollider;
    9.  
    10. // These variables are for the gears, the array is the list of ratios. The script
    11. // uses the defined gear ratios to determine how much torque to apply to the wheels.
    12. var GearRatio : float[];
    13. var CurrentGear : int = 0;
    14.  
    15. // These variables are just for applying torque to the wheels and shifting gears.
    16. // using the defined Max and Min Engine RPM, the script can determine what gear the
    17. // car needs to be in.
    18. var EngineTorque : float = 600.0;
    19. var MaxEngineRPM : float = 3000.0;
    20. var MinEngineRPM : float = 1000.0;
    21. private var EngineRPM : float = 0.0;
    22.  
    23.  
    24.  
    25. function Start () {
    26.     // I usually alter the center of mass to make the car more stable. I'ts less likely to flip this way.
    27.     rigidbody.centerOfMass.y = -1.5;
    28. }
    29.  
    30. function Update () {
    31.  
    32.     var mph = rigidbody.velocity.magnitude * 2;
    33.     mphDisplay.text = mph + " MPH" ;
    34.    
    35.     // This is to limith the maximum speed of the car, adjusting the drag probably isn't the best way of doing it,
    36.     // but it's easy, and it doesn't interfere with the physics processing.
    37.     rigidbody.drag = rigidbody.velocity.magnitude / 220;
    38.    
    39.     // Compute the engine RPM based on the average RPM of the two wheels, then call the shift gear function
    40.     EngineRPM = (FrontLeftWheel.rpm + FrontRightWheel.rpm)/2 * GearRatio[CurrentGear];
    41.     ShiftGears();
    42.  
    43.     // set the audio pitch to the percentage of RPM to the maximum RPM plus one, this makes the sound play
    44.     // up to twice it's pitch, where it will suddenly drop when it switches gears.
    45.     audio.pitch = Mathf.Abs(EngineRPM / MaxEngineRPM) + 1.0 ;
    46.     // this line is just to ensure that the pitch does not reach a value higher than is desired.
    47.     if ( audio.pitch > 2.0 ) {
    48.         audio.pitch = 2.0;
    49.     }
    50.  
    51.     // finally, apply the values to the wheels. The torque applied is divided by the current gear, and
    52.     // multiplied by the user input variable.
    53.     FrontLeftWheel.motorTorque = EngineTorque / GearRatio[CurrentGear] * Input.GetAxis("Vertical");
    54.     FrontRightWheel.motorTorque = EngineTorque / GearRatio[CurrentGear] * Input.GetAxis("Vertical");
    55.        
    56.     // the steer angle is an arbitrary value multiplied by the user input.
    57.     FrontLeftWheel.steerAngle = 20 * Input.GetAxis("Horizontal");
    58.     FrontRightWheel.steerAngle = 20 * Input.GetAxis("Horizontal");
    59. }
    60.  
    61. function ShiftGears() {
    62.     // this funciton shifts the gears of the vehcile, it loops through all the gears, checking which will make
    63.     // the engine RPM fall within the desired range. The gear is then set to this "appropriate" value.
    64.     if ( EngineRPM >= MaxEngineRPM ) {
    65.         var AppropriateGear : int = CurrentGear;
    66.        
    67.         for ( var i = 0; i < GearRatio.length; i ++ ) {
    68.             if ( FrontLeftWheel.rpm * GearRatio[i] < MaxEngineRPM ) {
    69.                 AppropriateGear = i;
    70.                 break;
    71.             }
    72.         }
    73.        
    74.         CurrentGear = AppropriateGear;
    75.     }
    76.    
    77.     if ( EngineRPM <= MinEngineRPM ) {
    78.         AppropriateGear = CurrentGear;
    79.        
    80.         for ( var j = GearRatio.length-1; j >= 0; j -- ) {
    81.             if ( FrontLeftWheel.rpm * GearRatio[j] > MinEngineRPM ) {
    82.                 AppropriateGear = j;
    83.                 break;
    84.             }
    85.         }
    86.        
    87.         CurrentGear = AppropriateGear;
    88.     }
    89. }
    90.  
    91. function Check_If_Car_Is_Flipped()
    92. {
    93.     if(transform.localEulerAngles.z > 80  transform.localEulerAngles.z < 280)
    94.         resetTimer += Time.deltaTime;
    95.     else
    96.         resetTimer = 0;
    97.    
    98.     if(resetTimer > resetTime)
    99.         FlipCar();
    100.         }
    101.        
    102.         function FlipCar()
    103. {
    104.     transform.rotation = Quaternion.LookRotation(transform.forward);
    105.     transform.position += Vector3.up * 0.5;
    106.     rigidbody.velocity = Vector3.zero;
    107.     rigidbody.angularVelocity = Vector3.zero;
    108.     resetTimer = 0;
    109.     currentEnginePower = 0;
    110.     }
    111.        
    112.        
    What tutorial is that from?
  9. gamenut30111

    gamenut30111

    New Member

    Joined:
    Nov 7, 2009
    Messages:
    399
    Wow, my car just drove over water, I enjoyed that. I would have to say that you need to fix the gui and the colliders on the map.
  10. bahamapascal

    bahamapascal

    New Member

    Joined:
    Feb 16, 2011
    Messages:
    23
  11. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Cool. I am also somewhat new, but I know the basics. :)
  12. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
  13. Fishman92

    Fishman92

    Member

    Joined:
    Feb 9, 2010
    Messages:
    2,553
    Dude, it was cool till i came off the tracks, but nice going!
    Also, you can't use images in your signature :p.
  14. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    I see that. Why not? xD I have a new menu designer, so, he's going to do the site and menus! :D Updates soon! :)
  15. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Double post... Some updates.

    - Speedometer is fixed.
    - Cameras better optimized.
    - new grass
    - More roads with more higher poly hills.

    Controls:

    - Arrow keys to drive.
    - 1 + 2 for cameras.

    Webplayer: http://www.pasteunity.com/WebPlayer.aspx?GameID=19

    Enjoy. Please tell me what could be better. :)
  16. bahamapascal

    bahamapascal

    New Member

    Joined:
    Feb 16, 2011
    Messages:
    23
  17. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Thanks. But, I'll be making my own cars. ^^ Anyone else have crits?
  18. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Double post. Updates! :) Some new things. Totally new car physics. :) What would be the best way to implement a minimap?

    http://www.pasteunity.com/WebPlayer.aspx?GameID=19

    - 100% new car physics
    - Handbrake ('spacebar')
    - Skid sounds with handbrake.
    - 'Gearing Games' image automatically loads the main menu after 5 seconds.
    - Fixed Speedo, with new font and color.

    Please let me know your crits! :D If you don't like the new physics, please tell me how to improve them. :)

    EDIT: Updated car physics. Lemme know your crits! :D
    Last edited: Mar 12, 2011
  19. NemorisGames

    NemorisGames

    New Member

    Joined:
    Mar 20, 2010
    Messages:
    52
    In my opinion, the driving feels pretty good, i missed some indicators and an inside view. the art will be the biggest issue very soon, i specially don't like the square ramps, but with smooth ramps and a nice landscaping your game has a great potencial. Keep it on!
  20. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    lol

    Updates. New menu, car close to completion, ingame pause with ESC, better car tail lights, realtime shadows, better car speedometer, new road textures, background music, more city, another bridge, improved car physics, and more! :) Tell me what you guys think!

    [​IMG]

    Webplayer: Click for WebPlayer.

    Have fun! :D
  21. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Whoever said this game is dead? :p But, no replies? :(

    UPDATES:

    - Beta Menus(Still WiP by Az)
    - Has working multiple cars' selection(thanks to DMan and Jesse Anders! Thanks!! :D)
    - Rear view mirror
    - Mini-Map
    - Bigger city
    - Nice 'blob' shadow
    - Ai traffic has started WiP
    - Can change resolutions in Options menu
    - fixed menus position on screen(tex will be fixed on ingame ones)
    - Many other various changes/edits/improvements that there are too many to type here. :)

    Play the webplayer here!! :D
  22. Fishman92

    Fishman92

    Member

    Joined:
    Feb 9, 2010
    Messages:
    2,553
    Hi, shapin up! Can I sujjest you use the smoothfollow camera instead of making it a child of the camera? The end result is alot nicer.
  23. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    I tried making it find the game object of body, but it doesnt work. :(
  24. Fishman92

    Fishman92

    Member

    Joined:
    Feb 9, 2010
    Messages:
    2,553
    just drag and drop the whole car object onto the script? then unparent the camera from the car if you haven't already.
  25. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Major updates.

    * Improved car selection screen.
    * Two new cars.
    * Highly improved car shaders.
    * 2 tunnels.
    * Expanded city.
    * Speedometer works now.
    * Car physics completely changed for a third time. Car doesn't flip until over 80 MPH now. That's what would happen in real life without stabilizer bars. ;)
    * Press F4 to restart level.
    * Improved cameras.

    Some pics. :)

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]
  26. Adrenaline Crew

    Adrenaline Crew

    Member

    Joined:
    Dec 14, 2010
    Messages:
    389
    What program did you make roads in?
  27. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    I used. Zmodeler. Each road is it's own object. Like a puzzle. :)
  28. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824


    An awesome test of a draw bridge animation. Crits welcome.
  29. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    update. Now with animated gates. And 2 bridges! :D

  30. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    How is my animation? It's my first. :)
  31. Taigo

    Taigo

    New Member

    Joined:
    Feb 18, 2010
    Messages:
    128
    Very cool, you could have a boat running on waypoints around the river and place a trigger on it´s way to lift the bridge :)
  32. vreference

    vreference

    New Member

    Joined:
    Mar 22, 2011
    Messages:
    154
    The gates would look better if they bounced a bit when they reached the top, those mechanisms always have quite a bit of lash when they are fully raised. Also your car sounds like it's idling at 6000RPM LOL.
  33. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    lol. They do that a bit. Just not when they are going up. I'll add that. :) I know, the car sounds louder in Fraps. LOL. I'll see if I can add a boat that runs through the river. First, to model it. :D I'm also going to add sounds (like bells for the warning of the bridge going up, and the sounds the bridge should make when going up). Any reccomendations of bell sounds?
  34. vreference

    vreference

    New Member

    Joined:
    Mar 22, 2011
    Messages:
    154
    Keep in mind that volume (loudness) and frequency are different. Also worth mentioning that I saw you posted some code somewhere that seemed to indicate you were calculating engine RPM between 1000 and 3000 RPM, if you are using those numbers to change your engine sound you might have a hard time. 500-5500 (large v8) or 800-7000 (more modern high performance engine) would be more realistic generic ranges for an automotive gasoline engine. Many games use a separate actual recording of an engine idling for idle and fade into the higher RPM frequency altered sound.

    As for bells? I would probably just go out to a deserted railroad crossing and wait =) ...but I'm sure there are plenty of examples on youtube.
  35. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Great! I already found bell sounds from railroad crossings. :) I'll try to make my RPM ranges better later on. I also added some cool stairs, I'll show a pic later. Thanks for this advice! :D
  36. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Big updates. I made 2 new menus. Car selection screen and the Options, both are almost done. Just need some buttons to do. Cars are a lot more stable, new shader(cubemap), made by me, Stairs, signs, traffic lights that work correctly, new water, car suspensions, and a gear indicator! :D Also, the car selection screen shows the cars' stats. :) Oh, and the city's name is going to be Seaview City. :)

    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
  37. Fishman92

    Fishman92

    Member

    Joined:
    Feb 9, 2010
    Messages:
    2,553
    Loooking really good now. I can haz webplaya?
  38. herpderpy

    herpderpy

    New Member

    Joined:
    Mar 9, 2010
    Messages:
    477
    Amazing Carking - Just a quick question - Did you use the car tutorial on the unity site for the physics/car control? It's amazing and I'd LOVE to implement it in a game I'm working on at the moment

    ~ Alex
  39. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    I used a different tutorial. But, I HIGHLY modified it for my own needs. Like, added a new gear shifting system. :D I'll post a WebPlayer up soon. I cant now because, of input problems(no one will answer my thread)! :'(
  40. herpderpy

    herpderpy

    New Member

    Joined:
    Mar 9, 2010
    Messages:
    477
    Is it possible to send me a link to the tutorial? Would be awesome help!

    Ah - Well when you have it up I'll be happy to to a look:D
  41. LastBulliet

    LastBulliet

    New Member

    Joined:
    Apr 4, 2011
    Messages:
    91
    web player link does not work at all sends me to a non working page...
  42. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
  43. LastBulliet

    LastBulliet

    New Member

    Joined:
    Apr 4, 2011
    Messages:
    91
    Thanks mate im trying it now it keeps saying problem loading page though :*(
  44. RichBosworth

    RichBosworth

    New Member

    Joined:
    May 26, 2009
    Messages:
    325
    If you were using PasteUnity, then unfortunately it was hacked earlier this week.
  45. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Try it now. No, it's now pasteunity. ;)
  46. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Just some WiP for another car. 1994 Honda Del Sol. :) Model made in max.

    [​IMG]
    [​IMG]

    Hope you like. :)
  47. Fishman92

    Fishman92

    Member

    Joined:
    Feb 9, 2010
    Messages:
    2,553
    It's OK, but the camera REALLY needs sorting. Use the unity car camera or the smooth follow camera or SOMETHING....
    Also, with the WASD or Arrows, the car wouldn't drive straight. Had to use throttle and brake with my toes while steering with an analogue stick on my controller to drive 'well'. Also, the car needs headlights. On the mesh. And if I can knock streelights down, I should be ale to knock the traffic lights over too.

    But my main point, in 3 words:
    Fix
    The
    Camera.
  48. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Dude. The inputs will NOT reset. ;) I do not know why! It's driving me nuts. There's 4 cameras, the default camera is the orbit cam. That's the one that just stays there, like a static camera. I do not know why. The smoothcam is one of the other three. Please read this topic for the Input problem.

    For the car straight problem, it is the wheel colliders/CenterOfMass. I'll try to figure that out. ;)
  49. carking1996

    carking1996

    Member

    Joined:
    Jun 15, 2010
    Messages:
    1,824
    Some update. :)

    [​IMG]
  50. ognjenm

    ognjenm

    New Member

    Joined:
    May 3, 2011
    Messages:
    97
    Last edited: May 22, 2011