Repository navigation
Bring back what Aussie Outback 4x4 added to the engine: four-wheel drive, ruts, blows, shared scenes - #88
Merged
Conversation
…wheel drive, ruts, blows, shared scenes The game is built on the engine in a fork, and changed the engine's crates as it went. This is everything in them that is not the game's own, on main as it is now. Vehicles: a transfer case with low range and lockers, a driveline solved as one, seven more surfaces with how far a tyre sinks and digs in each and what rain does, tyres aired down, a payload, a tray that things lie in, and ground that keeps the ruts pressed into it (solstice-vehicle's rut.rs), which the wheels behind ride in. Game: a driver who gets out and walks, loose things as bodies, blows measured (impact.rs), a map of what the ground is made of (ground.rs) with a `surfaces FILE` line in a scene's text to name one, a time to beat worked out from a track (par.rs), and parts of a car's model taken off and put back. Rendering: ruts drawn by relief mapping from the cells the wheels read, mud that lies wet and cracks at its rim, glass seen through, headlamps, a coat of paint, rust, dust and mud on whatever is driven, and pages and materials written while a game is played. Scenes: an actor whose model is in a file shared with other scenes (`shared`), a scene that lends its meshes and textures to those baked beside it (`lends`), the join that makes one scene of two, and packs of pieces read one at a time (`bake --kit`). The viewer reads a scene with the file it shares, whole or streamed, and draws ruts round whatever is driven. Nothing else of the game's viewer is here, nor its world generator. The tests' trucks are fixtures beside gt.vehicle. docs/ruts.md says how ruts are built; docs/gameplay.md says how scenes share. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…files - Glass is a blended material whose colour is see-through. One whose colour is opaque is drawn opaque, as before glass, and stays off the masked raster path, with the old warning. - The pack reader holds every length to the file's size, the surface map refuses runs that would wrap and rows past its own, and filling a borrowed scene checks its sums. - The ruts' texture is a one-square stand-in until something is first pressed, so a scene nobody drives on no longer allocates tens of megabytes for it; the resolve pass is bound again when it is made whole. - A square of ruts is counted changed, and copied to the GPU, only when its bytes change, so a car standing on grass no longer re-uploads its squares every frame; a square a strip changed nothing in is not kept. The strip's size guard saturates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ee-through colour Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aussie Outback 4x4 is built on this engine in a fork, and its last thirty commits changed the engine's crates as well as adding the game. This brings back everything in those crates that is not the game's own, onto
mainas it is now (the fork has not fallen behind: its base is #87).Nothing of the game comes with it: not its world generator, its menus, its trucks or its maps.
What comes back
Vehicles off the road (
solstice-vehicle,solstice-physics)Transfer,DriveMode), front and rear lockers, and a driveline solved as one (drivetrain::solve_all).Surfacegains dirt, mud, bog, leaf litter, rock, ford and sand, each with how far a tyre sinks and digs, and how rain changes it (set_wetness). Tyres can be aired down; a payload weighs on the springs.rut.rs): soft ground keeps what tyres press into it. Wheels behind ride in the ruts of those ahead, a spinning wheel digs itself in, a deep rut holds a car back.Knock,car_touches).place).The game layer (
solstice-game)get_out,get_in,Idle).add_thing,move_thing,carry, which ride in a tray and weigh on the car.impact.rs,take_impacts). What a blow breaks is left to the game.SurfaceMap), and asurfaces FILEline in a scene's text to name one. That line is the one thing here the fork did not have: there the generator wrote the map itself.par.rs), an autopilot with a pace, handicaps on what the player asks of a car, and parts of a car's model that can be taken off and put back (detach,attach).Rendering (
solstice-render,solstice-asset,solstice-import)ruts.rs,ground/ruts.wgsl,Renderer::sync_ruts), with mud that lies wet at its heart and cracked at its rim (Material::MUD).Material::GLASS), headlamps (set_lamp), and a coat on whatever is driven: paint in any colour, rust, dust, mud, wet (Coat,set_coat,set_resprays,Material::PAINT,INSIDE).BuildOptions::flat,Renderer::rewrite_pageandset_material.Imported::names), so a model of named pieces can have some shown and some not.Scenes that share a file (
solstice-asset,solstice-bake,bake)sharedat the end of anactorline: the actor's model is inshared.solsticebeside the scene, and the two are joined as they are read (join.rs), whole or streamed.lendsin a scene's text: scenes baked beside it leave out every mesh and texture it also has, by content hash, and the join puts them back (lend.rs,join::fill).pack.rs,bake --kit): a model of pieces in one file, each piece read alone.Procedural ground and plants (
solstice-procgen): four ground materials of dry eucalypt country (bush.rs), three more barks and four more kinds of leaf. Nothing in the engine uses them yet; they are there to be planted with.In the viewer
Only what makes these reachable, about 300 lines, most of them one new file:
sharedactors is read with the file beside it, whole or with--stream(shared.rs);play.rs).What is left out, and why
solstice-bake/src/outback, 9,300 lines with its tests) and theoutback,provingandarenascene lines. With them goeslends outback;lendsalone stays.web.rs,loader.js). The join itself is here; the page's side of it is tangled with the game's map cache.Changed on the way
scenes/folder. They now read two fixtures besidegt.vehicle:truck.vehicle(a 2.8-tonne desert pickup) andwagon.vehicle(a two-tonne diesel wagon).tests/raptor.rsistests/truck.rs.docs/ruts.mdis the fork's note on ruts with the viewer's and the game's parts taken out;docs/gameplay.mdgains "What several scenes share".Behaviour that changes for the engine's own scenes
Playcan have two actors with a camera if one is a car: the car and whoever drives it.Checked
On Windows with an RTX 5080, on the final commit:
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --release -- -D warnings(seven lints in the ported code were fixed on the way:rut.rs,streaming/mod.rs,vg/resolve.rs,bake/src/kit.rs)cargo test --workspace --release: 1,087 passed, none failed, 3 ignored (as onmain: they need scans or are measurements), the GPU tests among thembake-webpython scripts/test_affected.pyandnode apps/viewer/web/editor/test.mjsNew tests with this: the join (
solstice-builder/tests/join.rs), ruts (rut.rs,tests/ruts.rs), the truck off the road (tests/truck.rs), blows (impact.rs,tests/blows.rs), loose things (tests/things.rs), the viewer's adoption of shared actors (shared.rs), and a scene'ssurfacesandlendslines (scene_file.rs).Not checked
shared.solstice(whole and--stream), and ruts on a circuit's grass.surfaces FILEline is new here and has its one test; no scene uses it.Fixed after review
Two commits on top, from an independent review (Claude Sonnet 5.5):
join::fillchecks its sums.New tests: a blended opaque-colour material is not glass (both importers), damaged packs, wrapped runs and extra rows in a surface map, a repeated press changes nothing, and a GPU test that ruts draw without errors from the first press.
Authorship
Written by: Claude, through Claude Code (the port and its fixes).
Reviewed by: Claude Sonnet 5.5 (two independent reviews: the PR, then the fixes; no findings left open). Locally verified by Claude Opus 5.5 at d1bea3d:
bash scripts/check-changed.sh --all(1091 passed, 0 failed, all checks passed, GPU tests and browser builds included) andnode apps/viewer/web/editor/test.mjs(all passed). The newsha2dependency and the new file formats (SOLPACK1 packs,shared,lendsandsurfacesscene lines,.surfacesmaps, new.vehiclekeys) were approved by the owner.🤖 Generated with Claude Code