This is a continuation of the engine behind Twisted Babylon - Dev Log - #25 by Pryme8
It demonstrates all the components that go into creating a car that meshes well with the soft body physics (beams, dynamic colliders, voxelization, deformation lattice, and connection queries).
Ill post some of the internal playtesting today. Just finished the leaking systems so your radiator can get a leak and cause your cooling system to run out of coolant eventually causing your head gasket to seize up along with slow leaks in tires and other systems, detections if the mounts are destroyed etc so I know when there is terminal damage.
Annd I added one other type of damage most race games leave out, Fatal.
Its getting really spicy, just finished side roads, the utility lines and buildings for two real Finnish roads and they have all the road sign and markings legally required by Finnish law and all the Rally regulations are respected as well for track construction and markers.
Ill have to do a full writeup here soon about how the drive physics actually work because I can confidently claim I have one of the better driving simulation systems ever made for webGL.
Here I had AI do a summary of the systems because its too much for me to go over without sounding like a mad man I also told it to keep all the scientific talk out of it because Id struggle to not explain shit in newtons and jargon --------
The idea in one line: the car behaves like a real machine. Everything that moves it comes from its tires on the ground and its own parts working, with no hidden helpers keeping it on the road.
What works today
Tires that read the road. Grip depends on the surface and on how much weight is on each tire. Tarmac grips hard but lets go once you push past the limit. Gravel grips less but keeps holding as the car slides, which is what makes a controllable rally slide possible. Brake hard and there’s less grip left for turning, just like a real car.
Weight that moves. Springs, shock absorbers and anti-roll bars at each wheel shift the car’s weight when you brake, accelerate and corner. Drivers can use that shift to help turn the car, as real rally drivers do.
A complete engine and drivetrain. The engine delivers its real published power curve, can stall, and hits its rev limiter. You get turbo lag and anti-lag, a working clutch, gearboxes that reward clean shifts, and differentials that split power between the wheels. Pull the handbrake in the four-wheel-drive car and the rear wheels lock while the front ones keep pulling.
Tires that fail. Tires have real air pressure and temperature. A hard landing can pinch one and sharp stones can puncture one. A leaking tire goes flat and pulls the car to one side, and one driven too hard comes apart and leaves you on the rim.
Breakdowns that unfold. Damage doesn’t just end the run, it plays out over time. A holed radiator makes the engine run hotter until it seizes minutes later, and a cracked oil pan loses pressure in corners first. Leaking turbo pipes, failing brake lines, bent steering and snapped driveshafts all behave as they would in a real car. A small hit can be nursed to the finish.
Crashes with consequences. Each car’s body is built from over a hundred crushable pieces, so hitting a tree crumples the car where it hit. Every crash is judged as it happens: drive on, out of the rally, or in the worst case fatal for the crew. Both cars have been through virtual crash tests into walls and poles from the front, side and rear.
Water. Drive into a lake and the car floats, fills up and sinks. If the engine’s air intake goes under, the engine drowns.
Two cars, and a Garage that changes them. One is a 1970s rear-wheel-drive two-door and the other a 1990s four-wheel-drive turbo rally car, both built from published engineering figures under fictional names. Swap gearboxes, axle ratios and differentials, or adjust wheel alignment, anti-roll bars and brake balance, and the car drives differently.
Places to drive. There’s a test ground with hills, a jump, a rough lane of potholes and ruts, and a skid pad. There are also two real gravel roads in Finland, built from open map and elevation data, that you can drive start to finish.
Feedback from the simulation itself. Tires throw gravel, dust and spray and leave marks that match the surface. Engine sound is generated live from the simulated engine rather than played from recordings.
Why it holds up
The physics updates 480 times a second, which is eight times for every frame on a 60 fps screen.
The same inputs always give exactly the same result, so crashes and breakdowns are fair. That same repeatability is the basis for replays and leaderboards later.
Driver aids are optional. Auto-clutch and auto-shift help keyboard and gamepad players, and features like anti-lock brakes only appear on cars that really had them. The physics underneath is the same either way.
A live data screen and exportable logs show what every tire is doing, like a real team’s data engineer would see.
About 290 automated tests cover the physics, damage and crash code, and many of them run against the real physics engine.
Coming next
Gravel that piles up in front of a sliding tire, wet roads, snow and ice.
Suspension based on real suspension geometry, tire temperature affecting grip, tire wear, and brakes that fade when hot.
Parts that break off in a crash, like bumpers and wheels.
Racing wheels, pedals and force feedback. Only keyboard and gamepad work today, and the game currently ignores wheel controllers.
Replays, ghost cars, and an in-game co-driver reading pace notes. The co-driver’s voice lines already exist.
I also downloaded over 1.2 tb of lidar data for specific California roads and will be doing a set of roads set at a historic timepoint (1990s). That included a set of public information request to caltrans to get the blueprints and final lay designs for 360+ bridges and specific construction elements to make sure that the recreations are as close to true as possible. Im still waiting on the requests to come back but in the meantime the flora and land feature digestion is already done.
Also coming in the next patch is updates to allow the wheels to detect more then a single contact point, have mass pile ups in front of the wheels depending on the looseness of the surface. Steering column adjustments for high speed travel, update to the fatal crash system, fixes to a hard system crash due to the morph system going into unreasonable numbers, precaching a secondary compression model from the ground up to prevent unrealistic damage to the sub structures. Refinements to the hidden hazards in the flora. Revamped buildings and yard design, long road streaming and physics streaming to allow courses to extend to well over 300km without load screens. Way points, course restrictions on route since there are so many side roads now that you could technically cheat the line. A huge batch of physics updates to improve stability and yeah.. thats all I can think of for now.
Oh and car b has its own engine voices now for all its internal components.
(thought of one more thing)
Canopy coverage research is almost done!
Car B now has its own voice, where before it drove in silence. It has its own manifold and turbine, turbo boost and anti-lag bangs.
Added a transmission voice: dog-box whine, four-wheel-drive drivetrain whine and gear clacks.
Car B’s cabin boom is now a quarter of car A’s.
Fixed the listener lagging behind the camera at speed.
Exhaust pops are now seeded events from the engine (fuel system, limiter, anti-lag). The voice plays them as each cylinder’s exhaust valve opens (sound frames v5), so replays sound the same.
Steering
Added a real rack, column and driver’s hands, so the steering pushes back like the tires do. The cockpit wheel follows the column (telemetry v7).
Keys and sticks are limited to the lock the car’s speed allows, and a stick pushed to its end winds on as slowly as a held key.
Added damping at the rim and the rack, so a car let go at speed settles instead of spinning.
Crash, crush and damage
Fixed things that could freeze the page: flat hulls are now refused (babylon-box3d 0.6.1), and one exception in a tick no longer stops the render loop.
Fixed crush problems: refused crushes roll back, chunks can’t be carried absurdly far, and parts and cabin steel outside a chunk now move with its face.
Damage limits are now realistic: suspension wrecks at 8 cm, brake lines tear from 5 cm, driveshafts pull from 4 cm of plunge. Track rod bend and driveshaft pull are measured properly.
Hits from below are baked per chunk from pad presses in the crash rig, with the ground’s hand-set floor kept as a minimum.
Ticks now stop when the car’s body stops being finite (NaN).
Tire contact
The tire meets the ground as a disc (a footprint) instead of one point, so potholes, cleats and step edges behave (GroundQuery v4).
Tire pinching and the bead’s lateral load are fixed, so flat landings no longer flatten all four tires.
Wheels in the air no longer cost extra.
Real stages and the Forge
Farmyards are cleared round their buildings, with lawns, gravel and old trees.
Junctions have signs, name plates and mailboxes. Every side road is closed as the rally closes it, and every T, Y and crossroads is patched, including crowded groups.
Side roads have their own roadside. Field entrances, paths (with tread and tape) and the boom that closes Ala-Painaantie are built, and the boom collides.
The Forge moved to version 3: centreline review and end checks. The start’s roads close at the clearance points, and Saukkolantie stays 6.5 m wide.
Generated stages can now sprout forest roads, field tracks and driveways by rule.
Forests: stumps are rare in unworked forest, a stand being thinned was added, and bushes no longer hide anything solid.
Performance
Measured a baseline for the real stages: frames, memory by layer and the ground query.
A real stage’s CPU memory dropped from 2.8 GB to 2.1 GB, and the ground query allocates nothing.
Car A’s tick garbage dropped from 6 KB to 3.5 KB, and the rack allocates nothing.
Sharing a pole’s or pad’s force among chunks now grows with the chunks touching instead of their square.
Also have two new courses being created, a run from highway 101 on route 36 all the way out to the Mad River burger bar (about 86km) and a 300km section of the historic highway 1 on the coastline around the Big Sur area.
The two Finland courses are done, things are getting really fun. Still need to make some tweaks to steering and suspension but its getting closer all the time.
Im doing the historic 1 out of Big Sur in the 1990s before a bunch of the classic structures got washed out. Did a public information request for As Built designs from Caltrans and that got approved so Im getting the actual blue prints for all the bridges, retaining walls, abutments etc and have a blueprint system to digest them into real models.
The biggest tech lift this week was getting physics and model streaming to work so all that does not have to be loaded into memory at once.
Along with powerline digestion and watershed tables now contributing to the road parsing things are starting to speed up.
Ive set a hard limit on geospatial data to be at least a 2m resolution so things are very close to an approximation of real world locations.
Ill be getting it on a steam here soon along with allowing early access play.
If anyone really wants to support me then plllllease wishlist it when it comes out and or buy/wishlist its predecessor Twisted Retro Rally whose full version will be coming out this month.
Also Ill be giving out some free keys to people that help me test.