• Projects
  • GDSim - Driving Simulator Prototype

My itch.io page is live! Check it out: https://lupine-vidya.itch.io/gdsim

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! :)

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.

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.

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. :)

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!

@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.
  3. I did, but if it escaped your notice, I have moved it to the top of the post.
  4. 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.

  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.

a month later

I have uploaded a new version of GDSim, version 0.2 alpha. :) This version is also now available in 32-bit form, for both Windows and Linux.

Version 0.2a includes significant refinements to handling and steering, improved CPU drivers, new sound effects, new menu options, fixes, various visual and audio adjustments, and more. It also benefits from the upgrade to Godot 3.3. Full details are available on itch.io.

Nice! You say in the changelog that:

Physics FPS now scales according to number of vehicles in session May I ask the range in which the Physics FPS can vary? And what's the difference in rendering FPS with and without this Physics FPS scaling?

@Saitodepaula said: You say in the changelog that:

Physics FPS now scales according to number of vehicles in session May I ask the range in which the Physics FPS can vary? And what's the difference in rendering FPS with and without this Physics FPS scaling? The range, also listed in the readme and the tooltip for the OptionButton node, is currently as follows. I designed it so "High" may be ideal for 144Hz screens:

........{ Solo / Versus / Quartet }
.V.High = 360Hz / 240Hz / 180Hz
...High = 288Hz / 192Hz / 144Hz
Default = 240Hz / 160Hz / 120Hz
....Low = 180Hz / 120Hz /  90Hz

I had the idea while running a larger pack of cars to test the changes to the CPU drivers. Typical performance on my main PC is 144+ fps (Vsync). At 240Hz, eight cars on the track currently results in around 25-35fps. At 90Hz, my PC can do eight cars at between 60 to 120fps -- but 90Hz is too low for a simulation like this, so it's a crude solution until more optimization is done.

Realistically, eight cars is not something I will worry about until much later. I intend to stick to a maximum of four for now.

EDIT: To be clear, I'm not pleased with the effect this feature has on the tire model, particularly now that I've spent more time with it. A user-configurable physics rate is not a bad idea, but the lower values are too low, so you can expect this to change. Maybe I should keep it between 180Hz and 360Hz.

a month later
a month later

Version 0.4 alpha is now uploaded, introducing important new features, most of all a save file, and including support for user-created content! More details can be found on the devlog.

Pulled from another thread:

@cucoogames said: Do you plan to go multiplayer? Apart from the local multiplayer, which I could probably extend to four players, I have no plan for online multiplayer. I think it would require more effort to smooth it out than it would be worth, for a project the size of mine. I am superficially aware of a couple methods to make it work, but on top of my lacking experience, my project is relatively demanding on weaker PCs like my old laptop, causing physics slowdown I think I would have to fix somehow.

Looking to the future, while I committed to making split screen multiplayer work with GDSim, what I would like to build on this simulation is a singleplayer concept, and not exactly a typical racing game. ;)

Yes that's fun, I finally took her out for spin. Physics also feel quite good.

Unfortunately my credit card was declined by itch (not the 1st time it happens) and I do not have PayPal. So I went with the "free" version ...

My question: Have you tried using it with a steering wheel? I only have a gamepad.

2nd question: Did you built the map directly in Godot or did you use i.e. Blender? I am experimenting with the HTerrain plugin to give it some natural curves, but its also kind of tricky.

2 months later

@cucoogames -- Thanks! :)

  1. I have tried GDSim with a wheel; it works okay, but there is no force feedback. It would be nifty to explore proper wheel support in the future, but Godot is not made for it yet; it does not even receive all of the buttons of a wheel set.
  2. The maps are made with a combination of Wings3D and Godot, including this useful addon.