FilipeTessaro - Drivecraft: Multiplayer Vehicles and Traffic AI - Car, Truck, Trailer, Motorbike

Drivecraft is a vehicle plugin made for multiplayer first: cars, a truck with its semi-trailer and a motorbike that a player drives without waiting for the server, and traffic that drives itself on lanes you draw. It has its own physics and does not use Chaos Vehicles.

Drives without lag. The driver's machine runs the vehicle ahead, the server checks every frame, and a wrong guess is replayed from that frame. Measured with 150 ms of lag and 5% packet loss: the driver was corrected 0 times driving a car, a truck with its trailer, a motorbike, crashing into a parked car and head on into another player.

Light on the server. Every vehicle runs on one fixed 60 Hz frame, the same on the server and every client. 50 vehicles cost about 0.07 ms each per frame.

Any character gets in. Add one component to your own character, any class. Driver or passenger, change seats, get out on either side, get out of a car lying on its roof and flip it back on its wheels.

Car, truck, trailer, motorbike. The truck tows a semi-trailer simulated and predicted with it. The motorbike leans into turns by itself. Eight ready-made setups as Data Assets: sports car, family car, SUV, van, bus, truck, trailer and motorbike.

  • Sports car: 0-100 km/h in 5.4 s, 260 km/h

  • Family car: 0-100 km/h in 6.7 s, 160 km/h

  • SUV: 0-100 km/h in 6.4 s, 190 km/h

  • Motorbike: 0-100 km/h in 5.8 s, 180 km/h

An engine and a gearbox. Torque curve, gear ratios, rev limiter, automatic or manual, all simulated and predicted with the rest.

Tuning you can feel. ABS and traction control you can turn off, brake balance, anti-roll bars, downforce and drag. Ground surfaces by physical material: dirt, grass and ice come with it, each with its own grip and rolling resistance.

Traffic that obeys. Lanes are splines you draw. Traffic follows the car ahead, slows for bends, stops at junctions with right of way, stop signs or traffic lights, and changes lanes to pass a slow car or to get to its next turn. Every driver is a bit different: speed, distance kept, how pushy. They honk at a player standing in the way and stop with their hazards on after a crash. In the example town, 30 cars for 120 s: 62 went through the lights on green, 3 on yellow, none on red, and no two cars touched.

Damage. A hit takes bodywork off; at the front the engine pulls less, near a wheel that tyre grips less. Apply damage or repair from Blueprint.

Lights and sound. Headlights, brake lights, reversing lights, turn signals and hazards, the same on every machine. The engine sound plays a recording pitched by the rpm, or makes the sound as it plays. A horn.

Blueprint all the way. Vehicle, setup, rider, traffic manager, lanes and junctions are open to Blueprint, with events for getting in and out, damage, honking and every traffic car spawned.

An example town to play. A town of blocks with traffic, an avenue, traffic lights, a dirt yard and an ice yard, every vehicle parked to drive, and two players with F1 and F2. Open L_DrivecraftTown and press Play.

A demo to play. Windows demo, no engine needed: [demo link]

Docs: https://apps.tessaroapps.com/drivecraft/docs/

Engine versions: 5.6, 5.7 and 5.8, Windows. Uses the Enhanced Input plugin.
PS: Feature requests are accepted