Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions crates/daemon/names/shops.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,16 @@ Osgood's
Delacroix & Fils
Pemberton's
Marlborough House Stores
[s8]
Crossroads Service
Blue Star Gasoline
Highway Garage
Libertyville Motors
Fairway Service Station
Red Arrow Filling
Pioneer Gas & Oil
Summit Service
Milestone Garage
Oak Lane Service
Golden Mile Motors
Cornerstone Fuel
1 change: 1 addition & 0 deletions crates/daemon/src/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ pub const BLUEPRINTS: &[Blueprint] = &[
bp("c6", "Craftsman bungalow", Cottage, &[Village], 1, 450),
bp("c7", "Half-timbered house", Cottage, &[Village], 1, 550),
bp("s2", "Corner café", Shop, &[MainStreet, Downtown], 1, 500),
bp("s8", "Filling station", Shop, &[MainStreet], 1, 500),
bp("s6", "Tower brewery", Workshop, &[Works], 1, 600),
bp("s5", "Department store", Shop, &[Downtown], 2, 1200),
bp(
Expand Down
2 changes: 1 addition & 1 deletion crates/daemon/src/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2196,7 +2196,7 @@ mod tests {
let w = c.world(None, Timestamp::UNIX_EPOCH, &TimeZone::UTC);
let shops = w.needs.iter().find(|n| n.id == "hamlet-shops").unwrap();
assert!(shops.fits.is_empty());
assert_eq!(shops.fits_locked, ["s1", "s3", "s2"]);
assert_eq!(shops.fits_locked, ["s1", "s3", "s2", "s8"]);
}

#[test]
Expand Down
5 changes: 3 additions & 2 deletions docs/APP.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ are blueprints and their prices.
| S4 | Brick factory | workshop | `s4_factory.py` | in |
| S5 | Department store | shop classic | `s5_store.py` | in |
| S6 | Tower brewery | workshop | `s6_brewery.py` | in |
| S7-S9 | Corner store, filling station, market hall | shop | | |
| S8 | Filling station | shop diner | `s8_station.py` | in |
| S7, S9 | Corner store, market hall | shop | | |
| A1 | Pre-war brick block | apartment classic | `a1_apartment.py` | in |
| A2 | Brownstone row | apartment townhouse | `a2_brownstone.py` | in |
| A3 | Balcony block | apartment classic | `a3_balcony.py` | in |
Expand Down Expand Up @@ -147,7 +148,7 @@ carry a FOR SALE board. Park spots draw the
decorations bought for them (`SPOTS` in `models.ts`).

Signs that carry a name (S1's fascia; the café, diner and works friezes,
S6's painted wall; the office, L2 and S5 name panels and canopies; L1 and
S6's painted wall, S8's canopy fascia; the office, L2 and S5 name panels and canopies; L1 and
L3's gilt names) show the building's own name: `NameSheet` in
`real.ts` paints each name into a shared sheet the first time a building
asks for it. A1's two shop signs are stock, by seed.
Expand Down
2 changes: 1 addition & 1 deletion ui/blender/real/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import lib # noqa: E402

MODELS = {"a1": "a1_apartment", "a2": "a2_brownstone", "c1": "c1_farmhouse", "c2": "c2_cottage", "c3": "c3_modern", "c4": "c4_aframe", "s1": "s1_shop", "s2": "s2_cafe", "s3": "s3_diner", "s4": "s4_factory", "o1": "o1_tower", "o2": "o2_round", "o3": "o3_brutalist", "l1": "l1_deco", "l2": "l2_supertall", "s5": "s5_store", "s6": "s6_brewery", "l3": "l3_gothic", "a3": "a3_balcony", "c5": "c5_stone", "c6": "c6_bungalow", "c7": "c7_timber", "a4": "a4_deco", "a5": "a5_paris", "a6": "a6_modern", "cars": "vehicles", "trees": "trees", "street": "street", "bridge": "bridge", "civic": "civic", "p1": "p1_substation", "f1": "f1_fire", "e1": "e1_school", "h1": "h1_clinic", "l5": "l5_cityhall", "e2": "e2_police", "e3": "e3_library", "h2": "h2_hospital", "p2": "p2_power", "w2": "w2_pumping"}
MODELS = {"a1": "a1_apartment", "a2": "a2_brownstone", "c1": "c1_farmhouse", "c2": "c2_cottage", "c3": "c3_modern", "c4": "c4_aframe", "s1": "s1_shop", "s2": "s2_cafe", "s3": "s3_diner", "s4": "s4_factory", "o1": "o1_tower", "o2": "o2_round", "o3": "o3_brutalist", "l1": "l1_deco", "l2": "l2_supertall", "s5": "s5_store", "s6": "s6_brewery", "l3": "l3_gothic", "a3": "a3_balcony", "c5": "c5_stone", "c6": "c6_bungalow", "c7": "c7_timber", "a4": "a4_deco", "a5": "a5_paris", "a6": "a6_modern", "cars": "vehicles", "trees": "trees", "street": "street", "bridge": "bridge", "civic": "civic", "s8": "s8_station", "p1": "p1_substation", "f1": "f1_fire", "e1": "e1_school", "h1": "h1_clinic", "l5": "l5_cityhall", "e2": "e2_police", "e3": "e3_library", "h2": "h2_hospital", "p2": "p2_power", "w2": "w2_pumping"}

argv = sys.argv[sys.argv.index("--") + 1 :] if "--" in sys.argv else []
flags = {a for a in argv if a.startswith("--")}
Expand Down
490 changes: 490 additions & 0 deletions ui/blender/real/s8_station.py

Large diffs are not rendered by default.

20 changes: 16 additions & 4 deletions ui/src-tauri/models.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "69b5b45241f8dd01",
"url": "https://github.com/Sagyam/DeepWork/releases/download/models-69b5b45241f8dd01/",
"id": "39218fff38c933a7",
"url": "https://github.com/Sagyam/DeepWork/releases/download/models-39218fff38c933a7/",
"files": [
{
"path": "a1.glb",
Expand Down Expand Up @@ -224,6 +224,12 @@
"sha256": "b07216f9ba9e2a5bd1669e897e69cc5c6ff65509505e08bf79fee2914f32c1ce",
"asset": "s6.glb"
},
{
"path": "s8.glb",
"size": 180024,
"sha256": "6c2b763aa77c1d3910ea93f2ee43ccd14d7198eff18d9eec54bd238f1903ecea",
"asset": "s8.glb"
},
{
"path": "street.glb",
"size": 58531,
Expand All @@ -244,8 +250,8 @@
},
{
"path": "bc7.json",
"size": 2070,
"sha256": "1cf3de656aa25dae3be51d07e57d07cb92cbe54dc5835330f3e91fe625c52382",
"size": 2078,
"sha256": "3bdb6724a8fea310ea98388e3d1a3a3a5d851f2e37d4c68577c58f707ef66b6d",
"asset": "bc7.json"
},
{
Expand Down Expand Up @@ -470,6 +476,12 @@
"sha256": "57455a4355b7e9e7d600f45cefd76625595ce5f675113d7dbde270858da5918e",
"asset": "s6_ao.bc7"
},
{
"path": "s8_ao.bc7",
"size": 2681684,
"sha256": "6cb6cfa4a1ba5aeeed842cb3129c718c12e0ee889232444ccc583c289a9968ef",
"asset": "s8_ao.bc7"
},
{
"path": "street_ao.bc7",
"size": 2979625,
Expand Down
9 changes: 9 additions & 0 deletions ui/src/city/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,15 @@ function realYard(p: Parts, rp: Parts, s: Spec, def: RealDef, r: () => number) {
fenceRun(p, "fence_panel", half, back + 0.1, -half, back + 0.1);
break;
}
case "s8": {
// Concrete to the pavement and under the canopy, a car drawn up at the
// pumps (between the islands or outside one); the bins out back.
p.box(mat(0xb2aea6, { roughness: 0.92 }), LOT - 0.4, KERB, LOT - 0.4, 0, 0, cz);
parked(p, s.seed % 2 ? 0 : -4.3, 3.6, 0, s.seed + 3);
const bin = mat(0x2a4a34, { roughness: 0.6 });
for (let i = 0; i < 2; i++) p.box(bin, 0.7, 1.1, 0.7, 2.0 + i * 0.85, KERB, back + 0.7);
break;
}
case "s6": {
// Setts to the pavement before the cart arch, the casks on them;
// behind, the yard with the brewery's van along the back wall and the bins.
Expand Down
1 change: 1 addition & 0 deletions ui/src/city/plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const DESIGNS: Record<string, { kind: Kind; style: string }> = {
s4: { kind: "shop", style: "factory" },
s5: { kind: "shop", style: "classic" },
s6: { kind: "shop", style: "factory" },
s8: { kind: "shop", style: "diner" },
a1: { kind: "apartment", style: "classic" },
a2: { kind: "apartment", style: "townhouse" },
a3: { kind: "apartment", style: "classic" },
Expand Down
39 changes: 38 additions & 1 deletion ui/src/city/real.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ const S2_F2 = 3.2;
/** S2's frieze, cornice and roof above its top storey: the slates start 1.04 m up, the stacks top out 4.8 m up. */
const S2_EAVES = 1.04;
const S3_TOP = 3.36;
/** S8's wall head: the roof piece (parapet, fin tower) stands on it. */
const S8_TOP = 3.8;
const S4_TOP = 5.3;
const P1_EAVES = 3.0;
const F1_G = 5.0;
Expand Down Expand Up @@ -485,6 +487,21 @@ export const DEFS: Record<string, RealDef> = {
smoke: () => new THREE.Vector3(-1.2, 4.05, -3.4),
debris: 0xb4b8bc,
},
s8: {
id: "s8",
kind: "shop",
style: "diner",
// The canopy's fascia to the back wall, the air post to the pylon sign.
w: 14.2,
d: 12.8,
front: 1.2,
floors: () => 1,
stack: (floors, roof) => [...(floors > 0 ? [{ piece: "body", y: 0 }] : []), ...(roof ? [{ piece: "roof", y: S8_TOP }] : [])],
top: () => S8_TOP,
// The fin tower's cap.
height: () => S8_TOP + 5.5,
debris: 0xe8e2d4,
},
s4: {
id: "s4",
kind: "shop",
Expand Down Expand Up @@ -1445,6 +1462,19 @@ const dinerNames = new NameSheet(1, 8, 2048, 128, ["STARLITE DINER", "MOONBEAM D
g.fillText(text, 1024, y, 1900);
});

/** Filling stations' names for the canopy's fascia, 2048 x 128 a row: white sans capitals with a dark edge, on clear. */
const stationNames = new NameSheet(1, 8, 2048, 128, ["CROSSROADS SERVICE", "BLUE STAR GASOLINE", "HIGHWAY GARAGE", "PIONEER GAS & OIL", "SUMMIT SERVICE", "MILESTONE GARAGE", "OAK LANE SERVICE", "GOLDEN MILE MOTORS"], (g, _x, y0, name) => {
const y = y0 + 66;
const text = spaced(name.toUpperCase(), 2);
g.textAlign = "center";
g.textBaseline = "middle";
g.font = "800 88px 'Helvetica Neue', Helvetica, Arial, sans-serif";
g.fillStyle = "rgba(10,10,12,0.55)";
g.fillText(text, 1028, y + 4, 1880);
g.fillStyle = "#fbf8f0";
g.fillText(text, 1024, y, 1880);
});

/** Firms' names painted on a factory's frieze, 2048 x 128 a row: cream letters, weathered, on clear. */
const worksNames = new NameSheet(1, 8, 2048, 128, ["HOLLIS & WARD · ENGINEERS", "BRANDT MACHINE WORKS", "NORTHGATE FOUNDRY CO.", "EAGLE SPRING & AXLE CO.", "MERCER BROS. · BOILERMAKERS", "UNION BOX & PAPER CO.", "CALDER WORSTED MILLS", "PARAGON CASTINGS LTD."], (g, _x, y0, name) => {
g.textAlign = "center";
Expand Down Expand Up @@ -1516,6 +1546,7 @@ function namesFor(id: string, role: string): NameSheet | null {
case "works": return worksNames;
case "cafename": return cafeNames;
case "deconame": return decoNames;
case "stationname": return stationNames;
default: return null;
}
}
Expand Down Expand Up @@ -1938,7 +1969,7 @@ export function groundMat(name: string, tile: number, opts: Std & { normal?: num
*/
export function realMat(id: string, role: string, paint: Paint, damage: number, variant = ""): THREE.Material {
const pick = (list: number[], i: number) => list[((i % list.length) + list.length) % list.length];
const tinted = ["brick", "bluebrick", "rubbed", "steelframe", "doors", "corrugated", "works", "siding", "shutter", "shopframe", "door", "shingle", "sign", "cornice", "ghost", "render", "cladding", "alu", "shake", "boards", "timber", "chair", "enamel", "neon", "neon2", "dinername", "carpaint", "slate", "ridge", "rustic", "cafename", "parasol", "officeglass", "spandrel", "mullion", "blades", "towername", "cladstone", "boardform", "floodstone", "deco", "bronze", "deconame", "brownstone", "door2", "door3", "infill", "fieldstone", "stoneslate", "oak", "plaintile", "zincseam", "band", "fin", "modbrick", ...LEAVES, "hedge"].includes(role) || (id === "a2" && role === "frame") || (id === "a5" && role === "stone");
const tinted = ["brick", "bluebrick", "rubbed", "steelframe", "doors", "corrugated", "works", "siding", "shutter", "shopframe", "door", "shingle", "sign", "cornice", "ghost", "render", "cladding", "alu", "shake", "boards", "timber", "chair", "enamel", "neon", "neon2", "dinername", "carpaint", "slate", "ridge", "rustic", "cafename", "parasol", "officeglass", "spandrel", "mullion", "blades", "towername", "cladstone", "boardform", "floodstone", "deco", "bronze", "deconame", "stationname", "brownstone", "door2", "door3", "infill", "fieldstone", "stoneslate", "oak", "plaintile", "zincseam", "band", "fin", "modbrick", ...LEAVES, "hedge"].includes(role) || (id === "a2" && role === "frame") || (id === "a5" && role === "stone");
const names = namesFor(id, role);
const cell = names?.cell(paint.name, paint.signs) ?? -1;
const key = `${id}:${role}:${damage}:${variant}:${tinted ? `${paint.wall}:${paint.accent}:${paint.roof}:${paint.signs}:${cell}` : ""}`;
Expand Down Expand Up @@ -2092,6 +2123,12 @@ export function realMat(id: string, role: string, paint: Paint, damage: number,
if (damage < 2) m.userData.night = 0.45;
break;
}
case "stationname": {
const t = stationNames.texture(cell);
m = new THREE.MeshStandardMaterial({ map: t, alphaTest: 0.5, roughness: 0.3, emissive: 0xffffff, emissiveMap: t, emissiveIntensity: 0, polygonOffset: true, polygonOffsetFactor: -2, polygonOffsetUnits: -2 });
if (damage < 2) m.userData.night = 0.6;
break;
}
case "gravel": m = w(pbr("gravel", [1.5, 1.5], { roughness: 0.95 }), 0.6); break;
case "sedum": m = w(pbr("sedum", [1.2, 1.2], { roughness: 0.9 })); break;
// A6's are black monocrystalline panels: the cells' grid stays, the blue goes.
Expand Down
2 changes: 2 additions & 0 deletions ui/src/mockcity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const BLUEPRINTS: Omit<BlueprintInfo, "owned" | "unlocked" | "built">[] = [
{ id: "o1", name: "Curtain-wall office tower", kind: "office", districts: ["downtown"], level: 2, price: 1500 },
{ id: "o2", name: "Round glass tower", kind: "office", districts: ["downtown"], level: 2, price: 1800 },
{ id: "o3", name: "Brutalist office", kind: "office", districts: ["downtown"], level: 2, price: 1600 },
{ id: "s8", name: "Filling station", kind: "shop", districts: ["main_street"], level: 1, price: 500 },
{ id: "s6", name: "Tower brewery", kind: "workshop", districts: ["works"], level: 1, price: 600 },
{ id: "s5", name: "Department store", kind: "shop", districts: ["downtown"], level: 2, price: 1200 },
{ id: "l1", name: "Art deco skyscraper", kind: "tower", districts: ["downtown"], level: 2, price: 3000 },
Expand Down Expand Up @@ -136,6 +137,7 @@ const PILES: Record<string, string[]> = {
o3: ["Federation House", "Concord House", "Bastion House", "Keystone House", "Monolith House", "Unity House", "Meridian House", "One Harbour Place"],
l1: ["The Orion Building", "Halcyon Tower", "Continental Life", "The Zenith Building"],
s5: ["Hargreaves & Co.", "The Emporium", "Whitlock's", "Fairbanks & Sons"],
s8: ["Crossroads Service", "Blue Star Gasoline", "Highway Garage", "Pioneer Gas & Oil"],
s6: ["Kestrel Ales", "Old Mill Brewery", "Castle Brewery Co.", "Hartley & Sons · Brewers"],
l3: ["The Cathedral Building", "Ashford Tower", "Mercantile Trust", "The Guildhall Tower"],
l2: ["Horizon Tower", "The Spire", "Apex Tower", "Vantage Tower"],
Expand Down
2 changes: 1 addition & 1 deletion ui/src/proto/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Viewer for the realistic models (blender/real, `bun run models`): one
// building on its lot, built by the app's own code (models.ts), on a street
// corner. Open /proto.html in the dev server with
// ?model=a1|a2|a3|a4|a5|a6|c1|c2|c3|c4|c5|c6|c7|s1|s2|s3|s4|o1|o2|o3|l1|l2|p1|f1|e1|h1|l5|e2|e3|h2|p2|w2 &floors=7 &seed=3 &damage=0|1|2|3 (3: the ruin)
// ?model=a1|a2|a3|a4|a5|a6|c1|c2|c3|c4|c5|c6|c7|s1|s2|s3|s4|s5|s6|s8|o1|o2|o3|l1|l2|p1|f1|e1|h1|l5|e2|e3|h2|p2|w2 &floors=7 &seed=3 &damage=0|1|2|3 (3: the ruin)
// &view=hero|city|detail|roof|back|street &hour=15
// &count=N is a stress test: N buildings on a grid, drawn instanced (or one
// mesh each with &draw=separate).
Expand Down
Loading