A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Map: settlement quick wins: a whiter White City with balconies, stepped stone houses, fewer and lower domes (refs #31) (#453)
Eyal Golaneafc1a6a4d08
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f2c188410..8bda38be7 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -200,6 +200,11 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB### Changed- The trees are warm olive-brown instead of bright green, like the groves in promo 03 (refs #34): citrus groves, olivecrowns, palms and cypresses. Only the leaf colours change; the fruit, meshes and frame cost are the same.+- Map: settlement quick wins (refs #31). The White City's blocks are lime white, with a solid-parapet balcony on each+ upper storey, deep windows and more roof rooms. The old towns' and villages' houses step back (the top storey a smaller+ block on the lower roof), have roof rooms and grey-buff limestone walls under lime roofs. Domes stay on hill houses only,+ fewer (old towns 22% to 8%, hill villages 7%; plain villages none, as their mud-brick houses had flat roofs) and low.+ Every house stands where it did: same lots, trees and building count (docs/visual-v1.md, "Settlement quick wins").- HUD round 1, the info panel and the trim (promo look, refs #398). Before a hex is chosen, the info panel is a one-linehint, not an empty block. A hex's facts (region, settlements, 1948 localities, placements) are rows with a gold sign,with no yields and no land-use name. When both map actions are refused for the same reason, the reason shows once,diff --git a/docs/visual-v1.md b/docs/visual-v1.mdindex 2337a1960..dad8963c9 100644--- a/docs/visual-v1.md+++ b/docs/visual-v1.md@@ -2166,6 +2166,92 @@ blocks, village houses, red-roofed villas), Jaffa 6 → 7, Tel Aviv 8 → 7.- Ramla:- White Tower (square, five storeys, 27 m; rebuilt after the 1318 earthquake; 31.9275 N, 34.8661 E): https://en.wikipedia.org/wiki/White_Tower_(Ramla)+## Settlement quick wins (branch `art/settlements-quickwins`, refs #31)+The 2026-10-13 gap audit (`.superpowers/audit-2026-10-13/renders`: `measure.py`, `metrics.json`) ranked the settlements+the biggest gap to promo 03. Measured with its crops and poses: editor renders (`MapCapture.Promo`, Mobile tier, with+`-extraPose close30:34.83:32.00:30000:10`) and the WebGL `?shot` of gameplay03. Main is `7aeec3f`.++**Changes.**+- **White City** (`Style.WhiteBlock`):+ - Walls are lime-white plaster (0.94, 0.945, 0.94; was 0.94, 0.92, 0.87), with 8% of blocks cream (was 12%).+ - Roofs are paler (0.90, 0.89, 0.86).+ - Each upper storey has a balcony with a solid plastered parapet on the street side, and on most blocks the back too+ (`WhiteBlockDetail`). Each balcony stays inside the plot's lot.+ - Roof rooms are on 80% of blocks (was 50%), and a second room is on 45% of the blocks that do not step.+ - `Kit.shader`, White City walls only: discrete windows with plaster piers between them, the glass near black+ (`_CityWindowDark` 0.95; the other styles keep `_WindowDark` 0.55), and a darker band under the balcony slab. The+ storey pattern holds until a storey is about two pixels (was three), so the 30 km look keeps its window rows.+- **Old towns, Arab towns and villages** (`Style.OldHouse`, `Style.Village`, `Archetype.OldTown`, `Archetype.ArabTown`;+ `StoneHouse`):+ - Three in four houses of two storeys or more step back: the top storey is a smaller block on one corner of the lower+ roof. Single-storey houses often have a roof room.+ - Walls are grey-buff limestone (0.77, 0.70, 0.60, jittered from grey to buff) and roofs lime plaster.+ - A village below 120 m (the coastal plain and the valleys) is mud brick (0.78, 0.69, 0.56) with flat roofs.+ - Domes are fewer and lower: a cap rising 0.6 of its radius, not a hemisphere, in the roof's lime colour, not white.+ - Old towns: 8% of flat-roofed houses (was 22%).+ - Hill villages: 7% (was 10% of every village).+ - Plain villages: none.+ - The mosques' and landmarks' domes are unchanged.+- **Historical basis.** The owner's ruling (m3-rulings, "Owner rulings"): where the promo departs from the era, the promo+ wins, but the architecture stays plausible for 1948. Domes are reduced, not removed.+ - The hill country built in limestone, and its houses were roofed with stone vaults and cupolas.+ - The coastal plain and the valleys built in mud brick, with flat roofs of beams and earth.+ - So domes stay on hill houses only, as the low cap a vault shows from outside.+ - Sources are under "Sources" below.+- **Layout unchanged.** A 1948 locality's houses share the locality's random stream with its spots. `Emit(Archetype.ArabTown)`+ still draws exactly five numbers from it (wall, roof, the dome roll), and each house's detail comes from a stream seeded+ off it. The lattice towns' houses already had a stream of their own.+ - Every building stands where it did: same lots, same trees, buildings 1954 (WebGL) / 1953 (editor), locality buildings+ 1339, trees 8358, draws 63.+ - So #318 (the localities' landmark lots in Tel Aviv) and #249 (tree holes under the figures) are untouched.++**Result** (main → branch; promo in brackets):++| | main | branch | promo 03 | target |+|---|---|---|---|---|+| gameplay03 white share (V > 0.72, S < 0.28; WebGL shot, map area) | 2.49% | 6.55% | 7.46% (audit) | >= 4.5%: met |+| gameplay03 white share (editor, Mobile) | 2.36% | 6.84% | | |+| close30 Tel Aviv edge density (crop 0.32-0.58 x 0-0.30, 600x400) | 0.038 | 0.054 | 0.114 | >= 0.07: not met |+| close30 Tel Aviv p5 / p95 | 0.241 / 0.753 | 0.221 / 0.787 | 0.136 / 0.896 | p5 <= 0.18: not met |+| close30 Tel Aviv warmth | 0.131 | 0.114 | 0.090 | <= 0.09: not met |+| close30 Jaffa edge / warmth | 0.041 / 0.141 | 0.047 / 0.112 | 0.100 / 0.107 | |+| close30 village crop edge / warmth | 0.035 / 0.222 | 0.036 / 0.198 | 0.071 / 0.132 | |++- **Why Tel Aviv's edge, p5 and warmth fall short.**+ - At close30 a storey is about three pixels. The crop's top third lies in the far tilt-shift band: the edge per band+ rose from 0.031-0.046 to 0.039-0.058, against the promo's 0.05-0.16.+ - About half the crop is the town's sand ground. Its tint comes from `PaintGround`, and+ `SeaTests.TheBeachBesideTelAvivStaysSandWithTheKitsOn` pins it.+ - The walls are already near-neutral white; the remaining yellow is the sun and the grade.+ - Closing the gap needs denser, smaller blocks (a layout change that meets #318), palms between the buildings (the+ vegetation) and a ground or light change. None is a quick win, so they are left as follow-ups.+- **Kit numbers** (WebGL `KITS` line, main → branch): buildings 1954 → 1954, vertices 85,401 → 99,131, triangles+ 66,436 → 68,366, draws 63 → 63.+- **Boot** (`tools/headed.py boot --runs 3 --cpu 4`, three rounds, order rotated, each round under one exclusive+ `machine_lock`, 2026-10-14; builds of main `7aeec3f` and this branch; 9 cold loads each):++ | | map_build median (range) | `kits built` phase median | first_frame median |+ |---|---|---|---|+ | main | 3067 ms (3042-3085) | 747 ms | 11075 ms |+ | branch | 3055 ms (3036-3077) | 743 ms | 11081 ms |++ - Within noise: the per-round medians alternate (+19, -26, -16 ms), and the kit phase is unchanged.+ - The machine was loaded (other sessions' jobs), so both sides sit over the 2720 ms budget. Main does too; that is+ #321's margin, not this change.+- **Goldens:** the WebGL `golden&smoke=5` run shows `GOLDEN OK 1950 71e9904d`, `GOLDEN OK 1952 62f8ec61` and+ `SMOKE OK 5 turns 1948-06-19 d3fdd459`, unchanged.+- **Tests:** EditMode passes 768/768 with 0 `warning CS`, on the branch and on main `7aeec3f` alike. An earlier run on+ the old base lost 52 UI, label and border coroutine tests to destroyed scene objects. It did not reproduce: all 768+ pass on both.++### Sources (checked 2026-10-13)+- Stone in the mountains, mud brick and wood on the coast and in the valleys: Palestine Ministry of Tourism and Antiquities,+ virtual museum, "Traditional Palestinian House - Al Hosh - The Courtyard":+ https://virtualmuseum.tourism.ps/en/article/72/Traditional-Palestinian-House---Al-Hosh---The-Courtyard+- Vaults, cupolas and roofing of the Palestinian traditional house: M. Abuarkub, "Traditional Building Materials and+ Techniques in Palestine", Prostor 25 (2017) 140-153, https://doi.org/10.31522/p.25.1(53).9+- The White City (1930s International Style, flat roofs, balconies): https://en.wikipedia.org/wiki/White_City,_Tel_Aviv+## Issue #195: the water and the border lookups out of the terrain's fragment shader- **Why.** promo-sea (#138) put the water shading (`ScWaterShade`, the breakers' `fwidth`, the footprint) in the terraingraph's function, and promo-borders (#206) six neighbour fetches in `ScBorderApply`'s loop. Either one makes the shaderdiff --git a/unity/Assets/Materials/Kit.mat b/unity/Assets/Materials/Kit.matindex d51c1cba9..91d323b95 100644--- a/unity/Assets/Materials/Kit.mat+++ b/unity/Assets/Materials/Kit.mat@@ -25,6 +25,7 @@ Material:m_TexEnvs: []m_Ints: []m_Floats:+ - _CityWindowDark: 0.95- _Jitter: 0- _WindowDark: 0.55m_Colors:diff --git a/unity/Assets/Scripts/Map/Kits/KitMesh.cs b/unity/Assets/Scripts/Map/Kits/KitMesh.csindex 60baf4c3a..27c4251e2 100644--- a/unity/Assets/Scripts/Map/Kits/KitMesh.cs+++ b/unity/Assets/Scripts/Map/Kits/KitMesh.cs@@ -146,8 +146,9 @@ namespace Statecraft.Game.Map.Kits}}- /// <summary>A smooth hemisphere (a mosque's or a house's dome) of radius r standing on y.</summary>- public void Dome(float x, float z, float y, float r, Color32 colour, int segments = 10, int rings = 4)+ /// <summary>A smooth dome (a mosque's or a house's) of radius r standing on y: a hemisphere, or, with+ /// <paramref name="rise"/> under 1, a lower cap rising rise x r (a village house's shallow vault).</summary>+ public void Dome(float x, float z, float y, float r, Color32 colour, int segments = 10, int rings = 4, float rise = 1f){colour.a = 0;int first = pos.Count;@@ -158,7 +159,9 @@ namespace Statecraft.Game.Map.Kits{float th = 2f * Mathf.PI * i / segments;var n = new Vector3(Mathf.Cos(phi) * Mathf.Cos(th), Mathf.Sin(phi), Mathf.Cos(phi) * Mathf.Sin(th));- V(new Vector3(x, y, z) + n * r, n, colour, Vector2.zero);+ // An ellipsoid's normal: the sphere's with its height scaled by 1 / rise (unchanged for a hemisphere).+ var nn = rise == 1f ? n : new Vector3(n.x * rise, n.y, n.z * rise).normalized;+ V(new Vector3(x, y, z) + new Vector3(n.x * r, n.y * r * rise, n.z * r), nn, colour, Vector2.zero);}}for (int j = 0; j < rings; j++)diff --git a/unity/Assets/Scripts/Map/Kits/SettlementKits.cs b/unity/Assets/Scripts/Map/Kits/SettlementKits.csindex e8b5807c2..683043555 100644--- a/unity/Assets/Scripts/Map/Kits/SettlementKits.cs+++ b/unity/Assets/Scripts/Map/Kits/SettlementKits.cs@@ -696,10 +696,16 @@ namespace Statecraft.Game.Map.Kitscase Style.WhiteBlock:case Style.TownBlock:{- var wall = rnd.Chance(st == Style.TownBlock ? 0.3f : 0.12f) ? Jitter(C(0.90f, 0.84f, 0.72f), ref rnd, 0.04f) : Jitter(C(0.94f, 0.92f, 0.87f), ref rnd, 0.035f);- var roof = Jitter(C(0.80f, 0.78f, 0.74f), ref rnd, 0.05f);+ bool white = st == Style.WhiteBlock;+ // The White City's lime-white plaster (settlements quick wins, #31: promo 03's Tel Aviv reads white, not cream; a+ // few blocks keep the cream render). The moshava centres keep their warmer plaster.+ var wall = white+ ? (rnd.Chance(0.08f) ? Jitter(C(0.93f, 0.90f, 0.83f), ref rnd, 0.03f) : Jitter(WhitePlaster, ref rnd, 0.025f))+ : rnd.Chance(0.3f) ? Jitter(C(0.90f, 0.84f, 0.72f), ref rnd, 0.04f) : Jitter(C(0.94f, 0.92f, 0.87f), ref rnd, 0.035f);+ var roof = white ? Jitter(C(0.90f, 0.89f, 0.86f), ref rnd, 0.03f) : Jitter(C(0.80f, 0.78f, 0.74f), ref rnd, 0.05f);// A third of the blocks step down at one end: a lower wing within the plot (L and stepped massing).- if (b.storeys >= 3 && rnd.Chance(0.33f))+ bool stepped = b.storeys >= 3 && rnd.Chance(0.33f);+ if (stepped){float a = yaw * Mathf.Deg2Rad, share = rnd.Range(0.58f, 0.72f), side = rnd.Chance(0.5f) ? 1f : -1f;float w1 = b.w * share, w2 = b.w - w1, d2 = b.d * rnd.Range(0.7f, 1f), h2 = b.h - storey * rnd.Range(1, 3);@@ -708,20 +714,31 @@ namespace Statecraft.Game.Map.Kitsvar c2 = p + new Vector2(u2 * Mathf.Cos(a) - v2 * Mathf.Sin(a), u2 * Mathf.Sin(a) + v2 * Mathf.Cos(a));km.Box(c1.x, c1.y, yaw, w1, b.d, bottom, top, b.h, wall, roof, Facade.WhiteCity, m);km.Box(c2.x, c2.y, yaw, w2 * 1.01f, d2, bottom, top, h2, wall, roof, Facade.WhiteCity, m);+ if (white) WhiteBlockDetail(km, c1, u1, b.lotR, yaw, w1, b.d, top, b.h, wall, roof, m, ref rnd);Record(id, "building", p, yaw, b.w, b.d, b.h, wall);Record(id, "wing", c2, yaw, w2, d2, h2, wall);}else{km.Box(p.x, p.y, yaw, b.w, b.d, bottom, top, b.h, wall, roof, Facade.WhiteCity, m);+ if (white) WhiteBlockDetail(km, p, 0f, b.lotR, yaw, b.w, b.d, top, b.h, wall, roof, m, ref rnd);Record(id, "building", p, yaw, b.w, b.d, b.h, wall);}- // A stair tower or roof room on many Bauhaus blocks.- if (rnd.Chance(0.5f))+ // A stair tower or roof room on many Bauhaus blocks (the White City's roofs: most have one).+ if (rnd.Chance(white ? 0.8f : 0.5f)){float rw = b.w * rnd.Range(0.22f, 0.36f), rd = b.d * rnd.Range(0.3f, 0.45f);km.Box(p.x + b.w * rnd.Range(-0.15f, 0.15f), p.y + b.d * rnd.Range(-0.12f, 0.12f), yaw, rw, rd, top + b.h - 2f, top + b.h, 2.8f * m, wall, roof, Facade.Plain, m);}+ // Many White City roofs carry a second room (the shared laundry room beside the stair head), at the+ // block's other end, inside its footprint (not on a stepped block, whose ends differ in height).+ if (white && !stepped && rnd.Chance(0.45f))+ {+ float rw = b.w * rnd.Range(0.16f, 0.24f), rd = b.d * rnd.Range(0.25f, 0.35f), a = yaw * Mathf.Deg2Rad;+ float u = (rnd.Chance(0.5f) ? 1f : -1f) * (0.5f * b.w - 0.6f * rw), v = rnd.Range(-0.2f, 0.2f) * b.d;+ km.Box(p.x + u * Mathf.Cos(a) - v * Mathf.Sin(a), p.y + u * Mathf.Sin(a) + v * Mathf.Cos(a), yaw, rw, rd, top + b.h - 2f, top + b.h,+ 2.4f * m, wall, roof, Facade.Plain, m);+ }break;}case Style.StoneBlock:@@ -738,24 +755,25 @@ namespace Statecraft.Game.Map.Kits}case Style.OldHouse:{- var wall = Jitter(C(0.83f, 0.72f, 0.54f), ref rnd, 0.06f);- var roof = Jitter(C(0.86f, 0.77f, 0.60f), ref rnd, 0.05f);+ var wall = StoneWall(ref rnd);+ var roof = Jitter(LimeRoof, ref rnd, 0.04f);// Outside the core, some Ottoman-era houses have red tiled roofs (Jaffa's Ajami, Haifa's lower town).bool tiled = rnd.Chance(t > 0.6f ? 0.14f : 0.03f);- km.Box(p.x, p.y, yaw, b.w, b.d, bottom, top, b.h, wall, roof, Facade.Stone, m, roofed: tiled);- if (tiled) km.Pyramid(p.x, p.y, yaw, b.w * 1.04f, b.d * 1.04f, top + b.h, 2.2f * m, Jitter(C(0.70f, 0.33f, 0.22f), ref rnd, 0.06f));- else if (rnd.Chance(0.22f)) km.Dome(p.x, p.y, top + b.h - 1f, Mathf.Min(b.w, b.d) * 0.33f, Jitter(C(0.88f, 0.84f, 0.76f), ref rnd, 0.05f));- else if (b.storeys >= 2 && rnd.Chance(0.3f)) // a roof room on the flat roof- km.Box(p.x + b.w * 0.2f, p.y - b.d * 0.15f, yaw, b.w * 0.45f, b.d * 0.5f, top + b.h - 2f, top + b.h, storey * 0.9f, wall, roof, Facade.Stone, m);+ if (tiled)+ {+ km.Box(p.x, p.y, yaw, b.w, b.d, bottom, top, b.h, wall, roof, Facade.Stone, m, roofed: true);+ km.Pyramid(p.x, p.y, yaw, b.w * 1.04f, b.d * 1.04f, top + b.h, 2.2f * m, Jitter(C(0.70f, 0.33f, 0.22f), ref rnd, 0.06f));+ }+ else StoneHouse(km, p, yaw, b, bottom, top, wall, roof, Facade.Stone, m, rnd.Chance(OldHouseDome), ref rnd);Record(id, "building", p, yaw, b.w, b.d, b.h, wall);break;}case Style.Village:{- var wall = Jitter(C(0.80f, 0.70f, 0.53f), ref rnd, 0.07f);- var roof = Jitter(C(0.84f, 0.75f, 0.59f), ref rnd, 0.06f);- km.Box(p.x, p.y, yaw, b.w, b.d, bottom, top, b.h, wall, roof, Facade.Village, m);- if (rnd.Chance(0.10f)) km.Dome(p.x, p.y, top + b.h - 1f, Mathf.Min(b.w, b.d) * 0.3f, roof);+ bool hill = ground.ElevM(p.x, p.y) >= HillVillageM;+ var wall = hill ? StoneWall(ref rnd) : Jitter(MudBrick, ref rnd, 0.06f);+ var roof = Jitter(LimeRoof, ref rnd, 0.05f);+ StoneHouse(km, p, yaw, b, bottom, top, wall, roof, Facade.Village, m, hill && rnd.Chance(VillageDome), ref rnd);Record(id, "building", p, yaw, b.w, b.d, b.h, wall);break;}@@ -780,6 +798,89 @@ namespace Statecraft.Game.Map.Kits}}+ // ---- Stone houses: the old towns and the Arab towns and villages (settlements quick wins, #31) -------------------+ // Promo 03's Qalqilya and Jaffa are layered stone houses: stepped storeys, roof rooms, few domes, grey-buff stone. The+ // 1948 basis: the hill country built in limestone and the coastal plain and valleys in mud brick (Palestine Ministry of+ // Tourism, "Traditional Palestinian House - Al Hosh", https://virtualmuseum.tourism.ps/en/article/72, checked+ // 2026-10-13); the hill house's roof was a stone vault or cupola, the plain's a flat roof of beams and earth (Abuarkub,+ // "Traditional Building Materials and Techniques in Palestine", Prostor 25 (2017) 140-153,+ // https://doi.org/10.31522/p.25.1(53).9). So domes stay, but only on hill houses, fewer and lower (a vault's low+ // cap, not a white hemisphere), and every flat roof is lime plaster.++ /// <summary>A village above this elevation (m) is a hill village: limestone walls, some domed roofs. Below it, the coastal+ /// plain's and the valleys' mud-brick houses with flat roofs.</summary>+ const float HillVillageM = 120f;+ /// <summary>Share of an old town's flat-roofed houses with a dome (was 22%: promo 03's Jaffa shows few).</summary>+ const float OldHouseDome = 0.08f;+ /// <summary>Share of a hill village's houses with a dome (was 10% of every village's).</summary>+ const float VillageDome = 0.07f;+ /// <summary>Grey-buff limestone, lime-plastered roofs and the plain's mud brick (sRGB).</summary>+ static readonly Color32 LimeRoof = C(0.86f, 0.83f, 0.77f), MudBrick = C(0.78f, 0.69f, 0.56f);++ /// <summary>A limestone wall colour, from grey to buff (exactly two draws, as one Jitter: the villages' streams rely on it).</summary>+ static Color32 StoneWall(ref KitRandom rnd) => Jitter(C(0.77f, 0.70f, 0.60f), ref rnd, 0.07f);++ /// <summary>A stone or mud-brick house of <paramref name="b"/>'s footprint: of two storeys or more, most step back, the top+ /// storey a smaller block on one corner of the lower roof (the lower roof its terrace); a one-storey house often has a+ /// roof room (an upper room). <paramref name="dome"/> puts a low dome on the topmost roof. All of it stands+ /// inside the footprint, so the lot is unchanged.</summary>+ static void StoneHouse(KitMesh km, Vector2 p, float yaw, Spec b, float bottom, float top, Color32 wall, Color32 roof, Facade facade,+ float m, bool dome, ref KitRandom rnd)+ {+ float storey = 3.3f * m, a = yaw * Mathf.Deg2Rad, ca = Mathf.Cos(a), sa = Mathf.Sin(a);+ Vector2 At(float u, float v) => p + new Vector2(u * ca - v * sa, u * sa + v * ca);+ // The upper block: 50-75% of the footprint each way, pushed to a seeded corner.+ float uw = b.w * rnd.Range(0.5f, 0.75f), ud = b.d * rnd.Range(0.5f, 0.75f);+ float su = rnd.Chance(0.5f) ? 1f : -1f, sv = rnd.Chance(0.5f) ? 1f : -1f;+ var uc = At(su * 0.5f * (b.w - uw), sv * 0.5f * (b.d - ud));+ if (b.storeys >= 2 && rnd.Chance(0.75f))+ {+ float low = b.h - storey;+ km.Box(p.x, p.y, yaw, b.w, b.d, bottom, top, low, wall, roof, facade, m);+ km.Box(uc.x, uc.y, yaw, uw, ud, top + low - 0.3f * m, top + low, storey, wall, roof, facade, m);+ if (dome) km.Dome(uc.x, uc.y, top + b.h - 0.2f * m, Mathf.Min(uw, ud) * 0.4f, roof, rise: 0.6f);+ return;+ }+ km.Box(p.x, p.y, yaw, b.w, b.d, bottom, top, b.h, wall, roof, facade, m);+ if (dome) km.Dome(p.x, p.y, top + b.h - 0.2f * m, Mathf.Min(b.w, b.d) * 0.33f, roof, rise: 0.6f);+ else if (rnd.Chance(0.35f)) // a roof room+ km.Box(uc.x, uc.y, yaw, uw * 0.8f, ud * 0.8f, top + b.h - 0.3f * m, top + b.h, storey * 0.85f, wall, roof, facade, m);+ }++ /// <summary>The White City's wall plaster (sRGB): lime white, a touch cool, so the warm sun leaves it white rather than cream.</summary>+ static readonly Color32 WhitePlaster = C(0.94f, 0.945f, 0.94f);++ /// <summary>A White City block's balconies (settlements quick wins, #31): the International Style's continuous balconies+ /// with solid plastered parapets, one per upper storey along a long side (most blocks on both), each a white band with+ /// its shadow under it, as promo 03's Tel Aviv shows. The box is <paramref name="w"/> x <paramref name="d"/> at+ /// <paramref name="c"/> (w along the yaw, the long side), walls from <paramref name="ground"/> up <paramref name="h"/>.+ /// Every balcony stays inside the plot's lot (radius <paramref name="lotR"/> round the plot's centre; c lies+ /// <paramref name="du"/> from it along the yaw), so trees and neighbours, which test the lot, never meet one.</summary>+ static void WhiteBlockDetail(KitMesh km, Vector2 c, float du, float lotR, float yaw, float w, float d, float ground, float h,+ Color32 wall, Color32 roof, float m, ref KitRandom rnd)+ {+ float storey = 3.3f * m, proj = 1.0f * m, parapet = 1.05f * m, slab = 0.2f * m;+ int storeys = Mathf.RoundToInt(h / storey);+ float a = yaw * Mathf.Deg2Rad, ca = Mathf.Cos(a), sa = Mathf.Sin(a);+ float reachV = 0.5f * d + proj;+ var rail = Jitter(wall, ref rnd, 0.015f);+ for (int side = -1; side <= 1; side += 2)+ {+ // The street side always, the back on most blocks.+ if (side > 0 && !rnd.Chance(0.75f)) continue;+ float share = rnd.Range(0.5f, 0.85f), u0 = rnd.Range(-0.5f, 0.5f) * (1f - share) * w;+ float bw = Mathf.Min(share * w, 2f * (Mathf.Sqrt(Mathf.Max(0f, lotR * lotR - reachV * reachV)) - Mathf.Abs(du + u0)));+ if (bw < 0.25f * w) continue;+ float v = side * (0.5f * d + 0.5f * proj);+ float x = c.x + u0 * ca - v * sa, z = c.y + u0 * sa + v * ca;+ for (int k = 1; k < storeys; k++)+ {+ float floor = ground + k * storey;+ km.Box(x, z, yaw, bw, proj, floor - slab, floor - slab, slab + parapet, rail, roof, Facade.Plain, m);+ }+ }+ }+/// <summary>Wall bottom (sunk 2 m below the lowest corner, so a house on a slope stands on a plinth, not on air) and the/// ground level the walls rise from (the highest corner, so the slope never buries a storey).</summary>static (float bottom, float ground) GroundSpan(Vector2 p, float yawDeg, float w, float d, KitGround ground, float m)@@ -988,19 +1089,28 @@ namespace Statecraft.Game.Map.Kits}case Archetype.OldTown:{- var wall = Jitter(C(0.83f, 0.72f, 0.54f), ref rnd, 0.06f);- var roof = Jitter(C(0.86f, 0.77f, 0.60f), ref rnd, 0.05f);- km.Box(p.x, p.y, yaw, b.w, b.d, bottom, top, b.h, wall, roof, Facade.Stone, m);- if (rnd.Chance(0.22f)) km.Dome(p.x, p.y, top + b.h - 1f, Mathf.Min(b.w, b.d) * 0.33f, Jitter(C(0.88f, 0.84f, 0.76f), ref rnd, 0.05f));- else if (rnd.Chance(0.03f)) km.Pyramid(p.x, p.y, yaw, b.w * 1.04f, b.d * 1.04f, top + b.h, 2.2f * m, Jitter(C(0.70f, 0.33f, 0.22f), ref rnd, 0.06f));+ // A town's fallback house (#317), on its own stream: drawn as the old town's lattice houses are.+ var wall = StoneWall(ref rnd);+ var roof = Jitter(LimeRoof, ref rnd, 0.04f);+ if (rnd.Chance(0.03f))+ {+ km.Box(p.x, p.y, yaw, b.w, b.d, bottom, top, b.h, wall, roof, Facade.Stone, m, roofed: true);+ km.Pyramid(p.x, p.y, yaw, b.w * 1.04f, b.d * 1.04f, top + b.h, 2.2f * m, Jitter(C(0.70f, 0.33f, 0.22f), ref rnd, 0.06f));+ }+ else StoneHouse(km, p, yaw, b, bottom, top, wall, roof, Facade.Stone, m, rnd.Chance(OldHouseDome), ref rnd);return wall;}case Archetype.ArabTown:{- var wall = Jitter(C(0.80f, 0.70f, 0.53f), ref rnd, 0.07f);- var roof = Jitter(C(0.84f, 0.75f, 0.59f), ref rnd, 0.06f);- km.Box(p.x, p.y, yaw, b.w, b.d, bottom, top, b.h, wall, roof, Facade.Village, m);- if (rnd.Chance(0.10f)) km.Dome(p.x, p.y, top + b.h - 1f, Mathf.Min(b.w, b.d) * 0.3f, roof);+ // A 1948 locality's houses share the locality's stream with its spots, so this draws exactly the five numbers+ // it always has (wall, roof, the dome roll), and the house's own detail comes from a stream seeded off it: the+ // villages keep every house where it was (layout, lots and trees unchanged).+ var peek = rnd; var detail = new KitRandom(peek.Next() ^ 0xA5C3F1E2D4B69788UL);+ bool hill = ground.ElevM(p.x, p.y) >= HillVillageM;+ var wall = hill ? StoneWall(ref rnd) : Jitter(MudBrick, ref rnd, 0.06f);+ var roof = Jitter(LimeRoof, ref rnd, 0.05f);+ bool dome = rnd.Value() < VillageDome && hill;+ StoneHouse(km, p, yaw, b, bottom, top, wall, roof, Facade.Village, m, dome, ref detail);return wall;}default:diff --git a/unity/Assets/Shaders/Kit.shader b/unity/Assets/Shaders/Kit.shaderindex b70ae027c..1c6ae7fd7 100644--- a/unity/Assets/Shaders/Kit.shader+++ b/unity/Assets/Shaders/Kit.shader@@ -13,6 +13,7 @@ Shader "Statecraft/Kit"_BaseColor ("Tint", Color) = (1, 1, 1, 1)_Jitter ("Per-instance tint jitter", Range(0, 0.5)) = 0_WindowDark ("Window darkness", Range(0, 1)) = 0.55+ _CityWindowDark ("White City window darkness", Range(0, 1)) = 0.95}SubShader{@@ -21,7 +22,7 @@ Shader "Statecraft/Kit"#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"CBUFFER_START(UnityPerMaterial)half4 _BaseColor;- half _Jitter, _WindowDark;+ half _Jitter, _WindowDark, _CityWindowDark;CBUFFER_ENDENDHLSL@@ -72,16 +73,19 @@ Shader "Statecraft/Kit"// Window mask (1 = glass) and its mean over a whole storey, for each facade style.float Windows(float style, float2 uv, float2 fw, out float mean){- float storey = 3.3, bay = style > 0.75 ? 1.7 : (style > 0.4 ? 4.2 : 3.0);+ float storey = 3.3, bay = style > 0.75 ? 2.0 : (style > 0.4 ? 4.2 : 3.0);float wv = fw.y / storey, wu = fw.x / bay;float a0, a1, b0, b1;- if (style > 0.75) { a0 = 0.38; a1 = 0.80; b0 = 0.10; b1 = 0.95; } // white city: ribbon windows+ if (style > 0.75) { a0 = 0.36; a1 = 0.86; b0 = 0.12; b1 = 0.84; } // white city: tall wide windows, plaster piers betweenelse if (style > 0.4) { a0 = 0.40; a1 = 0.72; b0 = 0.38; b1 = 0.62; } // village / moshava: a few small windowselse { a0 = 0.36; a1 = 0.74; b0 = 0.34; b1 = 0.64; } // stone: arched-height windowsmean = (a1 - a0) * (b1 - b0);float m = Band(uv.y / storey, a0, a1, wv) * Band(uv.x / bay, b0, b1, wu);- // Fade to the mean once a storey is under about three pixels: no moire at the gameplay zoom.- return lerp(mean, m, saturate(1.5 - wv * 3.0)) * step(0.0, uv.y);+ // Fade to the mean once a storey is under about three pixels: no moire at the gameplay zoom. The White City's+ // storeys hold until about two pixels (the box filter keeps them clean there), so its 30 km look keeps its+ // window rows (settlements quick wins, #31).+ float hold = style > 0.75 ? saturate(2.2 - wv * 4.4) : saturate(1.5 - wv * 3.0);+ return lerp(mean, m, hold) * step(0.0, uv.y);}half4 Frag(Varyings i) : SV_Target@@ -103,10 +107,12 @@ Shader "Statecraft/Kit"{float fv = fw.y / 3.3;float slab = Band(i.uv.y / 3.3, 0.28, 0.36, fv), under = Band(i.uv.y / 3.3, 0.36, 0.42, fv);- float fade = saturate(1.5 - fv * 3.0);- albedo *= 1.0 + 0.10 * lerp(0.08, slab, fade) - 0.22 * lerp(0.06, under, fade);+ float fade = saturate(2.2 - fv * 4.4);+ albedo *= 1.0 + 0.10 * lerp(0.08, slab, fade) - 0.45 * lerp(0.06, under, fade);}- albedo *= 1.0 - _WindowDark * glass;+ // The White City's ribbon windows sit deep under the balcony slabs and read near black in promo 03+ // (settlements quick wins, #31); the stone and village windows keep the shared darkness.+ albedo *= 1.0 - (style > 0.75 ? _CityWindowDark : _WindowDark) * glass;// Contact darkening in the bottom real 3 m of a wall.albedo *= lerp(0.72, 1.0, saturate(i.uv.y / 3.0));}