[Mod] Car that drifts and skids [driftcar]

[Mod] Car that drifts and skids [driftcar]

Postby paramat » Mon Aug 06, 2018 12:24 am

Image

^ Smoke particles come from each wheel when skidding.

Download https://github.com/paramat/driftcar/archive/master.zip
Browse code https://github.com/paramat/driftcar

driftcar by paramat
For Minetest 0.4.16 and later. Compatible with Minetest 5.0.0-dev.
Depends: default

Licenses
--------
Source code: MIT
Media (textures and car nodebox): CC BY-SA 3.0

Description
-----------
A vehicle using some physics modelling for more realistic behaviour.

Usage
-----
Due to client->server->client control delay this mod is best used in
singleplayer or in local multiplayer.
Intensive mods that cause long server lags, such as Lua mapgen mods, will affect
the responsiveness of the vehicle, even in singleplayer.

There is no crafting recipe, the vehicle can be found in the creative inventory.
Third-person camera mode is recommended when driving for a better view.
If parameter 'AVIEW' in the 'init.lua' file is set to 'true', view is
automatically set to vehicle velocity direction.

Controls
--------
Right mouse button = Enter or exit car when pointing at car.

Forward = Speed up. Slow down when moving backwards.

Backward = Slow down. Speed up when moving backwards.

Left = Rotate anticlockwise.

Right = Rotate clockwise.

More stuff
----------
Something i have wanted to do for a long time, use my knowledge of physics to create a car that has fairly realistic skidding behaviour. It's capable of drifting, doughnuts and J-turns.
Due to the issues mentioned above it's best tried out first in singleplayer, flat mapgen, with no other mods running, for best responsiveness.

4 forces (accelerations) are modelled:
Linear force due to wheel torque: accelerating or braking. Acceleration torque falls to zero at a certain speed.
Linear force due to rolling resistance. Constant and opposite to linear motion.
Air drag opposite to velocity. Opposite to velocity and proportional to speed.
Lateral force due to tire grip. Opposite to lateral motion. This is limited so that when tire grip is overcome when turning skidding occurs.

Turning is acheived by rotating the vehicle, the lateral force is what actually alters the direction of motion.
Some of the 4 forces are set to zero if the vehicle is not in contact with the ground. This can be seen if turning while driving off the side of a cliff.
paramat
Developer
 
Posts: 3371
Joined: Sun Oct 28, 2012 12:05 am
GitHub: paramat

Re: [Mod] Car that drifts and skids [driftcar]

Postby Chiantos » Tue Oct 09, 2018 8:52 am

Hello,

Image

With Mesecar title for DriftCar, this best no ?

Good day
Chiantos
Member
 
Posts: 304
Joined: Sun Jan 15, 2017 9:04 am
GitHub: BlockColor
In-game: mrchiantos

Re: [Mod] Car that drifts and skids [driftcar]

Postby Byakuren » Tue Oct 09, 2018 9:58 pm

Are the front and rear tires modelled separately?
Byakuren
Member
 
Posts: 816
Joined: Tue Apr 14, 2015 1:59 am
GitHub: raymoo
In-game: Raymoo + Clownpiece

Re: [Mod] Car that drifts and skids [driftcar]

Postby paramat » Fri Oct 12, 2018 3:09 am

The car entity has visual type "wielditem", so the car is simply modelled as a nodebox, no need to use blender.
The nodebox has 6 boxes: upper half, lower half, plus 4 boxes for the parts of the wheels that protrude downwards (the lowest 2 pixels of the wheels).
paramat
Developer
 
Posts: 3371
Joined: Sun Oct 28, 2012 12:05 am
GitHub: paramat

Re: [Mod] Car that drifts and skids [driftcar]

Postby Byakuren » Sat Oct 13, 2018 7:25 am

Sorry, I meant physics modeling.
Byakuren
Member
 
Posts: 816
Joined: Tue Apr 14, 2015 1:59 am
GitHub: raymoo
In-game: Raymoo + Clownpiece

Re: [Mod] Car that drifts and skids [driftcar]

Postby paramat » Sat Oct 27, 2018 1:16 pm

I see. No, all wheels are assumed to be fixed and non-steering. The car is rotated around it's y axis according to control inputs in a simple way.
paramat
Developer
 
Posts: 3371
Joined: Sun Oct 28, 2012 12:05 am
GitHub: paramat

Re: [Mod] Car that drifts and skids [driftcar]

Postby Lone_Wolf » Fri Mar 29, 2019 7:29 pm

Nice mod! Could this be put on the ContentDB?
Lone_Wolf
Member
 
Posts: 2144
Joined: Sun Apr 09, 2017 5:50 am
GitHub: LoneWolfHT
In-game: Lone_Wolf



Return to WIP Mods



Who is online

Users browsing this forum: Bing Bot [Bot] and 0 guests