Discussion
Loading...

Discussion

Log in
  • Sign up
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
youen
youen
@youen@mastodon.gamedev.place  ·  activity timestamp 5 days ago

Here is another video showing the old prototype. The physics wheel slides, it does not rotate. But the mesh used for rendering does rotate (according to the movement speed). And as is visible at the beginning, the vehicle can remain stable if perpendicular to the slope.

Now I basically need to reproduce this in Godot.

Your browser does not support the video tag.
This video cannot be previewed
Open original
A video in first person view where we see the player create a vehicle, then get on the driving seat, and drive around on grassy hills. The player also collides with trees, which make them fall down, which also break the branches.
  • Copy link
  • Flag this post
  • Block
youen
youen
@youen@mastodon.gamedev.place replied  ·  activity timestamp 4 days ago

This anisotropic friction thing is going to prove an interesting challenge (which is an euphemism for "I'm in a dead end").

The old implementation I made relied on PhysX providing the normal force applied to each contact point, which I need to compute friction. The more you press objects one against the other, the more friction forces prevent them to slide relatively to the other.

Sadly, #Jolt does not provide this information 😬

#GameDev #Godot

  • Copy link
  • Flag this comment
  • Block
youen
youen
@youen@mastodon.gamedev.place replied  ·  activity timestamp 4 days ago

I think my remaining options would be:

* see if I can do something with the VehicleConstraint of Jolt https://jrouwe.github.io/JoltPhysicsDocs/5.2.0/class_vehicle_constraint.html#details
* try to implement proper anisotropic friction (according to documentation, the Contact constraints are "considered an internal class" https://jrouwe.github.io/JoltPhysics/#constraints so I'd have to modify Jolt)
* use a different physics engine
* try to use a cylinder collider with a hinge joint to make a wheel that actually rolls and see if that's stable or not

Jolt Physics: Jolt Physics

Jolt Physics: VehicleConstraint Class Reference

  • Copy link
  • Flag this comment
  • Block
thomastc | frozenfractal
thomastc | frozenfractal
@thomastc@mastodon.gamedev.place replied  ·  activity timestamp 5 days ago

@youen Very likely you are already aware, but just in case, Godot has a dedicated VehicleWheel3D node. No idea if it suits your needs... from the docs it seems like you might indeed need to reinvent the wheel. Literally.
https://docs.godotengine.org/en/stable/classes/class_vehiclewheel3d.html

Godot Engine documentation

VehicleWheel3D

Inherits: Node3D< Node< Object A 3D physics body for a VehicleBody3D that simulates the behavior of a wheel. Description: A node used as a child of a VehicleBody3D parent to simulate the beha...
  • Copy link
  • Flag this comment
  • Block
youen
youen
@youen@mastodon.gamedev.place replied  ·  activity timestamp 5 days ago

@thomastc well, no, I wasn't aware 😅

As you said, the docs make it seem like I'll need to implement my own, but I'll take a look at their implementation anyway, could be interesting. Thanks for the pointer!

  • Copy link
  • Flag this comment
  • Block
thomastc | frozenfractal
thomastc | frozenfractal
@thomastc@mastodon.gamedev.place replied  ·  activity timestamp 5 days ago

@youen Phew, glad to be of assistance! 😊

  • Copy link
  • Flag this comment
  • Block
youen
youen
@youen@mastodon.gamedev.place replied  ·  activity timestamp 5 days ago

@thomastc apparently they go one step further than using a fixed collider for each wheel: they have no wheel collider, and instead use raycasts to find the terrain distance, and apply forces on the vehicle body to keep it away from the ground (like an hovercraft)

Don't think this would do in my case, since players may use wheels for other things, such as roller conveyors. And I don't think their system would work if another object was to rest above a wheel.

Still, interesting technique.

  • Copy link
  • Flag this comment
  • Block
Giuseppe Bilotta
Giuseppe Bilotta
@giuseppebilotta@fediscience.org replied  ·  activity timestamp 2 days ago

@youen @thomastc if you are still exploring options, you may want to look also into Project Chrono

https://projectchrono.org/

We use it for physically-accurate simulations, and while we do not do vehicles, I know that other research groups have actually used for that.

  • Copy link
  • Flag this comment
  • Block
youen
youen
@youen@mastodon.gamedev.place replied  ·  activity timestamp 2 days ago

@giuseppebilotta
Thanks for the info, I did not know about Project Chrono, seems an interesting library! However my first feeling is that it's not targeted at real-time high performances? Also, there are discussions to integrate it in Godot, but apparently it's not available for now https://github.com/godotengine/godot-proposals/issues/3023

For the anisotropic friction issue, it's solved now, I've implemented it in Jolt https://mastodon.gamedev.place/@youen/116094183738985725
@thomastc

  • Copy link
  • Flag this comment
  • Block

Bonfire social

This is a bonfire demo instance for testing purposes

Bonfire social: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1 no JS en
Automatic federation enabled
Log in Create account
  • Explore
  • About
  • Members
  • Code of Conduct