Repository navigation
Vehicles: real models for every car, train and boat, and for the signal heads - #1515
Merged
Merged
Conversation
…al heads 47 vehicle models and 6 signal-head states, built by a Python kit in assets/vehicles (Blockbench's format, textures painted from the geometry, livery masks, flicker and rider-view checks) and embedded from out/. Java draws each body as one item_display from the world's resource pack (1.21.6+), Bedrock as entity geometry with wheels that turn with speed. Parked cars become the same models, lamps dark, when vehicles move on Java. Signal heads are one display each, a model per state the data pack swaps, and mast arms a straight bar at any angle. Faces that change along one axis only take one texel row, losslessly, which halved the atlas the vehicles share with facade photos; the vehicles' share is set aside before facades are sized. Cars stop only where a car head faces them, and queue behind a car held at a red line instead of driving through it from inside a junction, as a headless server run of Hamburg's junctions showed both going wrong. Moving Vehicles and Working Traffic Lights get the New! badge. Claude-Session: https://claude.ai/code/session_015UbtD55SJyhmbrZNKRYFdi
|
⏱️ Benchmark run finished in 0m 54s 📈 Compared against baseline: 48s time, 1250 MB memory ✅ This PR improves generation time. 📅 Last benchmark: 2026-11-14 01:26:38 UTC You can retrigger the benchmark by commenting |
Cars stopped with their middle on the stop point, so the longer the car, the further its front reached over the line, a truck by 1.6 blocks. A signal's stop is now two points, one for cars and one further back for buses and trucks, each placed so the longest of its kind stands with its front a block short of the stop line the road markings paint, or just short of the signal where none is. A car about to cross a junction first checks for room past it: no red light too close behind the junction to wait at clear of it, and no car standing across the start of the lane out, heading its way. Otherwise it waits at the edge, for 40 s at most. Inside a junction, a car standing in the lane ahead, or ahead on the same way through, is a queue to wait behind, not crossing traffic to pass after a while. Claude-Session: https://claude.ai/code/session_015UbtD55SJyhmbrZNKRYFdi
From the review of the stop line and junction work: - A stop line is looked for among every road's, by where it lies, so a line painted on the way before the signal's counts. Only one crossing this lane between its start and the signal does: not one beside some other stretch of road, which the old search pinned to the lane's end. - A car waiting at the edge of a junction is not held as at a red line: its front can reach into the road it crosses, so crossing traffic gives way to it. - The gate looks back over where a car joins a lane only where it joins partway along, not across a narrow junction at cars waiting on the far side. - Inside a junction, a car standing in the lane past it counts as a queue only when it heads much the same way, and the same-way-through check measures from the car's own heading in sixteenths of a turn, read fresh, not the eighth look last left behind. - Stops for two signal groups keep a point each. The gate's marks are cleared near the junction only, and a car already standing skips the gate. Claude-Session: https://claude.ai/code/session_015UbtD55SJyhmbrZNKRYFdi
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.
Moving vehicles and traffic lights get real models instead of stretched blocks: 47 vehicles plus 6 signal-head states, built in Blockbench's format by a small Python kit, drawn on Java from the world's resource pack and on Bedrock from the add-on.
Vehicles
assets/vehicles:_lowbuilds for low bridges: motorboat, sailboat, river and car ferries, sea ferry, water bus, tour boat, peniche, barges, river cruise.kit.pypaints each texel from the geometry.build.pywrites the textures, livery masks, Java item models, Bedrock geometry and metadata intoout/, which Arnis embeds and recolours per livery.check.pychecks every model for flickering faces and for a blocked view from the rider's seat.item_display, with the brake lights on a second display.Traffic lights
item_displayper head, a model per state: red, amber, green, red-and-amber; walkers red and green. The data pack swaps the model, replacing 7 block displays per car head. The lit lens glows.Car behaviour fixes
Found by running a generated Hamburg world on a headless server and logging every car, body and head twice a second for several signal cycles:
Also
resources.zipkeeps the models out, container wagons named by their colours.Testing
cargo test: 2,629 passed. Integration tests pass, all GUI tests pass, clippy and fmt clean.check.py.Known limitations
resources.zipstill declares format 46 because facades and the pause menu work there.