Search Unity

RC Racing Game

Discussion in 'Works In Progress' started by lockbox, Nov 29, 2012.

  1. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    I'm developing an on-road remote control car racing game for PC. The goals of this game are to:

    1. Capture the excitement of real RC racing (see video below)
    2. Offer single player (offline with AI opponents) and multi-player modes
    3. Allow players to create and share their own track designs with others

    I worked on the track designer earlier in the year, got extremely distracted by other things for seven months, and am finally getting motivated to work on this again. If you're interested, I have a web-based track designer prototype you can try (link below)

    Next steps:

    1. Create a car that can be driven within the track designer
    2. Automatic way point and racing line generator for AI opponents
    3. Develop AI opponents with different personalities (i.e. newbie, skilled, aggressive, precision driver, improving driver, sloppy driver, etc.)

    Any feedback, comments or questions are appreciated. :)

    Real RC racing video: Watch at 480p or higher!!



    Track designer prototype (web-based):

    http://dl.dropbox.com/u/25954755/wip02/RCTrackDesigner.html

    Track designer screen captures:

    $screenshot01.jpg $screenshot02.jpg $screenshot03.jpg
     
    Last edited: Nov 29, 2012
  2. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    In keeping with the requirements of this section, below are some screen captures of my progress this past week. The holiday season is a very busy time for me after hours, so I haven't had as much time as I've wanted to work on the project.

    game project + wife + holidays = not very productive

    I have very little modeling experience, so my initial goal was just to rough out a car now and clean it up later. It took a couple of hours to relearn how to use Blender, but it came back to me pretty quickly.

    The car I'm modeling is the latest 1/10th scale electric sedan put out by Team Xray, which only came out a couple of months ago. I had to put together a library of reference photos - both from Team Xray's site and some photos that people building the car have posted online. This kit minus all the electronics (servo, speed controller, motor, battery, receiver) is $500, so I'd rather not buy it solely for the purpose of modeling it.

    The other thing I spent an incredible amount of time on was researching the wheel collider and various car related scripts posted on the Web - again. I was looking for new tutorials, videos or info and trust me when I say, there isn't a whole lot of new stuff out there.

    The best free scripts and tutorials I've found thus far continues to be the one put out by polynurb (aka JamesArndt here in the forum). He has all the scripts and a very robust project with more stuff in it linked under the video on his YouTube Channel. Link is here. I just had to tweak a few parameters so that I can use it for running the car on the test track in the track designer. Good stuff!

    Short term goals:

    1. Finish modeling the car - shock tower, suspension parts, wheels and bumper. No body for now, that can come later too.

    2. Import the model into Unity, apply the scripts and fine tune the steering, throttle and braking with the gun controller (pictured below)

    3. See if I can figure out how to make a working suspension. Yes, yes, I know - I don't need this, but it looks really cool and will play a role in the game when configuring the car.. See this demo for an example of working suspension arms.

    If you have any comments or questions, let me know. :)

    $wip_car_01.jpg $wip_car_02.jpg $wip_controller.jpg
     
    Last edited: Dec 8, 2012
  3. Tony-West

    Tony-West

    Joined:
    Dec 8, 2012
    Posts:
    49
    Hi Lockbox

    Congratulations on the work you have done so for on your sim. Can I just say that if you are creating this sim for financial rewards then I would strongly urge you to look at off-road rather than on-road. There is very little market for on-road. The other advantage of off-road is that you will be able to see the results of your work on the animating suspension. The downside is that the track editor may require some more work. However I suspect your motivation is more on a personal level than financial and so far you have made a great start.

    The track editor is a great feature to have as most drivers will want to be able to re-create their own club track to practice at home so good thinking to get that sorted early on.

    The modelling on the car looks solid and with some textures and materials thrown on their it should look great.

    A word of warning about the physics for an on-road rc sim. You are going to have to run the physics at a much higher frequency than you would for a normal driving sim, or even off-road rc, and I am not sure how well unity will cope with that so you might want to look into that. If it doesn't like it then you are going to need to write your own physics which is not a light undertaking.

    Anyway best of luck and I look forward to following your progress. As I said great start and keep up the good work.
     
  4. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    Tony,

    Thanks for the feedback and great advice. Very helpful info!

    Yeah, I'm not into it for the money, so it's all good. Free to play with a donate button, and *maybe* ads if it gets popular.

    I primarily run 1/10 nitro sedan, have a T2, and run a M18 in the garage, so I'm basing the game around something I know.

    I've only run off-road in Real Race (out of print RC sim), so I don't have a good "feel" for the cars and how to set them up for different type of track surfaces. Designing your own tracks for that game was a real challenge.

    I think I could pull off the off-road track designer, but I'd have to get a lot of real track time to get the cars right.
     
  5. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,007
    I'm keeping an eye on your progress. :) Good luck with it.

    I tried to create a 1/8th RC Nitro Buggy simulator for mobile earlier in the year. I tried both Edys vehicle physics and Unitycar.

    I had problems trying to get those packages to work with real scale cars. They just kept jumping around, which was a real shame as sometimes I could control them long enough to get a glimpse of what the physics would like like it looked great, they flipped and jumped very realistically.

    In the end I decided to move on to another game and go back to the RC Sim at a later stage.

    It's interesting what you say Tony about using a higher frequency for physics, maybe that is something that would of fixed the issue i was having?
     
  6. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    Thanks! Lots of challenges ahead, but I'm looking forward to them.

    Cheers
     
  7. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,007
    I dug out my old RC project and increased the frequency for physics like tony suggested and it made a huge difference! :D
     
  8. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    That's awesome! I'm glad that worked out for you.
     
  9. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    Finished the roughed out car minus the body. 20k vertices, 20.5k faces, and 55 objects in Blender. The count is way too high for racing around the track, so I'll be hiding certain objects as required once it's imported into Unity.

    This working model will allow me to setup the car configuration screen, see how the car moves/reacts around the track with different car, track, and physics settings (different views in a "playback" mode), and see how the car drives around from the driver's stand view.

    The final racing version of the car will only be 6 objects - the body (with fake underside), the four wheels, and the chassis plate for setting the physic's ride height position.

    $wip_car_03a.jpg

    $wip_car_03b.jpg
     
    Last edited: Dec 16, 2012
  10. suctioncup

    suctioncup

    Joined:
    May 19, 2012
    Posts:
    273
    Looks great so far. Every considered doing off road tracks? With RC buggies with bouncy suspension and a lot of bouncing around?
     
  11. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
  12. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,007
    I'm going to tackle off road 1/8th nitro buggies after my current projects. However mine will be for mobile devices.
     
  13. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    I have a working R/C car now. It behaves like it's suppose to, including crashing into things, flipping over, and getting stuck on the rails, but I need to spend a lot more time adjusting all the settings to get a solid baseline configuration. Still a lot more trial and error before it's right.

    My gun controller horizontal/vertical input value adjustment code seems to be working okay. I need to calculate the in-game steering endpoints [ relative to a real R/C car ] so that I can code that correctly and that will help with making the other adjustments. I can take a tight turn and accelerate out of the corners, but I feel like I'm slowing down too much to do that.

    I fussed with the Fixed Timestep values and that certainly makes a difference. With 0.01, the car spins very easily. 0.015 seems about right, but the SWAG endpoint adjustment need to be fixed, so that will definitely factor into the final value that I use.

    Manually adjusting the values in the inspector is getting "stupid", so I definitely need to get an interface up and running to continue. It needs to include a auto-checkpoint and rollback feature so that I can go back at any point in time without having to write things down. I also need to be able to put in a note so that I keep track of what I changed.

    The gear shifting isn't working right and I will have to completely recode that to work properly. It needs to be redone for the R/C gearing anyway, but for now, I just want it to accelerate a little more realistically.

    I'm happy with my progress, especially after putting in all these hours today - and that's what counts. :D

    $wip_working_rc_car.jpg
     
    Last edited: Dec 20, 2012
  14. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,007
    Awesome! Did you just use the wheel colliders in Unity?

    This is really making me want to work on my RC game, but im in the middle of a project damnit! :D

    Here's what I have so far, the physics are very sketchy!

     
    Last edited: Dec 20, 2012
  15. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    LOL! Yes, I used the Unity wheel colliders. I just imported my car into this polynurb's "Full tutorial scene" project from his YouTube video [ http://www.youtube.com/watch?v=21zuMIsy2GM - link is in the description ], copied everything over to my car and then started fussing with the parameters based in part on the info posted on this page: http://www.gotow.net/andrew/blog/?page_id=78

    On the wheel colliders, adjusting the wheel forward friction and sideways friction stiffness factors, and the spring value made a big difference. I also tested turning on/off the Antiroll_Bar and SimpleVelocityLimiter scripts and adjusting the values in the SimpleVelocityLimiter script.

    Just driving on the ground plane is misleading. Creating a small track let me see what was really happening with the car - and my camera angle was as you see it, not following the car as in the tutorial scene.
     
    Last edited: Dec 20, 2012
  16. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    Just watched the video.. Looks cool!
     
  17. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
  18. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,671
    Haha guys that's my vehicle tutorial! Glad it could help some folks out. I like that you posted the Andrew Gotow car tutorial as well, since my stuff is based on a lot of his work as well.
     
  19. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    Your tutorials are awesome! Good pacing, informative and fun to watch. Perfect examples of how to do Unity tutorials.
     
  20. Tony-West

    Tony-West

    Joined:
    Dec 8, 2012
    Posts:
    49
    Making good progress. Looking forward to seeing a none rough version of the car with some textures and watching it driving around a track. Will your tracks only be the ones from the editor or will you make some real tracks also?

    Getting double value on this thread with 2 RC sims in production. Going to be interesting to watch them both develop.
     
  21. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    Thanks Tony! :)

    If the player community is willing to help with track dimensions/elevations and getting the details correct, I am more than willing and happy to make some real tracks. That in itself will require me to develop a more sophisticated track editor, which assuming that things go well, will eventually make it's way into the game. I don't want to get too far ahead of myself. One thing at a time.
     
  22. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    If you can understand German, you should watch this video on the WheelCollider Wheel Friction Curve. He basically explains these values:

    $class-WheelCollider-4.jpg

    Good stuff!!

    http://youtu.be/mEQn3sxdsV4
     
  23. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,671
    Ha ah sounds like it could be a very thorough explanation, but it all sounds greek to me.
     
  24. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    The quivk and dirty:

    Extremum is the point that the wheels break loose and asymptote is the break loose point AFTER they've broken loose the first time.
     
  25. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,007
    Hey Tony, are you by any chance working on VRC Pro tracks? :)

    Taken from the VRCworld website:

     
  26. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,059
    Yes Tony is the single artist on that project.
     
  27. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,007
    He does all the artwork?! Awesome, He's good!
     
  28. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,059
    Yes everything, car modelling, track modelling, textures, Gui, etc, and in his spare time does the content for our MegaFier and MegaShapes demos.
     
  29. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,007
    Wow, great work!
     
  30. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    Indeed. :)
     
  31. sesamiam

    sesamiam

    Joined:
    Jun 13, 2012
    Posts:
    87
    Respect to the West brothers :)
     
  32. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    What's up guys. Hope you had a good Christmas. I've been out of commission with a head cold on top of being still wiped out from a weekend of last minute shopping and hosting a party on Christmas day. Ugh!

    Progress for this week? Even with a head cold, I can still surf the Internet... lol

    I'm big on storing data in XML, so I spent some time looking for some sample code to implement in the game. I found this really great tutorial on creating a file manager, manual XML creation and parsing (as opposed to XML Serialization), and encrypting file data, that just saved me from having to do hours of research, coding and debugging. Totally awesome!

    There are just a couple of compiler errors in the code that I'm sure you can figure it out. ;)

    http://www.fizixstudios.com/labs/do/view/id/unity-file-management-and-xml

    So in lieu of any real wip on the game this week, I present these R/C drift videos from a R/C drift track in Korea. These guys are so bad ass! I'm seriously thinking about replicating this track in the game for drifters, but only if I can figure out how to get a Unity car to drift like this. Talk about a challenge!!

    Enjoy!



     
  33. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    Still feeling like garbage, but spent some time modeling the body over three days. First time modeling a car (R/C bodies are formed out of a single piece of Lexan) and this took about 12 hours. I have no idea how this will look once I apply a texture to it, but I know it's going to need more work. I already see some problem areas - lol

    Comments? Suggestions?

    Photos: Blender model, with subsurf modifier applied, and renders.

    $wip_body_01.jpg $wip_body_02.jpg
     
    Last edited: Jan 1, 2013
  34. sesamiam

    sesamiam

    Joined:
    Jun 13, 2012
    Posts:
    87
    Model looks nice although I would like to know how much is the poly/tri-count for it? :)
     
  35. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    blender without subsuf - vertices: 2475, faces: 2374
    blender with subsurf - vertices: 9697, faces: 9480
     
  36. sesamiam

    sesamiam

    Joined:
    Jun 13, 2012
    Posts:
    87
    Im sure you could do the model with less verts but of course depending how close you want to view it ingame and how detailed you want it to be :) You could even use higher detailed model for the car selection menu for example and lower detailed for ingame.
     
  37. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    Agreed. I'll see how testing goes and adjust accordingly.
     
  38. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    Wow! Has it been that long since I posted something in this thread?

    In the process of troubleshooting my R/C car, I started writing my own tool to analyze what the problem was (and still is), which eventually turned into a developer tool that I just submitted to the Asset Store. Product Website and link to one of the web player demos is here:

    http://objectmotionstudio.wordpress.com/

    $oms_screenshot_01.png $oms_screenshot_02.png
     
    Elharter likes this.
  39. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    355
    wow! This is looking amazing Lockbox. I love the track editor option. That will ad a nice touch.

    If you need any help, let me know. I can at least tell you "what not to do"....as i made a lot of mistakes that are still getting redone. :D.

    Im just having to much fun lately racing real RC Cars to finish all the stuff i want....:D

    Kevin
     
  40. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    Thanks Kevin - and thanks for the offer. I will certainly keep it in mind.

    Real RC racing is ALWAYS more fun than anything you could ever do on a computer. :D
     
  41. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    After being dragged into a high budget / high profile project at work for the past 11 months (which won't be done until 2017/18 - *ugh* ), I am finally getting back to this. After watching the indoor Euro Offroad series, I'm definitely adding indoor offroad.. Checkout the video below...

    At present, I'm checking with the guys are Rival{Theory} on their thoughts on how RAIN might be able to take care of the automatic pathfinding, automatic waypointing, and AI requirements for the game. It would save me A LOT of time if it can. I will be focusing on those 3 things over the next few months and will share the results as things progress.

    Cheers!

     
    Last edited: Feb 28, 2014
  42. indiegamemodels

    indiegamemodels

    Joined:
    Jan 25, 2012
    Posts:
    269
    The video of the real races you have posted now and in your first post are extremly impressive :eek:

    I didn't knew it was that fast and required that much skills and refexes!

    good luck with your game!
     
  43. lockbox

    lockbox

    Joined:
    Feb 10, 2012
    Posts:
    507
    This week's dev journal:

    RAIN is not going to work for my project, so I have to write the code myself. No problem. ;)

    I made some progress this week and that's always a good thing.

    As you may (or may not) recall, users are able to create their own tracks in my game and I really don't want them to have to figure out the racing line and waypoints for the AI, so the game is going to do it for them. I have yet to see a Unity game that does this (please let me know if there is one that does!), so this is quite a challenge.

    The first thing I did was figure out the geometric apex of each red and white dot relative to each red and white dot's rails. From a racing standpoint, any angle less than 180 degrees is not a apex point, so it's primarily reflex angles (angles >= 180, but I'm using 150) that define turns. As you see in the photo below, each red and white dot has a cyan geometric center point, with a purple dot on the left (left looking top down based on the apex's orientation), and gray dot on the right.

    After that step is complete, each of the purple and gray dots does a raycast sweep on it's side of the apex point for other purple and gray dots to determine the next adjacent cyan apex dot. The raycast sweep only goes from the apex angle -180 to the apex angle. Why does it need to do a raycast sweep? Since the player can drop red and white dots anywhere on the track in any order, the game doesn't know where the next dot is from a driving standpoint. Now it does.

    At this point, I don't have the racing apex for each turn, the racing line or the waypoints. The next step is to determine the geometric racing line using straight lines, then convert that into bezier curves, and then adjust each bezier curve for both late apex and multi-apex turns. After that's done, I can start working on waypoints.
     

    Attached Files:

  44. Elharter

    Elharter

    Joined:
    Sep 20, 2015
    Posts:
    30
    Hi lockboy... i know this thread is very old...but whats the current state about the track editor please?
     
  45. yorak

    yorak

    Joined:
    Sep 29, 2014
    Posts:
    1
    I'd also be interested about the status of the project. I've just recently started building an open source RC buggy simulator with Blender and would like to hear if which license you are planning to use in your simulator project. Are you aiming for a commercial game, or would it be possible to collaborate.

    I do not want to hijack the thread, but for those interested, my project resides here (Github).


    Even if you lockboy are not interested in collaborating with the assets, physics modeling etc. please see the input folder in my projects Github repository. It includes instructions and open source implementation for using a real RC controller as a PC joystick (support for Linux, but Windows should be quite easy with vJoy). What you need is an Arduino dev board (that costs only few dollars if you order one from ebay) and some male to female jumper wires. You are welcome to use the input side code as you see best.
     
    devotid and JamesArndt like this.
  46. Elharter

    Elharter

    Joined:
    Sep 20, 2015
    Posts:
    30
    Is that thread not more active? id like to see news about that rc-stuff :)
     
    JamesArndt likes this.
  47. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,671
    I was considering a little hobby side project with RC cars :)
     
  48. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,007
    The problem I have/had with RC cars is the scale. If you want accurate scale it tends to throw the physics in to a unstable mess.
     
  49. Elharter

    Elharter

    Joined:
    Sep 20, 2015
    Posts:
    30
    you? show me!