Log inGet started
World

Torque Valley: Driving, Drift and Crash Sandbox

README.md

driveSurfaces

Checks driveSurfaces.surfaces and its two components:

  • Table: names() / list() hold the 14 surfaces in the fixed car.surfaceId order. get / byId / default agree, unknown names and ids answer nil, and the definitions are frozen and well formed (class, skid sound, grip, slide, stiffness, rolling, roughness, dust).
  • Grip ordering: tarmac > concrete > wet tarmac > gravel > snow > ice, with puddles below wet tarmac and oil the slipperiest after ice.
  • Materials: every surface's material resolves, and an unknown surface raises.
  • Patch zones: inside/outside tests with the vertical pad, overlapping zones (the later one wins), rotated zones and unregistering.
  • Sampling: a pad's own Surface, an ancestor's Surface, the tarmac default (bare entity or nil) and a patch zone winning over the ground under it.
  • Authoring: paint() sets the Model material and the Surface kind. A SurfacePatch component registers its zone and removes it on despawn.

It leaves alone how a car's tyres use the numbers (torqueCars' grip, rolling and bogging), the look of the materials and shaders, and the gallery scene. Zones are registered under tests_driveSurfaces_* keys and entities are spawned far from the play area. Both are removed after each test.

Run it in edit mode:

return asset.resolve("driveSurfaces", "testSuite"):run()