Repository navigation
feat(fp): player building crews that build phone orders in real time - #15
Merged
Merged
Conversation
Orders placed from the phone now go to the player's two building crews instead of the contractors. CitySim.apply_player_order hands an order's sites to a crew and keeps the order in crew_jobs; advance_crews moves the crews on with the frame time at game speed, held back while a sliced tick or spread work runs. A building takes 2 minutes (a park) to 5 (the airport) at speed 1 and a road 10 seconds a tile; a third order waits for a free crew. Sites go through their stages as the work goes in, finished orders open, a bulldoze cancels the order, and saves keep the orders. Each crew is on its site to see: a foreman by the gate, two builders whose clips follow the stage and a hauler carrying crates from a pile to the work, in the trades bodies from the character roster, with dust and a board over the gate naming the crew, the order, the stage and the time left. A crew that takes an order while you play walks in through the gate, and a road crew moves along the road. Where they stand comes from a per-site grid (crew_grid.gd) over the ground inside the hoarding and the construction kit's new decks: the ground among the rebar, the slab, every frame floor and the scaffold boards, with the posts kept clear. crew_spots.gd picks the door, the foreman's spot, work spots the door reaches and a drop point the hauler reaches without walking into the crew. The hoarding gate now faces the frontage road, and each spoil berm blocks on its own, so the pit inside is open ground. The phone says how many crews are free and how long an order takes, a card under the top bar counts down the orders, E on a worker gets a word about the job and the site's interact label names its crew. FpFeature gains link_signal() and unlink_signals() for teardown. Behind the "crews" flag, with fp_crew_jobs_test (sim) and fp_crews_test (grid, spots, rig, card, photo shot); fp_core_test and fp_player_test read the gate from CityView.site_gate. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Automated reviewNo new findings on the 39 changed files (gdlint, complexity, TODO policy, dead code). Run |
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.
What
Orders you place on foot from the phone now go to your own two building crews, who build them in real time on site, so you can see a build happen (feedback: "no visible build, want CoC-style crews").
Sim (
scripts/sim/)CitySim.apply_player_order(mi, a):apply_actionfor the phone. The order's sites go to the player'sD.CREWS(2) crews instead of the contractors, and the order is kept increw_jobs(total/donein crew seconds,crew-1 while it waits).advance_crews(seconds):_processfeeds it the frame time at game speed, holding time back while a sliced tick or spread work runs. Sites go through their stages, finished orders open, waiting orders take crews as they free up (crew_job_started/crew_job_finished,cancelledwhen a bulldoze clears the sites). Saves keep the orders.D.crew_seconds): 2 min (park) to 5 min (airport) at speed 1, 10 s per road tile (CREW_MIN_S,CREW_MAX_S,CREW_TILE_S).Crews on site (
scripts/fp/crews/, flagcrews)crew_rig.gd: a foreman by the gate, two builders whose clips follow the stage, a hauler carrying crates from a pile to the work, dust while they work, and a board over the gate naming the crew, the order, the stage and the time left. A crew that takes an order while you play walks in through the gate; a road crew moves along the road.crew_bodies.gd: HC's trades bodies, loaded on background threads, pooled for reuse (stand-in capsules without the roster).crew_grid.gd: a per-site walk grid (0.8 m cells) over the ground inside the hoarding and the construction kit's decks, clear of every collision box, cylinder and deck post, with links for steps and climbs.crew_spots.gd: picks the door, the foreman's spot and pile, work spots the door reaches, and a drop point the hauler reaches without walking into the crew. When a finished building fills its lot, the crew works from the scaffold.crew_card.gd: a card under the top bar listing the orders with stage, progress and countdown, and the ones waiting.crews_feature.gd: wires it up. E on a worker gets a word about the job, the site's interact label names its crew, and a toast says when an order is done. There's a newcrewsphoto-tour shot through a site gate.Construction kit and view (
scripts/world/)ConstructionKit.deck()/decks_of(): where people stand on a site's own parts (the ground among the rebar, the poured slab, the slab under a frame, every frame floor, the scaffold boards) and which posts to keep clear.Siteroot'sgatemeta. Each spoil berm now blocks on its own, so the pit inside is open ground.CityView.site_gate(i)andsite_decks(i)read them in world space.Phone, HUD, interact
apply_player_orderand shows how many crews are free and how long the order takes, or when a crew frees up.hud_stylegets crew colours, and the interact label shows which crew builds a site.Shared
FpFeature.link_signal()/unlink_signals(): a shared way for features to connect signals and drop them in teardown (used by crews).NOTIFICATION_PREDELETE, so quitting without teardown does not leak them.Tests
fp_crew_jobs_test(sim: queueing, timing, sliced-tick hold, saves, cancel, finish_all_sites, instant mode).fp_crews_test(arrival through the gate, hauler route, talk, queue, every stage including the scaffold, finish, cancel, road crew, rebuild, photo shot, teardown, free without teardown).fp_core_testandfp_player_testread the gate fromCityView.site_gate.Checks run
tools/gate.sh fullwithGATE_RETRIES=1: PASS (36 steps, no flaky steps).tools/gate.sh render --only fp_photo: PASS (24 shots, including the newcrewsshot).pre-commit run --all-filesandpython tools/checks/run_all.py: PASS.tools/gen_api_docs.py: regenerateddocs/api;README.mdanddocs/fp/ARCHITECTURE.mdupdated.