Search Unity

Kart Demo - WIP

Discussion in 'Works In Progress - Archive' started by JamesArndt, Jun 6, 2012.

Thread Status:
Not open for further replies.
  1. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932


    So I'm going to start working on a free to play web streaming Go Kart racing game. I want to stream it right off of my own site and monetize it with some small side ads. I will probably implement it into Facebook as well.
    Anyways here is a starting scene for me using some of past car physics stuff..you'll notice it isn't a GoKart yet (I'm still busy setting that up).

    Check the latest build at www.fatboxsoftware.com

    This is where I will host the game (so I will test it this way as well)....hit the little button at the bottom called "Kart Race Experiment".

    UPDATED:

    Finished the concepts/layouts for outdoor Track 2 (A-F configs) for Super Kart Racing. These are concepts for the first outdoor track featured in the game. Want to learn more about the game? Visit www.superkartracing.com

     
    Last edited: Feb 18, 2013
  2. ironbelly

    ironbelly

    Joined:
    Dec 26, 2011
    Posts:
    597
    If you could port this to Android/iPhone it'd be mint. I can't believe there aren't any quality kart racers for Android out yet
     
  3. snowconesolid

    snowconesolid

    Joined:
    Dec 9, 2011
    Posts:
    868
    wow really nice little demo, it truly shows off Unitys ability to make great looking games, but off course unity alone cannot create this, you had to make that beautiful car and sunset like setting. checked out your portfolio to, your really talented. wish I could create realistic enviorments like that.

    keep up the good work man. And I agree with ironbelly, this looks much better than a lot of current ios games.
     
  4. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Update:

    Check the latest build at www.fatboxsoftware.com

    Follow the button at the bottom of the page called "Kart Race Experiment". I was successful at transferring all of the physics and stuff over from the stand-in Mustang. I've implemented the working speedometer on it's new rigidbody. Also you'll notice I got the wheel and steering linkage working with the turning of the vehicle. This was accomplished by triggering a hold animation for left and right turning when you hit the "A" key or the "D" key. I created set driven keys in Maya, set up a NURBS control for turning the linkage/steering wheel and baked out 8 frame animations for both turn angles. Next task is to get some raycast AI working on the scene (I'm going to have to throw a few hundred more meters of ground in there).
     
    Last edited: Jun 20, 2012
  5. tatelax

    tatelax

    Joined:
    Feb 4, 2010
    Posts:
    1,168
    Really nice demo. I think it needs more sliding.
     
  6. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    I agree, it could use some more sliding.

    EDIT : Someone on CGTalk found something I overlooked. Please use the WASD keys for control as the actual keyboard key control is inverted in this build.
     
    Last edited: Jun 10, 2012
  7. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932


    Would like to emulate something like this.

     
    Last edited: Jun 11, 2012
  8. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932


    Tweaked the physics a bit with the suspension...added in a new driver camera up close. Also started work on the actual track. It's all very WIP...the Kart itself still hasn't gotten it's nice occlusion pass.

    Check the latest build at www.fatboxsoftware.com
     
    Last edited: Jun 20, 2012
  9. TehWut

    TehWut

    Joined:
    Jun 18, 2011
    Posts:
    1,577
    Haha that's a really cool demo!

    The tires are very grippy though - were you aiming for this? Every time I would overturn, I would turn in the other direction, which in turn would overturn me more (no pun intended), and then I turned against it and overturned again, eventually resulting in a serpentine pattern that leads me off the clff. Basically, I think there is a grip issue, and unless you really want to monitor speed control and acceleration, it is ungoldy difficult to make any turn.
     
  10. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    No the tire slip and stuff is very much in progress. Your insights are good though, I don't want it to be super difficult.
     
  11. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932


    Integrated new speed-based vehicle handling (not sure how accurate it is yet)..but basically your steering becomes less sensitive the faster you go. I've also got a new sound manager working. You have engine sounds based on RPMs, you have a wind passing by you sound based on velocity. The sounds are not fully looped yet in Audacity, so you will hear some pops. I've also implemented a camera shake animation on the cameras based on velocity as well. It's starting to feel really cool.


    Check the latest build at www.fatboxsoftware.com
     
    Last edited: Jun 20, 2012
  12. Paradigm-SW

    Paradigm-SW

    Joined:
    Dec 23, 2011
    Posts:
    402
    Looks really good! Add some bananas, shells and bombs and we'll have a killer app ;)
     
  13. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Well we may get debris, oils slicks and potholes...but I dunno bout bananas lol. Maybe?

    Edit: I've fixed a bug I simply forgot to fix before which was the keyboard arrow input keys being reversed for forward and backwards motion.
     
    Last edited: Jun 12, 2012
  14. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    With online play, and upfront pricing( like a 1$ , don't give us push notifications or invasive adds !)
    this would be great
     
  15. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    @keithsoulasa - If it were to be a paid app for $.99 there would be absolutely no ads whatsoever. I don't see a need for push notifications either. It would be straight game play. Multiplayer would absolutely be a given for a game like this too. Multiplayer is where I'm going to need to find as much research as I can from the good Unity folks and the internet in general.
     
  16. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    @JamesArndt , if I had any idea how to do networked coding, I would totally code it for you . Photon has a good middle ware for networking unity games, .

    The only kart game I can think of for android is Mole Kart , which is crap since your spamed with push adds, I'd rather pay a buck then deal with push ads for random apps( likely more crapware )
     
  17. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    @keithsoulasa - Well the online community is so awesome about Unity I shouldn't have a problem finding a way to implement this and roll my own system or use a tutorial system.
     
  18. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Game has great potential and looks very good. Right now its way to easy though : p
    Its impossible to get the cart to loose the grip and my kart keeps dragging left all the time.
     
  19. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    @Virror - I've fixed the issue of pulling left....still working on implementing a handbrake for sliding.
     
  20. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    So I've got some updates:



    As of today I finally gotten a small LCD tach and speedo on the steering wheel working. As of right now it's not reading out RPMs and the MPHs are not rounding off properly so they jitter a bit. The track is standing in for the final path, it's textures and UVs are not complete either so you'll see some parts of the track where the grass/dirt blend is not broken up.

    I've gotten feedback about implementing a handbrake for sliding through turns and feedback about adjusting the slip when taking turns and such. I'm working on, the physics calculation stuff is a little more complex so I usually tackle easier things first.

    Next task is to get some raycast AI working on the scene.

    Check the latest build at www.fatboxsoftware.com
     
    Last edited: Jun 20, 2012
  21. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Any programmers in here that could help me on this WIP. Here is my script:
    Code (csharp):
    1. var sidewaysSlipThreshold : float = 2;
    2. var sidewaysSlipAudio : AudioClip;
    3. var sidewaysSlipSoundPlayed : Boolean;
    4.  
    5. function Start() {
    6. sidewaysSlipSoundPlayed = false;
    7. }
    8.  
    9. function FixedUpdate() {
    10.     var hit : WheelHit;
    11.     var wheel : WheelCollider = GetComponent(WheelCollider);
    12.      
    13.     if( wheel.GetGroundHit( hit ) ) {
    14.    
    15.         if( hit.sidewaysSlip > sidewaysSlipThreshold )
    16.         if (!sidewaysSlipSoundPlayed)
    17.         {
    18.             audio.clip = sidewaysSlipAudio;
    19.             audio.Play();
    20.             sidewaysSlipSoundPlayed = true;
    21.         }
    22.         else
    23.         {
    24.             sidewaysSlipSoundPlayed = false;
    25.         }
    26.     }
    27. }
    So my problem is this: Right now it does work...every time the wheelcollider senses a slippage above that variable in my script it sets off the tire squealing audio clip. Unfortunately, I am not a logical thinker (artist)...so I'm trying to wrap my head around how to stop it from repeating the sound every time the wheelcollider senses a hit on the slip?

    I've tried setting the sound being played to false (via a boolean), but it still plays like a blip every time the tire does like 20 slips per second lol. Really I need it to play the looping sound only after the very first slip is triggered and then stop when it senses 0% slippage. That's precisely what I need it to do.
    I am a learning coder, but I'm not getting there with this. I'm trying everything to help myself before asking in the forum for help.
     
    Last edited: Jun 14, 2012
  22. LeakySink

    LeakySink

    Joined:
    Apr 9, 2012
    Posts:
    141
    Create a timer function you kick off the first time the sound is played, then have it disable your boolean until the appropriate time has passed when the sound can play again.
     
  23. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    @LeakySink - Wow why did I not think of a timer...so like a YieldWaitforSeconds type thing. I can expose a public variable to make this adjustable in the inspector as well. Thank you very much good sir! I owe you one.
     
  24. Code_Of_Honour

    Code_Of_Honour

    Joined:
    May 28, 2012
    Posts:
    293
    Yes, like that. Although, not sure if a YieldWaitforSeconds will work in a FixedUpdate...I'm pretty sure it only works in functions that don't update every frame...although, I have no idea what the difference between Update and FixedUpdate is, so I could be wrong. However, if it does fail, try this:

    Code (csharp):
    1.  
    2. var timer : float;
    3. var randomboolean : boolean;
    4.  
    5. function FixedUpdate
    6. {
    7. timer -= Time.deltaTime;
    8.  
    9. if(timer <= 0)
    10. {
    11.  timer = 0;
    12.  randomboolean = true;
    13. }
    14. if(randomboolean)
    15. {
    16. timer = 10; // Or whatever time you want before the sound plays next
    17. }
    18. }
    19.  
     
  25. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
  26. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
  27. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
    Same, it looks sweet.
     
  28. MellowNinja

    MellowNinja

    Joined:
    Mar 26, 2012
    Posts:
    344
    The link is 404'd
     
  29. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Last edited: Jun 20, 2012
  30. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    @SevenBits - Were you the same guy playing in the Team Rush game last night? You were saying you hated me because I think I was using an overpowered or unbalanced weapon. :)
     
  31. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932


    Decided to start doing a daily video log (2-3 minute videos max) describing what I accomplished in the build that given day. Also a good spot to share info, scripts and any implementation specifics with other folks.
     
  32. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    Here's a work around when you need to basically yieldTime in a Update or Fixed Update script

    Code (csharp):
    1.  
    2. var Go : float  = 0;
    3.  
    4.  
    5. function Update () {
    6.  
    7. if( Go==0  wheel.GetGroundHit( hit ) ) {
    8. Go = 1 ;
    9. }
    10. }
    11.  
    12. function Start () {
    13. while( true)
    14. {
    15. yield WaitForSeconds(.2);// IF YOU DONT PUT THIS UNITY WILL CRASH, the actual time doesn't really matter, but its needed to avoid an infinite //loop , you should be good checking every .2 seconds , but make sure to put a yield in here ,  
    16. if( Go == 1 )
    17. {
    18. audio.clip = sidewaysSlipAudio;
    19.  
    20. audio.Play();
    21. yieldWaitForSeconds(2); // how long are we waiting before playing the sound clip again ?
    22. Go = 0; // this gives it back to the update function to check if we're hitting the ground
    23.  
    24. }
    25. }// forgot to close the function , sorry bout that
    26. }// again , closing up !
    27.  
    Thats a very noob work around , but if you ever need to yield time in an update function then that code up their will basically do it .

    nice progress dude, you should look into pro-race kit( he's on the asset forum section I think ) for enemy ai .
     
    Last edited: Jun 15, 2012
  33. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
    Pretty cool. I like the feel of the kart. It would be fun if later you added an indoor track with sharper turns. And could you share the script you used for the gates? Thanks!
     
  34. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932



    Worked on the HTML for the web page interface for the game. Also I've worked more on the main menu interface, trying to get it closer to representing something useful. Today was mostly HTML and main menu work for the buttons, etc. I've also got a splash page working (with the fatbox logo) as the game menu loads.

    As usual here's the link, go check it out! http://dl.dropbox.com/u/16956434/Kart_Race_Demo/Kart_Race.html
     
  35. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
  36. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,667
    i can't play it, i push de go race button and nothing happens
     
  37. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    What button is that lol? Use the WASD keys to play. The W key is the gas.
     
  38. Tekniko

    Tekniko

    Joined:
    Jun 15, 2012
    Posts:
    50
    Really cool, I loved the handling it felt very real. I thought the engine noise was a bit too over powering.
     
  39. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Noted. I will definitely decrease the intensity of the engine sound.
     
  40. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    I've migrated all of the HTML code to run embedded on a new web site now. It's a site purely dedicated to my Unity development work.



    You can find the current builds of the Kart Demo at this link (got a proper URL and all now):

    http://www.fatboxsoftware.com/

    This is where I'll be updating the build each night with updates as I progress.
     
    Last edited: Jun 19, 2012
  41. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Getting better and better : )
    Menu seems very, very slow and its way to easy to drive : p Perfect tire grip, so you cant get out of track : )
     
  42. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Yeah I'm sorting out the responsiveness of the menu buttons today. The car physics haven't been touched since creation, so they will be worked on at some point again and improved.
     
  43. Train

    Train

    Joined:
    Apr 22, 2008
    Posts:
    344
    I play`d the demo and it is very nice. Makes a lot off fun. Good job!
     
  44. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932


    Build has been updated today with actual updating GUI elements for lap counting and lap timing. It's rough right now, and not the final look of the text in the UI, but the functionality is working (only slightly buggy :). I've also implemented some nice UI graphics that slide in quick when you hit a checkpoint in the road. They ease in/fade in and ease/fade out when triggered onto the screen.

    Check the latest build at www.fatboxsoftware.com
     
  45. Deleted User

    Deleted User

    Guest

    It is coming along nicely. Driving is fun! I think you should lock the camera to the seat in driver's view mode. It feels odd to have the car pivot underneath the driver in this view.

    Keep up the good work!
     
  46. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932


    Nightly build. I've tweaked the vehicle physics quite a bit (still not there yet)...speed based tire grip and steering sensitivity scripting today. I've also ditched the realtime shadows for now...until the AI are in and functioning under stress tests tomorrow. Also you may notice at this moment there are invisible barriers on the sides of the roads...it's only temporary.

    You can can test and play at: www.fatboxsoftware.com
     
  47. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932



    Visually you'll see some changes in tonight's build. You'll notice I've started to work on the environment and got some stuff in there. Maybe one more week and the entire environment will be complete. On the scripting side I've implemented some more blocks of code to handle slippage at higher speeds...this physics scripting is intense stuff. I'm starting to learn to wear the scripting hat. I spend all day coding/testing stuff and then I'm thinking "man I wish I had an artist to handle all of that silly environment art lol". I love it...it's why I do it.

    So bullet point 1.) environment art update 2.) physics for higher speed slippage, etc. accomplished today. Oh and if you find you are interpenetrating art geometry it's because I haven't gotten around to opening up the collision file and updating it to match the new art. All in good time.

    As usual you can test the updated build at: www.fatboxsoftware.com
     
  48. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932


    I have AI vehicles working in the build now! There are a few things to note. They both share the same Waypoint spline, so they follow the exact same path. That will be fixed later on as they all get unique paths. Their art wheels are not turning with the wheelcolliders, so no wheel movement (will be fixed as well in the future). Turning is not as mathematically smoothed out as it could be yet, so they will jerk the steering wheel each time they seek that next waypoint. Also I do have the variables scripted in to rubber band them..basically adjust their speed and aggression at specific points. These attributes are not honed in yet in this build, so you won't notice huge drops in speed (it's there though). Finally you'll noticed I implemented a neat little standard startup countdown. A script simply disables player and AI control, hides GUI textures and sound, until a yield WaitForSeconds function says they are enabled. Practical and simple.

    The build can be tested at: www.fatboxsoftware.com
     
  49. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Resolved the bug where certain folks where getting locked up at the level loading screen (keyboard control diagram). Turns out the level wasn't streamed in yet, and the user was able to get through the menus so quickly that they would get stuck at that screen.

    The build can be tested at: www.fatboxsoftware.com
     
  50. jujunosuke

    jujunosuke

    Joined:
    Apr 30, 2011
    Posts:
    190
    Dude, this is looking good !

    One problem i have is the spec of my computer.
    Could you add some option to disable some expensive shaders ? Or to lower the res a little bit etc...

    Because right now, i think that i run about 10 fps...
     
Thread Status:
Not open for further replies.