GDSim - Bespoke RigidBody-Based Driving Simulator

WolfeWolfe Posts: 22Member
edited April 11 in Projects

Download link here:
https://lupine-vidya.itch.io/gdsim?password=unlisted

Finally, it is time to introduce my project. GDSim will serve as the demonstration platform for the ongoing development on my own driving/racing simulator, with a powertrain simulation, suspension model, and tire model that elevate it above the built-in VehicleBody and VehicleWheel nodes.

I have noticed some talk in Godot spaces that the VehicleBody and VehicleWheel nodes are inadequate, and that there are not many resources for 3D driving/racing games. I hope to pay back the Godot community for providing such a powerful and versatile game development platform by sharing things I've learned along the way in this endeavour.

I have already begun that effort on my "home" forum, GTPlanet.net. Take a look to see my explanation of the some of the framework for the suspension and tire model.

I may cross-post my write-ups or post links to new entries along the way; whichever the admins prefer, I suppose (
@TwistedTwigleg ).

First, if you enjoy cars and driving/racing games, please download and try my project. I hope you enjoy drifting the Works Blackjack as much as I have in playtesting! :)


Tags :

Comments

  • TwistedTwiglegTwistedTwigleg Posts: 4,204Admin
    edited April 3

    Looks great @Wolfe! :smile:

    @Wolfe said:
    I may cross-post my write-ups or post links to new entries along the way; whichever the admins prefer, I suppose (@TwistedTwigleg ).

    However you want is fine! There's no rules or restrictions either way, so go with whatever works best for you.

  • WolfeWolfe Posts: 22Member

    I have just posted part V of the thread on GTPlanet, about simulating a powertrain.

    I think there is actually just one major topic left that I wanted to cover, which is to go back to tires with the model that I am actually using (instead of Pacejka), and a couple things that have changed since last autumn.

    This thread, though, is for GDSim. I have posted a thread with links in the Tutorials section so people can find it in its proper place.

  • WolfeWolfe Posts: 22Member

    I have been putting in some time on the CPU drivers. I've fixed a few bugs for them, and I plan to do the next upload once they're a bit more competitive in general.

    Meanwhile on the simulation, I have implemented fuel consumption based on brake-specific fuel consumption. The engine now sputters and stalls once it's running on fumes, and the quantity of fuel adds a bit of mass (0.7489kg per liter). Different vehicles can have different BSFC values, making them more or less efficient.

    There is no point in fuel consumption for sprints around the test circuit, of course, but it's preparation for the future. :)

  • SaitodepaulaSaitodepaula Posts: 65Member
    edited April 8

    Great work! I will try the prototype on itch.io!

    Some suggestions:

    1. Place a link to itch.io on you first post here.
    2. Place a video of the game in action, also in the first post.

    Now some comments: you've said in your post about "Suspending a RigidBody" in the GTPlanet foruns, that you tried the rigid body + joints approach, but it was too unstable. I understand that, as this is my approach in my game, and I've solved the instability at high speeds using a higher physics FPS (I use 240 FPS in my game), and simple collision shapes, like cyllinders for the wheels, not custom meshes.

    Anyway, I understand that having a simulation as a target, the joints solution might not be ideal.

    Also, Godot physics seems to run more smooth in general when compared to Bullet, but I've not made the jump to Godot physics yet because I cant' set the position of the center of mass, and this is key in my game.

    Other comment, about the spring arm solution: Juan just proposed a change for it. So, I don't know if it will change your solution, but I think it's important to keep an eye on it:

    https://github.com/godotengine/godot-proposals/issues/2560

    You may also want to keep an eye on this:

    https://github.com/godotengine/godot/issues/45333

    All in all, it's great to see a project directed at racing and vehicle simulation in Godot! I think everyone will benefit of different approaches coming from different projects!

  • WolfeWolfe Posts: 22Member

    @Saitodepaula said:
    Great work! I will try the prototype on itch.io!

    Some suggestions:

    1. Place a link to itch.io on you first post here.
    2. Place a video of the game in action, also in the first post.

    1. I did, but if it escaped your notice, I have moved it to the top of the post.
    2. Not quite there yet. :) I want to refine the engine sounds a bit more first. I'm not so worried about marketing this project; in my plan, GDSim is a playable work-in-progress toward something greater.

    Now some comments: you've said in your post about "Suspending a RigidBody" in the GTPlanet foruns, that you tried the rigid body + joints approach, but it was too unstable. I understand that, as this is my approach in my game, and I've solved the instability at high speeds using a higher physics FPS (I use 240 FPS in my game), and simple collision shapes, like cyllinders for the wheels, not custom meshes.

    Coincidentally, GDSim is also running physics at 240 FPS. The tire model needs a high framerate for stability at a standstill.

    When I was using the G6DOF joints, I actually got the best results from the combination of an overlapping cylinder shape and sphere shape. The cylinder hypothetically represented the edges of the sidewalls, adding a bit of "bite", while the sphere made for more consistent contact, allowing a bit of roll instead of just leaning on the sharp edge of the cylinder.

    Other comment, about the spring arm solution: Juan just proposed a change for it. So, I don't know if it will change your solution, but I think it's important to keep an eye on it:

    https://github.com/godotengine/godot-proposals/issues/2560

    You may also want to keep an eye on this:

    https://github.com/godotengine/godot/issues/45333

    I have already had my concerns about other discussions like these behind the scenes, but I did not catch this new one yet. Thank you for bringing it to my attention. I will add my $0.02 to the thread now.

  • SaitodepaulaSaitodepaula Posts: 65Member
    1. I did, but if it escaped your notice, I have moved it to the top of the post.

    Ops, it did escaped, great!

    1. Not quite there yet. :) I want to refine the engine sounds a bit more first. I'm not so worried about marketing this project; in my plan, GDSim is a playable work-in-progress toward something greater.

    Take your time!

    Coincidentally, GDSim is also running physics at 240 FPS. The tire model needs a high framerate for stability at a standstill.

    What I have noticed, is that if higher physics FPS are used (like mor than 400), the game begans to run in kind of a slow motion. I don't know if it's OK or not, but I think that the CPU tries to run so many physics frames that it drags down the whole performance. I will make some more tests and open an issue on Github if I can confirm it.

    When I was using the G6DOF joints, I actually got the best results from the combination of an overlapping cylinder shape and sphere shape. The cylinder hypothetically represented the edges of the sidewalls, adding a bit of "bite", while the sphere made for more consistent contact, allowing a bit of roll instead of just leaning on the sharp edge of the cylinder.

    Hum, combining spheres and cyllinders sound interesting, never thought about that. What I've done to make the wheels actually stop after letting go the accelerator key, is to increase the rigid body (of the wheels) damp to something between 0.5 or 1.0.

Sign In or Register to comment.