From 152b9251a95e1136793e469b1e782003281324ff Mon Sep 17 00:00:00 2001 From: soul Date: Thu, 29 Oct 2026 23:00:49 +0100 Subject: [PATCH 001/108] Research: release pipeline prior art (Unity CI, Personal licensing, Forgejo runners and releases, versioning tools) Co-Authored-By: Claude Opus 5.5 --- .../2026-10-29-release-pipeline-prior-art.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 docs/research/2026-10-29-release-pipeline-prior-art.md diff --git a/docs/research/2026-10-29-release-pipeline-prior-art.md b/docs/research/2026-10-29-release-pipeline-prior-art.md new file mode 100644 index 000000000..8faf9ed21 --- /dev/null +++ b/docs/research/2026-10-29-release-pipeline-prior-art.md @@ -0,0 +1,53 @@ +# Release pipeline prior art (Eyes, 2026-10-29) + +Serves: the Aetheria release pipeline forks (where Starfire builds run, how versions bump), raised 2026-10-29 by the operator's "we should have an auto release pipeline with semantic versioning and change logs". Eyes pass, session self-2026-10-28-ag9. +Facts with pointers. No recommendations. "unverified" = not opened/confirmed. + +## 1. Headless Unity CI builds (GameCI) +- Docker Hub `unityci/editor` (built by github.com/game-ci/docker, MIT, "not affiliated with Unity"). Tags checked via https://hub.docker.com/v2/repositories/unityci/editor/tags?name=6000.3 (1,881 tags total at fetch): + - 6000.3.24f1 (the project's version) EXISTS, pushed 2026-09-10: `ubuntu-6000.3.24f1-{base,linux-il2cpp,windows-mono,mac-mono,webgl,ios,android}-3.2.2` (also `-3`, `-3.2`, unprefixed). Sizes (compressed): base 5.21 GB, linux-il2cpp 5.68 GB, windows-mono 5.95 GB. No `linux-mono` tag (Linux Mono player support is in the base editor; unverified wording). `windows-6000.3.24f1-base` tags marked inactive. + - Newer: 6000.3.26f1 (2026-10-08), 6000.3.27f1 (2026-10-21), same module set. Windows-container images (`windows--base/windows-il2cpp/...`, 9-13 GB) also exist. +- GameCI docs: https://game.ci/docs/github/builder — "Many Mono targets can be cross-compiled, so a Linux runner can produce a Windows Mono player"; IL2CPP needs matching OS for some platforms (https://game.ci/docs/docker/docker-images: "Some platforms require their respective operating systems in order to generate IL2CPP builds"). Windows and macOS targets each consume an extra license seat, all Linux targets together one. +- unityVersion needs full string e.g. `6000.0.23f1`; `dockerMemoryLimit` defaults 95% of system memory on Linux; 6.6+ needs 1 GiB shm (`dockerShmSize`). +- Known failure reports (not this exact setup): Unity issuetracker 24511 — `windows-mono` module install on Linux fails ERROR_CHECKSUM_MISMATCH for 6000.5.9f1 (stale md5 in release manifest; applies to Hub/module install, not prebuilt GameCI images). Old game-ci issue: Windows IL2CPP from Linux not possible/failed (2021.2 era); Mono worked. +- Memory/disk: no authoritative figure found. Unity issue UUM-90456: Linux IL2CPP "Linking GameAssembly.so" high memory, OOM-killed on low-RAM machines; forum: "LLVM ERROR: out of memory" on 32 GB, Master->Release C++ config fixed it. Unity docs (6000.3 linux-il2cpp-crosscompiler): toolchain package 462 MB (Linux), 2 GB each Win/mac host. Image pulls are 5-6 GB compressed each (above); a single image holds one module set (no combined image unless built with `game-ci build-unity-image`). +- gVisor/rootless: ZERO reports found of Unity Editor under gVisor/runsc (searches 2x). Yggdrasil runner facts from the runbook (F:\Projects\gamecult-ops\runbooks\forgejo-eureka-yggdrasil.md lines 29-45, 85-105): runsc with `--ignore-cgroups`, ENFORCED cap MemoryMax=4G via unit (no swap), CPUQuota 200%; "A 6 GB allocation was OOM-killed (exit 137) at the 4G cap"; gVisor reports host 16 CPUs/62 GB; capacity 1. +- No reports found of unity-builder on Forgejo/Gitea Actions (searched). + +## 2. Unity licensing for CI +- Unity 6000.3 manual (https://docs.unity.com/en-us/engine/6000.3/manual/get-started/install-and-upgrade/licenses-and-activation/managing-your-unity-license): command-line `-serial/-username/-password` (and `-returnlicense`) procedures "don't apply to Unity Personal. To activate a license for Unity Personal, log in to the Unity Hub." Headless/automated builds named as a use case for the Pro procedure. Named-user variant: `-serial -username -password` with serial omitted. +- Unity Build Server terms (https://unity.com/legal/terms-of-service/build-server, "Last updated: June 30, 2026"): §2.5 "You may not use Unity Build Server with the Unity Personal tier of the Unity Software." §1.1: if Total Finances exceed $200,000 USD, Personal may not be used at all. Build Server = floating licence server product. Unity Licensing Server docs (https://docs.unity.com/en-us/licensing-server) don't state eligible tiers on fetched page (Requirements page not read). +- GameCI Personal path (https://game.ci/docs/github/activation): activate in Unity Hub locally, copy the `.ulf` to secret `UNITY_LICENSE` + `UNITY_EMAIL`/`UNITY_PASSWORD`; Pro: `UNITY_SERIAL`+email+password; floating: `unityLicensingServer`. Docs say licences are not tied to a Unity version/platform; .ulf can be generated on one OS and used on another. Page does not mention Unity 6. +- Status of alf->ulf web activation (game-ci/documentation#408, open, updated 2026-10-04): https://license.unity3d.com/manual flow for Personal intermittently works (hidden "option-personal" element trick; "less than $100k" option); reports 2025-06..2025-11 "works", 2026-03-30 "web method expired with error", 2026-10-04 "workaround doesn't work anymore" vs another user succeeded same day. Alternative in thread (2025-08-21 GabLeRoux): create the .ulf via Unity Hub (not the website). A 2026-04-23 comment describes extracting a serial from the Hub-made .ulf and passing it with -username/-password (unverified). Also game-ci/unity-test-runner#235 (closed dup; 2026-04-29 comment "Confirmed the workaround above still works today"). +- Unity forum (Aug 2023) "Unity no longer supports manual activation of Personal licenses": no Unity staff reply. Codemagic help (updated Jun 2026, secondary) says Plus/Pro needed for CI. +- I did not find the current Unity Terms of Service text on Personal + automated builds beyond the Build Server terms above. + +## 3. Forgejo Actions / releases +- forgejo-runner Windows: official releases are linux-amd64/arm64 only (https://code.forgejo.org/api/v1/repos/forgejo/runner/releases, v13.2.1 2026-10-29). README: "supported and tested on amd64 and arm64" on Linux-kernel OSes. Windows: community builds only (github.com/Crown0815/Forgejo-runner-windows-builder; runner issues #263, #976, #1032 fixed compile via PR 987, #1441 open "How to keep the Windows built stable"; maintainers (earl-warren, #263) decline to test/support Windows). Host label syntax `self-hosted:host` documented at https://forgejo.org/docs/latest/admin/actions/configuration/ ("no isolation at all"); docs don't mention Windows. A third-party fork (forge.yumechi.jp yume-runner) ships a pwsh host-mode sample (unverified). +- Release API: `/repos/{owner}/{repo}/releases` and `/releases/{id}/assets` (https://forgejo.org/docs/latest/user/repository/releases/). Official action `actions/forgejo-release` (https://code.forgejo.org/actions/forgejo-release): inputs url, repo, tag, title, sha, token (needs write:repository), release-dir, release-notes(-file), prerelease, override, direction upload/download, gpg signing. +- Limits on THIS forge (https://eureka.gamecult.org/forge/api/v1/settings/attachment, version 16.0.3+gitea-1.22.0): release/attachment max_size 2048 MB per file, max_files 5 per upload, allowed_types default list incl .zip .gz .tgz .json .log .md .pdf .png ... (no .exe, .tar.xz, .7z, .AppImage, .msi). Config cheat sheet confirms `[repository.release]` ALLOWED_TYPES default list, MAX_SIZE 2048, MAX_FILES 5 (https://forgejo.org/docs/latest/admin/config-cheat-sheet/). Release-asset ALLOWED_TYPES is overridable by admin. +- Push mirror: docs say it mirrors "branches, tags, and commits" (`git push --mirror`); releases not mentioned (https://forgejo.org/docs/latest/user/repo-mirror/). A third-party project (gitea.com/FrankenBit/release-toolkit) states releases are API objects that do not cross a push mirror; tags do. So releases do not propagate (consistent, not officially stated). +- State of GameCult/Aetheria on the forge now: exists (id 60), `empty: true`, `mirror: false`, has_actions true, has_releases true, no releases/tags, default branch master. + +## 4. SemVer + changelog tooling +| Tool | What decides bump | Forgejo/Gitea | Non-conventional history | +|---|---|---|---| +| release-please (googleapis) | Conventional Commit prefixes (feat=minor, fix=patch, !=major); `Release-As:` footer overrides. | GitHub-only; issue googleapis/release-please#2870 (opened 2026-08-06, open) asks for Forgejo/Gitea provider. | README: "assumes you are using Conventional Commit messages"; non-releasable commits produce no release PR; squash-merge `BEGIN_COMMIT_OVERRIDE` in PR body rewrites changelog lines. | +| semantic-release 25.0.9 | commit-analyzer (angular preset default). | Default plugin is @semantic-release/github; Gitea publishers are third-party npm: @markwylde/semantic-release-gitea 2.2.0 (2025-12), @forge-for-gitea/semantic-release-gitea 1.2.0 (2025-09), @saithodev/... 2.1.0 (2021). Node tool. | Non-matching commits yield no release (standard behaviour; not verified from docs fetched). | +| changesets | Hand-written changeset files declaring bump per package; no commit parsing. | CLI host-agnostic (git + files); changesets/action is GitHub-only (unverified); designed for npm/monorepos ("conceptually beneficial for single package repos"). | Unaffected by commit style. | +| git-cliff | `--bump`/`--bumped-version` from commits: fix=patch, feat=minor, !=major; custom_major/minor_increment_regex; `[bump] features_always_bump_minor`, `breaking_always_bump_major`, `initial_tag`; `--bump major|minor|patch` explicit; tag_pattern. | Remote integrations: GitHub, GitLab, Gitea/Forgejo, Bitbucket, Azure DevOps (docs: website/docs/integration/gitea.md; configuration/remote.md). Rust single binary. Changelog only (does not publish releases). | `conventional_commits=false, filter_unconventional=false` includes any commit unparsed; `commit_parsers` regex on message groups arbitrary prose (e.g. `{message=".*", group="Other"}`); for unconventional commits only the subject line is used when bumping (docs usage/bump-version.md). | +| knope 0.23.2 (2026-10-22) | Conventional commits and/or changeset files (`.changeset/*.md` style); can disable conventional commits via PrepareRelease. | Native Gitea support: `[gitea] owner/repo/host` (example host codeberg.org), `GITEA_TOKEN`, Gitea CreateRelease step, release assets test (crates/knope/tests/gitea_release/release_assets). | "Any commit without a first line structured like [type(scope)!: summary] isn't a conventional commit" (ignored for bump). | +| cocogitto (cog) | `cog bump --auto` from Conventional Commits; hooks; `cog changelog` (tera templates). | README mentions only GitHub integration (action/bot); changelog `remote` templates (remote = "github.com" in example); Gitea unverified. | `cog check`/`cog commit` enforce convention; non-conforming handling not read. | +| Release Drafter v7 | Pull-request labels/title via `version-resolver` (major/minor/patch labels) and autolabeler; drafts release notes from merged PRs. | README: package `release-drafter` has CLI/API "for other CI systems... supports GitHub, GitHub Enterprise Server, Gitea, Forgejo, and GitLab." Main use is GitHub Action. | Independent of commit style; depends on PRs/labels existing (Aetheria history is direct commits; PR usage unverified). | +- Aetheria facts given: prose subjects, no Conventional Commits, v0.1 tag from 2020. + +### Game projects in practice (checked via release APIs) +- Mindustry (Anuken/Mindustry): GitHub tags `v160.7`, `v160.6` (build-number versions, 2026-09/10), 4 assets per release (Mindustry.jar, server-release.jar, assets.jar, dependencies.jar), notes hand-written bullets. +- OpenTTD: tags `16.0-beta5` (2026-10-24, prerelease, 0 attached assets on the GitHub release); release.yml workflow triggered by `release: published` / workflow_dispatch builds source, docs, Linux, etc. +- Veloren (GitLab veloren/veloren): releases v0.18.0 (2026-01-23), v0.17.0 (2024-12-27), v0.16.0 (2024-03-31); plus moving tags `weekly` and `nightly` (updated 2026-10-27). FreeBSD ports track weekly as `s20260128`. CI file not read. +- Godot: tags `4.7.2-stable`, `4.7-stable`; ~34 assets per release; hand-managed. +- Unitystation (Unity, open source): GitHub releases stopped 2017; "Get latest release by using our launcher" (latest-release body). +- None of these showed Conventional-Commit-driven bumps in what I read; not verified beyond release listings. + +## Unread / not done +- Unity Licensing Server Requirements page; unity-builder issue tracker for 6000.3; Forgejo `release` event / GITHUB_TOKEN permissions in 16.0 Actions; cocogitto non-conventional behaviour; semantic-release/changesets docs on non-conventional input (stated from knowledge, marked unverified above). From a4be037a4294efaa5d3d5267ecdc71c4375a9c80 Mon Sep 17 00:00:00 2001 From: soul Date: Fri, 30 Oct 2026 03:12:31 +0100 Subject: [PATCH 002/108] LFS lives on the Eureka forge: .lfsconfig points every clone at it Co-Authored-By: Claude Opus 5.5 --- .lfsconfig | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .lfsconfig diff --git a/.lfsconfig b/.lfsconfig new file mode 100644 index 000000000..d9ce439fc --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://eureka.gamecult.org/forge/GameCult/Aetheria.git/info/lfs From 17c19521f5804fb59280aa2b38305d0b7b779cc4 Mon Sep 17 00:00:00 2001 From: Nibu Date: Thu, 5 Nov 2026 11:39:11 +0000 Subject: [PATCH 003/108] ship-authoring stats --top-speed adds the VelocityLimit a hull made without --like lacks validate refuses a ship hull with no top speed, and stats --top-speed refused a hull with none, so a package made without --like could not be made valid by any command (follow-up package-hull-top-speed). The flag now adds exactly one VelocityLimit and edits it on a later run; two stay refused. Co-Authored-By: Claude Sonnet 5.5 --- tests/Aetheria.Shared.Tests/ShipProductTests.cs | 11 +++++++++-- tools/AetherDb/ShipAuthoringCommands.cs | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/ShipProductTests.cs b/tests/Aetheria.Shared.Tests/ShipProductTests.cs index bb358c4df..343f35082 100644 --- a/tests/Aetheria.Shared.Tests/ShipProductTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipProductTests.cs @@ -353,8 +353,6 @@ public sealed class ShipProductTests : IDisposable RefusedAndUntouched(path, "--mass", "5", "--mass", "6"); // A valid flag beside a bad one writes nothing. RefusedAndUntouched(path, "--mass", "5", "--durability", "-2"); - RefusedAndUntouched(bare, "--top-speed", "50"); - RefusedAndUntouched(bare, "--mass", "5", "--top-speed", "50"); // Two VelocityLimits leave no one top speed to set. RefusedAndUntouched(twin, "--top-speed", "50"); @@ -385,6 +383,15 @@ public sealed class ShipProductTests : IDisposable Assert.Equal((1f, 0f, 8000f), (ShipAuthoringStore.Load(path).Hull.Mass, ShipAuthoringStore.Load(path).Hull.Drag, ShipAuthoringStore.Load(path).Hull.Durability)); Assert.Equal(0, Run("stats", bare, "--armor", "12").Code); Assert.Equal(12f, ShipAuthoringStore.Load(bare).Hull.Armor); + + // A hull with no VelocityLimit gets exactly one from --top-speed, the only way a hull made without --like can + // satisfy validate; a second run edits that one rather than adding another. + Assert.Empty(ShipAuthoringStore.Load(bare).Hull.Behaviors.OfType()); + Assert.Equal(0, Run("stats", bare, "--mass", "5", "--top-speed", "50").Code); + Assert.Equal(0, Run("stats", bare, "--top-speed", "60").Code); + var added = Assert.Single(ShipAuthoringStore.Load(bare).Hull.Behaviors.OfType()).TopSpeed; + Assert.Equal((60f, 60f), (added.Min, added.Max)); + Assert.Equal(5f, ShipAuthoringStore.Load(bare).Hull.Mass); } [Fact] diff --git a/tools/AetherDb/ShipAuthoringCommands.cs b/tools/AetherDb/ShipAuthoringCommands.cs index bce7eda08..841da957e 100644 --- a/tools/AetherDb/ShipAuthoringCommands.cs +++ b/tools/AetherDb/ShipAuthoringCommands.cs @@ -8,7 +8,7 @@ using System.Linq; // Uses the existing database executable; mod authoring does not earn another binary target. public static class ShipAuthoringCommands { - private const string Usage = "ship-authoring create [--like ] | inspect | centre | validate | product (--name [--description ] [--not-offered] | --remove) | price | stats [--mass m] [--durability d] [--armor a] [--drag x] [--top-speed v] | compose "; + private const string Usage = "ship-authoring create [--like ] | starter --like | inspect | centre | validate | product (--name [--description ] [--not-offered] | --remove) | price | stats [--mass m] [--durability d] [--armor a] [--drag x] [--top-speed v] | compose "; private static readonly string[] StatFlags = { "--mass", "--durability", "--armor", "--drag", "--top-speed" }; @@ -78,6 +78,12 @@ public static class ShipAuthoringCommands Console.WriteLine($"Created draft {path}; fill its model bindings and schematic in Blender."); return 0; } + if (args[0] == "starter" && args.Length == 6 && args[4] == "--like") + { + var path = ShipStarterCommand.Write(args[1], args[2], args[3], ShippedShipHull(args[5])); + Console.WriteLine($"Wrote a flyable starter package {path}; replace its stand-in model through Blender and Package, then set price and product."); + return 0; + } if (args[0] == "price" && args.Length == 3) { // Judged before the file is touched: a refusal leaves it byte-identical. @@ -111,7 +117,13 @@ public static class ShipAuthoringCommands if (stats.TryGetValue("--top-speed", out var topSpeed)) { var limits = (hull.Behaviors ?? new List()).OfType().ToArray(); - if (limits.Length != 1) throw new InvalidOperationException($"{ship.Id}: --top-speed needs exactly one VelocityLimit on the hull; it has {limits.Length}."); + if (limits.Length > 1) throw new InvalidOperationException($"{ship.Id}: --top-speed needs at most one VelocityLimit on the hull; it has {limits.Length}."); + // A hull made without --like has none, and this is its only way to get one: validate refuses a ship without a top speed. + if (limits.Length == 0) + { + limits = new[] { new VelocityLimitData() }; + (hull.Behaviors ??= new List()).Add(limits[0]); + } // A fixed top speed, as every shipped hull authors one (Min equal to Max); its terms are kept. limits[0].TopSpeed.Min = limits[0].TopSpeed.Max = topSpeed; } From 5b4665dfbbd637d65ee25617c83d97bd2eaf6fc1 Mon Sep 17 00:00:00 2001 From: Nibu Date: Thu, 5 Nov 2026 11:39:11 +0000 Subject: [PATCH 004/108] ship-authoring starter: a complete flyable package for authors with no Blender Writes //ship.cc and ship.glb: a shipped hull's stats, a 4x6 grid with two drives, a radiator, two energy guns and the internal modules, and a boxed model carrying every anchor. The package is read back through ShipModCatalog.ReadPackage, so the GLB's node ids and mesh roles are judged by the reader the game boots with. Refuses to overwrite a package. Co-Authored-By: Claude Sonnet 5.5 --- docs/moddable-ship-authoring.md | 5 + .../ShipModCatalogTests.cs | 22 ++ tools/AetherDb/ShipStarterCommand.cs | 213 ++++++++++++++++++ 3 files changed, 240 insertions(+) create mode 100644 tools/AetherDb/ShipStarterCommand.cs diff --git a/docs/moddable-ship-authoring.md b/docs/moddable-ship-authoring.md index 446bb6d89..6a9e5c5c0 100644 --- a/docs/moddable-ship-authoring.md +++ b/docs/moddable-ship-authoring.md @@ -63,6 +63,11 @@ be empties. Package exports the collection, Grease Pencil excluded, to collection holds exactly one Grease Pencil object, and shows AetherDb's verdict in the panel. It runs the AetherDb in the game folder's `ModTools` (see Tools below). +A package made with `create` and no `--like` has no top speed, which `validate` refuses; `ship-authoring stats --top-speed ` +adds the one `VelocityLimit` it needs (and edits it on a later run). +Without Blender, `ship-authoring starter --like ` writes a complete flyable package: the +shipped hull's stats, a 4×6 grid carrying two thrusters, a radiator, two energy guns and the internal modules, and a boxed +`ship.glb` with every anchor. The model is a stand-in to replace through Blender and **Package**. `ship-authoring inspect ` reads drafts; `validate` requires complete hull, model, and anchor authoring, and judges `ship.glb` once it exists. diff --git a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs index 717108d8d..3def3e6dd 100644 --- a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs @@ -501,6 +501,28 @@ public sealed class ShipModCatalogTests : IDisposable Assert.True(File.Exists(target), error); } + // starter: a complete package from nothing but a hull to take stats from. The package must pass the reader the game boots + // with (GLB node ids and mesh roles included) and plan a rig, and a second run must not touch the first package. + [Fact] + public void StarterWritesAPackageTheGameLoadsAndPlansARigFrom() + { + var like = new HullData { Name = "Like", HullType = HullType.Ship, Mass = 1234, Behaviors = { new VelocityLimitData() } }; + var mods = Path.Combine(_directory.Path, "GameData", "Mods"); + var path = ShipStarterCommand.Write(mods, "probe.starter", "Probe Starter", like); + + var package = ShipModCatalog.ReadPackage(path); + Assert.Equal(("Probe Starter", 1234f), (package.Hull.Name, package.Hull.Mass)); + var plan = ShipModPlan.Build(package.Hull, package.Visual); + Assert.Equal(2, plan.Thrusters.Length); + Assert.Single(plan.Radiators); + Assert.Equal(new[] { 1, 1 }, plan.Weapons.Select(weapon => weapon.Muzzles.Length)); + Assert.Equal(package.Hull.Shape.Width * package.Hull.Shape.Height, package.Hull.Shape.Cells.Cast().Count(cell => cell)); + + var before = File.ReadAllBytes(path); + Assert.Throws(() => ShipStarterCommand.Write(mods, "probe.starter", "Other", like)); + Assert.Equal(before, File.ReadAllBytes(path)); + } + [Fact] public void CentreCommandPrintsShapeCenterOfMass() { diff --git a/tools/AetherDb/ShipStarterCommand.cs b/tools/AetherDb/ShipStarterCommand.cs new file mode 100644 index 000000000..2a502a1f5 --- /dev/null +++ b/tools/AetherDb/ShipStarterCommand.cs @@ -0,0 +1,213 @@ +using GameCult.Caching; +using CultMath; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Text; + +// `ship-authoring starter`: a complete, flyable mod package for authors with no Blender at hand. It writes the package +// (//ship.cc and ship.glb) with the stats of a shipped hull, a small hull grid, a working rig (two thrusters, +// a radiator, two energy guns, the internal modules) and a boxed model that carries every anchor the rig needs. The +// model is a stand-in an author replaces through Blender and Package; the records are judged by the same validator and +// reader the game boots with, so a starter that is written is a starter the game loads. +public static class ShipStarterCommand +{ + // Hull grid, x across, y from the stern (0) to the bow. The mount rows below say what sits in each cell. + private const int Width = 4, Height = 6; + + private sealed class Part + { + public string Id, Role, Parent; + public HardpointType? Mount; + public int2 Cell, Size = new int2(1, 1); + public float3 Position; + // Box half-extents; null for an empty node. Scale is the node scale, used by the shield envelope. + public float3? Half; + public float3? Scale; + } + + public static string Write(string modsRoot, string id, string name, HullData like) + { + ShipAuthoringStore.RequireShipId(id); + var directory = Path.Combine(Path.GetFullPath(modsRoot), id); + var path = Path.Combine(directory, "ship.cc"); + if (File.Exists(path) || File.Exists(Path.Combine(directory, "ship.glb"))) + throw new InvalidOperationException($"Refusing to replace the package in {directory}"); + + // Metres, nose toward -Y, up +Z, as the Blender add-on's kit frame has it; the GLB writer converts to glTF's Y-up. + var parts = new[] + { + new Part { Id = "map", Role = "map-icon", Half = new float3(3f, 5f, .05f) }, + new Part { Id = "collider", Role = "hull-collider", Half = new float3(3f, 5f, 1f) }, + new Part { Id = "shield", Role = "shield", Scale = new float3(4f, 6f, 2.5f) }, + new Part { Id = "tractor", Role = "tractor", Position = new float3(0f, -5f, 0f) }, + new Part { Id = "thruster.port", Role = "thruster-emitter", Mount = HardpointType.Thruster, Cell = new int2(0, 0), Size = new int2(2, 1), Position = new float3(2.2f, 5.4f, 0f), Half = new float3(.4f, .6f, .4f) }, + new Part { Id = "thruster.starboard", Role = "thruster-emitter", Mount = HardpointType.Thruster, Cell = new int2(2, 0), Size = new int2(2, 1), Position = new float3(-2.2f, 5.4f, 0f), Half = new float3(.4f, .6f, .4f) }, + new Part { Id = "radiator", Role = "radiator-mesh", Mount = HardpointType.Radiator, Cell = new int2(1, 1), Size = new int2(2, 1), Position = new float3(0f, 2f, 1.1f), Half = new float3(1.5f, .8f, .08f) }, + new Part { Id = "gun.port", Role = "weapon-mount", Mount = HardpointType.Energy, Cell = new int2(0, 5), Position = new float3(1.8f, -3f, 1.1f) }, + new Part { Id = "gun.port.muzzle", Role = "weapon-muzzle", Parent = "gun.port", Position = new float3(1.8f, -4f, 1.1f) }, + new Part { Id = "gun.starboard", Role = "weapon-mount", Mount = HardpointType.Energy, Cell = new int2(3, 5), Position = new float3(-1.8f, -3f, 1.1f) }, + new Part { Id = "gun.starboard.muzzle", Role = "weapon-muzzle", Parent = "gun.starboard", Position = new float3(-1.8f, -4f, 1.1f) }, + }; + // Internal modules show on no model, so they have a cell and no anchor. + var internals = new[] + { + ("reactor", HardpointType.Reactor, new int2(1, 2), new int2(2, 2)), ("shield", HardpointType.Shield, new int2(3, 4), new int2(1, 1)), + ("control", HardpointType.ControlModule, new int2(1, 4), new int2(2, 2)), ("sensors", HardpointType.Sensors, new int2(0, 4), new int2(1, 1)), + }; + + var ship = new ShipAuthoring + { + Id = id, + ModelAsset = "ship.glb", + Anchors = parts.Select(part => new ShipAnchor { Id = part.Id, Role = part.Role, ModelNodeId = part.Id, ParentId = part.Parent }).ToList() + }; + var hull = ShipAuthoringStore.HullLike(like, name, id); + hull.Shape = new Shape(Width, Height); + for (var x = 0; x < Width; x++) + for (var y = 0; y < Height; y++) + hull.Shape.Cells[x, y] = true; + hull.Hardpoints = parts.Where(part => part.Mount != null) + .Select(part => (part.Id, part.Mount.Value, part.Cell, part.Size)) + .Concat(internals.Select(row => (Id: "internal." + row.Item1, Mount: row.Item2, Cell: row.Item3, Size: row.Item4))) + .Select(row => new HardpointData + { + Type = row.Item2, Position = row.Item3, Shape = Block(row.Item4), Transform = row.Item1, + // The grid's stern is y = 0 and its bow the far row: a drive there pushes the ship toward the bow, which the + // authoring grid spells Reversed (as Djinni's stern drives are). + Rotation = row.Item2 == HardpointType.Thruster ? ItemRotation.Reversed : ItemRotation.None + }).ToList(); + ShipAuthoringStore.Validate(hull, ship); + + Directory.CreateDirectory(directory); + File.WriteAllBytes(Path.Combine(directory, ship.ModelAsset), Glb(parts)); + using (var cache = ShipAuthoringStore.Open(path, writable: true)) + { + ShipAuthoringStore.Write(cache, hull, ship); + cache.FlushAsync().Wait(); + } + // The reader the game boots with, over the written package: the GLB's node ids and mesh roles are judged too. + ShipModCatalog.ReadPackage(path); + return path; + } + + private static Shape Block(int2 size) + { + var shape = new Shape(size.x, size.y); + foreach (var cell in shape.AllCoordinates) shape[cell] = true; + return shape; + } + + // One GLB holding every part as a root-level node, each box with its own vertices (a convex collider cooks from it + // as it is), and each muzzle a child of its mount. Node ids travel in extras.aetheria.id, as Package writes them. + private static byte[] Glb(Part[] parts) + { + var bin = new List(); + var views = new List(); + var accessors = new List(); + var meshes = new List(); + var meshOf = new Dictionary(); + + int View(byte[] bytes, int target) + { + while (bin.Count % 4 != 0) bin.Add(0); + views.Add($@"{{""buffer"":0,""byteOffset"":{bin.Count},""byteLength"":{bytes.Length},""target"":{target}}}"); + bin.AddRange(bytes); + return views.Count - 1; + } + string F(float value) => value.ToString("R", CultureInfo.InvariantCulture); + + foreach (var part in parts.Where(part => part.Half != null)) + { + var (hx, hy, hz) = (part.Half.Value.x, part.Half.Value.y, part.Half.Value.z); + var positions = new List(); + var normals = new List(); + var indices = new List(); + // Six faces, outward normals, in the Blender frame; Gltf() turns each into glTF's. + foreach (var (axis, sign) in new[] { (0, 1), (0, -1), (1, 1), (1, -1), (2, 1), (2, -1) }) + { + var u = (axis + 1) % 3; + var v = (axis + 2) % 3; + var half = new[] { hx, hy, hz }; + var first = (ushort)(positions.Count / 3); + foreach (var (a, b) in new[] { (-1, -1), (1, -1), (1, 1), (-1, 1) }) + { + var corner = new float[3]; + corner[axis] = sign * half[axis]; + corner[u] = a * half[u]; + corner[v] = b * half[v]; + positions.AddRange(Gltf(corner[0], corner[1], corner[2])); + var normal = new float[3]; + normal[axis] = sign; + normals.AddRange(Gltf(normal[0], normal[1], normal[2])); + } + // The (axis, u, v) frame is right-handed, so the corner order above winds counter-clockwise seen from +axis. + var order = sign > 0 ? new[] { 0, 1, 2, 0, 2, 3 } : new[] { 0, 2, 1, 0, 3, 2 }; + indices.AddRange(order.Select(i => (ushort)(first + i))); + } + var positionView = View(positions.SelectMany(BitConverter.GetBytes).ToArray(), 34962); + var normalView = View(normals.SelectMany(BitConverter.GetBytes).ToArray(), 34962); + var indexView = View(indices.SelectMany(BitConverter.GetBytes).ToArray(), 34963); + var low = Gltf(-hx, -hy, -hz); + var high = Gltf(hx, hy, hz); + var box = new[] { Math.Min(low[0], high[0]), Math.Min(low[1], high[1]), Math.Min(low[2], high[2]), Math.Max(low[0], high[0]), Math.Max(low[1], high[1]), Math.Max(low[2], high[2]) }; + accessors.Add($@"{{""bufferView"":{positionView},""componentType"":5126,""count"":{positions.Count / 3},""type"":""VEC3"",""min"":[{F(box[0])},{F(box[1])},{F(box[2])}],""max"":[{F(box[3])},{F(box[4])},{F(box[5])}]}}"); + accessors.Add($@"{{""bufferView"":{normalView},""componentType"":5126,""count"":{normals.Count / 3},""type"":""VEC3""}}"); + accessors.Add($@"{{""bufferView"":{indexView},""componentType"":5123,""count"":{indices.Count},""type"":""SCALAR""}}"); + meshOf[part] = meshes.Count; + meshes.Add($@"{{""primitives"":[{{""attributes"":{{""POSITION"":{accessors.Count - 3},""NORMAL"":{accessors.Count - 2}}},""indices"":{accessors.Count - 1}}}]}}"); + } + + // A muzzle is a child of its mount, so its translation is relative to the mount's. + var byId = parts.ToDictionary(part => part.Id, StringComparer.Ordinal); + var nodeIndex = parts.Select((part, index) => (part.Id, index)).ToDictionary(pair => pair.Id, pair => pair.index, StringComparer.Ordinal); + string Node(Part part) + { + var translation = part.Parent == null ? part.Position : part.Position - byId[part.Parent].Position; + var g = Gltf(translation.x, translation.y, translation.z); + var json = new StringBuilder($@"{{""name"":""{part.Id}"""); + if (meshOf.TryGetValue(part, out var mesh)) json.Append($@",""mesh"":{mesh}"); + if (part.Scale != null) { var s = Gltf(part.Scale.Value.x, part.Scale.Value.y, part.Scale.Value.z); json.Append($@",""scale"":[{F(Math.Abs(s[0]))},{F(Math.Abs(s[1]))},{F(Math.Abs(s[2]))}]"); } + json.Append($@",""translation"":[{F(g[0])},{F(g[1])},{F(g[2])}]"); + var children = parts.Where(child => child.Parent == part.Id).Select(child => nodeIndex[child.Id]).ToArray(); + if (children.Length > 0) json.Append($@",""children"":[{string.Join(",", children)}]"); + json.Append($@",""extras"":{{""aetheria.id"":""{part.Id}""}}}}"); + return json.ToString(); + } + var roots = parts.Where(part => part.Parent == null).Select(part => nodeIndex[part.Id]); + var document = $@"{{""asset"":{{""version"":""2.0"",""generator"":""AetherDb ship-authoring starter""}},""scene"":0,""scenes"":[{{""nodes"":[{string.Join(",", roots)}]}}]," + + $@"""nodes"":[{string.Join(",", parts.Select(Node))}],""meshes"":[{string.Join(",", meshes)}],""accessors"":[{string.Join(",", accessors)}]," + + $@"""bufferViews"":[{string.Join(",", views)}],""buffers"":[{{""byteLength"":{bin.Count + (4 - bin.Count % 4) % 4}}}]}}"; + return Container(document, bin.ToArray()); + } + + // Blender (x right, y back, z up) to glTF (x right, y up, z toward the viewer): the exporter's +Y-up conversion. + private static float[] Gltf(float x, float y, float z) => new[] { x, z, -y }; + + private static byte[] Container(string json, byte[] bin) + { + byte[] Pad(byte[] bytes, byte fill) + { + var padded = new byte[(bytes.Length + 3) / 4 * 4]; + Array.Fill(padded, fill); + bytes.CopyTo(padded, 0); + return padded; + } + var body = Pad(Encoding.UTF8.GetBytes(json), (byte)' '); + var data = Pad(bin, 0); + using var stream = new MemoryStream(); + using var writer = new BinaryWriter(stream); + writer.Write(0x46546C67u); + writer.Write(2u); + writer.Write((uint)(28 + body.Length + data.Length)); + writer.Write((uint)body.Length); + writer.Write(0x4E4F534Au); + writer.Write(body); + writer.Write((uint)data.Length); + writer.Write(0x004E4942u); + writer.Write(data); + return stream.ToArray(); + } +} From a892b5463bac008e95518eca322a6e074e39a0d9 Mon Sep 17 00:00:00 2001 From: Nibu Date: Thu, 5 Nov 2026 11:39:11 +0000 Subject: [PATCH 005/108] Wren: the starter's first package, a stand-in light courier in GameData/Mods Written by ship-authoring starter --like Djinni, priced, with an unoffered Aeronautics Unlimited product (so the census counts it sold and no faction fields a box). Tests: it composes into the catalog, its mounts take catalog gear, and the fitted ship moves under thrust. Drop the directory to remove it; replace the model through Blender and Package to make it a real hull. Co-Authored-By: Claude Sonnet 5.5 --- GameData/Mods/aetheria.wren/ship.cc | 3 + GameData/Mods/aetheria.wren/ship.glb | 3 + .../Aetheria.Shared.Tests/WrenPackageTests.cs | 68 +++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 GameData/Mods/aetheria.wren/ship.cc create mode 100644 GameData/Mods/aetheria.wren/ship.glb create mode 100644 tests/Aetheria.Shared.Tests/WrenPackageTests.cs diff --git a/GameData/Mods/aetheria.wren/ship.cc b/GameData/Mods/aetheria.wren/ship.cc new file mode 100644 index 000000000..0b5e70964 --- /dev/null +++ b/GameData/Mods/aetheria.wren/ship.cc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b66dab2993fc365eacaf900ef1405f40b8ac2301977793c61d1c96475743017a +size 10506 diff --git a/GameData/Mods/aetheria.wren/ship.glb b/GameData/Mods/aetheria.wren/ship.glb new file mode 100644 index 000000000..03b70b729 --- /dev/null +++ b/GameData/Mods/aetheria.wren/ship.glb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98bf1b4a0e19e67568930ca79b9d61529c21c63dd74ee8df3d3f1d419d3a81cc +size 6964 diff --git a/tests/Aetheria.Shared.Tests/WrenPackageTests.cs b/tests/Aetheria.Shared.Tests/WrenPackageTests.cs new file mode 100644 index 000000000..bb95cbb55 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/WrenPackageTests.cs @@ -0,0 +1,68 @@ +using System.Linq; +using CultMath; +using GameCult.Caching; +using Xunit; +using static CultMath.math; +using Random = CultMath.Random; + +// GameData/Mods/aetheria.wren: a first-party package written by `ship-authoring starter --like Djinni`, then priced and given +// an unoffered Aeronautics Unlimited product by `ship-authoring price` and `product`; its model is the starter's boxed +// stand-in. It is the pipeline's proof from a hull package on disk to a ship that flies in the headless simulation: the +// package composes into the catalog, its mounts take catalog gear, and the fitted ship moves under thrust. `fly` cannot +// reach it (an unoffered product is never drawn), so these tests are the flight check until a pinned Loadout exists. +public sealed class WrenPackageTests +{ + private const string Id = "aetheria.wren"; + + private static HullData Wren(CultCache cache) => cache.Get(new CultRecordRef(ShipModCatalog.HullKey(Id))); + + [Fact] + public void TheStarterPackageIsInTheComposedCatalogWithTheStatsOfItsLike() + { + using var cache = RestoredHullsTests.OpenCatalog(); + var hull = Wren(cache); + var like = cache.GetByName("Djinni"); + Assert.NotNull(hull); + Assert.Equal(("Wren", HullType.Ship, like.Mass, like.Durability), (hull.Name, hull.HullType, hull.Mass, hull.Durability)); + Assert.Equal(ShipModCatalog.AuthoringKey(Id), hull.Visual.Key); + Assert.Equal(2, hull.Hardpoints.Count(h => h.Type == HardpointType.Thruster)); + Assert.Equal(2, hull.Hardpoints.Count(h => h.Type == HardpointType.Energy)); + } + + // The starter's product is its maker's but off the market (rulings package-carries-product, off-market-is-unoffered-product): + // the census wants every design sold or placed, and no faction fields a stand-in box. + [Fact] + public void TheStarterIsMadeButNeverOffered() + { + using var cache = RestoredHullsTests.OpenCatalog(); + var hull = Wren(cache); + var product = Assert.Single(cache.GetAll(), p => p.Design.Key.Equals(ShipModCatalog.HullKey(Id))); + Assert.Equal("Aeronautics Unlimited", cache.Get(product.Manufacturer).Name); + Assert.True(product.NotOffered); + Assert.True(hull.Price > 0); + Assert.DoesNotContain(hull, LoadoutGenerator.SoldHulls(cache)); + } + + // Every mount takes a catalog design: the starter's footprints are sized to gear that exists, so it can be fitted out. + [Fact] + public void EveryMountTakesACatalogDesign() + { + using var cache = RestoredHullsTests.OpenCatalog(); + var designs = cache.GetAll().ToArray(); + var bare = Wren(cache).Hardpoints.Where(hardpoint => !designs.Any(hardpoint.Takes)).Select(hardpoint => $"{hardpoint.Transform} ({hardpoint.Type})").ToArray(); + // No shield design fits a 1x1 yet (hardpoint-fit lists Djinni's 4-cell shield with none either); every other mount does. + Assert.Equal(new[] { "internal.shield (Shield)" }, bare); + } + + [Fact] + public void TheStarterFliesUnderThrust() + { + using var cache = RestoredHullsTests.OpenCatalog(); + var ship = RestoredHullsTests.BuildThrustedShip(cache, "Wren"); + var start = ship.Velocity; + ship.MovementDirection = float2(0, 1); + for (var i = 0; i < 10; i++) ship.Zone.Update(1f / 60f); + Assert.NotEqual(start, ship.Velocity); + Assert.True(ship.GetBehavior().Limit > 0f); + } +} From 8c5a904cb7d1da930489c04680c871ffa0295d2b Mon Sep 17 00:00:00 2001 From: Nibu Date: Thu, 5 Nov 2026 11:39:11 +0000 Subject: [PATCH 006/108] Tests that pin a thruster's authored push read it at ThrustScale 1 e0c1daa4e made thrust a tenth of authored by default (GameplaySettings.ThrustScale = .1), which broke twelve tests that pin what a thruster, a hull or a brain does (Brownout, ConditionRatio, Longinus top speed, the evasion, approach and envelope tests, SimRateEquivalence). Their fixtures now state ThrustScale 1: they pin mechanics, and a retune of the global knob does not move them. Co-Authored-By: Claude Sonnet 5.5 --- tests/Aetheria.Shared.Tests/BrownoutTests.cs | 3 ++- tests/Aetheria.Shared.Tests/ConditionRatioTests.cs | 3 ++- tests/Aetheria.Shared.Tests/RestoredHullsTests.cs | 10 +++++++++- tests/Aetheria.Shared.Tests/RunStartTests.cs | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/BrownoutTests.cs b/tests/Aetheria.Shared.Tests/BrownoutTests.cs index 95958170c..3ac400c56 100644 --- a/tests/Aetheria.Shared.Tests/BrownoutTests.cs +++ b/tests/Aetheria.Shared.Tests/BrownoutTests.cs @@ -53,7 +53,8 @@ public sealed class BrownoutTests : IDisposable { DefaultEntitySettings = new EntitySettings(), Tiers = new[] { new RarityTier { Name = "Common", Quality = .5f, Color = new float3(1, 1, 1) } }, - QualityPriceModifier = new ExponentialLerp() + QualityPriceModifier = new ExponentialLerp(), + ThrustScale = 1f // these pin a thruster's authored push, not the global flight tuning }; private static PerformanceStat Constant(float v) => new PerformanceStat { Min = v, Max = v }; diff --git a/tests/Aetheria.Shared.Tests/ConditionRatioTests.cs b/tests/Aetheria.Shared.Tests/ConditionRatioTests.cs index 00d446384..3e02965db 100644 --- a/tests/Aetheria.Shared.Tests/ConditionRatioTests.cs +++ b/tests/Aetheria.Shared.Tests/ConditionRatioTests.cs @@ -28,7 +28,8 @@ public sealed class ConditionRatioTests : IDisposable { DefaultEntitySettings = new EntitySettings(), Tiers = new[] { new RarityTier { Name = "Common", Quality = .5f, Color = new float3(1, 1, 1) } }, - QualityPriceModifier = new ExponentialLerp() + QualityPriceModifier = new ExponentialLerp(), + ThrustScale = 1f // these pin a thruster's authored push, not the global flight tuning }; private static PerformanceStat Constant(float v) => new PerformanceStat { Min = v, Max = v }; diff --git a/tests/Aetheria.Shared.Tests/RestoredHullsTests.cs b/tests/Aetheria.Shared.Tests/RestoredHullsTests.cs index 6dd235551..121d468b3 100644 --- a/tests/Aetheria.Shared.Tests/RestoredHullsTests.cs +++ b/tests/Aetheria.Shared.Tests/RestoredHullsTests.cs @@ -31,7 +31,15 @@ public sealed class RestoredHullsTests // (tools/AetherDb/AuthoredSettings.cs) is the same headless YAML reader tools/AetherDb already uses to // inspect Settings.asset outside Unity; this loads the real GameplaySettings the same way instead of // hand-copying its fields a second time. - internal static GameplaySettings Settings() => AuthoredSettings.Load(FindRepoRoot()).Read("GameplaySettings"); + internal static GameplaySettings Settings() => PinnedFlight(AuthoredSettings.Load(FindRepoRoot()).Read("GameplaySettings")); + + // The authored settings with the global thrust tuning at 1 (GameplaySettings.ThrustScale, 0.1 in play): tests that pin + // what a thruster, a hull or a brain does read the gear's own thrust, so a retune of the knob does not move them. + internal static GameplaySettings PinnedFlight(GameplaySettings settings) + { + settings.ThrustScale = 1f; + return settings; + } // Same composition FireControlCut7Tests.OpenReadOnlyRealCatalog uses: a registry scoped to the shipped // assembly's own [CultDocument] types, so this test's own process-wide type registration never pollutes the diff --git a/tests/Aetheria.Shared.Tests/RunStartTests.cs b/tests/Aetheria.Shared.Tests/RunStartTests.cs index 69b040d4e..efd17eb71 100644 --- a/tests/Aetheria.Shared.Tests/RunStartTests.cs +++ b/tests/Aetheria.Shared.Tests/RunStartTests.cs @@ -53,7 +53,7 @@ public sealed partial class RunStartTests : IDisposable _galaxy = new Galaxy(tutorial, authored.Read("TutorialBackgroundSettings"), _cache, new PlayerSettings(), Directory.CreateDirectory(Path.Combine(_root, "Narrative")), _ => { }, null, GalaxySeed); - _items = new ItemManager(1u, _cache, new ProvenanceLedger(), authored.Read("GameplaySettings"), _ => { }); + _items = new ItemManager(1u, _cache, new ProvenanceLedger(), RestoredHullsTests.PinnedFlight(authored.Read("GameplaySettings")), _ => { }); _protagonist = _galaxy.ResolveFaction(tutorial.ProtagonistFaction); // GameSettings.StartingHullName is a plain field of the Unity settings object, not a ServerShared subtree From a0c760f5cf46c798012ac2ece37dc7113dbd46c3 Mon Sep 17 00:00:00 2001 From: Nibu Date: Thu, 5 Nov 2026 11:39:59 +0000 Subject: [PATCH 007/108] Wren: product renamed Wren Courier; 'Wren' collided with a shipped product and compose excluded the package Co-Authored-By: Claude Sonnet 5.5 --- GameData/Mods/aetheria.wren/ship.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GameData/Mods/aetheria.wren/ship.cc b/GameData/Mods/aetheria.wren/ship.cc index 0b5e70964..d81f9bba5 100644 --- a/GameData/Mods/aetheria.wren/ship.cc +++ b/GameData/Mods/aetheria.wren/ship.cc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b66dab2993fc365eacaf900ef1405f40b8ac2301977793c61d1c96475743017a -size 10506 +oid sha256:6b1744dfa7dd6c5325ca3bd04fba941408cdc1255c06d1fc0d52fa67c97dc100 +size 10514 From 2b0fb3c22ded74ab25513c122d74014aadffa086 Mon Sep 17 00:00:00 2001 From: Nibu Date: Fri, 6 Nov 2026 00:15:56 +0000 Subject: [PATCH 008/108] fly reaches unoffered hulls through their Loadout; authoring doc no longer says console-only A hull no maker offers is drawn by no generator, so fly now falls back to a catalog Loadout of the named ship hull (Loadouts.Materialize with the game's chooser). The authoring doc claimed a product-less package is console-only; it is unreachable unless a Loadout fits it. Co-Authored-By: Claude Sonnet 5.5 --- Assets/Scripts/Gameplay/ActionGameManager.cs | 20 ++++++++++++++++---- docs/moddable-ship-authoring.md | 5 +++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 62105a711..a0cf3a4c1 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -590,12 +590,24 @@ public class ActionGameManager : MonoBehaviour } var generator = new LoadoutGenerator(ref ItemManager.Random, ItemManager, CurrentGalaxy, Zone.GalaxyZone, null, 2); var pack = generator.GenerateShipLoadout(data => string.Equals(data.Name, hullName, StringComparison.InvariantCultureIgnoreCase)); - if (pack == null) + Ship ship; + if (pack != null) ship = (Ship) EntitySerializer.Unpack(ItemManager, Zone, pack); + else { - ConsoleController.Instance.AppendLogLine($"No ship hull named \"{hullName}\""); - return; + // An unoffered hull is drawn by nobody; it reaches a ship only through a Loadout (ruling off-market-is-general). + var failures = new List(); + var loadout = ItemManager.ItemData.GetAll().FirstOrDefault(l => + ItemManager.ItemData.Get(l.Hull) is { HullType: HullType.Ship } hull && + string.Equals(hull.Name, hullName, StringComparison.InvariantCultureIgnoreCase)); + ship = loadout == null ? null : Loadouts.Materialize(ItemManager, Zone, loadout, generator.ChooseProduct, failures) as Ship; + if (ship == null) + { + ConsoleController.Instance.AppendLogLine(failures.Count > 0 + ? $"Cannot build \"{hullName}\": {string.Join("; ", failures)}" + : $"No ship hull named \"{hullName}\" that a maker offers or a Loadout fits"); + return; + } } - var ship = (Ship) EntitySerializer.Unpack(ItemManager, Zone, pack); ship.IsPlayerShip = true; ship.Direction = _currentEntity.Direction; ship.Position.xz = _currentEntity.Position.xz + _currentEntity.Direction.Rotate(ItemRotation.Clockwise) * 30; diff --git a/docs/moddable-ship-authoring.md b/docs/moddable-ship-authoring.md index 6a9e5c5c0..81871b2dc 100644 --- a/docs/moddable-ship-authoring.md +++ b/docs/moddable-ship-authoring.md @@ -245,8 +245,9 @@ catalog. Continue refuses a run naming a design the catalog no longer holds price and `ship-authoring product --name [--description ]` writes the package's product by that maker (`--remove` deletes it). A package with a product needs a price above 0, - because generation skips price 0; a package with none stays valid and is - console-only. Compose follows. + because generation skips price 0; a package with none stays valid but no + maker offers it, so generation never draws it. Console `fly ` reaches such a hull only + through a catalog Loadout of it. Compose follows. 3. A command-line validator rejects malformed cells, overlapping or dangling hardpoints, missing model nodes, and unresolved asset references with precise errors. It changes no live catalog or scene on failure. The From 65a6297aee247c603141850eaf0be2dc7048f989 Mon Sep 17 00:00:00 2001 From: Nibu Date: Sat, 7 Nov 2026 11:55:50 +0000 Subject: [PATCH 009/108] Save standings by faction, not by list position RunSave.Capture wrote Factions in HomeZones key order and Relationships in galaxy.Factions order; Galaxy's save constructor paired them by index, so a galaxy whose two orders differed resumed with standings on the wrong factions. SavedGame.Standings (Key 16) now carries each standing with its faction ref. A save without it still reads Relationships by index, the only record it holds. Co-Authored-By: Claude Sonnet 5.5 --- Assets/Scripts/ServerShared/Galaxy.cs | 12 +++-- Assets/Scripts/ServerShared/SavedGame.cs | 20 +++++++- tests/Aetheria.Shared.Tests/RunSaveTests.cs | 53 +++++++++++++++++++-- 3 files changed, 76 insertions(+), 9 deletions(-) diff --git a/Assets/Scripts/ServerShared/Galaxy.cs b/Assets/Scripts/ServerShared/Galaxy.cs index 08512f8af..797e77764 100644 --- a/Assets/Scripts/ServerShared/Galaxy.cs +++ b/Assets/Scripts/ServerShared/Galaxy.cs @@ -58,10 +58,14 @@ public class Galaxy Seed = savedGame.Seed; Factions = savedGame.Factions.Select(faction => cultCache.Get(faction)).ToArray(); - for (var i = 0; i < Factions.Length; i++) - { - FactionRelationships[Factions[i]] = savedGame.Relationships[i]; - } + if (savedGame.Standings != null) + foreach (var standing in savedGame.Standings) + FactionRelationships[cultCache.Get(standing.Faction)] = standing.Relationship; + else + // A save before Standings wrote Relationships in an order it did not record; it is right only for a + // galaxy that never reordered, and is all that save holds. + for (var i = 0; i < Factions.Length; i++) + FactionRelationships[Factions[i]] = savedGame.Relationships[i]; var savedZones = savedGame.Zones.Select(zone => cultCache.Get(zone)).ToArray(); Zones = savedZones.Select(zone => diff --git a/Assets/Scripts/ServerShared/SavedGame.cs b/Assets/Scripts/ServerShared/SavedGame.cs index 90ef03566..ff4de6e9b 100644 --- a/Assets/Scripts/ServerShared/SavedGame.cs +++ b/Assets/Scripts/ServerShared/SavedGame.cs @@ -45,6 +45,8 @@ public class SavedGame [Key(11)] public bool IsTutorial; + // Read only by a save written before Standings: its entries follow galaxy.Factions order, not Factions order, so + // Galaxy trusts it only when the two orders cannot differ (see Galaxy's save constructor). [Key(12)] public FactionRelationship[] Relationships; @@ -61,6 +63,21 @@ public class SavedGame // gets Regions, Partition and Deal from its saved graph, boss zones, Exit and seed. [Key(15)] public List Provinces; + + // Each faction's standing, keyed by the faction itself so no list order can misplace it. Written by RunSave.Capture; + // null in a save written before it, which then reads Relationships. + [Key(16)] + public List Standings; +} + +[MessagePackObject] +public class SavedStanding +{ + [Key(0)] + public CultRecordRef Faction; + + [Key(1)] + public FactionRelationship Relationship; } [MessagePackObject] @@ -87,7 +104,8 @@ public static class RunSave DiscoveredZones = galaxy.DiscoveredZones.Select(dz => Array.IndexOf(galaxy.Zones, dz)).ToArray(), Background = galaxy.Background, Factions = factions.Select(f => cache.RefOf(f)).ToArray(), - Relationships = galaxy.Factions.Select(f => galaxy.FactionRelationships[f]).ToArray(), + Standings = galaxy.Factions.Select(f => new SavedStanding + {Faction = cache.RefOf(f), Relationship = galaxy.FactionRelationships[f]}).ToList(), HomeZones = galaxy.HomeZones.ToDictionary( x => Array.IndexOf(factions, x.Key), x => Array.IndexOf(galaxy.Zones, x.Value)), diff --git a/tests/Aetheria.Shared.Tests/RunSaveTests.cs b/tests/Aetheria.Shared.Tests/RunSaveTests.cs index 00a6baa75..05c0a86ac 100644 --- a/tests/Aetheria.Shared.Tests/RunSaveTests.cs +++ b/tests/Aetheria.Shared.Tests/RunSaveTests.cs @@ -150,6 +150,48 @@ public sealed class RunSaveTests : IDisposable } } + // Galaxy.Factions and Galaxy.HomeZones.Keys are two orders of the same factions. A saved standing belongs to its + // faction, whichever order the galaxy lists them in. + [Fact] + public void StandingsSurviveSaveAndContinueWhenFactionOrderDiffersFromHomeZoneOrder() + { + using (var cache = AetheriaStores.Open(Catalog, catalogWritable: true)) + { + cache.Upsert(new Faction { Name = "Borealis", ShortName = "BOR" }); + cache.Upsert(new Faction { Name = "Corvid", ShortName = "COR" }); + cache.FlushAsync().Wait(); + } + + using (var cache = Open()) + { + var factions = cache.GetAll().OrderBy(f => f.Name, StringComparer.Ordinal).ToArray(); + var game = Game(cache, factions); + RunSave.Commit(cache, game, Zones(2, null, -1), new ProvenanceLedger()); + } + + var expected = new Dictionary + { + { "Adrasteia", FactionRelationship.Hated }, { "Borealis", FactionRelationship.Friendly }, { "Corvid", FactionRelationship.Beloved } + }; + + using (var cache = Open()) + { + var galaxy = new Galaxy(cache, cache.GetGlobal(), _ => { }); + Assert.NotEqual(galaxy.Factions, galaxy.HomeZones.Keys); + foreach (var faction in galaxy.Factions) galaxy.FactionRelationships[faction] = expected[faction.Name]; + var itemManager = new ItemManager(1u, cache, new ProvenanceLedger(), TestSettings(), _ => { }); + galaxy.Zones[0].Contents = new Zone(itemManager, new PlanetSettings(), new ZonePack(), galaxy.Zones[0], galaxy); + var (game, zones) = RunSave.Capture(cache, galaxy, galaxy.Zones[0].Contents, null, new SavedActionBarBinding[0], 0); + RunSave.Commit(cache, game, zones, RunSave.Lots(cache)); + } + + using (var cache = Open()) + { + var galaxy = new Galaxy(cache, cache.GetGlobal(), _ => { }); + Assert.Equal(expected, galaxy.Factions.ToDictionary(f => f.Name, f => galaxy.FactionRelationships[f])); + } + } + // The run's credits ride the save: what Capture is given is what a later Continue reads from the run store. [Fact] public void CreditsSurviveContinue() @@ -753,11 +795,14 @@ public sealed class RunSaveTests : IDisposable return new ZonePack { Orbits = { root, moon }, Planets = { body } }; } - private static SavedGame Game(CultCache cache) => new SavedGame + private static SavedGame Game(CultCache cache) => Game(cache, cache.GetAll().Single()); + + // HomeZones lists the factions in reverse of their saved order. + private static SavedGame Game(CultCache cache, params Faction[] factions) => new SavedGame { - Factions = new[] { cache.RefOf(cache.GetAll().Single()) }, - Relationships = new[] { FactionRelationship.Neutral }, - HomeZones = new Dictionary { { 0, 0 } }, + Factions = factions.Select(f => cache.RefOf(f)).ToArray(), + Relationships = factions.Select(_ => FactionRelationship.Neutral).ToArray(), + HomeZones = factions.Select((_, i) => factions.Length - 1 - i).ToDictionary(i => i, _ => 0), BossZones = new Dictionary(), DiscoveredZones = new[] { 0 }, ActionBarBindings = new SavedActionBarBinding[0], From b571555e2a2ac2637366e200924f769d9168dd70 Mon Sep 17 00:00:00 2001 From: Nibu Date: Sat, 7 Nov 2026 15:00:22 +0000 Subject: [PATCH 010/108] ship-authoring stats --top-speed adds the VelocityLimit a bare hull lacks create without --like makes a hull with no behaviors, Validate refuses a ship hull without a VelocityLimit, and stats --top-speed refused any hull without exactly one: no command could give such a hull a top speed. The first --top-speed now adds the one limit; two or more are still refused. Co-Authored-By: Claude Sonnet 5.5 --- tests/Aetheria.Shared.Tests/ShipProductTests.cs | 6 ++++-- tools/AetherDb/ShipAuthoringCommands.cs | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/ShipProductTests.cs b/tests/Aetheria.Shared.Tests/ShipProductTests.cs index bb358c4df..f2326ed82 100644 --- a/tests/Aetheria.Shared.Tests/ShipProductTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipProductTests.cs @@ -353,8 +353,6 @@ public sealed class ShipProductTests : IDisposable RefusedAndUntouched(path, "--mass", "5", "--mass", "6"); // A valid flag beside a bad one writes nothing. RefusedAndUntouched(path, "--mass", "5", "--durability", "-2"); - RefusedAndUntouched(bare, "--top-speed", "50"); - RefusedAndUntouched(bare, "--mass", "5", "--top-speed", "50"); // Two VelocityLimits leave no one top speed to set. RefusedAndUntouched(twin, "--top-speed", "50"); @@ -385,6 +383,10 @@ public sealed class ShipProductTests : IDisposable Assert.Equal((1f, 0f, 8000f), (ShipAuthoringStore.Load(path).Hull.Mass, ShipAuthoringStore.Load(path).Hull.Drag, ShipAuthoringStore.Load(path).Hull.Durability)); Assert.Equal(0, Run("stats", bare, "--armor", "12").Code); Assert.Equal(12f, ShipAuthoringStore.Load(bare).Hull.Armor); + // A hull with no top speed (create without --like) gets its one VelocityLimit from the first --top-speed. + Assert.Equal(0, Run("stats", bare, "--top-speed", "50").Code); + var added = ShipAuthoringStore.Load(bare).Hull.Behaviors.OfType().Single().TopSpeed; + Assert.Equal((50f, 50f), (added.Min, added.Max)); } [Fact] diff --git a/tools/AetherDb/ShipAuthoringCommands.cs b/tools/AetherDb/ShipAuthoringCommands.cs index bce7eda08..9f8f1c41c 100644 --- a/tools/AetherDb/ShipAuthoringCommands.cs +++ b/tools/AetherDb/ShipAuthoringCommands.cs @@ -110,8 +110,11 @@ public static class ShipAuthoringCommands var (hull, ship, _) = ShipAuthoringStore.Load(args[1]); if (stats.TryGetValue("--top-speed", out var topSpeed)) { - var limits = (hull.Behaviors ?? new List()).OfType().ToArray(); - if (limits.Length != 1) throw new InvalidOperationException($"{ship.Id}: --top-speed needs exactly one VelocityLimit on the hull; it has {limits.Length}."); + hull.Behaviors ??= new List(); + var limits = hull.Behaviors.OfType().ToList(); + // A hull made without --like has none, and Validate refuses a ship hull without one: the first --top-speed adds it. + if (limits.Count == 0) { limits.Add(new VelocityLimitData()); hull.Behaviors.Add(limits[0]); } + if (limits.Count != 1) throw new InvalidOperationException($"{ship.Id}: --top-speed needs at most one VelocityLimit on the hull; it has {limits.Count}."); // A fixed top speed, as every shipped hull authors one (Min equal to Max); its terms are kept. limits[0].TopSpeed.Min = limits[0].TopSpeed.Max = topSpeed; } From d97e2714cd529dd5590cbb0c9ddef9a489428d74 Mon Sep 17 00:00:00 2001 From: Nibu Date: Tue, 10 Nov 2026 05:50:28 +0000 Subject: [PATCH 011/108] Retire the Wwise catalog fields: SoundBank, AudioStats (AudioStat) and Faction music Nothing reads or writes them (audio is native Unity plus AquaSynth). Keys 21, 22 and 13 to 15 stay reserved as never-reuse comments, as with the earlier retirements. The shipped catalog still holds old values; the reader skips unknown keys. Co-Authored-By: Claude Sonnet 5.5 --- Assets/Scripts/ServerShared/Corporations.cs | 9 +-------- Assets/Scripts/ServerShared/ItemData.cs | 16 +--------------- docs/aetheria-release-map.md | 8 +++++--- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/Assets/Scripts/ServerShared/Corporations.cs b/Assets/Scripts/ServerShared/Corporations.cs index 3b676aef4..e527606d9 100644 --- a/Assets/Scripts/ServerShared/Corporations.cs +++ b/Assets/Scripts/ServerShared/Corporations.cs @@ -47,14 +47,7 @@ public class Faction [Inspectable, CultReference(typeof(Faction), many: true), CultInspectorRange(0, 1), JsonProperty("allegiance"), Key(12)] public Dictionary, float> Allegiance = new Dictionary, float>(); - [Inspectable, JsonProperty("overworldMusic"), Key(13)] - public uint OverworldMusic; - - [Inspectable, JsonProperty("combatMusic"), Key(14)] - public uint CombatMusic; - - [Inspectable, JsonProperty("bossMusic"), Key(15)] - public uint BossMusic; + // Keys 13 to 15 (overworldMusic, combatMusic, bossMusic) held Wwise ids; retired, never reuse them. // Key 16 is reserved for Relations (operator ruling faction-relations-field). diff --git a/Assets/Scripts/ServerShared/ItemData.cs b/Assets/Scripts/ServerShared/ItemData.cs index fe705b4f6..72c07fc9a 100644 --- a/Assets/Scripts/ServerShared/ItemData.cs +++ b/Assets/Scripts/ServerShared/ItemData.cs @@ -417,11 +417,7 @@ public abstract class EquippableItemData : CraftedItemData [Inspectable, CultInspectorAssetGuid, JsonProperty("actionIcon"), Key(20)] public string ActionBarIcon; - [Inspectable, JsonProperty("soundBank"), Key(21)] - public uint SoundBank; - - [Inspectable, JsonProperty("audioStats"), Key(22)] - public List AudioStats = new List(); + // Keys 21 (soundBank) and 22 (audioStats) held Wwise ids; audio is native Unity plus AquaSynth now. Retired; never reuse them. [IgnoreMember] public abstract HardpointType HardpointType { get; } @@ -455,16 +451,6 @@ public abstract class EquippableItemData : CraftedItemData } } -[Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)] -public class AudioStat -{ - [Inspectable, JsonProperty("parameter"), Key(0)] - public uint Parameter; - - [Inspectable, JsonProperty("stat"), Key(1)] - public PerformanceStat Stat = new PerformanceStat(); -} - [CultDocument("aetheria.geardata", "1"), Inspectable, MessagePackObject, JsonObject(MemberSerialization.OptIn)] public class GearData : EquippableItemData { diff --git a/docs/aetheria-release-map.md b/docs/aetheria-release-map.md index 3176c3163..87e5beb8c 100644 --- a/docs/aetheria-release-map.md +++ b/docs/aetheria-release-map.md @@ -224,9 +224,11 @@ at the same commit. stat); `SoundBank` is catalog key 21 (`:403-404`). - Gone since B5: the `AetherDrive` audio calls and its `RpmAudioParameter` and `TorqueRatioAudioParameter` fields (grep 0), and the `EntityInstance` block that read - `item.Data.SoundBank` (grep 0). Follow-up `wwise-catalog-fields` still names both; its live - set is `SoundBank` (key 21), `AudioStats` (key 22) and `Faction.OverworldMusic`, - `CombatMusic`, `BossMusic` (`Corporations.cs:52-59`, keys 13 to 15). + `item.Data.SoundBank` (grep 0). Follow-up `wwise-catalog-fields` retired the rest: `SoundBank` + (key 21), `AudioStats` (key 22, with `AudioStat`) and `Faction.OverworldMusic`, `CombatMusic`, + `BossMusic` (keys 13 to 15) are deleted, their keys left as never-reuse comments. The shipped + `GameData/Aetheria.cc` still carries the old values (29 equippables with a `SoundBank`, 2 factions + with music); the reader skips unknown keys and the next catalog write drops them. - `WwiseMetadata.cs` (91 lines) and `WwiseSoundBinding.cs` (21 lines) are used only by that surface; both have `.meta` files. A repo-wide grep outside `docs` finds the Wwise symbols in exactly these files: `ChargedWeapon.cs`, `InstantWeapon.cs`, `Reactor.cs`, `Thruster.cs`, From db6bda1655d78a6c804da60e05a7cd87ab07cb29 Mon Sep 17 00:00:00 2001 From: Nibu Date: Tue, 10 Nov 2026 20:54:42 +0000 Subject: [PATCH 012/108] docs: ship concept batch brief (#5) --- docs/ship-concept-batch.md | 182 +++++++++++++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 docs/ship-concept-batch.md diff --git a/docs/ship-concept-batch.md b/docs/ship-concept-batch.md new file mode 100644 index 000000000..efef39dd7 --- /dev/null +++ b/docs/ship-concept-batch.md @@ -0,0 +1,182 @@ +# Ship concept batch: brief + +**Value:** a reproducible way to turn the lore's faction looks and the hull data's size limits into a few dozen Klein concept images, sifted by human votes. +**Entry points:** the mill's file contract (section 1), the Raven call (section 2), the prompt template (section 4), batch 1 (section 6), the sift plan (section 7). +**Status:** a plan. No image has been generated, Raven was not called, and `raven-image` was not yet installed on Yggdrasil when this was written (root install pending, `gamecult-ops` 3fdcf02). + +All images this batch makes are **concept art only until a human has reviewed them** (section 8). Nothing here is canon: the lore pages it draws on are labelled brainstorming (`AetheriaLore` `Brainstorming/Ship Design Language.md`). + +Sources: AetheriaLore `main` 14d827ca (`scripts/concept-mill/`, `Aetheria/media/concept-mill/`, `Aetheria/Brainstorming/`), Aetheria `master` c33feebde (`docs/content-batch-one.md`, `Assets/Scripts/ServerShared/Enums.cs`), gamecult-ops `tools/raven-image/README.md` (3fdcf02). + +## 1. What the existing Concept Mill emits + +The mill is in AetheriaLore, not Aetheria. It is a build script plus a hand-edited data file; it never calls an image model. Renders come from outside (so far the BFL `flux-3-image` API, operated by hand) and are ingested. + +**Input, per render** (not in the repo; default root `Aetheria/Brainstorming/Renders/`, `--renders ` overrides): `.png` and `.md`. The `.md` is the render record: + +``` +# +## Hypothesis what this render tests +## What changed delta from the previous round +## Agent verdict (rounds 4-5 call it "Agent observation") +## Render record Model, Parameters, Request id, Date, Composition (bullets) +## Prompt the full composed prompt, blocks separated by blank lines +``` + +**Source of truth:** `scripts/concept-mill/ships.yaml`, hand-edited. `build.mjs` validates it and fails on a duplicate ship id, a duplicate variant id inside a ship, an unknown `status.kind`, a ship with no variants, more than one `pick`/`default` per ship, or a missing derivative file. + +Per **ship** (the unit the page and the vote use): + +| Field | Meaning | +|---|---| +| `id` | slug, unique; the URL hash `#<ship>/<variant>` and the vote key | +| `name`, `code`, `faction`, `role`, `desig` | display; `desig` is e.g. `Bench 1 · entry B · safe bet` | +| `crew`, `mass` | strings (`mass` is `Small (per prompt)` or `TBD`) | +| `hardpoints` | rows `[qty, size, mount-text]` (size: `Small`, `Medium`, `Utility`, `Sensor`, `Built-in`) | +| `loadout` | list of strings | +| `concept`, `notes`, `beaten` | readout prose: what it is for, design note, what counters it | +| `status` | `{kind: pass\|new\|scrap, stamp, verdict}`; `stamp`/`verdict` carry only the operator's word, or say she has not given one. `kind` places the ship in the menu: Kept / Unreviewed / Scrap bin | + +Per **variant** (one render): `id`, `round` (display label), `image` (derivative basename), `prompt` (record basename, defaults to `image`), optional `source` (render basename to ingest from), `hypothesis`, `verdict`, `operator` (verbatim operator verdict), `pick: true` or `default: true` (at most one per ship). Hypothesis and verdict default to the record's `## Hypothesis` and `## Agent verdict` sections. + +**Output, per variant** (committed, in `Aetheria/media/concept-mill/`): + +- `<image>.webp`: PNG resized to 1600 px wide, quality 82 +- `<image>-thumb.webp`: 720 px wide, quality 72 +- `prompts/<prompt>.txt`: a byte copy of the render's `.md` record + +**Output, manifest:** `site/quartz/components/data/conceptMill.json`: `{sections: [{kind, title}], votes: {enabled, endpoint, bifrostUrl}, ships: [...]}`. Each ship is its `ships.yaml` row with `crew` stringified, `hardpoints` as `{qty, size, mount}` objects, and `variants: [{id, round, image, thumb, prompt, hypothesis, verdict, operator, pick}]` where the three paths are URLs under `/media/concept-mill/`; plus `defaultVariant` (the pick/default variant, else the last). Ships are ordered by section, then faction in first-seen order, then file order. Today: 27 ships, 48 variants. + +**Provenance the mill keeps today:** whatever the `.md` record holds, shown as a downloadable text file. It has no machine-readable provenance fields, no seed, no hash, no licence or review state; the BFL endpoint offered no seed. Section 5 adds them. + +**Vote slot (what Heimdall's Bifrost page meets):** hidden until `votes.enabled` and `votes.endpoint` are set in `ships.yaml`. The page does `GET <endpoint>` (no credentials) and expects JSON `{ "<ship id>": {up, down, members?: {up, down}} }`, and links `<bifrostUrl>/<ship id>` ("Vote on Bifrost"). **Votes are per ship, not per variant.** A sift that must rank several seeds of one concept needs either one ship row per seed or a variant-keyed tally; the second is a change to `aetheriaConceptMill.inline.ts`. This batch uses the first (section 5), so no mill change is needed. + +## 2. What the Raven client needs + +`raven-image` (gamecult-ops `tools/raven-image`, one stdlib Python file plus `graphs/flux3-klein.json`): + +- **Where it runs:** Yggdrasil only. The service is `http://10.77.0.4:8190` (`RAVEN_URL` overrides). Install is root's (`/opt/commons/opt/raven-image/`, symlink in `/opt/commons/bin/`); until then a caller can run the file from a checkout of 3fdcf02. +- **Call:** `raven-image "<prompt>" --size 1536x1024 --seed <n> [--no-enhance] -o <path>.png`. Prints one line per image: `path seed size seconds`. `-n` makes several images (`out-1.png`, ...); this batch passes explicit seeds, so one call per image. +- **Exit codes:** 0 ok; **75** Raven busy or off (no retry; the caller decides when to ask again); 1 for a rejected graph, failed render or timeout (900 s wait per image). +- **Cost:** about 45 s warm, 81 s cold, per 1536x1024 image (README check run). Raven is Deru's desktop: small batches, one client at a time. +- **What it leaves to the caller:** it prints the seed and, per the brief, the prompt; it writes only the PNG. It writes **no sidecar**, so the batch driver must write the record (section 5). The upsampler (on by default) rewrites the prompt; the record must keep both what we sent and what the printed prompt says Klein received, or use `--no-enhance`. +- **Driver needs:** a list of `(concept id, seed, size, prompt file)`; skip-if-PNG-exists so exit 75 resumes cleanly; stop the whole run on the first 75. + +## 3. Proposal constraints from lore and hull data + +**Hull classes.** `HullType` has only `Ship`, `Station`, `Turret` (`Enums.cs:139`). Lore and code define no size class for ships. The labels Light, Medium and Heavy below are **this batch's**, from the shipped hulls' schematic grids (cells, 2.0 m per cell, `hull_grid.py:11`; maximum 32 cells a side): + +| Batch class | Grid (cells, width x length) | Hull precedent | Approx. size | +|---|---|---|---| +| Light | up to 8 x 18 | Longinus 6x17, Turret 8x8 | 12-16 m wide, up to ~36 m long | +| Medium | 10-12 x 12-19 | Smoke Test Hull 10x19, Zenith 12x12 | 20-24 m wide | +| Heavy | 7 x 16 at 4200 mass, or 14+ wide | Noka MKI spec 7x16 (`content-batch-one.md` section 2), Djinni 14x17 | 28 m+ | + +The shipped hull grids are from `GameData/Aetheria.cc` as decoded in `/opt/commons/handoff/aetheria-ship-brief-for-brokkr-20261110.md`. No metre size, crew count or calibre is canon; prompts must not state metres. + +**Hardpoints.** Types: Energy, Ballistic, Launcher, Sensors, Thruster, Radiator, Shield, Reactor, ControlModule (+Hull, Tool, Thermal, WarpDrive). Only weapons (Energy, Ballistic, Launcher), Thruster and Radiator have a visible mount on the model; Reactor, Shield, Sensors, ControlModule are internal (`ShipAuthoring.cs`). Spec precedent for a heavy: 2 Ballistic 2x2, 1 Launcher 1x3, 1 Sensors 1x1 visible-ish, 2 Thruster, 2 Radiator, 2 Shield. For concept prompts: **at most four counted features, each with a location** (Faction Ship Concept Prompts guideline 4). Thrusters and radiators are left out of prompts: the operator places them (Ship Design Language). + +**Silhouettes** are the faction blocks in `Ship Design Language.md` (twelve are used here) and, where later rounds shortened them to livery and register, the `r8` records in `Aetheria/media/concept-mill/prompts/`. Rules the prompts keep: one analogy that places the parts; thick, closed, mirror-symmetric; matte; no wings, fins, wheels or tracks (vacuum hull); no real people, no political symbols. + +## 4. Prompt templates + +Composition follows the mill's latest practice (records `oboz-r8f`, global block **G3**): blocks separated by a blank line, in this order: + +1. **Ship prompt** (below), most specific, first. +2. **Faction livery block**: the faction's block from `Ship Design Language.md`, cut to palette, finish and markings (the r8 Zhestokost block is the model). +3. **Global block G3**: the text in `prompts/oboz-r8f.txt` (third paragraph), copied unchanged. It is not restated here; copying it into this doc would make a second copy. +4. **Frame clause**, verbatim: *One complete ship, centered with clear margin around it, three-quarter front view from slightly above showing the dorsal surface and one side; moderate lens; plain seamless light gray background; soft key light with gentle form shadows; matte finishes throughout.* + +**Ship prompt template:** + +> Design the {name}, a {crew}-crew {faction} {role}. Its whole body follows {analogy}: one {mass-adjective} cast body, mirror-symmetric along its long axis. {feature 1 with location}. {feature 2 with location}. {feature 3 with location}. The cockpit is {cockpit form and location}. {class cue: proportion only, never metres}. + +Slots are filled from the batch table (section 6): `analogy` is the "hook" column, features come from the "visible" column, class cue is one of: *light: long and narrow, about three times as long as wide*; *medium: compact and square-shouldered, about one and a half times as long as wide*; *heavy: broad and low, a little over twice as long as wide* (7x16 is 2.3:1). Names are working titles; the mill's `name` is set when a concept is kept. + +**Variation axes** (one varied per sibling, never several): analogy (safe bet vs moonshot, as the Ship Prompt Bench labels them); feature placement; class cue. Mirror the bench's `Safe bet` / `Moonshot` label in `desig`. + +## 5. Seed policy and record + +- **Seeds are derived, not picked:** `seed(concept, k) = first 4 bytes (big-endian) of sha256("<concept-id>:<k>")`, for `k = 0..3`. Nobody chooses a lucky seed; anyone can regenerate. Raven's random default is never used. +- **One mill ship row per rendered seed:** ship id `<concept-id>-s<k>`, so Bifrost's per-ship tally ranks seeds with no mill change. (A later page change can fold them into variants of one ship.) +- **A seed does not carry across sizes.** The same seed at a different resolution makes a different image. So a hi-res re-render of a sifted winner is a **new image** with `parent: <low-res id>`, not a larger copy of it. +- **Upsampler off for the sift** (`--no-enhance`): the composed prompts are already full captions (about 450-550 words), and with it off the image is a function of (prompt, seed, size, graph). Not yet probed: whether Klein's text encoder truncates a prompt this long; the first render pair must answer it before the batch runs (cost: two images). +- **Record per image** (one `.md` sidecar in the mill's existing record format, so `build.mjs` ingests it unchanged), with the **Render record** bullets: + +``` +- Model: FLUX.3 Klein distilled (ComfyUI graph flux3-klein.json, sha256 <hash>), via raven-image <gamecult-ops commit> +- Parameters: size 1536x1024 | 768x512, seed <n>, steps/cfg/sampler as in the graph (16, 1, euler/simple), upsampler off|on +- Seed derivation: sha256("<concept-id>:<k>") +- Date: <UTC>; made by <Mind> run <run id> +- Parent: <image id or none> +- Composition: ship prompt, faction livery block (<source file@commit>), global block G3 (<source>), frame clause +- Upsampled prompt as printed by the client: <text, only when the upsampler was on> +- Review: UNREVIEWED concept-only; reviewer and date when a human has looked +- Licence: FLUX Kommunity License v.1.0; outputs are concept art until the legal root rules (gamecult-ops tools/raven-image/README.md); no training on outputs +``` + + `status.stamp` in `ships.yaml` stays `UNREVIEWED` and `verdict` says the operator has not given one, per the file header. + +## 6. Batch 1: 36 concepts + +Twelve factions (Zhestokost, Alakrita, Aeronautics Unlimited, Finch Cybernetics, Rossum & Douglas, NiteLife Energy, Lightsail Express, Cetacean Navigators, Cryonix, Sol Dominion, Adrasteia, Death Monkey Explosives), three classes each. Chosen because each has a full block in `Ship Design Language.md`. Roles are **proposals** drawn from the mill's existing roster and the faction blocks, not from Faction Play (not read for this pass); the Noka MKI row is the content-batch spec's hull. `id` is `<slug>-<class letter>`; the ship id of a render is `<id>-s<k>`. + +| id | Faction | Class | Role | Anatomy hook | Visible features (location) | +|---|---|---|---|---|---| +| zh-l | Zhestokost | L | column picket | cast-iron stove, narrowed | 1 short gun in a box turret (bow); 1 sensor block (dorsal); magazine hatch (flank) | +| zh-m | Zhestokost | M | line gunship | forklift | 2 box turrets (shoulders); magazine hatches (dorsal rows); tow lug (stern) | +| zh-h | Zhestokost | H | Noka MKI heavy | armored fist, one centerline cannon | 1 centerline cannon (bow); 2 smaller guns (shoulders); 1 launcher bank (dorsal) | +| alk-l | Alakrita | L | duel interceptor | racing scull | 2 lasers (hood edges); crease lines (full length) | +| alk-m | Alakrita | M | raid cutter | closed folding fan | 2 forward guns; fin stack (stern); gold inlay | +| alk-h | Alakrita | H | patron's heavy escort | folded fan, broadened | 3 guns (prow row); laurel plaque (cockpit) | +| au-l | Aeronautics Unlimited | L | swarm skirmisher | bison hump | rocket pod (hump face); gun (forward); sensor dome (dorsal) | +| au-m | Aeronautics Unlimited | M | tool gunboat | compact excavator | tool socket (bow); 2 guns (shoulders); module bays (flank) | +| au-h | Aeronautics Unlimited | H | frontier monitor | pack mule | 2 module bays; launcher (dorsal); survey mast | +| fin-l | Finch Cybernetics | L | tracker | bird skull | ear dish (flank); lens row (brow); 1 gun (chin) | +| fin-m | Finch Cybernetics | M | relay picket | diving bird, folded | 2 dishes (flanks); 2 guns (shoulders) | +| fin-h | Finch Cybernetics | H | sensor cruiser | prosthetic joint | 3 dishes; 1 gun battery (bow) | +| rd-l | Rossum & Douglas | L | wedge interceptor | flying wedge | 2 guns (nose); flush hatches (dorsal) | +| rd-m | Rossum & Douglas | M | MIRV picket | wedge, thickened | missile hatches (dorsal plane x4); sensor (nose) | +| rd-h | Rossum & Douglas | H | missile barge | wedge, widest | missile hatches (x4); 2 guns (shoulders) | +| nl-l | NiteLife Energy | L | station guard | espresso machine | cartridge (flank); 1 gun (bow); release catch (cartridge) | +| nl-m | NiteLife Energy | M | cartridge gunship | smart speaker | cartridge (dorsal); 2 guns (flanks) | +| nl-h | NiteLife Energy | H | station monitor | appliance, scaled | cartridge (rear); 3 guns (forward) | +| ls-l | Lightsail Express | L | courier | long-haul cab | cab; 1 clamp rail (spine); 1 gun (cab roof) | +| ls-m | Lightsail Express | M | armed hauler | truck and trailer, fused | 2 containers; 2 guns (cab); clamps (spine) | +| ls-h | Lightsail Express | H | convoy tug | road train, fused | 3 containers; docking collar (stern); 2 guns | +| cet-l | Cetacean Navigators | L | corridor escort | dolphin flanks | 2 lobes; 1 gun (boom); amber locks | +| cet-m | Cetacean Navigators | M | recovery tug | beluga back | 2 lobes; tow points (stern); 1 gun | +| cet-h | Cetacean Navigators | H | rescue carrier | whale decks | 2 lobes; transfer locks (ridge); 2 guns | +| cry-l | Cryonix | L | cold sniper | spruce cone | folded emitters (flank); 1 long gun (bow) | +| cry-m | Cryonix | M | heat-sink skirmisher | vacuum flask | folded emitters; 2 guns (waist) | +| cry-h | Cryonix | H | long-range heavy | closed cone, large | folded emitter scales; 1 long gun (bow) | +| sol-l | Sol Dominion | L | interdiction cutter | cast-iron flatiron | sensor plane (dorsal); 2 disablers (shoulders) | +| sol-m | Sol Dominion | M | patrol cutter | hammerhead | hammer sensor plane; 2 disablers (tips) | +| sol-h | Sol Dominion | H | registry cruiser | stamp handle | module bands; 3 disablers (bow) | +| adr-l | Adrasteia | L | deniable courier | flatfish | 1 gun, recessed (nose); 1 cut facet (camera side) | +| adr-m | Adrasteia | M | cold smuggler | cut gemstone, flat | 1 sensor (recessed); cargo collar (belly) | +| adr-h | Adrasteia | H | quiet gunship | stingray | 2 guns (recessed); asymmetric facet | +| dme-l | Death Monkey Explosives | L | charge runner | toolbox | charge feed (dorsal); 1 spike (bow) | +| dme-m | Death Monkey Explosives | M | infrastructure breaker | demolition frame | 2 spikes; detachable charge section (belly) | +| dme-h | Death Monkey Explosives | H | demolition barge | amp stack | 4 charge bays; 2 braces | + +Hooks are drawn from the faction blocks and the bench where they exist (Zhestokost, Alakrita, AU, Finch, R&D, NiteLife, Lightsail, Cetacean, Cryonix, Sol Dominion, Adrasteia, DME entries) and are otherwise this brief's suggestions; the first batch is where they get tested. The guideline "one analogy per prompt" is kept: the hook column is the one analogy; the features are placements. + +**Count:** 36 concepts x 4 seeds = 144 low-res images. + +## 7. Sift plan + +1. **Probe (2 images, before anything else):** one concept at 768x512 with the upsampler off, one at 1536x1024, same prompt, to check that the long composed prompt is not truncated and that 768x512 is legible. If the low-res image is unreadable, sift at 1152x768 and update the cost. +2. **Stage 1, low-res:** 144 images at 768x512, upsampler off, seeds from section 5. Cost is not measured; if time scales with pixels it is about a quarter of 45 s, so about 12-15 s each and roughly 35 minutes in all. Run in chunks of 12 so exit 75 loses little, one client at a time, driver stops at the first 75. +3. **Ingest** as `<concept>-s<k>` ships (status `new`, `UNREVIEWED`), through `build.mjs` from a renders root of PNG plus record. Votes: `up`/`down` per ship on Bifrost. +4. **Cull by vote:** per concept, keep the seed with the most net up votes; a concept with no net-positive seed is dropped. A human looks at the kept images before anything is re-rendered; a Mind's reading of a thumbnail is not a review. +5. **Stage 2, hi-res:** re-render each kept concept at 1536x1024, same prompt, 2 new seeds (`k = 4, 5`), `parent` set to the winning low-res image. About 36 x 2 x 45 s = 54 minutes at most. +6. **Review:** an operator verdict moves a ship out of `new`; only her word sets `pass` or `scrap` (ships.yaml header). + +## 8. Rules for these images + +- **Concept-only until human-reviewed.** Klein outputs are not shipped assets; the licence question (revenue line, affiliates, what concept art feeding a shipped product counts as) is open with whoever holds the legal root (`tools/raven-image/README.md`, "Licence: concept art only until ruled"). +- **How each image was made is recorded** per section 5, one record per image, committed with the image. +- **No training on outputs**, nor on anything derived from them (FLUX licence 4.b). +- No likenesses of real people (licence 4.a); no political symbols (lore). +- Nothing in this batch calls Raven until the driver, the probe in section 7 and the install are done. From c6a3bee879f1b572f4df582d5bcff09add21af5f Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Tue, 10 Nov 2026 22:10:49 +0000 Subject: [PATCH 013/108] Continue refuses a run whose equipment no longer fits its hull's edited layout A mod package edited in place keeps its hull key, so RequireDesigns passed while saved gear could sit outside the new hardpoints or interior cells and be dropped on load. RequireLayouts applies the equip rules (HardpointData.TakesAt, interior cells for tools) to each saved entity and names the changed hulls. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/SavedGame.cs | 31 +++++++++++++++- tests/Aetheria.Shared.Tests/RunSaveTests.cs | 41 +++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/ServerShared/SavedGame.cs b/Assets/Scripts/ServerShared/SavedGame.cs index ff4de6e9b..88ff8c9bf 100644 --- a/Assets/Scripts/ServerShared/SavedGame.cs +++ b/Assets/Scripts/ServerShared/SavedGame.cs @@ -158,7 +158,7 @@ public static class RunSave var named = designs.Where(key => key.IsSet()).Distinct() .Where(key => cache.Get<ItemData>(key) == null) .Select(key => key.Value).OrderBy(key => key, StringComparer.Ordinal).ToArray(); - if (named.Length == 0) return; + if (named.Length == 0) { RequireLayouts(cache, game); return; } const string modHull = "mod-hull:"; var mods = named.Where(key => key.StartsWith(modHull, StringComparison.Ordinal)).Select(key => key.Substring(modHull.Length)).ToArray(); var others = named.Where(key => !key.StartsWith(modHull, StringComparison.Ordinal)).ToArray(); @@ -168,6 +168,35 @@ public static class RunSave ". Reinstall them, or start a new game."); } + // Continue's second gate: a hull's cells or hardpoints edited under a saved run must still hold what the run + // equipped on it (a package edited in place keeps its key, so the design check above passes). Each saved piece of + // gear must sit where equipping would accept it on the hull as the catalog holds it now, by the same rules + // (HardpointData.TakesAt for hardpoint gear, interior cells for tools); occupancy is not rechecked, the save + // carries only what equipping admitted. + private static void RequireLayouts(CultCache cache, SavedGame game) + { + var moved = new SortedSet<string>(StringComparer.Ordinal); + void Check(EntityPack pack) + { + if (pack.Hull.Data.Key.IsSet() && cache.Get<ItemData>(pack.Hull.Data.Key) is HullData hull) + foreach (var (position, item) in pack.Equipment.Concat(pack.CargoBays).Concat(pack.DockingBays)) + { + if (!item.Data.Key.IsSet() || !(cache.Get<ItemData>(item.Data.Key) is EquippableItemData design)) continue; + var fits = design.HardpointType == HardpointType.Tool + ? design.Shape.Coordinates.All(cell => hull.InteriorCells[position + design.Shape.Rotate(cell, item.Rotation)]) + : hull.Hardpoints.Any(hardpoint => hardpoint.TakesAt(design, position - hardpoint.Position)); + if (!fits) moved.Add(hull.Name); + } + foreach (var child in pack.Children) Check(child); + } + foreach (var zoneRef in game.Zones ?? Array.Empty<CultRecordRef<SavedZone>>()) + foreach (var pack in cache.Get(zoneRef).Contents?.Entities ?? new List<EntityPack>()) + Check(pack); + if (moved.Count > 0) + throw new InvalidOperationException("This run's equipment no longer fits its hulls' layouts; changed hulls: " + + string.Join(", ", moved) + ". Restore the earlier version of the mod, or start a new game."); + } + private static InvalidOperationException MalformedSave(string where) => new InvalidOperationException($"This run's save is malformed: {where}. Start a new game."); diff --git a/tests/Aetheria.Shared.Tests/RunSaveTests.cs b/tests/Aetheria.Shared.Tests/RunSaveTests.cs index 05c0a86ac..545c1681a 100644 --- a/tests/Aetheria.Shared.Tests/RunSaveTests.cs +++ b/tests/Aetheria.Shared.Tests/RunSaveTests.cs @@ -592,6 +592,47 @@ public sealed class RunSaveTests : IDisposable Assert.Equal(before, File.ReadAllBytes(Run)); } + // Continue from a hull's edited layout: a mod package edited in place keeps its key, so the design check passes, but + // gear saved against the old hardpoints must not be loaded onto the new ones (equipping would silently drop it). + [Fact] + public void RunWhoseHullHardpointMovedRefusesContinueNamingTheHull() + { + var hullKey = new CultRecordKey("mod-hull:mod.skiff"); + HullData Skiff(int2 hardpointAt) => new HullData + { + Name = "Skiff", + Shape = new Shape(4, 4), + Hardpoints = new List<HardpointData> { new HardpointData { Type = HardpointType.Sensors, Position = hardpointAt, Shape = new Shape() } } + }; + CultRecordRef<ItemData> lamp; + using (var cache = AetheriaStores.Open(Catalog, catalogWritable: true)) + { + cache.UpsertAsync(typeof(HullData), Skiff(new int2(1, 1)), hullKey).GetAwaiter().GetResult(); + lamp = new CultRecordRef<ItemData>(cache.Upsert(new GearData { Name = "Lamp", Hardpoint = HardpointType.Sensors, Shape = new Shape() }).Key); + cache.FlushAsync().Wait(); + } + using (var cache = Open()) + { + var pack = BarePack(new EquippableItem { Data = new CultRecordRef<ItemData>(hullKey), Lot = 1 }); + pack.Equipment = new[] { (new int2(1, 1), new EquippableItem { Data = lamp, Lot = 1 }) }; + var lots = new ProvenanceLedger { NextLot = 2 }; + lots.Lots[1] = new Lot { Origin = new Attributed() }; + RunSave.Commit(cache, Game(cache), new[] { ZoneOf(pack) }, lots); + } + using (var cache = Open()) RunSave.RequireDesigns(cache, cache.GetGlobal<SavedGame>()); + + using (var cache = AetheriaStores.Open(Catalog, catalogWritable: true)) + { + cache.UpsertAsync(typeof(HullData), Skiff(new int2(3, 3)), hullKey).GetAwaiter().GetResult(); + cache.FlushAsync().Wait(); + } + using (var cache = Open()) + { + var refusal = Assert.Throws<InvalidOperationException>(() => RunSave.RequireDesigns(cache, cache.GetGlobal<SavedGame>())); + Assert.Contains("changed hulls: Skiff", refusal.Message); + } + } + // --- RequireDesigns: what it walks, what it lists --------------------------------------------------------------- // Commits a run whose zones the caller builds, then returns RequireDesigns' refusal message, or null when it passes. From b3f3c9a0c80719db5474d17fe66bbe8ef656da35 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Tue, 10 Nov 2026 22:11:56 +0000 Subject: [PATCH 014/108] docs: record the Continue hull-layout gate in the release map Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- docs/aetheria-release-map.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/aetheria-release-map.md b/docs/aetheria-release-map.md index 87e5beb8c..18f9b6941 100644 --- a/docs/aetheria-release-map.md +++ b/docs/aetheria-release-map.md @@ -514,7 +514,7 @@ record. | follow-up | `belt-render-reads-index` | full game | Belt rendering through the index. | | follow-up | `c4-ship-element-ids` | full game | Variants campaign. | | follow-up | `variants-python-raw-push` | full game | Variants campaign. | -| follow-up | `mod-hull-changed-under-run` | full game | Mod edits under a run; demo hulls are first-party. | +| follow-up | `mod-hull-changed-under-run` | full game | Mod edits under a run; demo hulls are first-party. Done 2026-11-10 (#6): `RunSave.RequireLayouts` makes Continue refuse a run whose gear no longer fits its hull's edited cells or hardpoints, naming the hull. | | follow-up | `ship-lods` | full game | Only if a profile shows cost. | | follow-up | `hull-decals` | full game | Insignia and damage decals. | | follow-up | `hull-player-paint` | full game | Player liveries. | From 9135360bebfafece21cac04d6b7a6da2bcf9977d Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 01:58:59 +0000 Subject: [PATCH 015/108] AetherDb: weapon-ammo lists every weapon's energy, magazine, reload and ammunition type Read-only audit command, so ammunition rulings are checked against the catalog and not against names. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tools/AetherDb/Program.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/AetherDb/Program.cs b/tools/AetherDb/Program.cs index 99963e8dd..50f97c019 100644 --- a/tools/AetherDb/Program.cs +++ b/tools/AetherDb/Program.cs @@ -36,6 +36,7 @@ public static class Program case "brownout-migrate": return BrownoutMigrate(args.Contains("apply")); case "roles-migrate": return RolesMigrate(args.Contains("apply")); case "firing-arc-migrate": return FiringArcMigrate(args.Contains("apply")); + case "weapon-ammo": return WeaponAmmo(); case "range-falloff": return RangeFalloff(args.Skip(1).ToArray()); case "targeting-catalog": return TargetingCatalog(args.Contains("apply")); case "targeting-catalog-6c": return TargetingCatalog6c(args.Contains("apply")); @@ -1109,6 +1110,19 @@ public static class Program // and a damage multiplier at maximum range. Guided weapons, lock weapons and mine layers keep the unauthored // defaults (no falloff). The command upserts every weapon design, which is also what drops the retired damage curve // (key 7) from the stored records. Idempotent: the values are functions of Range alone. Dry run unless "apply". + // Read-only: what every weapon design draws per shot (reactor energy, magazine, rounds), so ammunition rulings are audited + // against the catalog and not against names. + private static int WeaponAmmo() + { + var db = AetherDb.Open(); + Console.WriteLine($"{"weapon",-28} {"behaviour",-20} {"energy",-11} {"mag",5} {"reload",6} ammo"); + foreach (var item in db.Cache.GetAll<WeaponItemData>().OrderBy(i => i.Name, StringComparer.Ordinal)) + foreach (var w in item.Behaviors.OfType<WeaponData>()) + Console.WriteLine($"{item.Name,-28} {w.GetType().Name,-20} {w.Energy.Min}-{w.Energy.Max,-6} {w.MagazineSize,5} {w.ReloadTime,6} " + + (w.AmmoType.IsSet() ? db.Cache.Get<SimpleCommodityData>(w.AmmoType.Key)?.Name ?? w.AmmoType.Key.Value : "-")); + return 0; + } + private static int RangeFalloff(string[] args) { var apply = args.Contains("apply"); From 8f77000844c38d457f131109451ae1cceb62a8c5 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 01:58:59 +0000 Subject: [PATCH 016/108] Launchers draw real rounds: Missiles commodity and recipe, a reload that pays its crate, a reserve readout Rulings ballistics-real-ammo and ballistics-cycle-power, follow-up launcher-ammunition. The Munitions batch adds the Missiles commodity (a high-explosive warhead and a rocket motor at the munitions works; guidance waits on the electronics chain) and sets AmmoType=Missiles on the five launcher designs; reactor energy per shot stays as authored. InstantWeapon: the reload used to refill the magazine on its timer and never reach the cargo branch in UseAmmo, so no ammunition-fed weapon ever paid a round. The refill now takes one unit of AmmoType from cargo (TakeReloadRound) and, with none, the magazine stays empty; UseAmmo only starts a reload when a unit is there. Weapon.Reserve exposes the cargo count and the HUD shows rounds/reserve for magazine weapons. Tests: shipped launchers all name Missiles and Missiles has a recipe; a fed weapon fires its magazine and no more without crates, reloads once per crate; Reserve equals the cargo count and falls per reload. The commodity count pin goes 22 to 23. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../ServerShared/Behaviors/InstantWeapon.cs | 27 +++--- .../Scripts/ServerShared/Behaviors/Weapon.cs | 2 + Assets/Scripts/UI/HUD/SchematicDisplay.cs | 2 +- .../CommodityRecordsTests.cs | 2 +- .../FireControlPerWeaponTests.cs | 88 ++++++++++++++++++- .../LauncherAmmunitionCatalogTests.cs | 28 ++++++ tools/AetherDb/Economy/Munitions.cs | 16 ++++ 7 files changed, 149 insertions(+), 16 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/LauncherAmmunitionCatalogTests.cs diff --git a/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs b/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs index da23bc107..c8587f72d 100644 --- a/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs @@ -229,7 +229,7 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior, IPowerCo if (!_coolingDown || !(_cooldown < 0)) return false; _overshoot = min(-_cooldown * CountdownSpan, dt); _coolingDown = false; - if (_data.MagazineSize > 0 && _ammo == 0) + if (_data.MagazineSize > 0 && _ammo == 0 && TakeReloadRound()) { _ammo = _data.MagazineSize; OnReloadComplete?.Invoke(); @@ -239,6 +239,17 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior, IPowerCo return true; } + // A reload pays a round (ruling ballistics-real-ammo): one unit of the weapon's AmmoType leaves the cargo as the magazine refills, + // and with none to take the magazine stays empty. A weapon with no AmmoType reloads free. + private bool TakeReloadRound() + { + if (!_data.AmmoType.IsSet()) return true; + var cargo = Entity.FindItemInCargo(_data.AmmoType.Key); + if (cargo == null) return false; + if (cargo.ItemsOfType[_data.AmmoType.Key][0] is SimpleCommodity simpleCommodity) cargo.Remove(simpleCommodity, 1); + return true; + } + private float CountdownSpan => max(ShortestCycle, _data.MagazineSize > 0 && _ammo == 0 ? _data.ReloadTime : Cooldown); // A countdown that starts outside a round (a charge failing) carries the last one's overshoot like every restart. @@ -265,18 +276,8 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior, IPowerCo return true; } - var hasAmmo = true; - if (_data.AmmoType.IsSet()) - { - var cargo = Entity.FindItemInCargo(_data.AmmoType.Key); - if (cargo != null) - { - var item = cargo.ItemsOfType[_data.AmmoType.Key][0]; - if (item is SimpleCommodity simpleCommodity) - cargo.Remove(simpleCommodity, 1); - } - else hasAmmo = false; - } + // The reload starts only if a round is there to load; FinishCountdown takes it. + var hasAmmo = !_data.AmmoType.IsSet() || Entity.CountItemsInCargo(_data.AmmoType.Key) > 0; if(hasAmmo) { OnReloadBegin?.Invoke(); diff --git a/Assets/Scripts/ServerShared/Behaviors/Weapon.cs b/Assets/Scripts/ServerShared/Behaviors/Weapon.cs index cb42d6bd4..62e4f4b14 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Weapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Weapon.cs @@ -102,6 +102,8 @@ public abstract class Weapon : ActivatedBehavior public abstract float DamagePerSecond { get; } public abstract float RangeDamagePerSecond(float range); public abstract int Ammo { get; } + // Rounds in the ship's cargo that reload this weapon's magazine: crates of AmmoType, 0 when the weapon draws none. + public int Reserve => _data.AmmoType.IsSet() ? Entity.CountItemsInCargo(_data.AmmoType.Key) : 0; public WeaponData WeaponData => _data; public float RangeFactor(float at) => WeaponData.RangeFactor(MinRange, EffectiveRange, Range, _data.DamageAtMaxRange, at); diff --git a/Assets/Scripts/UI/HUD/SchematicDisplay.cs b/Assets/Scripts/UI/HUD/SchematicDisplay.cs index 57f545960..f5d6d8af3 100644 --- a/Assets/Scripts/UI/HUD/SchematicDisplay.cs +++ b/Assets/Scripts/UI/HUD/SchematicDisplay.cs @@ -236,7 +236,7 @@ public class SchematicDisplay : MonoBehaviour if (x.Weapon.WeaponData.AmmoType.IsSet()) { if(x.Weapon.WeaponData.MagazineSize > 1) - x.ListElement.AmmoLabel.text = x.Weapon.Ammo.ToString(); + x.ListElement.AmmoLabel.text = $"{x.Weapon.Ammo}/{x.Weapon.Reserve}"; else x.ListElement.AmmoLabel.text = _entity.CountItemsInCargo(x.Weapon.WeaponData.AmmoType.Key).ToString(); } diff --git a/tests/Aetheria.Shared.Tests/CommodityRecordsTests.cs b/tests/Aetheria.Shared.Tests/CommodityRecordsTests.cs index 2b2acfaa0..91bce1993 100644 --- a/tests/Aetheria.Shared.Tests/CommodityRecordsTests.cs +++ b/tests/Aetheria.Shared.Tests/CommodityRecordsTests.cs @@ -13,7 +13,7 @@ public sealed class CommodityRecordsTests public void ShippedCatalogOpensWithTheRetiredKeysGone() { using var cache = RestoredHullsTests.OpenCatalog(); - Assert.Equal(22, cache.GetAll<SimpleCommodityData>().Count()); + Assert.Equal(23, cache.GetAll<SimpleCommodityData>().Count()); Assert.Equal(63, cache.GetAll<CompoundCommodityData>().Count()); Assert.Contains(cache.GetAll<SimpleCommodityData>(), c => c.Name == "Ammo"); Assert.All(cache.GetAll<CompoundCommodityData>(), c => Assert.False(string.IsNullOrEmpty(c.Name))); diff --git a/tests/Aetheria.Shared.Tests/FireControlPerWeaponTests.cs b/tests/Aetheria.Shared.Tests/FireControlPerWeaponTests.cs index f2fc94777..0b5faa343 100644 --- a/tests/Aetheria.Shared.Tests/FireControlPerWeaponTests.cs +++ b/tests/Aetheria.Shared.Tests/FireControlPerWeaponTests.cs @@ -85,7 +85,7 @@ public sealed class FireControlPerWeaponTests : IDisposable (ItemRotation Rotation, float Arc)[] mounts = null, bool beam = false, WeaponFuse? fuse = null, float blast = 0f, float range = 100f, float targetRange = 60f, float accuracy = 1f, float minHit = .2f, bool lockWeapon = false, bool turret = false, float energy = 0f, float heat = 0f, float visibility = 0f, int magazine = 0, bool singleAmmoBurst = false, bool decoy = false, bool charged = false, bool auto = false, float damage = 100f, - float effective = float.PositiveInfinity, float damageAtMax = 0f, float velocity = 0f, float targetLayerHeight = 0f) + float effective = float.PositiveInfinity, float damageAtMax = 0f, float velocity = 0f, float targetLayerHeight = 0f, int? crates = null, float reload = 1f) { mounts ??= new[] { (ItemRotation.None, 0f) }; var hullData = new HullData @@ -144,10 +144,20 @@ public sealed class FireControlPerWeaponTests : IDisposable behavior.Heat = Constant(heat); behavior.Visibility = Constant(visibility); behavior.MagazineSize = magazine; + behavior.ReloadTime = reload; var cache = AetheriaStores.Open(Catalog + Guid.NewGuid().ToString("N"), catalogWritable: true); _openCaches.Add(cache); cache.Upsert(new VerseGrammar { Revision = 1 }); + // An ammunition-fed weapon: it names the Missiles commodity, and the shooter carries `crates` of it in a bay. + if (crates.HasValue) + { + var bayShape = new Shape(4, 4); + foreach (var cell in bayShape.AllCoordinates) bayShape[cell] = true; + cache.Upsert(new CargoBayData { Name = "Bay", Shape = new Shape(), InteriorShape = bayShape, Price = 20, Durability = 4 }); + cache.Upsert(new SimpleCommodityData { Name = "Missiles", Shape = new Shape(), Price = 1, MaxStack = 100 }); + behavior.AmmoType = new CultRecordRef<SimpleCommodityData>(cache.RefOf<ItemData>(cache.GetByName<SimpleCommodityData>("Missiles")).Key); + } cache.Upsert(hullData); cache.Upsert(shooterHullData); cache.Upsert(new WeaponItemData @@ -220,6 +230,13 @@ public sealed class FireControlPerWeaponTests : IDisposable var item = shooter.Equipment.Single(x => x.EquippableItem == d); rig.Decoy = new Gun { Item = item, Weapon = (Weapon) item.Behaviors.Single(b => b is Weapon) }; } + if (crates.HasValue) + { + var bay = new EquippedCargoBay(items, Make("Bay", lot++, 4), new int2(1, 1), shooter, "bay"); + shooter.CargoBays.Add(bay); + if (crates.Value > 0) + Assert.True(bay.TryStore(new SimpleCommodity { Data = items.ItemData.RefOf<ItemData>(items.ItemData.GetByName<SimpleCommodityData>("Missiles")), Quantity = crates.Value })); + } var targeting = Make("Targeting", lot++, 1); Assert.True(shooter.TryFindSpace(targeting, out var tpos)); Assert.True(shooter.TryEquip(targeting, tpos)); @@ -1306,4 +1323,73 @@ public sealed class FireControlPerWeaponTests : IDisposable Assert.False(weapon.CanFire); } + + // ==== Ruling ballistics-real-ammo: an ammunition-fed weapon pays a round per magazine reload, no free reload ==== + + // One launcher-shaped weapon (magazine 2, reload 3 s, Missiles) held on its trigger at no target, `crates` of Missiles in the + // hold. Returns the rig and a counter of committed shots. + private (Rig Rig, Func<int> Shots) AmmoRig(int crates) + { + var r = Build(fuse: WeaponFuse.Proximity, blast: 30f, range: 40f, magazine: 2, auto: true, crates: crates, reload: 3f); + r.Shooter.SetTarget(TargetRef.None); + Aim(r, float2(0, 1)); + var shots = 0; + r.Zone.ShotCommitted.Subscribe(_ => shots++); + r.Gun.Weapon.Activate(); + return (r, () => shots); + } + + private static void Run(Rig r, float seconds) + { + for (var t = 0f; t < seconds; t += .25f) { r.Gun.Weapon.Activate(); r.Zone.Update(.25f); } + } + + // With no crate in the hold the magazine is fired once and the gun then stays empty, however long the trigger is held. Kills: + // a reload that refills the magazine without taking a crate (UseAmmo or FinishCountdown refilling on the timer alone). + [Fact] + public void AnAmmunitionFedWeaponWithNoCratesFiresItsMagazineAndNoMore() + { + var (r, shots) = AmmoRig(crates: 0); + Run(r, 30f); + Assert.Equal(2, shots()); + Assert.Equal(0, r.Gun.Weapon.Ammo); + } + + // One crate is one reload: after ReloadTime the full magazine fires again, the crate is gone, and then the gun is empty. Kills: + // a reload that consumes no crate, or more than one, or refills a partial magazine. + [Fact] + public void OneCrateReloadsTheWholeMagazineOnceAfterTheReloadTime() + { + var (r, shots) = AmmoRig(crates: 1); + Run(r, 2f); + Assert.Equal(2, shots()); + Assert.Equal(1, r.Gun.Weapon.Reserve); + Run(r, 30f); + Assert.Equal(4, shots()); + Assert.Equal(0, r.Gun.Weapon.Reserve); + Assert.Equal(0, r.Gun.Weapon.Ammo); + } + + // The reserve a HUD shows is the cargo count of the weapon's ammunition, and it falls by one when the magazine reloads. Kills: a + // Reserve that reads a constant, the wrong commodity, or a count that ignores the stack quantity. + [Fact] + public void TheReserveIsTheCargoCountOfTheAmmunitionAndFallsByOnePerReload() + { + var (r, shots) = AmmoRig(crates: 3); + Assert.Equal(3, r.Gun.Weapon.Reserve); + Assert.Equal(3, r.Shooter.CountItemsInCargo(r.Gun.Weapon.WeaponData.AmmoType.Key)); + Run(r, 2f); + Assert.Equal(2, shots()); + Assert.Equal(3, r.Gun.Weapon.Reserve); + Run(r, 3.5f); + Assert.Equal(2, r.Gun.Weapon.Reserve); + } + + // A weapon with no ammunition type has no reserve. + [Fact] + public void AWeaponThatDrawsNoAmmunitionHasNoReserve() + { + var r = Build(magazine: 2); + Assert.Equal(0, r.Gun.Weapon.Reserve); + } } diff --git a/tests/Aetheria.Shared.Tests/LauncherAmmunitionCatalogTests.cs b/tests/Aetheria.Shared.Tests/LauncherAmmunitionCatalogTests.cs new file mode 100644 index 000000000..209a0caa9 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/LauncherAmmunitionCatalogTests.cs @@ -0,0 +1,28 @@ +using System.Linq; +using GameCult.Caching; +using Xunit; + +// Ruling ballistics-real-ammo, follow-up launcher-ammunition: a launcher is not a free gun. Read from the shipped catalog through +// AetherDb's own open, so what is checked is what ships. +public sealed class LauncherAmmunitionCatalogTests +{ + private static bool IsLauncher(WeaponData data) => data is LauncherData || data is GuidedWeaponData || data is LockWeaponData; + + // Every launcher design reloads from the Missiles commodity, and Missiles can be made. Kills: a launcher authored (or a new one + // added) with AmmoType unset, which reloads for free forever; Missiles without a recipe, which no station would ever supply. + [Fact] + public void EveryShippedLauncherReloadsFromMissilesAndMissilesCanBeMade() + { + using var db = AetherDb.Open(); + var missiles = db.Cache.GetAll<SimpleCommodityData>().Single(c => c.Name == "Missiles"); + var key = db.Cache.RefOf(missiles).Key; + var launchers = db.Cache.GetAll<WeaponItemData>().SelectMany(i => i.Behaviors.OfType<WeaponData>().Where(IsLauncher).Select(d => (i.Name, d))).ToArray(); + Assert.True(launchers.Length >= 5, $"fixture: the catalog holds its launchers ({launchers.Length})"); + foreach (var (name, data) in launchers) + { + Assert.True(data.AmmoType.IsSet(), $"{name} draws no ammunition"); + Assert.Equal(key, data.AmmoType.Key); + } + Assert.Contains(db.Cache.GetAll<RecipeData>(), r => r.Output.Key.Equals(key) && r.Inputs.Count > 0); + } +} diff --git a/tools/AetherDb/Economy/Munitions.cs b/tools/AetherDb/Economy/Munitions.cs index 9f0dfd075..2630c2dac 100644 --- a/tools/AetherDb/Economy/Munitions.cs +++ b/tools/AetherDb/Economy/Munitions.cs @@ -141,6 +141,14 @@ public sealed class Munitions : EconomyBatch "The same powder as a gun charge, shaped to burn for seconds instead of milliseconds: missile stocks and gun stocks compete for one powder train.", new[] { "thruster" }, (powder, 2), (steel, 1)); + // Missiles: the crate a launcher design reloads from. One crate is one magazine reload (UseAmmo removes one unit of the weapon's + // AmmoType at an empty magazine), the same convention as Ammo for guns. A crate is a warhead and a motor per two missiles' worth + // of magazine; the guidance package (seeker and fin actuators) waits on the electronics chain, so the recipe does not yet draw it. + var missiles = Simple("missiles", "Missiles", "Crated guided munitions: a high-explosive warhead mated to a rocket motor on a launch rail. The crate a launcher reloads from; the rounds are real, only the reactor energy of the launch is not.", 8f, 1800); + Recipe(missiles, "munitions-works", 1200, 24, 2, + "A missile crate is a warhead, a motor and a seeker in one box, and the box is the arsenal's most counted object: Zhestokost ties each launcher crew's allowance to a serial range, so a cache of loose crates is either a deserter's or a quartermaster's crime.", + new string[0], (warhead, 1), (motor, 1)); + var dispenser = Compound("mine-dispenser", "Mine Dispenser", "A rack and ejector that lays mines in a pattern.", 20f, 1600); Recipe(dispenser, "fabrication", 900, 20, 1, "Little more than steel and actuators, which is why every convoy navy can build one and every blockade starts with one.", @@ -151,6 +159,14 @@ public sealed class Munitions : EconomyBatch foreach (var gun in new[] { "Light Machine Gun", "Autocannon", "Long Slug Rifle", "Charged Scattergun", "Slug Rifle", "Flak Gun", "Cluster Cannon", "Point Defense Gun" }) Design(gun, 1800, 30, "A ballistic gun is a barrel and a feed; the round brings the energy."); Design("Mine Launcher", 1800, 24, "A dispenser and the warheads it lays."); + + // Launchers draw real rounds (ruling ballistics-real-ammo): the reactor energy per shot stays as authored, and each magazine + // reload consumes one Missiles crate. + foreach (var launcher in new[] { "Guided Missile Launcher", "Long-Range Missile Rack", "Short-Range Missile Rack", "Incendiary Rocket Pod", "Swarm Rocket Pod" }) + _a.Edit<WeaponItemData>(launcher, w => + { + foreach (var data in w.Behaviors.OfType<WeaponData>()) data.AmmoType = new CultRecordRef<SimpleCommodityData>(missiles.Key); + }); } private CultRecordRef<Faction> FactionRef(string name) From fdbf0b6851b8e52e1e581f74a416b91ca89caa09 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 01:58:59 +0000 Subject: [PATCH 017/108] GameData/Aetheria.cc: Munitions apply (Missiles commodity and recipe, AmmoType on five launchers) economy author Munitions apply on the latest origin/master catalog; rerun reports 0 added, 0 changed. sha256 d1c96c6ed8530a4e17246604580eca3a45666b3846d56d557f8869ce7c2cc2b3 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- GameData/Aetheria.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GameData/Aetheria.cc b/GameData/Aetheria.cc index 7a7b99f5c..5b9332c1f 100644 --- a/GameData/Aetheria.cc +++ b/GameData/Aetheria.cc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:68b37cb55c012c9d1df97bbf0de5c0a56d1804ce5f16f498738cd4de51c88e4b -size 214588 +oid sha256:d1c96c6ed8530a4e17246604580eca3a45666b3846d56d557f8869ce7c2cc2b3 +size 213302 From 386f29bf0d9c78f520402352357353380bb8b758 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 02:55:39 +0000 Subject: [PATCH 018/108] Generated ships carry the crates their weapons reload from; Missiles gets a cargo shape; comment and lore fixes LoadoutGenerator.GenerateShipLoadout, the one owner of NPC and generated-scenario fitting, now stocks AmmunitionCrates (3) of every distinct AmmoType the ship's weapons draw, after the consumable roll and without touching the random stream; it logs and goes on if no hold takes them. Missiles is authored with Ammo's 1x1 shape and a stack of 5 (a shapeless commodity cannot be stored at all). Tests: generated ships hold exactly the crates they draw and none of an ammunition they do not; a magazine weapon with no AmmoType still reloads free. weapon-ammo moves so RangeFalloff keeps its doc comment; the Munitions comment and lore now match the recipe (warhead and motor, magazines 2 to 288). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../Scripts/ServerShared/LoadoutGenerator.cs | 17 +++++++++ .../AmmunitionStockingTests.cs | 38 +++++++++++++++++++ .../FireControlPerWeaponTests.cs | 14 +++++++ tools/AetherDb/Economy/Munitions.cs | 18 +++++---- tools/AetherDb/Program.cs | 10 ++--- 5 files changed, 85 insertions(+), 12 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs diff --git a/Assets/Scripts/ServerShared/LoadoutGenerator.cs b/Assets/Scripts/ServerShared/LoadoutGenerator.cs index 9f4829eee..c82ec1300 100644 --- a/Assets/Scripts/ServerShared/LoadoutGenerator.cs +++ b/Assets/Scripts/ServerShared/LoadoutGenerator.cs @@ -24,6 +24,10 @@ public class LoadoutGenerator public const float ShipConsumableChance = .1f; public const int ShipConsumableUnits = 1; + // Ammunition-fed weapons reload from cargo (ruling ballistics-real-ammo), so a generated ship carries this many crates of every + // distinct AmmoType its weapons draw: enough to fight on past the first magazine, few enough to leave the rest of the hold. + public const int AmmunitionCrates = 3; + public LoadoutGenerator( ref Random random, ItemManager itemManager, @@ -56,6 +60,7 @@ public class LoadoutGenerator OutfitEntity(entity); EquipPickup(entity); StockConsumables(entity, ShipConsumableChance, ShipConsumableUnits); + StockAmmunition(entity); return EntitySerializer.Pack(entity); } @@ -162,6 +167,18 @@ public class LoadoutGenerator } } + // The crates the ship's weapons reload from: AmmunitionCrates of each distinct AmmoType, stopping when no hold takes another. + // Draws nothing from the random stream, so adding it moves no other roll. + private void StockAmmunition(Entity entity) + { + foreach (var key in entity.Weapons.Select(weapon => weapon.WeaponData.AmmoType).Where(type => type.IsSet()).Select(type => type.Key).Distinct()) + { + var crates = new SimpleCommodity { Data = new CultRecordRef<ItemData>(key), Quantity = AmmunitionCrates }; + if (!entity.CargoBays.Any(bay => bay.TryStore(crates))) + ItemManager.Log($"{entity.Name}: no room for {AmmunitionCrates} crates of {key.Value}."); + } + } + private static bool IsHeater(GearData item) => item.HardpointType == HardpointType.Tool && item.Behaviors.Any(b => b is ThermotoggleData { HighPass: false }) && diff --git a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs new file mode 100644 index 000000000..1fd278bfe --- /dev/null +++ b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs @@ -0,0 +1,38 @@ +using System.Linq; +using Xunit; + +// Ruling ballistics-real-ammo: generation stocks combatants with rounds, because a magazine weapon reloads from cargo and a ship with +// no crates fires one magazine and goes quiet. Measured on ships the production generator returns, over the shipped catalog. +public sealed partial class RunStartTests +{ + // Every generated ship whose weapons draw an ammunition type carries crates of each such type; a ship whose weapons draw none + // carries none of an ammunition commodity it does not draw. Kills: generation that stocks nothing (every NPC gun dies after one magazine), + // that stocks only one of several types, or that stocks ships with no use for them. + [Fact] + public void GeneratedShipsCarryTheAmmunitionTheirWeaponsDraw() + { + var generator = new LoadoutGenerator(ref _items.Random, _items, _galaxy, _galaxy.Entrance, _protagonist, .5f); + var shipHulls = LoadoutGenerator.SoldHulls(_cache).Where(h => h.HullType == HullType.Ship).Select(h => h.Name).ToList(); + var ammunition = _cache.GetAll<WeaponItemData>().SelectMany(i => i.Behaviors.OfType<WeaponData>()).Where(w => w.AmmoType.IsSet()) + .Select(w => w.AmmoType.Key).Distinct().ToArray(); + Assert.NotEmpty(ammunition); + var fed = 0; + foreach (var name in shipHulls) + for (var i = 0; i < 12; i++) + { + var pack = generator.GenerateShipLoadout(h => h.Name == name); + if (pack == null) continue; + var ship = EntitySerializer.Unpack(_items, null, pack); + var drawn = ship.Weapons.Select(w => w.WeaponData.AmmoType).Where(t => t.IsSet()).Select(t => t.Key).Distinct().ToArray(); + foreach (var key in drawn) + { + Assert.True(ship.CountItemsInCargo(key) > 0, $"{name}: a weapon draws {key.Value} and the hold has none"); + Assert.Equal(LoadoutGenerator.AmmunitionCrates, ship.CountItemsInCargo(key)); + } + foreach (var key in ammunition.Except(drawn)) + Assert.True(ship.CountItemsInCargo(key) == 0, $"{name}: no weapon draws {key.Value} and the hold carries it"); + if (drawn.Length > 0) fed++; + } + Assert.True(fed > 0, "fixture: some generated ship carries an ammunition-fed weapon"); + } +} diff --git a/tests/Aetheria.Shared.Tests/FireControlPerWeaponTests.cs b/tests/Aetheria.Shared.Tests/FireControlPerWeaponTests.cs index 0b5faa343..690bd27d3 100644 --- a/tests/Aetheria.Shared.Tests/FireControlPerWeaponTests.cs +++ b/tests/Aetheria.Shared.Tests/FireControlPerWeaponTests.cs @@ -1392,4 +1392,18 @@ public sealed class FireControlPerWeaponTests : IDisposable var r = Build(magazine: 2); Assert.Equal(0, r.Gun.Weapon.Reserve); } + + // A magazine weapon that names no ammunition still reloads free and keeps firing: only an AmmoType makes a reload cost a crate. + // Kills: TakeReloadRound refusing when AmmoType is unset, which would silence every unfed magazine gun after one magazine. + [Fact] + public void AMagazineWeaponWithNoAmmunitionTypeStillReloadsFree() + { + var r = Build(fuse: WeaponFuse.Proximity, blast: 30f, range: 40f, magazine: 2, auto: true, reload: 3f); + r.Shooter.SetTarget(TargetRef.None); + Aim(r, float2(0, 1)); + var shots = 0; + r.Zone.ShotCommitted.Subscribe(_ => shots++); + Run(r, 30f); + Assert.True(shots > 4, $"an unfed magazine weapon fires past its first magazine, fired {shots}"); + } } diff --git a/tools/AetherDb/Economy/Munitions.cs b/tools/AetherDb/Economy/Munitions.cs index 2630c2dac..83cbee2f2 100644 --- a/tools/AetherDb/Economy/Munitions.cs +++ b/tools/AetherDb/Economy/Munitions.cs @@ -141,12 +141,16 @@ public sealed class Munitions : EconomyBatch "The same powder as a gun charge, shaped to burn for seconds instead of milliseconds: missile stocks and gun stocks compete for one powder train.", new[] { "thruster" }, (powder, 2), (steel, 1)); - // Missiles: the crate a launcher design reloads from. One crate is one magazine reload (UseAmmo removes one unit of the weapon's - // AmmoType at an empty magazine), the same convention as Ammo for guns. A crate is a warhead and a motor per two missiles' worth - // of magazine; the guidance package (seeker and fin actuators) waits on the electronics chain, so the recipe does not yet draw it. - var missiles = Simple("missiles", "Missiles", "Crated guided munitions: a high-explosive warhead mated to a rocket motor on a launch rail. The crate a launcher reloads from; the rounds are real, only the reactor energy of the launch is not.", 8f, 1800); - Recipe(missiles, "munitions-works", 1200, 24, 2, - "A missile crate is a warhead, a motor and a seeker in one box, and the box is the arsenal's most counted object: Zhestokost ties each launcher crew's allowance to a serial range, so a cache of loose crates is either a deserter's or a quartermaster's crime.", + // Missiles: the crate a launcher design reloads from. One crate is one magazine reload (the reload takes one unit of the weapon's + // AmmoType), the same convention as Ammo for guns, whatever the magazine holds (2 to 288 rounds across the five designs). A crate is + // a warhead and a motor; the guidance package (seeker and fin actuators) waits on the electronics chain, so the recipe does not + // yet draw it. Shape and stack match Ammo's, so a hold takes crates cell for cell. + var missiles = new SimpleCommodityData { Name = "Missiles", Shape = new Shape(), MaxStack = 5, Mass = 8f, Price = 1800, + Description = "Crated guided munitions: a high-explosive warhead mated to a rocket motor on a launch rail. The crate a launcher reloads from; the rounds are real, only the reactor energy of the launch is not." }; + _a.Put(missiles, CommodityKey("missiles")); + var missilesRef = new CultRecordRef<ItemData>(CommodityKey("missiles")); + Recipe(missilesRef, "munitions-works", 1200, 24, 2, + "A missile crate is a warhead and a motor in one box, and the box is the arsenal's most counted object: Zhestokost ties each launcher crew's allowance to a serial range, so a cache of loose crates is either a deserter's or a quartermaster's crime.", new string[0], (warhead, 1), (motor, 1)); var dispenser = Compound("mine-dispenser", "Mine Dispenser", "A rack and ejector that lays mines in a pattern.", 20f, 1600); @@ -165,7 +169,7 @@ public sealed class Munitions : EconomyBatch foreach (var launcher in new[] { "Guided Missile Launcher", "Long-Range Missile Rack", "Short-Range Missile Rack", "Incendiary Rocket Pod", "Swarm Rocket Pod" }) _a.Edit<WeaponItemData>(launcher, w => { - foreach (var data in w.Behaviors.OfType<WeaponData>()) data.AmmoType = new CultRecordRef<SimpleCommodityData>(missiles.Key); + foreach (var data in w.Behaviors.OfType<WeaponData>()) data.AmmoType = new CultRecordRef<SimpleCommodityData>(CommodityKey("missiles")); }); } diff --git a/tools/AetherDb/Program.cs b/tools/AetherDb/Program.cs index 50f97c019..5d3d18e93 100644 --- a/tools/AetherDb/Program.cs +++ b/tools/AetherDb/Program.cs @@ -1105,11 +1105,6 @@ public static class Program return 0; } - // Damage falloff (aetheria-release, damage-curve-fate-ruled): every gun and beam authors an effective range at a - // fraction of its Range (Min and Max scaled, Terms copied so the effective range wears and heats as the range does) - // and a damage multiplier at maximum range. Guided weapons, lock weapons and mine layers keep the unauthored - // defaults (no falloff). The command upserts every weapon design, which is also what drops the retired damage curve - // (key 7) from the stored records. Idempotent: the values are functions of Range alone. Dry run unless "apply". // Read-only: what every weapon design draws per shot (reactor energy, magazine, rounds), so ammunition rulings are audited // against the catalog and not against names. private static int WeaponAmmo() @@ -1123,6 +1118,11 @@ public static class Program return 0; } + // Damage falloff (aetheria-release, damage-curve-fate-ruled): every gun and beam authors an effective range at a + // fraction of its Range (Min and Max scaled, Terms copied so the effective range wears and heats as the range does) + // and a damage multiplier at maximum range. Guided weapons, lock weapons and mine layers keep the unauthored + // defaults (no falloff). The command upserts every weapon design, which is also what drops the retired damage curve + // (key 7) from the stored records. Idempotent: the values are functions of Range alone. Dry run unless "apply". private static int RangeFalloff(string[] args) { var apply = args.Contains("apply"); From 5ec368c11ed1e006a93fc6821f4678efeb6325b4 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 02:55:39 +0000 Subject: [PATCH 019/108] GameData/Aetheria.cc: Munitions re-apply (Missiles shape and stack, recipe lore) economy author Munitions apply; rerun reports 0 changed. sha256 b737d1c74f48c3c0a2e911efd2824345c8491cd8a0c0d3754d78b85d3ea29c40 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- GameData/Aetheria.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GameData/Aetheria.cc b/GameData/Aetheria.cc index 5b9332c1f..e46487c5f 100644 --- a/GameData/Aetheria.cc +++ b/GameData/Aetheria.cc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d1c96c6ed8530a4e17246604580eca3a45666b3846d56d557f8869ce7c2cc2b3 -size 213302 +oid sha256:b737d1c74f48c3c0a2e911efd2824345c8491cd8a0c0d3754d78b85d3ea29c40 +size 213296 From 35fa50f2561aef083dc9817ecbba772ebe9a1b6a Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 03:12:36 +0000 Subject: [PATCH 020/108] Generated turrets are stocked with the crates their weapons reload from GenerateTurretLoadout calls the same StockAmmunition as ships; an ammo-fed turret otherwise went quiet after one magazine. Test: generated turrets hold exactly the crates for each ammunition type they draw. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../Scripts/ServerShared/LoadoutGenerator.cs | 1 + .../AmmunitionStockingTests.cs | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Assets/Scripts/ServerShared/LoadoutGenerator.cs b/Assets/Scripts/ServerShared/LoadoutGenerator.cs index c82ec1300..93c00aff9 100644 --- a/Assets/Scripts/ServerShared/LoadoutGenerator.cs +++ b/Assets/Scripts/ServerShared/LoadoutGenerator.cs @@ -76,6 +76,7 @@ public class LoadoutGenerator var entity = new OrbitalEntity(ItemManager, null, hull, default, ItemManager.GameplaySettings.DefaultEntitySettings); entity.Faction = Faction; OutfitEntity(entity); + StockAmmunition(entity); return EntitySerializer.Pack(entity) as OrbitalEntityPack; } diff --git a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs index 1fd278bfe..d1d0f1317 100644 --- a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs +++ b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs @@ -35,4 +35,23 @@ public sealed partial class RunStartTests } Assert.True(fed > 0, "fixture: some generated ship carries an ammunition-fed weapon"); } + + // A generated turret reloads from its own hold like a ship: every ammunition type its weapons draw has crates in it. Kills: a turret + // path that skips StockAmmunition, which leaves an ammo-fed turret quiet after one magazine. + [Fact] + public void GeneratedTurretsCarryTheAmmunitionTheirWeaponsDraw() + { + var generator = new LoadoutGenerator(ref _items.Random, _items, _galaxy, _galaxy.Entrance, _protagonist, .5f); + var fed = 0; + for (var i = 0; i < 60; i++) + { + var turret = EntitySerializer.Unpack(_items, null, generator.GenerateTurretLoadout()); + foreach (var key in turret.Weapons.Select(w => w.WeaponData.AmmoType).Where(t => t.IsSet()).Select(t => t.Key).Distinct()) + { + fed++; + Assert.Equal(LoadoutGenerator.AmmunitionCrates, turret.CountItemsInCargo(key)); + } + } + Assert.True(fed > 0, "fixture: some generated turret carries an ammunition-fed weapon"); + } } From 1f93e22239b05524fea1d82089004de89ecfdc61 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 03:19:46 +0000 Subject: [PATCH 021/108] AetherDb: MunitionsFeed gives the munitions chain real sources; Mines; every round-firing gun names its round MunitionsFeed (run after Munitions) authors the chain's leaf recipes: extraction at mining (Rock, New Metals, Gold, Potassium, Diamond) and volatiles (Water, Methane, Ammonia), Algae at agriculture, Oxygen/Steel/Cellulose Pulp at processing, Circuit Board/Actuator at fabrication. Munitions adds the Mines commodity and recipe, AmmoType=Ammo on Slug Rifle, Long Slug Rifle and Light Machine Gun, AmmoType=Mines on the Mine Launcher, a real Light Machine Gun magazine (0 -> 100 rounds, reload 3 s), and Zhestokost depot stand-ins for mining, volatiles and agriculture so the new recipes' station kinds are placed. Tests read the shipped catalog (pending the blob commit). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../MunitionsSourcingCatalogTests.cs | 79 +++++++++++++++++ tools/AetherDb/Economy/Munitions.cs | 29 ++++++- tools/AetherDb/Economy/MunitionsFeed.cs | 84 +++++++++++++++++++ 3 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 tests/Aetheria.Shared.Tests/MunitionsSourcingCatalogTests.cs create mode 100644 tools/AetherDb/Economy/MunitionsFeed.cs diff --git a/tests/Aetheria.Shared.Tests/MunitionsSourcingCatalogTests.cs b/tests/Aetheria.Shared.Tests/MunitionsSourcingCatalogTests.cs new file mode 100644 index 000000000..45c8db147 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/MunitionsSourcingCatalogTests.cs @@ -0,0 +1,79 @@ +using System.Collections.Generic; +using System.Linq; +using GameCult.Caching; +using Xunit; + +// Ruling ballistics-real-ammo, read from the shipped catalog: every gun that fires a round names the commodity it draws, and every +// such commodity (and the chain behind it) is produced from extraction, not from nothing. A round with no source is a magazine +// nobody can ever refill. +public sealed class MunitionsSourcingCatalogTests +{ + // The guns that fire real rounds: ballistic and launcher hardpoints, and the mine layer (a launcher in all but hardpoint). + private static bool FiresRounds(WeaponItemData item, WeaponData data) => + item.HardpointType == HardpointType.Ballistic || item.HardpointType == HardpointType.Launcher || data is MineLayerData; + + // Kills: a ballistic gun (or the Light Machine Gun's free hose) authored with AmmoType unset, which reloads for nothing; a + // drawn commodity that is not a commodity record; a magazine too small for a reload to mean anything. + [Fact] + public void EveryRoundFiringGunNamesAnAmmunitionCommodityAndHoldsARealMagazine() + { + using var db = AetherDb.Open(); + var guns = db.Cache.GetAll<WeaponItemData>() + .SelectMany(i => i.Behaviors.OfType<WeaponData>().Where(d => FiresRounds(i, d)).Select(d => (i.Name, d))).ToArray(); + Assert.True(guns.Length >= 14, $"fixture: the catalog holds its round-firing guns ({guns.Length})"); + foreach (var (name, data) in guns) + { + Assert.True(data.AmmoType.IsSet(), $"{name} draws no ammunition"); + Assert.NotNull(db.Cache.Get<SimpleCommodityData>(data.AmmoType.Key)); + Assert.True(data.MagazineSize >= 1, $"{name} has no magazine"); + } + Assert.Equal(new[] { "Ammo", "Mines", "Missiles" }, guns.Select(g => db.Cache.Get<SimpleCommodityData>(g.d.AmmoType.Key).Name).Distinct().OrderBy(n => n).ToArray()); + } + + // Kills: an ammunition commodity no chain of recipes reaches raw goods for (the Ammo, Missiles and Mines leaves had no recipe at all). + [Fact] + public void EveryDrawnAmmunitionHasAFiniteProductionDepth() + { + using var db = AetherDb.Open(); + var depth = EconomyChecks.Deep(db.Cache); + var drawn = db.Cache.GetAll<WeaponItemData>().SelectMany(i => i.Behaviors.OfType<WeaponData>()).Where(d => d.AmmoType.IsSet()) + .Select(d => d.AmmoType.Key.Value).Distinct().ToArray(); + Assert.Equal(3, drawn.Length); + foreach (var key in drawn) + Assert.True(depth[key] != null, $"{db.Cache.Get<ItemData>(new CultRecordKey(key)).Name} has no finite production depth"); + } + + // Kills: a leaf of the munitions chain left without a source or a sink (the 19 L-source-sink faults this chain shipped with). + [Fact] + public void TheMunitionsChainHasNoSourceSinkFault() + { + using var db = AetherDb.Open(); + var chain = new HashSet<string>(ChainOf(db.Cache), System.StringComparer.Ordinal); + Assert.True(chain.Count >= 25, $"fixture: the chain is walked ({chain.Count} goods)"); + var faults = EconomyChecks.SourceSink(db.Cache).Where(f => chain.Contains(KeyOfRecipe(f.Record))).ToArray(); + Assert.True(faults.Length == 0, string.Join("\n", faults.Select(f => f.Message))); + } + + private static string KeyOfRecipe(string recipeKey) => recipeKey.StartsWith("recipe:") ? recipeKey.Substring("recipe:".Length) : recipeKey; + + // Every good that feeds a drawn round, or fills a role of a round-firing gun, through the recipe graph; the rounds included. + private static IEnumerable<string> ChainOf(CultCache catalog) + { + var recipes = catalog.GetAll<RecipeData>().ToDictionary(r => r.Output.Key.Value); + var open = new Stack<string>(catalog.GetAll<WeaponItemData>().SelectMany(i => i.Behaviors.OfType<WeaponData>()) + .Where(d => d.AmmoType.IsSet()).Select(d => d.AmmoType.Key.Value).Distinct()); + foreach (var item in catalog.GetAll<WeaponItemData>().Where(i => i.Behaviors.OfType<WeaponData>().Any(d => FiresRounds(i, d)))) + { + var recipe = Recipes.RecipeOf(catalog, item); + if (recipe == null) continue; + foreach (var role in Recipes.RoleInputsOf(catalog, recipe)) + foreach (var filler in Recipes.Fillers(catalog, role.Name)) open.Push(filler.Value); + } + var seen = new HashSet<string>(open); + while (open.Count > 0) + if (recipes.TryGetValue(open.Pop(), out var recipe)) + foreach (var input in recipe.Inputs.Select(c => c.Commodity.Key.Value)) + if (seen.Add(input)) open.Push(input); + return seen; + } +} diff --git a/tools/AetherDb/Economy/Munitions.cs b/tools/AetherDb/Economy/Munitions.cs index 83cbee2f2..c20165253 100644 --- a/tools/AetherDb/Economy/Munitions.cs +++ b/tools/AetherDb/Economy/Munitions.cs @@ -32,7 +32,9 @@ public sealed class Munitions : EconomyBatch // Zhestokost has no station model of any kind yet. Its first planned model is the supply depot (ruling faction-station-models), // so its industrial kinds stand in on the depot until their own models land. One hop: depot itself has no Zhestokost stand-in. var zhestokost = FactionRef("Zhestokost"); - foreach (var kind in new[] { "processing", "fabrication", "munitions-works" }) + // The feed stock for the chain (MunitionsFeed) is extracted and grown where the arsenal's planners can reach it, so the mining, + // volatiles and agriculture kinds stand in on the depot too until the factions that own those industries place them. + foreach (var kind in new[] { "processing", "fabrication", "munitions-works", "mining", "volatiles", "agriculture" }) StandIn(kind, zhestokost, "depot"); // Interface goods: named by this chain, owned by another. @@ -153,6 +155,15 @@ public sealed class Munitions : EconomyBatch "A missile crate is a warhead and a motor in one box, and the box is the arsenal's most counted object: Zhestokost ties each launcher crew's allowance to a serial range, so a cache of loose crates is either a deserter's or a quartermaster's crime.", new string[0], (warhead, 1), (motor, 1)); + // Mines: the crate the mine launcher reloads from, a warhead per mine laid. Shape and stack as Missiles. + var mines = new SimpleCommodityData { Name = "Mines", Shape = new Shape(), MaxStack = 5, Mass = 7f, Price = 1400, + Description = "Crated proximity mines: a high-explosive warhead in a steel drum with a fuzed trigger. The crate a mine launcher reloads from." }; + _a.Put(mines, CommodityKey("mines")); + var minesRef = new CultRecordRef<ItemData>(CommodityKey("mines")); + Recipe(minesRef, "munitions-works", 900, 20, 2, + "A mine is a warhead with patience. Every blockade that holds a lane for a season is paid for in crates of these, and a convoy captain who finds a lane suddenly quiet counts the hours since the last tender came through.", + new string[0], (warhead, 1), (steel, 2)); + var dispenser = Compound("mine-dispenser", "Mine Dispenser", "A rack and ejector that lays mines in a pattern.", 20f, 1600); Recipe(dispenser, "fabrication", 900, 20, 1, "Little more than steel and actuators, which is why every convoy navy can build one and every blockade starts with one.", @@ -171,6 +182,22 @@ public sealed class Munitions : EconomyBatch { foreach (var data in w.Behaviors.OfType<WeaponData>()) data.AmmoType = new CultRecordRef<SimpleCommodityData>(CommodityKey("missiles")); }); + + // Every ballistic gun draws a round (ruling ballistics-real-ammo). The Light Machine Gun had no magazine, a free hose; it gets a + // real one so a single Ammo crate reloads it like the other guns. The mine launcher draws a Mines crate. + foreach (var gun in new[] { "Slug Rifle", "Long Slug Rifle", "Light Machine Gun" }) + _a.Edit<WeaponItemData>(gun, w => + { + foreach (var data in w.Behaviors.OfType<WeaponData>()) + { + data.AmmoType = new CultRecordRef<SimpleCommodityData>(ammo.Key); + if (gun == "Light Machine Gun") { data.MagazineSize = 100; data.ReloadTime = 3f; } + } + }); + _a.Edit<WeaponItemData>("Mine Launcher", w => + { + foreach (var data in w.Behaviors.OfType<WeaponData>()) data.AmmoType = new CultRecordRef<SimpleCommodityData>(CommodityKey("mines")); + }); } private CultRecordRef<Faction> FactionRef(string name) diff --git a/tools/AetherDb/Economy/MunitionsFeed.cs b/tools/AetherDb/Economy/MunitionsFeed.cs new file mode 100644 index 000000000..eab9c16cc --- /dev/null +++ b/tools/AetherDb/Economy/MunitionsFeed.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using GameCult.Caching; + +// Economy content, batch 1b: where the munitions chain's raw materials come from. Munitions writes the chain and names its leaves +// (Water, Methane, Ammonia, Oxygen, Potassium, Diamond, Steel, Cellulose Pulp, Actuator, Circuit Board) without recipes; this batch +// gives each a source at a station kind whose description already says it does that work: input-free extraction at mining (ore, +// Gold, Potassium, Diamond) and volatiles (Water, Methane, Ammonia), and processing or fabrication from those goods for the rest. +// Run after Munitions: it edits nothing the other batch writes and every output it names must exist. +public sealed class MunitionsFeed : EconomyBatch +{ + private EconomyAuthor _a; + + public override void Author(EconomyAuthor author) + { + _a = author; + + // Extraction: no inputs, so these are the chain's raw goods. + var rock = Make("Rock", "mining", 300, 10, 8, + "Nobody on a mining station calls it rock; it is the overburden, the slag, the thing the real cargo was buried in. It is also what every smelter, board shop and cement yard starts from, so the cheapest hold in the verse is the one that decides who can build."); + var metals = Make("New Metals", "mining", 300, 12, 6, + "The ore that built the cities: whoever holds the claim feeds every foundry downstream, which is why mining rights are the one commodity the garrisons will not leave unguarded."); + var gold = Make("Gold", "mining", 600, 8, 2, + "Gold has a use besides vanity: it does not corrode in a contact. Boards bound for a hull in a cold or wet corridor are gold-plated, and a prospector who finds a seam sells it to the board shops before the jewellers."); + var potassium = Make("Potassium", "mining", 300, 8, 4, + "Potash and saltpetre salts turn up in the same evaporite beds that mark old water. Farms want it for fertiliser and the arsenal wants it for powder; the survey crews tag the beds by which buyer reached them first."); + var diamond = Make("Diamond", "mining", 1200, 12, 1, + "Industrial stones from the deep kimberlite cores: grit for lining barrels and cutting tools rather than jewellery. A miner who sells one for a ring has wasted a barrel."); + var water = Make("Water", "volatiles", 300, 8, 6, + "Every station buys water first and everything else second. The ice haulers run on the knowledge that a station's water reserve is the one stock it cannot be talked out of counting."); + var methane = Make("Methane", "volatiles", 300, 8, 4, + "Skimmed from the cold ice where it keeps for ever. Hauled home it is cooking gas, a feedstock for the formaldehyde plants, and the first thing that burns when a tank is struck."); + var ammonia = Make("Ammonia", "volatiles", 300, 8, 4, + "Ammonia ice is the nitrogen the whole verse eats and shoots: the farms spread it and the arsenals nitrate it. The skimmers who work cold bodies know exactly which of the two their hold is bound for by the hauler waiting at the dock."); + + // Processing from those goods. + var oxygen = Make("Oxygen", "processing", 240, 10, 3, + "Cracking water ice pays twice: the oxygen goes to lungs and acid towers, and the hydrogen is fuel. A station that sells its oxygen cheap is either swimming in ice or hiding a shortage.", + (water, 3)); + + var steel = Make("Steel", "processing", 600, 20, 4, + "Foundries on the ore belts pour bar, sheet and billet from alloy ore and slag flux. A pour is cheap; the rolling mills that finish it are the part a blockade starves, and every gun, hull plate and nail in the verse is waiting behind them.", + (metals, 3), (rock, 1)); + + // Algae is a catalog commodity the agriculture station description says grows from Water and Potassium. + var algae = Make("Algae", "agriculture", 600, 12, 6, + "Vats of green water under lamp-light: the first thing a new habitat grows, because it eats ash and sunlight and gives back food, fibre and air. A farm that loses its algae loses its station within the season.", + (water, 2), (potassium, 1)); + + var pulp = Make("Cellulose Pulp", "processing", 300, 10, 2, + "Algae from the farm vats is washed, digested and pressed into pulp. The same vats make paper for a Zhestokost order book and guncotton stock for its arsenal, and the split is seen in how many hands the washing hall hires.", + (algae, 3)); + + var board = Make("Circuit Board", "fabrication", 600, 14, 2, + "Gold-plated contacts on a silicate board: the oldest reliable electronics. A region that cannot make its own boards imports a shortage in every device that has a fuze, a sensor or a lock.", + (gold, 1), (rock, 2)); + + Make("Actuator", "fabrication", 600, 16, 1, + "A steel housing, a motor and a controller board. It opens hatches and feeds guns, and a repair crew keeps a drawer of them because everything on a ship eventually needs to move on command.", + (steel, 2), (board, 1)); + } + + private CultRecordRef<ItemData> Make(string name, string kind, float cycle, int workforce, int count, string lore, + params (CultRecordRef<ItemData> Commodity, int Count)[] inputs) + { + var named = _a.Catalog.GetAll<ItemData>().Where(i => i.Name == name).ToArray(); + if (named.Length != 1) throw new InvalidOperationException($"{named.Length} items are named '{name}'; the munitions feed needs exactly one."); + var output = new CultRecordRef<ItemData>(_a.Catalog.RefOf(named[0]).Key); + _a.Put(new RecipeData + { + Output = output, + OutputCount = count, + Inputs = inputs.Select(i => new CommodityCount { Commodity = i.Commodity, Count = i.Count }).ToList(), + Cycle = cycle, + Workforce = workforce, + Upkeep = new List<CommodityCount>(), + StationKind = new CultRecordRef<StationKindData>(StationKindData.KeyOf(kind)), + LoreHook = lore, + Fills = new List<string>() + }, RecipeData.KeyOf(output.Key)); + return output; + } +} From 54632d4eb92604e0934b32b67b48143e36b2dadc Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 03:32:45 +0000 Subject: [PATCH 022/108] Tests: pin Mines in the commodity count; the stand-in fixture uses salvage, since Zhestokost now stands in for mining Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../Aetheria.Shared.Tests/CommodityRecordsTests.cs | 2 +- tests/Aetheria.Shared.Tests/StationKindTests.cs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/CommodityRecordsTests.cs b/tests/Aetheria.Shared.Tests/CommodityRecordsTests.cs index 91bce1993..b59885c26 100644 --- a/tests/Aetheria.Shared.Tests/CommodityRecordsTests.cs +++ b/tests/Aetheria.Shared.Tests/CommodityRecordsTests.cs @@ -13,7 +13,7 @@ public sealed class CommodityRecordsTests public void ShippedCatalogOpensWithTheRetiredKeysGone() { using var cache = RestoredHullsTests.OpenCatalog(); - Assert.Equal(23, cache.GetAll<SimpleCommodityData>().Count()); + Assert.Equal(24, cache.GetAll<SimpleCommodityData>().Count()); Assert.Equal(63, cache.GetAll<CompoundCommodityData>().Count()); Assert.Contains(cache.GetAll<SimpleCommodityData>(), c => c.Name == "Ammo"); Assert.All(cache.GetAll<CompoundCommodityData>(), c => Assert.False(string.IsNullOrEmpty(c.Name))); diff --git a/tests/Aetheria.Shared.Tests/StationKindTests.cs b/tests/Aetheria.Shared.Tests/StationKindTests.cs index 2082a3719..02db0c081 100644 --- a/tests/Aetheria.Shared.Tests/StationKindTests.cs +++ b/tests/Aetheria.Shared.Tests/StationKindTests.cs @@ -248,17 +248,17 @@ public sealed class StationKindTests : IDisposable { var world = World.Make(this, zenithOffered: false); var hub = world.Sell(world.Zh, "trade-hub", "Zh Hub"); - world.StandIn("mining", world.Zh, "trade-hub"); - var mining = world.Cache.Get(Kind("mining")); + world.StandIn("salvage", world.Zh, "trade-hub"); + var salvage = world.Cache.Get(Kind("salvage")); - Assert.Contains(Kind("mining").Key.Value, StationKinds.KindsOf(world.Cache, world.Zh).Select(kind => kind.Key.Value)); - Assert.Equal(Kind("trade-hub").Key, StationKinds.HullKindFor(world.Cache, world.Zh, Kind("mining")).Key); + Assert.Contains(Kind("salvage").Key.Value, StationKinds.KindsOf(world.Cache, world.Zh).Select(kind => kind.Key.Value)); + Assert.Equal(Kind("trade-hub").Key, StationKinds.HullKindFor(world.Cache, world.Zh, Kind("salvage")).Key); for (uint seed = 1; seed <= 10; seed++) { - var pack = world.Generator(world.Zh, seed).GenerateStationLoadout(Kind("mining")); + var pack = world.Generator(world.Zh, seed).GenerateStationLoadout(Kind("salvage")); Assert.Equal("Zh Hub", world.HullName(pack)); - Assert.Equal(Kind("mining").Key, pack.Kind.Key); - Assert.Equal(mining.Name, pack.Name); + Assert.Equal(Kind("salvage").Key, pack.Kind.Key); + Assert.Equal(salvage.Name, pack.Name); } var own = world.Generator(world.Zh).GenerateStationLoadout(Kind("trade-hub")); Assert.Equal(hub.Name, own.Name); From 8948b99e5964045c7559b9e382cc8d13ff81d7e2 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 03:32:54 +0000 Subject: [PATCH 023/108] GameData/Aetheria.cc: Munitions + MunitionsFeed apply (chain sources, Mines, gun ammo) sha256 0f81d35d4cec8f57178220f20bca98ffaa6709783349efe3cc28aa64ea1f02b1 economy author Munitions MunitionsFeed apply: 14 extraction/processing recipes (Rock, New Metals, Gold, Potassium, Diamond, Water, Methane, Ammonia, Algae, Oxygen, Steel, Cellulose Pulp, Circuit Board, Actuator), Mines commodity and recipe, Zhestokost depot stand-ins for mining, volatiles and agriculture. AmmoType=Ammo on Slug Rifle, Long Slug Rifle, Light Machine Gun; AmmoType=Mines on the Mine Launcher. Stat change: Light Machine Gun MagazineSize 0 -> 100, ReloadTime 1 -> 3 s. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- GameData/Aetheria.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GameData/Aetheria.cc b/GameData/Aetheria.cc index e46487c5f..553e6bcce 100644 --- a/GameData/Aetheria.cc +++ b/GameData/Aetheria.cc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b737d1c74f48c3c0a2e911efd2824345c8491cd8a0c0d3754d78b85d3ea29c40 -size 213296 +oid sha256:0f81d35d4cec8f57178220f20bca98ffaa6709783349efe3cc28aa64ea1f02b1 +size 220607 From c21fad28f566447b2c2769a87cf456b6d706ff11 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 03:36:58 +0000 Subject: [PATCH 024/108] Ammunition stock has one owner; a named AmmoType makes a one-round magazine Loadouts.StockAmmunition is the single owner of crate stocking. The generator calls it for generated ships and turrets, and Loadouts.Materialize calls it at the end, which covers every Loadout-built entity: scenario stage.Fit/Preset, the boss in ZoneGenerator, and the console-built ship. Paths left alone: Unpack of a pack or save (an entity's cargo is its own and a saved game's cargo is never touched on load), scenario stage.Cargo (adds on top of the stock), the LoadoutCommit validation build (discarded). The new-run player ship is stage.Generated and so already stocked by the generator. A hull with no bay gets no crates and a log line. InstantWeapon: a weapon that names an AmmoType is magazine-fed with an effective magazine of max(1, MagazineSize): every round leaves the magazine and the reload takes a crate. A weapon with no AmmoType and a magazine of 0 or 1 stays free. HUD shows rounds/reserve for every AmmoType weapon. ConstantWeapon keeps its own per-interval crate draw. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../ServerShared/Behaviors/InstantWeapon.cs | 16 ++-- Assets/Scripts/ServerShared/Loadout.cs | 15 ++++ .../Scripts/ServerShared/LoadoutGenerator.cs | 16 +--- Assets/Scripts/UI/HUD/SchematicDisplay.cs | 7 +- .../AmmunitionStockingTests.cs | 74 +++++++++++++++++++ .../FireControlPerWeaponTests.cs | 48 +++++++++++- 6 files changed, 148 insertions(+), 28 deletions(-) diff --git a/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs b/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs index c8587f72d..96cdc330e 100644 --- a/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs @@ -133,13 +133,13 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior, IPowerCo public InstantWeapon(InstantWeaponData data, EquippedItem item) : base(data, item) { _data = data; - _ammo = data.MagazineSize; + _ammo = Magazine; } public InstantWeapon(InstantWeaponData data, ConsumableItemEffect item) : base(data, item) { _data = data; - _ammo = data.MagazineSize; + _ammo = Magazine; } protected void Trigger() @@ -229,9 +229,9 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior, IPowerCo if (!_coolingDown || !(_cooldown < 0)) return false; _overshoot = min(-_cooldown * CountdownSpan, dt); _coolingDown = false; - if (_data.MagazineSize > 0 && _ammo == 0 && TakeReloadRound()) + if (Magazine > 0 && _ammo == 0 && TakeReloadRound()) { - _ammo = _data.MagazineSize; + _ammo = Magazine; OnReloadComplete?.Invoke(); } else @@ -250,7 +250,7 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior, IPowerCo return true; } - private float CountdownSpan => max(ShortestCycle, _data.MagazineSize > 0 && _ammo == 0 ? _data.ReloadTime : Cooldown); + private float CountdownSpan => max(ShortestCycle, Magazine > 0 && _ammo == 0 ? _data.ReloadTime : Cooldown); // A countdown that starts outside a round (a charge failing) carries the last one's overshoot like every restart. protected void StartCountdown() @@ -266,9 +266,13 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior, IPowerCo return overshoot; } + // A weapon that names an AmmoType is magazine-fed whatever MagazineSize says: its magazine is at least one round, every round + // leaves it and the reload takes a crate. A weapon with no AmmoType and a magazine of one or none fires free. + private int Magazine => _data.AmmoType.IsSet() ? max(1, _data.MagazineSize) : _data.MagazineSize; + private bool UseAmmo(float dt) { - if (_data.MagazineSize <= 1) return true; + if (!_data.AmmoType.IsSet() && _data.MagazineSize <= 1) return true; if (_ammo > 0) { diff --git a/Assets/Scripts/ServerShared/Loadout.cs b/Assets/Scripts/ServerShared/Loadout.cs index b8b73a0ab..f327837e2 100644 --- a/Assets/Scripts/ServerShared/Loadout.cs +++ b/Assets/Scripts/ServerShared/Loadout.cs @@ -202,9 +202,24 @@ public static class Loadouts built[g] = (items.Select(item => item.GetBehavior<Weapon>()).ToList(), items); } entity.WeaponGroups = built; + StockAmmunition(itemManager, entity); return entity; } + // The crates an entity's weapons reload from: LoadoutGenerator.AmmunitionCrates of each distinct AmmoType, stopping when no hold takes + // another. The one owner of ammunition stock: every path that fits weapons onto a new entity (the generator, a Loadout's Materialize, + // so a scenario's Fit, a boss, a console-built ship) ends here. A saved or packed entity is never stocked: its cargo is its own. + // Draws nothing from the random stream, so adding it moves no other roll. + public static void StockAmmunition(ItemManager itemManager, Entity entity) + { + foreach (var key in entity.Weapons.Select(weapon => weapon.WeaponData.AmmoType).Where(type => type.IsSet()).Select(type => type.Key).Distinct()) + { + var crates = new SimpleCommodity { Data = new CultRecordRef<ItemData>(key), Quantity = LoadoutGenerator.AmmunitionCrates }; + if (!entity.CargoBays.Any(bay => bay.TryStore(crates))) + itemManager.Log($"{entity.Name}: no room for {LoadoutGenerator.AmmunitionCrates} crates of {key.Value}."); + } + } + // The hull, then each slot's gear, made by the given builders and equipped to the loadout's cells: the one placement of // a loadout, run once on the throwaway manager to decide the fit and once on the live one to build. Null with every // misfit listed when any cell does not take its gear. diff --git a/Assets/Scripts/ServerShared/LoadoutGenerator.cs b/Assets/Scripts/ServerShared/LoadoutGenerator.cs index 93c00aff9..fcd554efd 100644 --- a/Assets/Scripts/ServerShared/LoadoutGenerator.cs +++ b/Assets/Scripts/ServerShared/LoadoutGenerator.cs @@ -60,7 +60,7 @@ public class LoadoutGenerator OutfitEntity(entity); EquipPickup(entity); StockConsumables(entity, ShipConsumableChance, ShipConsumableUnits); - StockAmmunition(entity); + Loadouts.StockAmmunition(ItemManager, entity); return EntitySerializer.Pack(entity); } @@ -76,7 +76,7 @@ public class LoadoutGenerator var entity = new OrbitalEntity(ItemManager, null, hull, default, ItemManager.GameplaySettings.DefaultEntitySettings); entity.Faction = Faction; OutfitEntity(entity); - StockAmmunition(entity); + Loadouts.StockAmmunition(ItemManager, entity); return EntitySerializer.Pack(entity) as OrbitalEntityPack; } @@ -168,18 +168,6 @@ public class LoadoutGenerator } } - // The crates the ship's weapons reload from: AmmunitionCrates of each distinct AmmoType, stopping when no hold takes another. - // Draws nothing from the random stream, so adding it moves no other roll. - private void StockAmmunition(Entity entity) - { - foreach (var key in entity.Weapons.Select(weapon => weapon.WeaponData.AmmoType).Where(type => type.IsSet()).Select(type => type.Key).Distinct()) - { - var crates = new SimpleCommodity { Data = new CultRecordRef<ItemData>(key), Quantity = AmmunitionCrates }; - if (!entity.CargoBays.Any(bay => bay.TryStore(crates))) - ItemManager.Log($"{entity.Name}: no room for {AmmunitionCrates} crates of {key.Value}."); - } - } - private static bool IsHeater(GearData item) => item.HardpointType == HardpointType.Tool && item.Behaviors.Any(b => b is ThermotoggleData { HighPass: false }) && diff --git a/Assets/Scripts/UI/HUD/SchematicDisplay.cs b/Assets/Scripts/UI/HUD/SchematicDisplay.cs index f5d6d8af3..526a83c80 100644 --- a/Assets/Scripts/UI/HUD/SchematicDisplay.cs +++ b/Assets/Scripts/UI/HUD/SchematicDisplay.cs @@ -234,12 +234,7 @@ public class SchematicDisplay : MonoBehaviour x.ListElement.CooldownFill.anchorMax = new Vector2(x.Cooldown.Progress, 1); x.ListElement.DurabilityLabel.text = $"{(int)(x.Row.Item.EquippableItem.Durability / itemData.Durability * 100)}%"; if (x.Weapon.WeaponData.AmmoType.IsSet()) - { - if(x.Weapon.WeaponData.MagazineSize > 1) - x.ListElement.AmmoLabel.text = $"{x.Weapon.Ammo}/{x.Weapon.Reserve}"; - else - x.ListElement.AmmoLabel.text = _entity.CountItemsInCargo(x.Weapon.WeaponData.AmmoType.Key).ToString(); - } + x.ListElement.AmmoLabel.text = $"{x.Weapon.Ammo}/{x.Weapon.Reserve}"; } if (x.ListElement.RangeLabel) diff --git a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs index d1d0f1317..95a59f52b 100644 --- a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs +++ b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs @@ -1,4 +1,6 @@ +using System.Collections.Generic; using System.Linq; +using static CultMath.math; using Xunit; // Ruling ballistics-real-ammo: generation stocks combatants with rounds, because a magazine weapon reloads from cargo and a ship with @@ -54,4 +56,76 @@ public sealed partial class RunStartTests } Assert.True(fed > 0, "fixture: some generated turret carries an ammunition-fed weapon"); } + + private static int[] FedTypesStocked(Entity ship, out int fed) + { + var keys = ship.Weapons.Select(w => w.WeaponData.AmmoType).Where(t => t.IsSet()).Select(t => t.Key).Distinct().ToArray(); + fed = keys.Length; + return keys.Select(key => ship.CountItemsInCargo(key)).ToArray(); + } + + // A test hull, a one-cell ammunition-fed gun (a magazine of none, so the single-round rule is in play) and a bay, + // in the shared catalog: the smallest authored ship that can carry crates. + private (string Hull, (string, CultMath.int2, ItemRotation)[] Slots) FedFit(bool bay) + { + var shape = new Shape(7, 7); + foreach (var cell in shape.AllCoordinates) shape[cell] = true; + var hullData = new HullData { Name = "Fed Hull", HullType = HullType.Ship, Shape = shape, Durability = 10, Mass = 100 }; + _cache.Upsert(hullData); + var rounds = _cache.Upsert(new SimpleCommodityData { Name = "Fed Rounds", Shape = new Shape(), Price = 1, MaxStack = 100 }); + _cache.Upsert(new WeaponItemData + { + Name = "Fed Gun", Hardpoint = HardpointType.Tool, Shape = new Shape(), Durability = 1, + Behaviors = { new InstantWeaponData { AmmoType = rounds, MagazineSize = 0 } } + }); + var interior = new Shape(4, 4); + foreach (var cell in interior.AllCoordinates) interior[cell] = true; + _cache.Upsert(new CargoBayData { Name = "Fed Bay", Shape = new Shape(), InteriorShape = interior, Price = 20, Durability = 4 }); + var slots = new List<(string, CultMath.int2, ItemRotation)> { ("Fed Gun", int2(3, 3), ItemRotation.None) }; + if (bay) slots.Add(("Fed Bay", int2(4, 3), ItemRotation.None)); + return ("Fed Hull", slots.ToArray()); + } + + // A ship a scenario fits slot by slot (stage.Fit, no generator) that carries a bay and an ammunition-fed weapon ends with the crates that + // weapon draws, and its own Reserve reads them. Kills: Materialize returning the entity unstocked (the authored ship fires one magazine). + [Fact] + public void AScenarioFitWithAFedWeaponAndABayCarriesItsCrates() + { + var (hull, slots) = FedFit(bay: true); + var (_, _, staged, failures) = Launch(new Scripted(false, stage => stage.Player(stage.Fit(hull, slots), float2(0, 0))), Inputs(() => GalaxySeed)); + Assert.True(failures.Count == 0, string.Join("; ", failures)); + var weapon = Assert.Single(staged.Player.Weapons); + Assert.True(weapon.WeaponData.AmmoType.IsSet(), "fixture: the gun draws ammunition"); + Assert.Equal(LoadoutGenerator.AmmunitionCrates, weapon.Reserve); + } + + // With no hold to put crates in there are none, and the fit still builds: stocking is bounded by what the ship can carry, never a failure. + [Fact] + public void AScenarioFitWithNoBayCarriesNoCratesAndStillBuilds() + { + var (hull, slots) = FedFit(bay: false); + var (_, _, staged, failures) = Launch(new Scripted(false, stage => stage.Player(stage.Fit(hull, slots), float2(0, 0))), Inputs(() => GalaxySeed)); + Assert.True(failures.Count == 0, string.Join("; ", failures)); + Assert.Equal(0, Assert.Single(staged.Player.Weapons).Reserve); + } + + // The new run's player ship (stage.Generated at the starting hull) and every ship the shipped main-galaxy scenario generates carry the crates + // their weapons draw: nothing that reaches play with ammunition-fed weapons is left to one magazine. + [Fact] + public void ANewRunPlayerShipCarriesTheCratesItsWeaponsDraw() + { + var fed = 0; + for (uint seed = GalaxySeed; seed < GalaxySeed + 8; seed++) + { + var (_, _, staged, failures) = Launch(new Scripted(false, stage => stage.Player(stage.Generated(stage.StartingHull), float2(0, 0)), seed), + Inputs(() => seed)); + Assert.True(failures.Count == 0, string.Join("; ", failures)); + foreach (var count in FedTypesStocked(staged.Player, out var types)) + { + Assert.Equal(LoadoutGenerator.AmmunitionCrates, count); + fed += types; + } + } + Assert.True(fed > 0, "fixture: some new-run player ship carries an ammunition-fed weapon"); + } } diff --git a/tests/Aetheria.Shared.Tests/FireControlPerWeaponTests.cs b/tests/Aetheria.Shared.Tests/FireControlPerWeaponTests.cs index 690bd27d3..95260b713 100644 --- a/tests/Aetheria.Shared.Tests/FireControlPerWeaponTests.cs +++ b/tests/Aetheria.Shared.Tests/FireControlPerWeaponTests.cs @@ -1328,9 +1328,9 @@ public sealed class FireControlPerWeaponTests : IDisposable // One launcher-shaped weapon (magazine 2, reload 3 s, Missiles) held on its trigger at no target, `crates` of Missiles in the // hold. Returns the rig and a counter of committed shots. - private (Rig Rig, Func<int> Shots) AmmoRig(int crates) + private (Rig Rig, Func<int> Shots) AmmoRig(int crates, int magazine = 2) { - var r = Build(fuse: WeaponFuse.Proximity, blast: 30f, range: 40f, magazine: 2, auto: true, crates: crates, reload: 3f); + var r = Build(fuse: WeaponFuse.Proximity, blast: 30f, range: 40f, magazine: magazine, auto: true, crates: crates, reload: 3f); r.Shooter.SetTarget(TargetRef.None); Aim(r, float2(0, 1)); var shots = 0; @@ -1406,4 +1406,48 @@ public sealed class FireControlPerWeaponTests : IDisposable Run(r, 30f); Assert.True(shots > 4, $"an unfed magazine weapon fires past its first magazine, fired {shots}"); } + + // A weapon that names an AmmoType is magazine-fed whatever MagazineSize says (0 or 1 is a magazine of one): it fires one round, every + // reload takes a crate, and with none it fires no more. Kills: UseAmmo/reload ignoring AmmoType at MagazineSize <= 1 (free fire, or + // fire that never touches the cargo). + [Theory] + [InlineData(0)] + [InlineData(1)] + public void ASingleRoundAmmunitionFedWeaponFiresOnePerCrateAndNoMore(int magazine) + { + var (r, shots) = AmmoRig(crates: 2, magazine: magazine); + Assert.Equal(1, r.Gun.Weapon.Ammo); + Run(r, 2f); + Assert.Equal(1, shots()); + Assert.Equal(2, r.Gun.Weapon.Reserve); + Run(r, 30f); + Assert.Equal(3, shots()); + Assert.Equal(0, r.Gun.Weapon.Reserve); + Assert.Equal(0, r.Gun.Weapon.Ammo); + } + + [Theory] + [InlineData(0)] + [InlineData(1)] + public void ASingleRoundAmmunitionFedWeaponWithNoCrateFiresOnceAndNoMore(int magazine) + { + var (r, shots) = AmmoRig(crates: 0, magazine: magazine); + Run(r, 30f); + Assert.Equal(1, shots()); + } + + // With no AmmoType a magazine of 0 or 1 is no magazine: the weapon fires free, as before. Kills: the new rule leaking onto unfed weapons. + [Theory] + [InlineData(0)] + [InlineData(1)] + public void AWeaponWithNoAmmunitionTypeAndNoRealMagazineFiresFree(int magazine) + { + var r = Build(fuse: WeaponFuse.Proximity, blast: 30f, range: 40f, magazine: magazine, auto: true, reload: 3f); + r.Shooter.SetTarget(TargetRef.None); + Aim(r, float2(0, 1)); + var shots = 0; + r.Zone.ShotCommitted.Subscribe(_ => shots++); + Run(r, 30f); + Assert.True(shots > 4, $"an unfed weapon fires on, fired {shots}"); + } } From ded74e8b109f7e3406b81706a0195b0012f94103 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 03:40:33 +0000 Subject: [PATCH 025/108] Scenario fits are stocked unless the scenario authors their cargo Materialize takes stockAmmunition (default true: boss, console ship). ScenarioStage passes false and stocks at the end of staging only the fitted entities whose cargo the scenario did not author with Cargo, so a scenario that names what a hold carries gets exactly that. A packed (saved) fit is never stocked. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Loadout.cs | 7 ++++--- Assets/Scripts/ServerShared/RunStart.cs | 1 + Assets/Scripts/ServerShared/ScenarioStage.cs | 16 +++++++++++++++- .../AmmunitionStockingTests.cs | 12 ++++++++++++ 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/ServerShared/Loadout.cs b/Assets/Scripts/ServerShared/Loadout.cs index f327837e2..4866aa406 100644 --- a/Assets/Scripts/ServerShared/Loadout.cs +++ b/Assets/Scripts/ServerShared/Loadout.cs @@ -157,11 +157,12 @@ public static class Loadouts // spawner is to pass LoadoutGenerator.ChooseProduct, with no fallback to any manufacturer; RunStart does, and so does the // boss in ZoneGenerator, which is built here too from its faction's Loadout (Loadouts.BossOf). The hull's type // picks the entity: a ship hull builds a Ship, a turret hull an OrbitalEntity with no orbit, which stays where it is - // put; a station hull is refused. The entity always gets exactly WeaponGroupCount groups; a loadout with fewer is + // put; a station hull is refused. The entity is stocked with the crates its weapons draw (StockAmmunition) unless the caller + // authors the cargo itself and passes stockAmmunition false. The entity always gets exactly WeaponGroupCount groups; a loadout with fewer is // padded with empty groups. A stated quality mints every lot of the fit at it, drawing nothing (a scenario states // one for a fit its checks rest on). public static Entity Materialize(ItemManager itemManager, Zone liveZone, Loadout loadout, - Func<CraftedItemData, FactionProductData> choose, List<string> failures, float? quality = null) + Func<CraftedItemData, FactionProductData> choose, List<string> failures, float? quality = null, bool stockAmmunition = true) { var cache = itemManager.ItemData; var reported = failures.Count; @@ -202,7 +203,7 @@ public static class Loadouts built[g] = (items.Select(item => item.GetBehavior<Weapon>()).ToList(), items); } entity.WeaponGroups = built; - StockAmmunition(itemManager, entity); + if (stockAmmunition) StockAmmunition(itemManager, entity); return entity; } diff --git a/Assets/Scripts/ServerShared/RunStart.cs b/Assets/Scripts/ServerShared/RunStart.cs index 20269e84c..cadd66bcc 100644 --- a/Assets/Scripts/ServerShared/RunStart.cs +++ b/Assets/Scripts/ServerShared/RunStart.cs @@ -44,6 +44,7 @@ public static class RunStart if (!stage.PlayerPlaced) failures.Add("player: the scenario places no player"); if (failures.Count > reported) return null; + stage.StockUnauthoredAmmunition(); var player = stage.PlayerShip; player.IsPlayerShip = true; diff --git a/Assets/Scripts/ServerShared/ScenarioStage.cs b/Assets/Scripts/ServerShared/ScenarioStage.cs index 453ede8ec..a813bbf49 100644 --- a/Assets/Scripts/ServerShared/ScenarioStage.cs +++ b/Assets/Scripts/ServerShared/ScenarioStage.cs @@ -18,6 +18,10 @@ public sealed class ScenarioStage private readonly List<string> _failures = new List<string>(); private readonly List<Placement> _placed = new List<Placement>(); private int _placements; + // The entities this stage built from a fit (a packed fit is a saved ship, whose cargo is its own) and those whose cargo the scenario + // authored with Cargo: the rest are stocked with the crates their weapons draw when staging ends (StockUnauthoredAmmunition). + private readonly HashSet<Entity> _fitted = new HashSet<Entity>(); + private readonly HashSet<Entity> _cargoAuthored = new HashSet<Entity>(); internal ScenarioStage(ItemManager items, Zone arena, string startingHull, TutorialGenerationSettings tutorialGenerationSettings) { @@ -40,6 +44,14 @@ public sealed class ScenarioStage public int Credits { get; set; } internal IReadOnlyList<string> Failures => _failures; + + // Staging's last step: a fitted entity whose cargo the scenario did not author gets the crates its weapons draw, like every other + // newly built armed entity (Loadouts.StockAmmunition). Draws nothing, so it moves no item roll. + internal void StockUnauthoredAmmunition() + { + foreach (var entity in _fitted.Where(entity => !_cargoAuthored.Contains(entity))) + Loadouts.StockAmmunition(_items, entity); + } internal bool PlayerPlaced { get; private set; } internal Ship PlayerShip { get; private set; } internal IReadOnlyList<Placement> Placed => _placed; @@ -160,6 +172,7 @@ public sealed class ScenarioStage public void Cargo(Entity entity, params string[] names) { if (entity == null) return; + _cargoAuthored.Add(entity); var where = $"cargo of {entity.Name}"; var bay = entity.CargoBays.FirstOrDefault(); foreach (var name in names) @@ -183,7 +196,8 @@ public sealed class ScenarioStage else { var failures = new List<string>(); - entity = Loadouts.Materialize(_items, Arena, fit.Loadout, _choose, failures, fit.Quality); + entity = Loadouts.Materialize(_items, Arena, fit.Loadout, _choose, failures, fit.Quality, stockAmmunition: false); + if (entity != null) _fitted.Add(entity); _failures.AddRange(failures.Select(failure => $"{where} ({fit.Loadout.Name}): {failure}")); if (entity == null) return null; } diff --git a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs index 95a59f52b..cd91df321 100644 --- a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs +++ b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs @@ -99,6 +99,18 @@ public sealed partial class RunStartTests Assert.Equal(LoadoutGenerator.AmmunitionCrates, weapon.Reserve); } + // A scenario that authors a fit's cargo (stage.Cargo) gets exactly that cargo: its author named what the hold holds, so no crates are added. + // Kills: stocking that ignores authored cargo and puts missiles into a scenario whose check counts what the hold carries. + [Fact] + public void AScenarioFitWhoseCargoIsAuthoredIsNotStocked() + { + var (hull, slots) = FedFit(bay: true); + var (_, _, staged, failures) = Launch(new Scripted(false, stage => + stage.Cargo(stage.Player(stage.Fit(hull, slots), float2(0, 0)), "Fed Gun")), Inputs(() => GalaxySeed)); + Assert.True(failures.Count == 0, string.Join("; ", failures)); + Assert.Equal(0, Assert.Single(staged.Player.Weapons).Reserve); + } + // With no hold to put crates in there are none, and the fit still builds: stocking is bounded by what the ship can carry, never a failure. [Fact] public void AScenarioFitWithNoBayCarriesNoCratesAndStillBuilds() From 36a74478b6852f3578fc915d7fea909505b2a118 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 04:26:16 +0000 Subject: [PATCH 026/108] Test: a Loadout-built ship is stocked by Materialize's default Pins the default path the boss and the console fly use: a fed gun leaves the ship with AmmunitionCrates, a gun that draws nothing leaves none. Removing the default StockAmmunition call fails the fed case. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../AmmunitionStockingTests.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs index cd91df321..a5e7e53c9 100644 --- a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs +++ b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs @@ -78,6 +78,11 @@ public sealed partial class RunStartTests Name = "Fed Gun", Hardpoint = HardpointType.Tool, Shape = new Shape(), Durability = 1, Behaviors = { new InstantWeaponData { AmmoType = rounds, MagazineSize = 0 } } }); + _cache.Upsert(new WeaponItemData + { + Name = "Plain Gun", Hardpoint = HardpointType.Tool, Shape = new Shape(), Durability = 1, + Behaviors = { new InstantWeaponData { MagazineSize = 0 } } + }); var interior = new Shape(4, 4); foreach (var cell in interior.AllCoordinates) interior[cell] = true; _cache.Upsert(new CargoBayData { Name = "Fed Bay", Shape = new Shape(), InteriorShape = interior, Price = 20, Durability = 4 }); @@ -99,6 +104,27 @@ public sealed partial class RunStartTests Assert.Equal(LoadoutGenerator.AmmunitionCrates, weapon.Reserve); } + // The Loadout path with the DEFAULT stocking argument (what the boss in ZoneGenerator and the console `fly` call): a ship built from a + // Loadout holds the crates its fed weapon draws, and one whose only weapon draws nothing holds none. Kills: Materialize + // dropping its default StockAmmunition (every Loadout-built armed ship fires one magazine). + [Theory] + [InlineData("Fed Gun", LoadoutGenerator.AmmunitionCrates)] + [InlineData("Plain Gun", 0)] + public void ALoadoutBuiltShipIsStockedByDefaultWithWhatItsWeaponsDraw(string gun, int crates) + { + var (hull, _) = FedFit(bay: true); + EquippableItemData Design(string name) => _cache.GetAll<EquippableItemData>().Single(item => item.Name == name); + var loadout = new Loadout { Name = "default stock", Hull = _cache.RefOf(_cache.GetAll<HullData>().Single(h => h.Name == hull)), WeaponGroups = new int[0][] }; + loadout.Slots.Add(new LoadoutSlot { Position = int2(3, 3), Rotation = ItemRotation.None, Design = _cache.RefOf(Design(gun)) }); + loadout.Slots.Add(new LoadoutSlot { Position = int2(4, 3), Rotation = ItemRotation.None, Design = _cache.RefOf(Design("Fed Bay")) }); + var failures = new List<string>(); + var ship = Loadouts.Materialize(_items, null, loadout, _ => null, failures); + Assert.True(failures.Count == 0, string.Join("; ", failures)); + var weapon = Assert.Single(ship.Weapons); + Assert.Equal(gun == "Fed Gun", weapon.WeaponData.AmmoType.IsSet()); + Assert.Equal(crates, ship.CargoBays.Sum(bay => bay.Cargo.Keys.OfType<SimpleCommodity>().Sum(c => c.Quantity))); + } + // A scenario that authors a fit's cargo (stage.Cargo) gets exactly that cargo: its author named what the hold holds, so no crates are added. // Kills: stocking that ignores authored cargo and puts missiles into a scenario whose check counts what the hold carries. [Fact] From 1013e2a2e4450a29be11701ed615ac009772a56d Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 04:35:18 +0000 Subject: [PATCH 027/108] Test: the Economy console-never-written probes keep only the calling thread's writes The two tests capture Console.Out to prove the commands write to the writer they are given. Console is process-global, so in a full-suite run other tests' diagnostic prints landed in the capture and failed the author dry-run test. ConsoleProbe keeps only writes made on the thread running the command, and serialises probes so two cannot restore each other's writer. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../EconomyCommandTests.cs | 52 ++++++++++++++----- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/EconomyCommandTests.cs b/tests/Aetheria.Shared.Tests/EconomyCommandTests.cs index c0c04f89c..ec1010812 100644 --- a/tests/Aetheria.Shared.Tests/EconomyCommandTests.cs +++ b/tests/Aetheria.Shared.Tests/EconomyCommandTests.cs @@ -5,6 +5,38 @@ using System.Linq; using GameCult.Caching; using Xunit; +// What the calling thread writes to Console while an action runs. Console is process-global and tests run in parallel, so a plain +// SetOut capture also collects other tests' diagnostic prints (the race that failed these tests in full-suite runs): the probe +// keeps only writes made on the thread that runs the action, and the gate keeps two probes from restoring each other's writer. +internal static class ConsoleProbe +{ + private static readonly object Gate = new object(); + + public static string WrittenBy(Action act) + { + lock (Gate) + { + var previous = Console.Out; + var probe = new ThreadWriter(Environment.CurrentManagedThreadId); + Console.SetOut(probe); + try { act(); } + finally { Console.SetOut(previous); } + return probe.Mine.ToString(); + } + } + + private sealed class ThreadWriter : TextWriter + { + private readonly int _thread; + public readonly System.Text.StringBuilder Mine = new System.Text.StringBuilder(); + public ThreadWriter(int thread) => _thread = thread; + public override System.Text.Encoding Encoding => System.Text.Encoding.UTF8; + public override void Write(char value) { if (Environment.CurrentManagedThreadId == _thread) lock (Mine) Mine.Append(value); } + public override void Write(string value) { if (Environment.CurrentManagedThreadId == _thread) lock (Mine) Mine.Append(value); } + public override void Write(char[] buffer, int index, int count) { if (Environment.CurrentManagedThreadId == _thread) lock (Mine) Mine.Append(buffer, index, count); } + } +} + public sealed class EconomyCommandTests { private sealed class Lambda : EconomyBatch @@ -286,17 +318,13 @@ public sealed class EconomyCommandTests using var db = AetherDb.Open(); var expected = new StringWriter(); var expectedCode = EconomyCommand.Report(db.Cache, expected); - var console = new StringWriter(); - var previous = Console.Out; - Console.SetOut(console); var output = new StringWriter(); - int code; - try { code = EconomyCommand.Run(new[] { "report" }, output); } - finally { Console.SetOut(previous); } + int code = 0; + var console = ConsoleProbe.WrittenBy(() => code = EconomyCommand.Run(new[] { "report" }, output)); Assert.Equal(expectedCode, code); Assert.NotEmpty(expected.ToString()); Assert.Equal(expected.ToString(), output.ToString()); - Assert.Empty(console.ToString()); + Assert.Empty(console); } [Fact] @@ -306,17 +334,13 @@ public sealed class EconomyCommandTests var before = File.ReadAllBytes(path); var expected = new StringWriter(); var expectedCode = EconomyCommand.Author(path, new EconomyBatch[] { new Munitions() }, false, expected); - var console = new StringWriter(); - var previous = Console.Out; - Console.SetOut(console); var output = new StringWriter(); - int code; - try { code = EconomyCommand.Run(new[] { "author", "Munitions" }, output); } - finally { Console.SetOut(previous); } + int code = 0; + var console = ConsoleProbe.WrittenBy(() => code = EconomyCommand.Run(new[] { "author", "Munitions" }, output)); Assert.Equal(expectedCode, code); Assert.NotEmpty(expected.ToString()); Assert.Equal(expected.ToString(), output.ToString()); - Assert.Empty(console.ToString()); + Assert.Empty(console); Assert.Equal(before, File.ReadAllBytes(path)); } From ac45a5c836a6e14704d39186e4db46dcfd3c626f Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 04:35:18 +0000 Subject: [PATCH 028/108] AetherDb: mining and volatiles descriptions name Diamond and Ammonia; the ExtractionKindDescriptions batch restates them Every commodity a kind extracts (a recipe with no inputs) is named in that kind's description: checked over the shipped catalog, only these two kinds broke it. The batch applies in the catalog commit that follows; until then the catalog tests for it fail. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../StationKindDescriptionTests.cs | 37 +++++++++++++++++++ .../Economy/ExtractionKindDescriptions.cs | 24 ++++++++++++ tools/AetherDb/StationKindsCatalog.cs | 7 +++- 3 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/StationKindDescriptionTests.cs create mode 100644 tools/AetherDb/Economy/ExtractionKindDescriptions.cs diff --git a/tests/Aetheria.Shared.Tests/StationKindDescriptionTests.cs b/tests/Aetheria.Shared.Tests/StationKindDescriptionTests.cs new file mode 100644 index 000000000..234df007a --- /dev/null +++ b/tests/Aetheria.Shared.Tests/StationKindDescriptionTests.cs @@ -0,0 +1,37 @@ +using System.Linq; +using GameCult.Caching; +using Xunit; + +// A station kind's description is what a player and a planner read of what it does; the recipes at the kind are what it does. +public sealed class StationKindDescriptionTests +{ + // Every good the shipped catalog extracts at a station kind (a commodity recipe with no inputs; a gear recipe is a design on offer, not raw) is named in that kind's description. + // Kills: a kind that gains an extraction recipe (Diamond at mining, Ammonia at volatiles) while its description still lists the old set. + [Fact] + public void EveryRawGoodAKindExtractsIsNamedInItsDescription() + { + using var db = AetherDb.Open(); + var cache = db.Cache; + var unnamed = cache.GetAll<RecipeData>().Where(recipe => recipe.Inputs.Count == 0 && recipe.StationKind.IsSet()) + .Select(recipe => (Kind: cache.Get(recipe.StationKind), Output: cache.Get(recipe.Output))) + .Where(pair => pair.Kind != null && (pair.Output is SimpleCommodityData || pair.Output is CompoundCommodityData) && !pair.Kind.Description.Contains(pair.Output.Name)) + .Select(pair => $"{pair.Kind.Name} extracts {pair.Output.Name}, which its description omits") + .Distinct().OrderBy(line => line).ToList(); + Assert.True(unnamed.Count == 0, string.Join("\n", unnamed)); + } + + // The two kinds the rule was cut for, by name, so the rule cannot pass by the catalog having lost the recipes. + [Fact] + public void MiningExtractsDiamondAndVolatilesAmmonia() + { + using var db = AetherDb.Open(); + var cache = db.Cache; + string Extracted(string kindId) => string.Join(",", cache.GetAll<RecipeData>() + .Where(recipe => recipe.Inputs.Count == 0 && recipe.StationKind.IsSet() && recipe.StationKind.Key.Equals(StationKindData.KeyOf(kindId))) + .Select(recipe => cache.Get(recipe.Output).Name)); + Assert.Contains("Diamond", Extracted("mining")); + Assert.Contains("Ammonia", Extracted("volatiles")); + Assert.Contains("Diamond", cache.Get<StationKindData>(StationKindData.KeyOf("mining")).Description); + Assert.Contains("Ammonia", cache.Get<StationKindData>(StationKindData.KeyOf("volatiles")).Description); + } +} diff --git a/tools/AetherDb/Economy/ExtractionKindDescriptions.cs b/tools/AetherDb/Economy/ExtractionKindDescriptions.cs new file mode 100644 index 000000000..b581af0d0 --- /dev/null +++ b/tools/AetherDb/Economy/ExtractionKindDescriptions.cs @@ -0,0 +1,24 @@ +using System; +using GameCult.Caching; + +// Economy content, batch 1c: the mining and volatiles station-kind descriptions name every good their kind now extracts. +// MunitionsFeed gave mining a Diamond recipe and volatiles an Ammonia recipe; the descriptions the station-round bench +// wrote predate them. The same text is StationKindsCatalog.Table's, so a catalog authored fresh says the same thing. +// Sets the description whatever it was, so a rerun converges. +public sealed class ExtractionKindDescriptions : EconomyBatch +{ + public override void Author(EconomyAuthor author) + { + foreach (var (id, description) in new[] + { + ("mining", StationKindsCatalog.DescriptionOf("mining")), + ("volatiles", StationKindsCatalog.DescriptionOf("volatiles")), + }) + { + var key = StationKindData.KeyOf(id); + var kind = author.Catalog.Get<StationKindData>(key) ?? throw new InvalidOperationException($"The catalog holds no station kind '{id}'."); + kind.Description = description; + author.Put(kind, key); + } + } +} diff --git a/tools/AetherDb/StationKindsCatalog.cs b/tools/AetherDb/StationKindsCatalog.cs index a450d2ff7..81e5aee4d 100644 --- a/tools/AetherDb/StationKindsCatalog.cs +++ b/tools/AetherDb/StationKindsCatalog.cs @@ -14,8 +14,8 @@ public static class StationKindsCatalog private static readonly (string id, string name, string description)[] Table = { - ("mining", "Mining Station", "Extracts ore (Rock, New Metals, Gold, Uranium, Potassium) from bodies and belts; consumes tools and food."), - ("volatiles", "Volatiles Station", "Skims Hydrogen, Methane and Water from gas giants and ice; consumes tools."), + ("mining", "Mining Station", "Extracts ore (Rock, New Metals, Gold, Uranium, Potassium) and Diamond from bodies and belts; consumes tools and food."), + ("volatiles", "Volatiles Station", "Skims Hydrogen, Methane, Ammonia and Water from gas giants and ice; consumes tools."), ("agriculture", "Agriculture Station", "Grows Organics (Algae, Fungi, Bacteria, Animal Products) from Water and Potassium; feeds residential."), ("processing", "Processing Station", "Refines ore and volatiles into Metals, Alloys and Compounds."), ("fabrication", "Fabrication Station", "Turns Alloys and Compounds into Manufacturing compounds, Assemblies, gear, Ammo and consumer goods."), @@ -33,6 +33,9 @@ public static class StationKindsCatalog ("waystation", "Waystation", "Fuel, repair and medicine along a corridor."), }; + // A kind's authored description: the one text a fresh catalog gets and an economy batch restates. + public static string DescriptionOf(string id) => Table.Single(row => row.id == id).description; + public static int Run(CultCache cache, bool apply, TextWriter output) { var held = cache.GetAll<StationKindData>().Select(kind => cache.RefOf(kind).Key.Value).ToHashSet(StringComparer.Ordinal); From 908712b2eef6e4151fcc44da8f21733697c316f8 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 04:36:56 +0000 Subject: [PATCH 029/108] HUD: a weapon says what its ammunition label shows; a beam reads its reserve alone ConstantWeapon names an AmmoType but has no magazine (a crate per AmmoInterval straight from the cargo), so the label printed its unfilled magazine ("1/N"). Weapon.AmmoReadout owns the label's text, HasMagazine says whether there is a magazine to show, and SchematicDisplay reads it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../ServerShared/Behaviors/ConstantWeapon.cs | 1 + .../Scripts/ServerShared/Behaviors/Weapon.cs | 6 ++++ Assets/Scripts/UI/HUD/SchematicDisplay.cs | 2 +- .../AmmunitionStockingTests.cs | 28 +++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/ServerShared/Behaviors/ConstantWeapon.cs b/Assets/Scripts/ServerShared/Behaviors/ConstantWeapon.cs index b90a124da..8e44075ed 100644 --- a/Assets/Scripts/ServerShared/Behaviors/ConstantWeapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/ConstantWeapon.cs @@ -46,6 +46,7 @@ public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior, IPowerC { get => _ammo; } + public override bool HasMagazine => false; public float Progress { diff --git a/Assets/Scripts/ServerShared/Behaviors/Weapon.cs b/Assets/Scripts/ServerShared/Behaviors/Weapon.cs index 62e4f4b14..f4cb9bc07 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Weapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Weapon.cs @@ -104,6 +104,12 @@ public abstract class Weapon : ActivatedBehavior public abstract int Ammo { get; } // Rounds in the ship's cargo that reload this weapon's magazine: crates of AmmoType, 0 when the weapon draws none. public int Reserve => _data.AmmoType.IsSet() ? Entity.CountItemsInCargo(_data.AmmoType.Key) : 0; + // Whether Ammo counts a magazine. A weapon that names an AmmoType and fires from one (InstantWeapon) does; a beam (ConstantWeapon) draws one + // crate per AmmoInterval straight from the cargo and has none. + public virtual bool HasMagazine => true; + // What the HUD's ammunition label shows: "magazine/reserve" for a magazine weapon, the reserve alone for one without a magazine, empty when + // the weapon draws no ammunition. The one rule the HUD reads, so the label cannot show a magazine a weapon does not have. + public string AmmoReadout => !_data.AmmoType.IsSet() ? "" : HasMagazine ? $"{Ammo}/{Reserve}" : Reserve.ToString(); public WeaponData WeaponData => _data; public float RangeFactor(float at) => WeaponData.RangeFactor(MinRange, EffectiveRange, Range, _data.DamageAtMaxRange, at); diff --git a/Assets/Scripts/UI/HUD/SchematicDisplay.cs b/Assets/Scripts/UI/HUD/SchematicDisplay.cs index 526a83c80..ac49c1297 100644 --- a/Assets/Scripts/UI/HUD/SchematicDisplay.cs +++ b/Assets/Scripts/UI/HUD/SchematicDisplay.cs @@ -234,7 +234,7 @@ public class SchematicDisplay : MonoBehaviour x.ListElement.CooldownFill.anchorMax = new Vector2(x.Cooldown.Progress, 1); x.ListElement.DurabilityLabel.text = $"{(int)(x.Row.Item.EquippableItem.Durability / itemData.Durability * 100)}%"; if (x.Weapon.WeaponData.AmmoType.IsSet()) - x.ListElement.AmmoLabel.text = $"{x.Weapon.Ammo}/{x.Weapon.Reserve}"; + x.ListElement.AmmoLabel.text = x.Weapon.AmmoReadout; } if (x.ListElement.RangeLabel) diff --git a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs index a5e7e53c9..2a52e1535 100644 --- a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs +++ b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs @@ -166,4 +166,32 @@ public sealed partial class RunStartTests } Assert.True(fed > 0, "fixture: some new-run player ship carries an ammunition-fed weapon"); } + + // The HUD's ammunition label (Weapon.AmmoReadout): a magazine gun reads "magazine/reserve", a beam that names an AmmoType has no magazine (it + // draws a crate per interval) and reads its reserve alone, a weapon that draws nothing reads empty. Kills: a label that prints the beam's + // never-filled magazine as "0/N", or one that drops the magazine from a gun's. + [Fact] + public void TheAmmoLabelShowsAMagazineOnlyForAWeaponThatHasOne() + { + var (hull, _) = FedFit(bay: true); + var rounds = _cache.GetAll<WeaponItemData>().Single(item => item.Name == "Fed Gun").Behaviors.OfType<WeaponData>().Single().AmmoType; + _cache.Upsert(new WeaponItemData + { + Name = "Fed Beam", Hardpoint = HardpointType.Tool, Shape = new Shape(), Durability = 1, + Behaviors = { new ConstantWeaponData { AmmoType = rounds } } + }); + EquippableItemData Design(string name) => _cache.GetAll<EquippableItemData>().Single(item => item.Name == name); + var loadout = new Loadout { Name = "label", Hull = _cache.RefOf(_cache.GetAll<HullData>().Single(h => h.Name == hull)), WeaponGroups = new int[0][] }; + foreach (var (name, x) in new[] { ("Fed Gun", 3), ("Fed Beam", 2), ("Plain Gun", 1), ("Fed Bay", 4) }) + loadout.Slots.Add(new LoadoutSlot { Position = int2(x, 3), Rotation = ItemRotation.None, Design = _cache.RefOf(Design(name)) }); + var failures = new List<string>(); + var ship = Loadouts.Materialize(_items, null, loadout, _ => null, failures); + Assert.True(failures.Count == 0, string.Join("; ", failures)); + + string Label(string name) => ship.Weapons.Single(weapon => _items.GetData(weapon.Item.EquippableItem).Name == name).AmmoReadout; + var reserve = LoadoutGenerator.AmmunitionCrates; + Assert.Equal(reserve.ToString(), Label("Fed Beam")); + Assert.Equal($"{ship.Weapons.Single(w => _items.GetData(w.Item.EquippableItem).Name == "Fed Gun").Ammo}/{reserve}", Label("Fed Gun")); + Assert.Equal("", Label("Plain Gun")); + } } From bd3563dee3b9936c965b0412a505f092b980c2cc Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 04:44:31 +0000 Subject: [PATCH 030/108] Scenarios: the Arcs turret and the Pursuit player carry the crates their guns reload from Arcs' hostile turret fits two 100-round Light Machine Guns and had no hold, so it fell silent after one magazine; it now fits a bay and carries 30 crates of Ammo (about 8 minutes of both guns firing without pause). Pursuit's authored cargo had no Mines, capping the player at one magazine of six; it now carries 10 crates (sixty-six mines). ScenarioStage.Cargo admits a commodity name as one unit, so authored cargo can state crates. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/ScenarioStage.cs | 10 ++- Assets/Scripts/ServerShared/Scenarios/Arcs.cs | 9 ++- .../Scripts/ServerShared/Scenarios/Pursuit.cs | 5 +- .../ScenarioAmmunitionTests.cs | 67 +++++++++++++++++++ 4 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/ScenarioAmmunitionTests.cs diff --git a/Assets/Scripts/ServerShared/ScenarioStage.cs b/Assets/Scripts/ServerShared/ScenarioStage.cs index a813bbf49..b7a19b87f 100644 --- a/Assets/Scripts/ServerShared/ScenarioStage.cs +++ b/Assets/Scripts/ServerShared/ScenarioStage.cs @@ -168,7 +168,8 @@ public sealed class ScenarioStage } // Items in the entity's first cargo bay, one per name. A name is an equippable or consumable design (open: the stage - // chooses its product) or a product of one (pinned); a name that is neither is a failure. + // chooses its product) or a product of one (pinned), or a commodity (one unit: the crates an AmmoType weapon reloads + // from); a name that is none of these is a failure. public void Cargo(Entity entity, params string[] names) { if (entity == null) return; @@ -177,6 +178,13 @@ public sealed class ScenarioStage var bay = entity.CargoBays.FirstOrDefault(); foreach (var name in names) { + var commodity = _items.ItemData.GetAll<SimpleCommodityData>().FirstOrDefault(data => data.Name == name); + if (commodity != null) + { + if (bay == null || !bay.TryStore(new SimpleCommodity { Data = new CultRecordRef<ItemData>(_items.ItemData.RefOf<ItemData>(commodity).Key), Quantity = 1 })) + _failures.Add($"{where}: no room for {name}"); + continue; + } var (data, product) = NamedOrProduct<CraftedItemData>(name, where, found => found is EquippableItemData || found is ConsumableItemData); if (data == null) continue; var build = Loadouts.Resolve(_items, _items.ItemData.RefOf(data), diff --git a/Assets/Scripts/ServerShared/Scenarios/Arcs.cs b/Assets/Scripts/ServerShared/Scenarios/Arcs.cs index f0c3f5553..fd5076075 100644 --- a/Assets/Scripts/ServerShared/Scenarios/Arcs.cs +++ b/Assets/Scripts/ServerShared/Scenarios/Arcs.cs @@ -1,3 +1,4 @@ +using System.Linq; using static CultMath.math; using static ItemRotation; @@ -20,6 +21,8 @@ public sealed class Arcs : Scenario public static readonly CultMath.float2 Bow = float2(0, 400), Stern = float2(0, -400), Turret = float2(600, 300), Port = float2(-400, 0), Starboard = float2(400, 0); + public const int TurretAmmoCrates = 30; + public override Galaxy Generate(GalaxyStage stage) => stage.Prelude(); public override void Stage(ScenarioStage stage) @@ -49,12 +52,14 @@ public sealed class Arcs : Scenario ("Compact Reactor", int2(3, 3), None), ("Turret Control Module", int2(3, 5), None), ("not if i see you first", int2(4, 5), None), // Compact Sensor - ("Panopticon Prime", int2(3, 6), None)); // Fire Control Array + ("Panopticon Prime", int2(3, 6), None), // Fire Control Array + ("Store-All Plus", int2(3, 1), None)); // Cargo Bay: the only 2x2 the turret hull has free stage.Player(fighter, float2(0, 0), facing: float2(0, 1)); stage.Place(stage.Bare("Longinus"), Bow); stage.Place(stage.Bare("Longinus"), Stern); - stage.Place(turret, Turret, stance: ScenarioStance.Hostile); + // The turret's guns reload from its hold, a crate of Ammo per 100-round magazine: both guns firing without pause spend about 3.5 crates a minute, so 30 outlast any session. + stage.Cargo(stage.Place(turret, Turret, stance: ScenarioStance.Hostile), Enumerable.Repeat("Ammo", TurretAmmoCrates).ToArray()); stage.Place(stage.Bare("Longinus"), Port); stage.Place(stage.Bare("Longinus"), Starboard); } diff --git a/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs b/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs index d6d630a88..20ad157a1 100644 --- a/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs +++ b/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs @@ -1,3 +1,4 @@ +using System.Linq; using static CultMath.math; using static ItemRotation; @@ -7,6 +8,7 @@ public sealed class Pursuit : Scenario // cloud breaking a sensor's lock, and well outside the 40 at which AStrongCloseSensorBurnsThrough shows a close // sensor burning through. private const float Astern = 300; + public const int MineCrates = 10; public override string Name => "Pursuit"; public override string Id => "pursuit"; @@ -55,7 +57,8 @@ public sealed class Pursuit : Scenario ("Store-All Plus", int2(2, 8), None)); // Cargo Bay var player = stage.Player(layer, float2(0, 0), facing: float2(0, 1)); - stage.Cargo(player, "Morning Fog", "Morning Fog", "Morning Fog", "send it", "send it"); + // The Mine Launcher reloads a magazine of six from a crate of Mines: ten crates are sixty-six mines, minutes of laying at its cooldown, more than a chase lasts. + stage.Cargo(player, new[] { "Morning Fog", "Morning Fog", "Morning Fog", "send it", "send it" }.Concat(Enumerable.Repeat("Mines", MineCrates)).ToArray()); stage.Place(pursuer, float2(0, -Astern), facing: float2(0, 1), stance: ScenarioStance.Hostile, piloted: true); } } diff --git a/tests/Aetheria.Shared.Tests/ScenarioAmmunitionTests.cs b/tests/Aetheria.Shared.Tests/ScenarioAmmunitionTests.cs new file mode 100644 index 000000000..740e793a2 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/ScenarioAmmunitionTests.cs @@ -0,0 +1,67 @@ +using System.Collections.Generic; +using System.Linq; +using UniRx; +using Xunit; + +// Scenarios that author a weapon's ammunition-fed crates in a hold (ruling ballistics-real-ammo): the staged hold is what the weapon reloads from, so a +// scenario whose check rests on a weapon firing past its first magazine states the crates it needs. Each test launches through the production path. +public sealed partial class RunStartTests +{ + // The Arcs turret fits two Light Machine Guns of a hundred rounds and a bay of Ammo: its hold holds what the scenario states, and across a minute + // in range of the player it fires past both first magazines, each reload taking a crate. Kills: a turret fit without a bay or with no authored + // crates (silent after one magazine), and Cargo failing to admit a commodity. + [Fact] + public void TheArcsTurretKeepsFiringPastItsFirstMagazine() + { + var (_, arena, staged, failures) = Launch(new Arcs(), Inputs(() => GalaxySeed)); + Assert.Empty(failures); + var player = staged.Player; + var turret = Assert.IsType<OrbitalEntity>(staged.Entities[2]); + var guns = turret.Weapons.ToList(); + Assert.Equal(2, guns.Count); + var ammo = guns[0].WeaponData.AmmoType.Key; + Assert.Equal(Arcs.TurretAmmoCrates, turret.CountItemsInCargo(ammo)); + + // The guns are Auto weapons: they fire on a hostile inside their range (400 m) with no pilot. The player starts 775 m off, so it flies up to 200 m. + arena.Update(0); + player.Position = turret.Position + new CultMath.float3(-200, 0, 0); + var shots = 0; + using var sub = arena.ShotCommitted.Subscribe(outcome => { if (ReferenceEquals(outcome.Source, turret)) shots++; }); + for (var tick = 0; tick < System.MathF.Round(60f / SimClock.GameStep); tick++) arena.Update(SimClock.GameStep); + + var firstMagazines = guns.Sum(gun => gun.WeaponData.MagazineSize); + Assert.True(shots > firstMagazines, $"the turret fired {shots} rounds, no more than its two first magazines of {firstMagazines}"); + Assert.True(turret.CountItemsInCargo(ammo) < Arcs.TurretAmmoCrates, "the turret reloaded without taking a crate"); + } + + // The Pursuit player's Mine Launcher draws its magazine of six from crates of Mines it carries beside the consumables: it lays past six, and the + // crate count falls by one per reload. Kills: authored cargo with no Mines (at most six mines), a reload that takes no crate. + [Fact] + public void ThePursuitPlayerLaysMoreThanOneMagazineOfMinesFromItsCrates() + { + var (_, arena, staged, failures) = Launch(new Pursuit(), Inputs(() => GalaxySeed)); + Assert.Empty(failures); + var player = staged.Player; + var launcher = player.Weapons.Single(weapon => weapon.WeaponData is MineLayerData); + var mines = launcher.WeaponData.AmmoType.Key; + Assert.Equal(Pursuit.MineCrates, player.CountItemsInCargo(mines)); + Assert.Equal(3, HeldOf(player, "Coolant Vent")); + + arena.Update(0); + var laid = 0; + using var sub = arena.Mines.ObserveAdd().Subscribe(_ => laid++); + var reloaded = new List<int>(); + var last = Pursuit.MineCrates; + for (var tick = 0; tick < System.MathF.Round(120f / SimClock.GameStep) && laid <= 18; tick++) + { + launcher.Activate(); + arena.Update(SimClock.GameStep); + var crates = player.CountItemsInCargo(mines); + if (crates != last) { reloaded.Add(last - crates); last = crates; } + } + + Assert.True(laid > launcher.WeaponData.MagazineSize, $"the player laid {laid} mines, no more than one magazine of {launcher.WeaponData.MagazineSize}"); + Assert.NotEmpty(reloaded); + Assert.All(reloaded, step => Assert.Equal(1, step)); + } +} From 0e9b10c3ae9bdb26cb026bf64c8a2d8d716a5d84 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 05:03:57 +0000 Subject: [PATCH 031/108] Crossing: the crosser is launched at the speed it should cross at, since a hull no longer decays below top speed 845f6c3aa (aetheria-gravity:ruling:no-drag-below-top-speed) removed hull drag below a hull's top speed. The crosser was staged at the Djinni's 50 m/s cap on the premise that drag slowed it to ~25 m/s at the bow line; it now holds 50 m/s and crosses at 2.57 s, 50 m/s relative, 1.1 rad/s, outside the tuned encounter (3.6 s, 25 m/s, 0.56 rad/s) that the Brief, the pass window and CrossingHoldsAcrossTheStartWindow all describe. CrossingConditions and CrossingHoldsAcrossTheStartWindow failed on that stale tuning, not on a defect. The encounter is restaged to reproduce its tuning under the ruled physics: launched at 25 m/s from 90 m out (probed over speed x start; constant-speed passes are dx / v seconds, 45 m ahead). The pass lands at 3.63 s, 44.7 m, 24.9 m/s relative, 0.56 rad/s. The test's launch-speed assertions now pin the scenario's 25 m/s instead of "most of the cap"; the time, distance, relative-speed and angular-rate windows are unchanged. If drag below top speed returns, the crosser decays and the pass leaves the window. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Scenarios/Crossing.cs | 12 +++++++----- tests/Aetheria.Shared.Tests/CrossingScenarioTests.cs | 10 +++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Assets/Scripts/ServerShared/Scenarios/Crossing.cs b/Assets/Scripts/ServerShared/Scenarios/Crossing.cs index 61529d6d9..e77f50166 100644 --- a/Assets/Scripts/ServerShared/Scenarios/Crossing.cs +++ b/Assets/Scripts/ServerShared/Scenarios/Crossing.cs @@ -6,8 +6,8 @@ public sealed class Crossing : Scenario public override string Name => "Crossing"; public override string Id => "crossing"; public override string Brief => "A Lightning Projector at the starboard gun and a Cell Blaster at the port gun, an unpiloted Djinni coasting across the bow " + - "close ahead and an unpiloted one waiting at range. The crosser is launched to port at 50 m/s and only coasts: nothing steers it, " + - "its hull drag slows it to about 25 m/s at the bow line, and it does not shoot back. Make the pass coasting: give no throttle until the Djinni has crossed the bow, then fly freely " + + "close ahead and an unpiloted one waiting at range. The crosser is launched to port at 25 m/s and only coasts: nothing steers it, " + + "a hull coasts at its launch speed below its top speed, and it does not shoot back. Make the pass coasting: give no throttle until the Djinni has crossed the bow, then fly freely " + "(thrusting from the start carries you past it). Verify: as the Djinni crosses close, FastBlast lands some and projector " + "almost none; against the Djinni at range both land. Fly it again without the Fire Control Array: " + "with it the small gun lands more."; @@ -16,13 +16,15 @@ public sealed class Crossing : Scenario // Where the Djinni sit: the player is at Origin facing +z. Origin is 250 m or more from every body, where the zone's // pull is weakest (about 1.4 u/s^2; the sum of the wells never drops to nothing, and at the old origin the player sat on the star). - // The crosser is unpiloted and placed moving at the Djinni's 50 m/s cap, so its pass is ballistic: bent by the field and slowed - // by hull drag (it reaches the bow line at about 25 m/s relative to the player, 3.6 s in), and nothing steers it. + // The crosser is unpiloted and placed moving at 25 m/s, well under the Djinni's 50 m/s top speed, so its pass is ballistic: a hull + // coasts below its top speed (aetheria-gravity:ruling:no-drag-below-top-speed) and only the field bends it, so it reaches the + // bow line at 25 m/s relative to the player, 3.6 s in, and nothing steers it. (Launched at the cap with drag slowing it to 25 m/s, + // as this scenario was first tuned, it would now hold 50 m/s and cross in 2.6 s.) // CrosserAt is the centre of the start window in which the pass holds: shifting it by 10 m along either axis keeps the pass // inside the test's time and distance windows (CrossingHoldsAcrossTheStartWindow). // The waiting Djinni sits inside the Lightning Projector's arc at 80% of its Range. public static readonly CultMath.float2 Origin = float2(724, 124); - public static readonly CultMath.float2 CrosserAt = Origin + float2(-128, 45), CrosserFacing = float2(1, 0), CrosserVelocity = float2(50, 0); + public static readonly CultMath.float2 CrosserAt = Origin + float2(-90, 45), CrosserFacing = float2(1, 0), CrosserVelocity = float2(25, 0); // The fighter is staged at this quality, so its gear and the range below do not ride the item stream. public const float StagedQuality = .6f; // The Lightning Projector's Range in metres at the staged fit: 996.99 after the three seconds the test settles for diff --git a/tests/Aetheria.Shared.Tests/CrossingScenarioTests.cs b/tests/Aetheria.Shared.Tests/CrossingScenarioTests.cs index 9c827b968..efaa4998d 100644 --- a/tests/Aetheria.Shared.Tests/CrossingScenarioTests.cs +++ b/tests/Aetheria.Shared.Tests/CrossingScenarioTests.cs @@ -10,7 +10,7 @@ using float3 = CultMath.float3; public sealed partial class RunStartTests { // Crossing: the demo's cast; projector and Cell Blaster fitted in separate weapon groups with the Fire Control Array - // aboard; an unpiloted hostile Djinni, coasting at the Djinni's speed cap, that crosses the bow inside 400 m; and an unpiloted neutral one inside the Lightning Projector's + // aboard; an unpiloted hostile Djinni, coasting at 25 m/s, that crosses the bow inside 400 m; and an unpiloted neutral one inside the Lightning Projector's // arc, short of its Range and beyond three quarters of it. [Fact] public void CrossingConditions() @@ -43,12 +43,12 @@ public sealed partial class RunStartTests Assert.True(toCrosser.z > 0, "the crosser starts ahead"); Assert.True(abs(dot(crosser.Direction, player.Direction)) <= sin(radians(30f)) + 1e-4f, "the crosser faces within 30 degrees of perpendicular to the player's bow"); - // It is placed moving: toward the bow line at most of the Djinni's 50 m/s cap, so its run is its own and not only the + // It is placed moving: toward the bow line at the scenario's 25 m/s, so its run is its own and not only the // arena's pull on the player. var crosserVelocity = ((Ship) crosser).Velocity; Assert.True(crosserVelocity.x * toCrosser.x < 0, "the crosser starts moving toward the bow line"); - Assert.True(abs(crosserVelocity.x) >= 40f, "the crosser's speed toward the bow line is most of the Djinni's speed cap"); - Assert.True(length(crosserVelocity) >= 40f, "the crosser starts at most of the Djinni's speed cap"); + Assert.Equal(25f, abs(crosserVelocity.x), 3); + Assert.Equal(25f, length(crosserVelocity), 3); Assert.False(player.IsHostileTo(waiting) || waiting.IsHostileTo(player), "the waiting Djinni is neutral"); Assert.Equal(0, AgentsOf(arena, waiting)); @@ -71,7 +71,7 @@ public sealed partial class RunStartTests Assert.True(length(pass.Ahead) < CrossingMetres, "the crosser passes inside the stated distance"); Assert.True(FireControl.InArc(small, float3(pass.Ahead.x, 0, pass.Ahead.y)), "Cell Blaster bears on the crosser as it crosses"); Assert.True(dot(FireControl.MountDirection(small), float3(player.Direction.x, 0, player.Direction.y)) > 0, "Cell Blaster mounts forward"); - // At seed 112 with no input the pass is at about 3.6 s and 45 m; a seed, field or staging change that loses it moves these. + // At seed 112 with no input the pass is at about 3.6 s and 45 m, at 25 m/s relative (a hull under its top speed coasts, so the launch speed holds); a seed, field or staging change that loses it moves these. Assert.InRange(pass.Seconds, CrossingEarliest, CrossingLatest); Assert.InRange(length(pass.Ahead), 30f, 60f); } From b2a2da9d2754f0ba845d699c69239f52539178cf Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 05:06:09 +0000 Subject: [PATCH 032/108] MiningCut3Tests: ChunkInfo's pinned bits are per host class; the Linux bits are the base's own ChunkInfoIsBitIdenticalToItsValueBeforeTheExtraction never passed on Linux: at c86f28e93 (the commit that added it) it already measures 1039274088 for the second observer where the recording says 1039274086, and base 12dfcef5, the code the recording claims to be taken from, measures the same ...088 on Linux (CultMath 0.4.1 and 0.5.0 alike). The sensor's bearing term (acos, curve) is libm arithmetic, which rounds differently on Windows, where the recording was made. It is a host-class recording read as universal, not a regression: no commit moved it. The pin is now per host class like the two-AI digest (ruling replays-per-host-class): windows-x64 keeps the original recording, linux-x64 is base 12dfcef5 run on Linux, and the current code equals it. A host with no recording fails and prints its bits. RunStartTests.HostClass is now internal, the one host-class name. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../DeterminismLedgerTests.cs | 2 +- tests/Aetheria.Shared.Tests/MiningCut3Tests.cs | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs b/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs index 6029d3647..aafadcbbd 100644 --- a/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs +++ b/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs @@ -255,7 +255,7 @@ public sealed partial class RunStartTests Assert.Equal(first.digest, second.digest); } - private static string HostClass() => + internal static string HostClass() => (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? "linux" : RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "windows" : RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "osx" : "other") diff --git a/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs b/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs index 5ac322c01..dc6ffd628 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs @@ -308,9 +308,17 @@ public sealed partial class MiningCut3Tests : IDisposable // ChunkInfo's value is not changed by moving its arithmetic under PassiveInfo: six observers at different // places and bearings, one with a second sensor so the average is live, read the same chunk, and every value - // matches the bits recorded at base 12dfcef5, before the extraction (a different order of the multiplication - // by the chunk's brightness moves them in the last bits). - private static readonly uint[] ChunkInfoAtBase = new uint[] { 1045120030u, 1039274086u, 1030543422u, 1029120970u, 1036363351u, 1035122917u }; + // matches the bits the code before the extraction (base 12dfcef5) gives on the same host class (a different order of + // the multiplication by the chunk's brightness moves them in the last bits). The bits are per host class because + // the sensor's bearing term (acos, curve) is libm arithmetic, which rounds differently on Windows and Linux; replays + // are trusted only on the host class that recorded them (ruling replays-per-host-class). windows-x64 is the recording the + // test was written with; linux-x64 is base 12dfcef5 run on Linux, which gives 1039274088 where Windows gave 1039274086 for + // the second observer, and the current code gives the same bits as that base. + private static readonly System.Collections.Generic.Dictionary<string, uint[]> ChunkInfoAtBase = new() + { + ["windows-x64"] = new uint[] { 1045120030u, 1039274086u, 1030543422u, 1029120970u, 1036363351u, 1035122917u }, + ["linux-x64"] = new uint[] { 1045120030u, 1039274088u, 1030543422u, 1029120970u, 1036363351u, 1035122917u }, + }; [Fact] public void ChunkInfoIsBitIdenticalToItsValueBeforeTheExtraction() @@ -329,7 +337,9 @@ public sealed partial class MiningCut3Tests : IDisposable Assert.All(values, v => Assert.InRange(v, 1e-4f, .99f)); // a live, unsaturated reading at every place var actual = values.Select(Bits).ToArray(); - Assert.True(actual.SequenceEqual(ChunkInfoAtBase), "ChunkInfo bits: " + string.Join(",", actual)); + var host = RunStartTests.HostClass(); + Assert.True(ChunkInfoAtBase.TryGetValue(host, out var pinned), $"ChunkInfo bits: host class {host} has no recording; measured " + string.Join(",", actual)); + Assert.True(actual.SequenceEqual(pinned), $"ChunkInfo bits on {host}: " + string.Join(",", actual) + " pinned " + string.Join(",", pinned)); } // A chunk outside every sun's light is dark: no visibility, no info, and it cannot be picked, while a lit From 85f1a933d483728cbb330c25e07902116d6325a5 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 05:07:47 +0000 Subject: [PATCH 033/108] GetAllChildClasses: the type memo is concurrent A plain Dictionary written by parallel catalog loads corrupted itself ("Operations that change non-concurrent collections must have exclusive access") and failed unrelated tests at random, through ValidateStatModifiers. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Extensions.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Assets/Scripts/ServerShared/Extensions.cs b/Assets/Scripts/ServerShared/Extensions.cs index 97433a299..6ac7b5186 100644 --- a/Assets/Scripts/ServerShared/Extensions.cs +++ b/Assets/Scripts/ServerShared/Extensions.cs @@ -32,16 +32,13 @@ public static class Extensions // Every loadable type assignable to this one. An assembly whose dependencies are missing (a Unity plugin // referencing UnityEngine outside Unity) still yields the types that do load. - private static readonly Dictionary<Type, Type[]> ChildClasses = new Dictionary<Type, Type[]>(); - public static Type[] GetAllChildClasses(this Type type) + // Read from parallel loaders (catalog validation, parallel tests), so the memo is concurrent. + private static readonly System.Collections.Concurrent.ConcurrentDictionary<Type, Type[]> ChildClasses = new System.Collections.Concurrent.ConcurrentDictionary<Type, Type[]>(); + public static Type[] GetAllChildClasses(this Type type) => ChildClasses.GetOrAdd(type, t => AppDomain.CurrentDomain.GetAssemblies().SelectMany(assembly => { - if (ChildClasses.TryGetValue(type, out var children)) return children; - return ChildClasses[type] = AppDomain.CurrentDomain.GetAssemblies().SelectMany(assembly => - { - try { return assembly.GetTypes(); } - catch (ReflectionTypeLoadException e) { return e.Types.Where(t => t != null); } - }).Where(type.IsAssignableFrom).ToArray(); - } + try { return assembly.GetTypes(); } + catch (ReflectionTypeLoadException e) { return e.Types.Where(x => x != null); } + }).Where(t.IsAssignableFrom).ToArray()); public static string SplitCamelCase(this string str) => Regex.Replace(Regex.Replace(str, @"(\P{Ll})(\P{Ll}\p{Ll})", "$1 $2"), @"(\p{Ll})(\P{Ll})", "$1 $2"); From ee49f95843aec147342d17bff758d5f3b7b41bab Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 05:07:47 +0000 Subject: [PATCH 034/108] AetherDb economy: Author takes the scratch root; TheTrialCopyIsRemoved audits its own, not the shared temp folder The test counted aetherdb-economy-* directories in the machine's temp folder, which every parallel test running the command also writes to. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../EconomyCommandTests.cs | 17 +++++++++++++---- tools/AetherDb/EconomyCommand.cs | 7 ++++--- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/EconomyCommandTests.cs b/tests/Aetheria.Shared.Tests/EconomyCommandTests.cs index ec1010812..9319dbb1c 100644 --- a/tests/Aetheria.Shared.Tests/EconomyCommandTests.cs +++ b/tests/Aetheria.Shared.Tests/EconomyCommandTests.cs @@ -178,10 +178,19 @@ public sealed class EconomyCommandTests public void TheTrialCopyIsRemoved() { using var f = EconomyFixture.Healthy(); - var before = Directory.GetDirectories(Path.GetTempPath(), "aetherdb-economy-*").Length; - Author(f, false, out _, a => Good(f, a, "coal")); - Author(f, true, out _, a => Good(f, a, "tar", lore: "")); - Assert.Equal(before, Directory.GetDirectories(Path.GetTempPath(), "aetherdb-economy-*").Length); + // A private scratch root: the temp folder is shared with every parallel test that runs the command, so counting it races. + var scratchRoot = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "aetherdb-economy-audit-" + Guid.NewGuid().ToString("N"))).FullName; + try + { + foreach (var apply in new[] { false, true }) + { + Flush(f); + var batch = new Lambda(a => Good(f, a, apply ? "tar" : "coal", lore: apply ? "" : "a good")); + EconomyCommand.Author(f.CatalogPath, new EconomyBatch[] { batch }, apply, new StringWriter(), TestCatalog.Registry(), scratchRoot); + } + Assert.Empty(Directory.GetFileSystemEntries(scratchRoot)); + } + finally { Directory.Delete(scratchRoot, true); } } [Fact] diff --git a/tools/AetherDb/EconomyCommand.cs b/tools/AetherDb/EconomyCommand.cs index 244fc4279..cf536cd9e 100644 --- a/tools/AetherDb/EconomyCommand.cs +++ b/tools/AetherDb/EconomyCommand.cs @@ -107,15 +107,16 @@ public static class EconomyCommand // atomically, so a refusal leaves Aetheria.cc byte-identical. A batch is compiled code and is reviewed as code: it is trusted not // to touch the real file, and the command refuses by name if the file changed under it. Added, changed and unchanged are read by // comparing the original and the copy on disk. A shape fault the batches introduce (present after, absent before, by rule and - // record) refuses; faults the catalog already held print and do not. - public static int Author(string catalogPath, IReadOnlyList<EconomyBatch> batches, bool apply, TextWriter output, CultDocumentRegistry registry = null) + // record) refuses; faults the catalog already held print and do not. The trial copy lives under scratchRoot (the temp folder unless a caller + // that audits it names a private one). + public static int Author(string catalogPath, IReadOnlyList<EconomyBatch> batches, bool apply, TextWriter output, CultDocumentRegistry registry = null, string scratchRoot = null) { if (apply && new FileInfo(catalogPath).IsReadOnly) { output.WriteLine("The batches are refused: Aetheria.cc is read-only. Clear the read-only flag, or check it out, and run again. The catalog is unchanged."); return 1; } - var scratch = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "aetherdb-economy-" + Guid.NewGuid().ToString("N"))).FullName; + var scratch = Directory.CreateDirectory(Path.Combine(scratchRoot ?? Path.GetTempPath(), "aetherdb-economy-" + Guid.NewGuid().ToString("N"))).FullName; try { var trial = Path.Combine(scratch, "Aetheria.cc"); From 601ce3cc18c66392cb45ac3a3c5ea54e7e64876e Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 05:14:40 +0000 Subject: [PATCH 035/108] Catalog: mining names Diamond, volatiles names Ammonia (economy author ExtractionKindDescriptions) Applied through AetherDb: 0 added, 2 changed (station-kind:mining, station-kind:volatiles), 0 removed. economy report fault count unchanged at 126. GameData/Aetheria.cc sha256 956a1573fa2aa69d7f72861e10dd17d7d3255d114e878da81802869efcfe31e9 (before: 0f81d35d4cec8f57178220f20bca98ffaa6709783349efe3cc28aa64ea1f02b1). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- GameData/Aetheria.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GameData/Aetheria.cc b/GameData/Aetheria.cc index 553e6bcce..3bf502c21 100644 --- a/GameData/Aetheria.cc +++ b/GameData/Aetheria.cc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0f81d35d4cec8f57178220f20bca98ffaa6709783349efe3cc28aa64ea1f02b1 -size 220607 +oid sha256:956a1573fa2aa69d7f72861e10dd17d7d3255d114e878da81802869efcfe31e9 +size 220628 From 3458f0d7b3b2fe80188bb892518c2ac9e474dffa Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 05:20:46 +0000 Subject: [PATCH 036/108] TwoAiDigestIsPinned: repin linux-x64 to 52fbb10d and name the flight-model commits that moved it Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs b/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs index aafadcbbd..31b71dba0 100644 --- a/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs +++ b/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs @@ -48,7 +48,13 @@ public sealed partial class RunStartTests // go of a held weapon it no longer commands (target gone, untracked, another group the pick, Combat ended), where a held gun fired on // until a later step selected its group (the candidate change reverted: d9493bbe). Both together: the digest below. Releasing a beam or a // lock the same way (h7) moved nothing. - private const string TwoAiPinnedDigest = "85e85c46cfc66693c819dd294ad02f3cd0eae5486c8f152a97e2e2787f854274"; + // Repinned an eighth time, once (suite-honest), for the flight-model changes that landed after h6 and never repinned this + // entry (bisected on master, each intended): e0c1daa4e made ThrustScale default 0.1, 845f6c3aa removed drag below top speed, + // ffdba39ac made ThrustScale scale the push only, and 8c5a904cb pinned the fixtures to ThrustScale=1. Pull requests 8 and 9 + // moved the digest and returned it to 52fbb10d, which master already measured before this cut. The authored-cargo and + // ammunition-data blob of this cut moved nothing (52fbb10d measured with it merged in). Fixtures run ThrustScale=1 while play + // uses 0.1, so this digest pins the fight's logic, not the shipped feel. + private const string TwoAiPinnedDigest = "52fbb10df2559829a11f3a38aae0783f3f1858b0499f6f46794a267a747adacb"; private const float TwoAiSeconds = 60f; [Fact] From 036f75a0d8e68f4e77d9194ae1dc2a2d56409b22 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 05:58:27 +0000 Subject: [PATCH 037/108] CoastingTests: a ship launched below top speed keeps it at the play ThrustScale 0.1 and at 1 Reads only the ship's velocity after the zone steps; reintroducing drag below top speed fails both cases (50 -> 18.39 in 10 s). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/CoastingTests.cs | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/Aetheria.Shared.Tests/CoastingTests.cs diff --git a/tests/Aetheria.Shared.Tests/CoastingTests.cs b/tests/Aetheria.Shared.Tests/CoastingTests.cs new file mode 100644 index 000000000..56b33151e --- /dev/null +++ b/tests/Aetheria.Shared.Tests/CoastingTests.cs @@ -0,0 +1,48 @@ +using System; +using CultMath; +using Xunit; +using static CultMath.math; +using float3 = CultMath.float3; +using Random = CultMath.Random; + +// The consumer's side of aetheria-gravity:ruling:no-drag-below-top-speed: a ship launched below its hull's top speed and +// left alone keeps that speed, at the global thrust tuning the game ships with (GameplaySettings.ThrustScale 0.1) as well as +// at the fixtures' 1. Reads only the ship's velocity after the zone steps: not Drag, DragScale or any field of the fix. +// Kills: drag reintroduced below top speed, or any deceleration whose size depends on ThrustScale. +public sealed class CoastingTests +{ + private const float PlayThrustScale = .1f; // GameplaySettings.ThrustScale's default, the value play runs at + + private static float CoastedSpeed(float thrustScale, float launchSpeed, float seconds) + { + using var cache = RestoredHullsTests.OpenCatalog(); + var hull = cache.GetByName<HullData>("Longinus"); + var settings = RestoredHullsTests.Settings(); + settings.ThrustScale = thrustScale; + var items = new ItemManager(1u, cache, new ProvenanceLedger(), settings, _ => { }); + items.Random = new Random(1u); + var random = new Random(1); + var pack = new LoadoutGenerator(ref random, items, null, null, null, .5f).GenerateShipLoadout(candidate => candidate == hull); + Assert.NotNull(pack); + var zone = new Zone(items, new PlanetSettings(), new ZonePack(), new GalaxyZone { Name = "Test", Owner = null }, null); + var ship = (Ship) EntitySerializer.Unpack(items, zone, pack); + zone.Admit(ship, piloted: false); + ship.Position = float3.zero; + zone.Update(0f); + + ship.MovementDirection = float2(0, 0); + ship.Velocity = float2(0, launchSpeed); + for (var i = 0; i < (int) (seconds * 60); i++) zone.Update(1f / 60f); + return length(ship.Velocity); + } + + [Theory] + [InlineData(PlayThrustScale)] + [InlineData(1f)] + public void AShipLaunchedBelowTopSpeedKeepsItsSpeed(float thrustScale) + { + const float launch = 50f; // Longinus's top speed is 100 + var speed = CoastedSpeed(thrustScale, launch, 10f); + Assert.True(speed >= launch - .01f, $"ThrustScale {thrustScale}: launched at {launch}, coasting 10 s left it at {speed}"); + } +} From eee5f213bfa82903044cad99c31b5220c118177d Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 05:59:30 +0000 Subject: [PATCH 038/108] Ammo label visibility is Weapon.ShowsAmmoReadout: the HUD's three AmmoType.IsSet() decisions move into Shared and are tested Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Behaviors/Weapon.cs | 4 +++- Assets/Scripts/UI/HUD/SchematicDisplay.cs | 6 +++--- tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/ServerShared/Behaviors/Weapon.cs b/Assets/Scripts/ServerShared/Behaviors/Weapon.cs index f4cb9bc07..52b69d196 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Weapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Weapon.cs @@ -109,7 +109,9 @@ public abstract class Weapon : ActivatedBehavior public virtual bool HasMagazine => true; // What the HUD's ammunition label shows: "magazine/reserve" for a magazine weapon, the reserve alone for one without a magazine, empty when // the weapon draws no ammunition. The one rule the HUD reads, so the label cannot show a magazine a weapon does not have. - public string AmmoReadout => !_data.AmmoType.IsSet() ? "" : HasMagazine ? $"{Ammo}/{Reserve}" : Reserve.ToString(); + public string AmmoReadout => !ShowsAmmoReadout ? "" : HasMagazine ? $"{Ammo}/{Reserve}" : Reserve.ToString(); + // Whether the HUD shows the ammunition label at all (and not the infinite-ammunition icon): the weapon names an AmmoType. + public bool ShowsAmmoReadout => _data.AmmoType.IsSet(); public WeaponData WeaponData => _data; public float RangeFactor(float at) => WeaponData.RangeFactor(MinRange, EffectiveRange, Range, _data.DamageAtMaxRange, at); diff --git a/Assets/Scripts/UI/HUD/SchematicDisplay.cs b/Assets/Scripts/UI/HUD/SchematicDisplay.cs index ac49c1297..90b4271d3 100644 --- a/Assets/Scripts/UI/HUD/SchematicDisplay.cs +++ b/Assets/Scripts/UI/HUD/SchematicDisplay.cs @@ -132,8 +132,8 @@ public class SchematicDisplay : MonoBehaviour //x.ListElement.Label.text = x.Item.EquippableItem.Name; if (!_enemy) { - x.ListElement.InfiniteAmmoIcon.gameObject.SetActive(!x.Weapon.WeaponData.AmmoType.IsSet()); - x.ListElement.AmmoLabel.gameObject.SetActive(x.Weapon.WeaponData.AmmoType.IsSet()); + x.ListElement.InfiniteAmmoIcon.gameObject.SetActive(!x.Weapon.ShowsAmmoReadout); + x.ListElement.AmmoLabel.gameObject.SetActive(x.Weapon.ShowsAmmoReadout); } } } @@ -233,7 +233,7 @@ public class SchematicDisplay : MonoBehaviour if (x.Cooldown != null) x.ListElement.CooldownFill.anchorMax = new Vector2(x.Cooldown.Progress, 1); x.ListElement.DurabilityLabel.text = $"{(int)(x.Row.Item.EquippableItem.Durability / itemData.Durability * 100)}%"; - if (x.Weapon.WeaponData.AmmoType.IsSet()) + if (x.Weapon.ShowsAmmoReadout) x.ListElement.AmmoLabel.text = x.Weapon.AmmoReadout; } diff --git a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs index 2a52e1535..dfdb9d040 100644 --- a/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs +++ b/tests/Aetheria.Shared.Tests/AmmunitionStockingTests.cs @@ -193,5 +193,10 @@ public sealed partial class RunStartTests Assert.Equal(reserve.ToString(), Label("Fed Beam")); Assert.Equal($"{ship.Weapons.Single(w => _items.GetData(w.Item.EquippableItem).Name == "Fed Gun").Ammo}/{reserve}", Label("Fed Gun")); Assert.Equal("", Label("Plain Gun")); + // The HUD shows the label (not the infinite-ammunition icon) exactly for the weapons that read something. + bool Shown(string name) => ship.Weapons.Single(weapon => _items.GetData(weapon.Item.EquippableItem).Name == name).ShowsAmmoReadout; + Assert.True(Shown("Fed Gun")); + Assert.True(Shown("Fed Beam")); + Assert.False(Shown("Plain Gun")); } } From 58c4fa10c193e09adc18b102fe9ac5ecaa2c277b Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 05:59:30 +0000 Subject: [PATCH 039/108] ShipProductTests and ShipModCatalogTests capture Console through ConsoleProbe.Capture so restores cannot interleave Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../EconomyCommandTests.cs | 25 ++++++++++++++----- .../ShipModCatalogTests.cs | 8 ++---- .../Aetheria.Shared.Tests/ShipProductTests.cs | 8 ++---- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/EconomyCommandTests.cs b/tests/Aetheria.Shared.Tests/EconomyCommandTests.cs index 9319dbb1c..9557f27a1 100644 --- a/tests/Aetheria.Shared.Tests/EconomyCommandTests.cs +++ b/tests/Aetheria.Shared.Tests/EconomyCommandTests.cs @@ -13,15 +13,28 @@ internal static class ConsoleProbe private static readonly object Gate = new object(); public static string WrittenBy(Action act) + { + Capture<int>(() => { act(); return 0; }, out var output, out _); + return output; + } + + // The action's result with what it wrote to Console.Out and Console.Error on this thread. + public static T Capture<T>(Func<T> act, out string output, out string error) { lock (Gate) { - var previous = Console.Out; - var probe = new ThreadWriter(Environment.CurrentManagedThreadId); - Console.SetOut(probe); - try { act(); } - finally { Console.SetOut(previous); } - return probe.Mine.ToString(); + var (previousOut, previousError) = (Console.Out, Console.Error); + var (probeOut, probeError) = (new ThreadWriter(Environment.CurrentManagedThreadId), new ThreadWriter(Environment.CurrentManagedThreadId)); + Console.SetOut(probeOut); + Console.SetError(probeError); + try { return act(); } + finally + { + Console.SetOut(previousOut); + Console.SetError(previousError); + output = probeOut.Mine.ToString(); + error = probeError.Mine.ToString(); + } } } diff --git a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs index 3def3e6dd..cbda4266b 100644 --- a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs @@ -546,12 +546,8 @@ public sealed class ShipModCatalogTests : IDisposable private static (int Code, string Output, string Error) Run(params string[] args) { - var (output, error) = (new StringWriter(), new StringWriter()); - var (previousOut, previousError) = (Console.Out, Console.Error); - Console.SetOut(output); - Console.SetError(error); - try { return (ShipAuthoringCommands.Run(args), output.ToString(), error.ToString()); } - finally { Console.SetOut(previousOut); Console.SetError(previousError); } + var code = ConsoleProbe.Capture(() => ShipAuthoringCommands.Run(args), out var output, out var error); + return (code, output, error); } [Fact] diff --git a/tests/Aetheria.Shared.Tests/ShipProductTests.cs b/tests/Aetheria.Shared.Tests/ShipProductTests.cs index 343f35082..e14950b0d 100644 --- a/tests/Aetheria.Shared.Tests/ShipProductTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipProductTests.cs @@ -247,12 +247,8 @@ public sealed class ShipProductTests : IDisposable private static (int Code, string Output, string Error) Run(params string[] args) { - var (output, error) = (new StringWriter(), new StringWriter()); - var (previousOut, previousError) = (Console.Out, Console.Error); - Console.SetOut(output); - Console.SetError(error); - try { return (ShipAuthoringCommands.Run(args), output.ToString(), error.ToString()); } - finally { Console.SetOut(previousOut); Console.SetError(previousError); } + var code = ConsoleProbe.Capture(() => ShipAuthoringCommands.Run(args), out var output, out var error); + return (code, output, error); } [Fact] From dcd27cb3b04c376131029feeca84de2d42dcb94c Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 05:59:44 +0000 Subject: [PATCH 040/108] Station-kind descriptions name only goods a recipe makes or takes Uranium, Hydrogen (and Bacteria, Fungi, Animal Products) were named by mining, volatiles, agriculture, habitat-support and power descriptions with no recipe behind them. Dropped the claims (smaller than authoring a power chain); batch StationKindDescriptions restates the five kinds in the catalog; test pins the rule. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- GameData/Aetheria.cc | 4 +-- .../StationKindDescriptionTests.cs | 29 +++++++++++++++++++ .../Economy/ExtractionKindDescriptions.cs | 24 --------------- .../Economy/StationKindDescriptions.cs | 27 +++++++++++++++++ tools/AetherDb/StationKindsCatalog.cs | 10 +++---- 5 files changed, 63 insertions(+), 31 deletions(-) delete mode 100644 tools/AetherDb/Economy/ExtractionKindDescriptions.cs create mode 100644 tools/AetherDb/Economy/StationKindDescriptions.cs diff --git a/GameData/Aetheria.cc b/GameData/Aetheria.cc index 3bf502c21..da60f2dd3 100644 --- a/GameData/Aetheria.cc +++ b/GameData/Aetheria.cc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:956a1573fa2aa69d7f72861e10dd17d7d3255d114e878da81802869efcfe31e9 -size 220628 +oid sha256:319c14830b174e4bd58fe849b1300f38d7724d91027e47a03a5c121741d38e51 +size 220537 diff --git a/tests/Aetheria.Shared.Tests/StationKindDescriptionTests.cs b/tests/Aetheria.Shared.Tests/StationKindDescriptionTests.cs index 234df007a..3e00ba91b 100644 --- a/tests/Aetheria.Shared.Tests/StationKindDescriptionTests.cs +++ b/tests/Aetheria.Shared.Tests/StationKindDescriptionTests.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Text.RegularExpressions; using GameCult.Caching; using Xunit; @@ -34,4 +35,32 @@ public sealed class StationKindDescriptionTests Assert.Contains("Diamond", cache.Get<StationKindData>(StationKindData.KeyOf("mining")).Description); Assert.Contains("Ammonia", cache.Get<StationKindData>(StationKindData.KeyOf("volatiles")).Description); } + + // Kills: a station-kind description naming a commodity no recipe yields or consumes (Uranium, Hydrogen, Bacteria, Fungi and + // Animal Products were named by the shipped descriptions with no recipe behind them). + [Fact] + public void EveryCommodityAStationKindNamesIsMadeOrTakenByARecipe() + { + using var db = AetherDb.Open(); + var c = db.Cache; + var used = c.GetAll<RecipeData>().SelectMany(r => r.Inputs.Select(i => i.Commodity.Key.Value).Append(r.Output.Key.Value)).ToHashSet(); + var commodities = c.GetAll<SimpleCommodityData>().ToArray(); + Assert.True(commodities.Length >= 20 && used.Count >= 20, $"fixture: the catalog holds its commodities and recipes ({commodities.Length}, {used.Count})"); + var kinds = c.GetAll<StationKindData>().ToArray(); + Assert.True(kinds.Length >= 17, $"fixture: the catalog holds its station kinds ({kinds.Length})"); + var orphans = from kind in kinds + from good in commodities + where Regex.IsMatch(kind.Description ?? "", @"\b" + Regex.Escape(good.Name) + @"\b") && !used.Contains(c.RefOf(good).Key.Value) + select $"{kind.Name} names {good.Name}"; + Assert.True(!orphans.Any(), string.Join("\n", orphans)); + } + + // Kills: the fresh-catalog text and the shipped catalog saying different things about the same kind. + [Fact] + public void TheShippedDescriptionsAreTheAuthoredTable() + { + using var db = AetherDb.Open(); + foreach (var id in new[] { "mining", "volatiles", "agriculture", "habitat-support", "power" }) + Assert.Equal(StationKindsCatalog.DescriptionOf(id), db.Cache.Get<StationKindData>(StationKindData.KeyOf(id)).Description); + } } diff --git a/tools/AetherDb/Economy/ExtractionKindDescriptions.cs b/tools/AetherDb/Economy/ExtractionKindDescriptions.cs deleted file mode 100644 index b581af0d0..000000000 --- a/tools/AetherDb/Economy/ExtractionKindDescriptions.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using GameCult.Caching; - -// Economy content, batch 1c: the mining and volatiles station-kind descriptions name every good their kind now extracts. -// MunitionsFeed gave mining a Diamond recipe and volatiles an Ammonia recipe; the descriptions the station-round bench -// wrote predate them. The same text is StationKindsCatalog.Table's, so a catalog authored fresh says the same thing. -// Sets the description whatever it was, so a rerun converges. -public sealed class ExtractionKindDescriptions : EconomyBatch -{ - public override void Author(EconomyAuthor author) - { - foreach (var (id, description) in new[] - { - ("mining", StationKindsCatalog.DescriptionOf("mining")), - ("volatiles", StationKindsCatalog.DescriptionOf("volatiles")), - }) - { - var key = StationKindData.KeyOf(id); - var kind = author.Catalog.Get<StationKindData>(key) ?? throw new InvalidOperationException($"The catalog holds no station kind '{id}'."); - kind.Description = description; - author.Put(kind, key); - } - } -} diff --git a/tools/AetherDb/Economy/StationKindDescriptions.cs b/tools/AetherDb/Economy/StationKindDescriptions.cs new file mode 100644 index 000000000..746847e2e --- /dev/null +++ b/tools/AetherDb/Economy/StationKindDescriptions.cs @@ -0,0 +1,27 @@ +using System; +using GameCult.Caching; + +// Economy content: station-kind descriptions that name only goods the recipe graph makes or takes. The station-round bench wrote +// descriptions naming Uranium, Hydrogen, Bacteria, Fungi and Animal Products, none of which any recipe yields or consumes; this +// restates the five kinds that named them (mining, volatiles, agriculture, habitat-support, power) as StationKindsCatalog.Table +// has them, so a catalog authored fresh says the same thing. Sets the description whatever it was, so a rerun converges. +public sealed class StationKindDescriptions : EconomyBatch +{ + public override void Author(EconomyAuthor author) + { + foreach (var (id, description) in new[] + { + ("mining", StationKindsCatalog.DescriptionOf("mining")), + ("volatiles", StationKindsCatalog.DescriptionOf("volatiles")), + ("agriculture", StationKindsCatalog.DescriptionOf("agriculture")), + ("habitat-support", StationKindsCatalog.DescriptionOf("habitat-support")), + ("power", StationKindsCatalog.DescriptionOf("power")), + }) + { + var key = StationKindData.KeyOf(id); + var kind = author.Catalog.Get<StationKindData>(key) ?? throw new InvalidOperationException($"The catalog holds no station kind '{id}'."); + kind.Description = description; + author.Put(kind, key); + } + } +} diff --git a/tools/AetherDb/StationKindsCatalog.cs b/tools/AetherDb/StationKindsCatalog.cs index 81e5aee4d..51d865f57 100644 --- a/tools/AetherDb/StationKindsCatalog.cs +++ b/tools/AetherDb/StationKindsCatalog.cs @@ -14,19 +14,19 @@ public static class StationKindsCatalog private static readonly (string id, string name, string description)[] Table = { - ("mining", "Mining Station", "Extracts ore (Rock, New Metals, Gold, Uranium, Potassium) and Diamond from bodies and belts; consumes tools and food."), - ("volatiles", "Volatiles Station", "Skims Hydrogen, Methane, Ammonia and Water from gas giants and ice; consumes tools."), - ("agriculture", "Agriculture Station", "Grows Organics (Algae, Fungi, Bacteria, Animal Products) from Water and Potassium; feeds residential."), + ("mining", "Mining Station", "Extracts ore (Rock, New Metals, Gold, Potassium) and Diamond from bodies and belts; consumes tools and food."), + ("volatiles", "Volatiles Station", "Skims Methane, Ammonia and Water from gas giants and ice; consumes tools."), + ("agriculture", "Agriculture Station", "Grows Algae from Water and Potassium; feeds residential."), ("processing", "Processing Station", "Refines ore and volatiles into Metals, Alloys and Compounds."), ("fabrication", "Fabrication Station", "Turns Alloys and Compounds into Manufacturing compounds, Assemblies, gear, Ammo and consumer goods."), ("shipyard", "Shipyard", "Assembles hulls from Assemblies and Alloys."), ("depot", "Depot", "Stores and dispatches stock; loads haulers and tenders."), ("trade-hub", "Trade Hub", "Exchanges every bloc's goods between haulers and takes a cut; produces nothing."), ("residential", "Residential Station", "A bloom: consumes food, water, Wearables, Consumables and Luxuries; supplies crews."), - ("habitat-support", "Habitat Support Station", "Air, water recycling, life support and medicine for nearby habitats; consumes Bacteria, Water, Compounds."), + ("habitat-support", "Habitat Support Station", "Air, water recycling, life support and medicine for nearby habitats; consumes Water and Compounds."), ("urban", "Urban Station", "Dense city and services: market, media, repair; consumes luxuries and food."), ("administrative", "Administrative Station", "Issues quotas, contracts and security; consumes luxuries."), - ("power", "Power Station", "Makes reactor fuel, reservoirs and capacitors from Uranium and Hydrogen."), + ("power", "Power Station", "Generates and distributes power for nearby stations."), ("research", "Research Station", "Certification, compute, prototypes; consumes Assemblies."), ("salvage", "Salvage Station", "Breaks wrecks into Metals and second-hand gear."), ("black-market", "Black Market", "Buys anything, fences stolen cargo."), From 465ab506665c1d5e2b7998885202f16d1a296132 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 06:34:46 +0000 Subject: [PATCH 041/108] Arcs player gets a bay; Arcs and Pursuit crates sized from a measured run The Arcs fighter had no hold, so its Autocannon and Cell Blasters went silent after one magazine: it now fits the one free 2x2 bay. The estimated crate counts are replaced by measured draws (ten minutes of play or death by heat) plus margin, authored for every ammunition-drawing shooter; ScenarioAmmunitionRunTests drives both scenarios and fails if any shooter is stocked below its measured draw. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Scenarios/Arcs.cs | 13 ++- .../Scripts/ServerShared/Scenarios/Pursuit.cs | 13 ++- .../ScenarioAmmunitionRunTests.cs | 103 ++++++++++++++++++ 3 files changed, 121 insertions(+), 8 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/ScenarioAmmunitionRunTests.cs diff --git a/Assets/Scripts/ServerShared/Scenarios/Arcs.cs b/Assets/Scripts/ServerShared/Scenarios/Arcs.cs index fd5076075..459ee4e8b 100644 --- a/Assets/Scripts/ServerShared/Scenarios/Arcs.cs +++ b/Assets/Scripts/ServerShared/Scenarios/Arcs.cs @@ -21,7 +21,10 @@ public sealed class Arcs : Scenario public static readonly CultMath.float2 Bow = float2(0, 400), Stern = float2(0, -400), Turret = float2(600, 300), Port = float2(-400, 0), Starboard = float2(400, 0); - public const int TurretAmmoCrates = 30; + // Crates of ammunition each shooter's hold is stocked with: the measured draw over a run (ScenarioAmmunitionRunTests: ten minutes of play, + // or until the shooter dies of heat) plus half again and one. The turret drew 14 Ammo with the player in its range; the player drew 27 Ammo + // holding every gun down. The guided launchers fire only on a lock, which that run cannot give them, so they carry the default three crates. + public const int TurretAmmoCrates = 22, PlayerAmmoCrates = 42, PlayerMissileCrates = 3; public override Galaxy Generate(GalaxyStage stage) => stage.Prelude(); @@ -43,7 +46,8 @@ public sealed class Arcs : Scenario ("not if i see you first", int2(5, 10), None), // Compact Sensor ("Panopticon Prime", int2(3, 6), Clockwise), // Fire Control Array ("🫳🔫", int2(8, 4), Clockwise), // Autocannon - ("ChargeBlast SG", int2(0, 4), CounterClockwise)); // Charged Scatter Blaster + ("ChargeBlast SG", int2(0, 4), CounterClockwise), // Charged Scatter Blaster + ("Store-All Plus", int2(4, 8), None)); // Cargo Bay: the only 2x2 the hull has free var turret = stage.Fit("Turret", ("ClearPath", int2(1, 2), None), // Light Machine Gun ("ClearPath", int2(5, 2), None), // Light Machine Gun @@ -55,10 +59,11 @@ public sealed class Arcs : Scenario ("Panopticon Prime", int2(3, 6), None), // Fire Control Array ("Store-All Plus", int2(3, 1), None)); // Cargo Bay: the only 2x2 the turret hull has free - stage.Player(fighter, float2(0, 0), facing: float2(0, 1)); + var player = stage.Player(fighter, float2(0, 0), facing: float2(0, 1)); + stage.Cargo(player, Enumerable.Repeat("Ammo", PlayerAmmoCrates).Concat(Enumerable.Repeat("Missiles", PlayerMissileCrates)).ToArray()); stage.Place(stage.Bare("Longinus"), Bow); stage.Place(stage.Bare("Longinus"), Stern); - // The turret's guns reload from its hold, a crate of Ammo per 100-round magazine: both guns firing without pause spend about 3.5 crates a minute, so 30 outlast any session. + // The turret's guns reload from its hold, a crate of Ammo per magazine. stage.Cargo(stage.Place(turret, Turret, stance: ScenarioStance.Hostile), Enumerable.Repeat("Ammo", TurretAmmoCrates).ToArray()); stage.Place(stage.Bare("Longinus"), Port); stage.Place(stage.Bare("Longinus"), Starboard); diff --git a/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs b/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs index 20ad157a1..157ea4f1f 100644 --- a/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs +++ b/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs @@ -8,7 +8,11 @@ public sealed class Pursuit : Scenario // cloud breaking a sensor's lock, and well outside the 40 at which AStrongCloseSensorBurnsThrough shows a close // sensor burning through. private const float Astern = 300; - public const int MineCrates = 10; + // Crates each shooter's hold is stocked with: the measured draw over a run (ScenarioAmmunitionRunTests: ten minutes of play, or until the + // shooter dies of heat) plus half again and one where the hold has room. The player laid four crates of Mines and drew + // 33 Ammo; its hold takes 54 crates after five consumables and Mines, so its Ammo stops at 39. The pursuer drew 31 Ammo and one Missiles. A launcher + // that drew under a reload carries the default three crates. + public const int MineCrates = 7, PlayerAmmoCrates = 39, PlayerMissileCrates = 3, PursuerAmmoCrates = 47, PursuerMissileCrates = 3; public override string Name => "Pursuit"; public override string Id => "pursuit"; @@ -57,8 +61,9 @@ public sealed class Pursuit : Scenario ("Store-All Plus", int2(2, 8), None)); // Cargo Bay var player = stage.Player(layer, float2(0, 0), facing: float2(0, 1)); - // The Mine Launcher reloads a magazine of six from a crate of Mines: ten crates are sixty-six mines, minutes of laying at its cooldown, more than a chase lasts. - stage.Cargo(player, new[] { "Morning Fog", "Morning Fog", "Morning Fog", "send it", "send it" }.Concat(Enumerable.Repeat("Mines", MineCrates)).ToArray()); - stage.Place(pursuer, float2(0, -Astern), facing: float2(0, 1), stance: ScenarioStance.Hostile, piloted: true); + stage.Cargo(player, new[] { "Morning Fog", "Morning Fog", "Morning Fog", "send it", "send it" } + .Concat(Enumerable.Repeat("Mines", MineCrates)).Concat(Enumerable.Repeat("Ammo", PlayerAmmoCrates)).Concat(Enumerable.Repeat("Missiles", PlayerMissileCrates)).ToArray()); + var hostile = stage.Place(pursuer, float2(0, -Astern), facing: float2(0, 1), stance: ScenarioStance.Hostile, piloted: true); + stage.Cargo(hostile, Enumerable.Repeat("Ammo", PursuerAmmoCrates).Concat(Enumerable.Repeat("Missiles", PursuerMissileCrates)).ToArray()); } } diff --git a/tests/Aetheria.Shared.Tests/ScenarioAmmunitionRunTests.cs b/tests/Aetheria.Shared.Tests/ScenarioAmmunitionRunTests.cs new file mode 100644 index 000000000..3a1921cbd --- /dev/null +++ b/tests/Aetheria.Shared.Tests/ScenarioAmmunitionRunTests.cs @@ -0,0 +1,103 @@ +using System.Collections.Generic; +using System.Linq; +using GameCult.Caching; +using Xunit; + +// How much ammunition a staged scenario really spends over a run (ruling ballistics-real-ammo): the crates a scenario authors are pinned to +// this measurement, not to an estimate. A run is RunSeconds of continuous play: the player holds every ammunition-drawing weapon down with its +// hostile-or-flank hull standing in weapon range, an AI shooter fires on its own, and every hull keeps its armour so no shooter or target leaves +// the run early. The draw is counted in crates (one reload per crate) and each drawn crate is put back, so the count is not capped by the stock. +public sealed partial class RunStartTests +{ + // Ten minutes: longer than any session the Arcs and Pursuit briefs ask a tester for. + public const float RunSeconds = 600f; + + // Crates each armed entity of the scenario draws over the run, keyed by (index in the stage's entities, -1 for the player; ammunition name), + // and the crates each held when the run began. + private (Dictionary<(int, string), int> drawn, Dictionary<(int, string), int> stocked) RunAmmunition(Scenario scenario, bool playerFires, bool standNearHostile) + { + var (_, arena, staged, failures) = Launch(scenario, Inputs(() => GalaxySeed)); + Assert.Empty(failures); + arena.Update(0); + var shooters = staged.Entities.Select((entity, index) => (entity, index)).Append((staged.Player, -1)) + .Where(s => s.Item1.Weapons.Any(weapon => weapon.WeaponData.AmmoType.IsSet())).ToList(); + var drawn = new Dictionary<(int, string), int>(); + var stocked = new Dictionary<(int, string), int>(); + var held = new Dictionary<(int, string), int>(); + string NameOf(CultRecordKey key) => _items.ItemData.Get<SimpleCommodityData>(key).Name; + foreach (var (entity, index) in shooters) + foreach (var key in entity.Weapons.Where(weapon => weapon.WeaponData.AmmoType.IsSet()).Select(weapon => weapon.WeaponData.AmmoType.Key).Distinct()) + { + stocked[(index, NameOf(key))] = entity.CountItemsInCargo(key); + // A shooter with no crate cannot reload at all, so a run could not show what it would draw: it is given one to start. + if (stocked[(index, NameOf(key))] == 0) + entity.CargoBays.First().TryStore(new SimpleCommodity { Data = new CultRecordRef<ItemData>(key), Quantity = 1 }); + drawn[(index, NameOf(key))] = 0; + held[(index, NameOf(key))] = entity.CountItemsInCargo(key); + } + var everyone = staged.Entities.Append(staged.Player).ToList(); + var player = staged.Player; + var sound = everyone.SelectMany(entity => entity.Equipment).ToDictionary(item => item, item => item.EquippableItem.Durability); + var hostile = standNearHostile ? staged.Entities.First(entity => player.IsHostileTo(entity)) : null; + for (var tick = 0; tick < System.MathF.Round(RunSeconds / SimClock.GameStep); tick++) + { + foreach (var entity in everyone) + for (var x = 0; x < entity.Armor.GetLength(0); x++) + for (var y = 0; y < entity.Armor.GetLength(1); y++) + entity.Armor[x, y] = entity.MaxArmor[x, y]; + foreach (var (item, durability) in sound) item.EquippableItem.Durability = durability; + if (hostile != null) player.Position = hostile.Position + CultMath.math.float3(-200, 0, 0); + if (playerFires) + foreach (var weapon in player.Weapons.Where(weapon => weapon.WeaponData.AmmoType.IsSet())) weapon.Activate(); + arena.Update(SimClock.GameStep); + if (false) System.IO.File.AppendAllText(System.Environment.GetEnvironmentVariable("TMPDIR") + "/dbg.txt", $"{scenario.Name} t={tick*SimClock.GameStep:F0} active={player.Active} me={player.Position} " + string.Join(",", player.Weapons.Select(w => w.WeaponData.AmmoType.IsSet() ? w.Ammo + "/" + w.Reserve : "e")) + "\n"); + foreach (var (entity, index) in shooters) + foreach (var key in entity.Weapons.Where(weapon => weapon.WeaponData.AmmoType.IsSet()).Select(weapon => weapon.WeaponData.AmmoType.Key).Distinct()) + { + var slot = (index, NameOf(key)); + var spent = held[slot] - entity.CountItemsInCargo(key); + if (spent <= 0) continue; + drawn[slot] += spent; + for (var crate = 0; crate < spent; crate++) + entity.CargoBays.First().TryStore(new SimpleCommodity { Data = new CultRecordRef<ItemData>(key), Quantity = 1 }); + } + } + return (drawn, stocked); + } + + // The most crates each shooter draws in any of the modes, and what it was stocked with. + private List<(int shooter, string ammo, int drawn, int stocked)> WorstRun(Scenario scenario, params (bool playerFires, bool standNearHostile)[] modes) + { + var worst = new Dictionary<(int, string), (int drawn, int stocked)>(); + foreach (var (fires, near) in modes) + { + var (drawn, stocked) = RunAmmunition(scenario, fires, near); + foreach (var slot in drawn.Keys) + worst[slot] = (System.Math.Max(drawn[slot], worst.TryGetValue(slot, out var seen) ? seen.drawn : 0), stocked[slot]); + } + return worst.Select(kv => (kv.Key.Item1, kv.Key.Item2, kv.Value.drawn, kv.Value.stocked)).ToList(); + } + + // Arcs, run to its end twice: the player holding every gun down, and the player standing in the hostile turret's range while the turret + // shoots. Kills: a crate count nobody measured (the turret's 30 and the player's none were estimates), a scenario shooter stocked below + // what a run draws so its guns go silent, and a harness that measures nothing. + [Fact] + public void ArcsStocksEveryShooterForARun() + { + var run = WorstRun(new Arcs(), (true, false), (false, true)); + Assert.Contains(run, r => r.shooter == 2 && r.ammo == "Ammo" && r.drawn > 0); + Assert.Contains(run, r => r.shooter == -1 && r.ammo == "Ammo" && r.drawn > 0); + Assert.All(run, r => Assert.True(r.stocked >= r.drawn, $"Arcs shooter {r.shooter} drew {r.drawn} {r.ammo} over a run and was stocked {r.stocked}")); + } + + // Pursuit, the player holding every gun down and the pursuer shooting back, then the player idle. Kills: as above, for the Mine Launcher's + // crates and the pursuer's. + [Fact] + public void PursuitStocksEveryShooterForARun() + { + var run = WorstRun(new Pursuit(), (true, false), (false, false)); + Assert.Contains(run, r => r.shooter == -1 && r.ammo == "Mines" && r.drawn > 0); + Assert.Contains(run, r => r.shooter == 0 && r.ammo == "Ammo" && r.drawn > 0); + Assert.All(run, r => Assert.True(r.stocked >= r.drawn, $"Pursuit shooter {r.shooter} drew {r.drawn} {r.ammo} over a run and was stocked {r.stocked}")); + } +} From f856021997d77b131db9c770ac9efde55955eb3c Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 07:16:40 +0000 Subject: [PATCH 042/108] Ammunition run: say the real window (heat death ~260 s, not ten minutes) and drop a dead debug line Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Scenarios/Arcs.cs | 4 ++-- Assets/Scripts/ServerShared/Scenarios/Pursuit.cs | 4 ++-- tests/Aetheria.Shared.Tests/ScenarioAmmunitionRunTests.cs | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/ServerShared/Scenarios/Arcs.cs b/Assets/Scripts/ServerShared/Scenarios/Arcs.cs index 459ee4e8b..8846d006b 100644 --- a/Assets/Scripts/ServerShared/Scenarios/Arcs.cs +++ b/Assets/Scripts/ServerShared/Scenarios/Arcs.cs @@ -21,8 +21,8 @@ public sealed class Arcs : Scenario public static readonly CultMath.float2 Bow = float2(0, 400), Stern = float2(0, -400), Turret = float2(600, 300), Port = float2(-400, 0), Starboard = float2(400, 0); - // Crates of ammunition each shooter's hold is stocked with: the measured draw over a run (ScenarioAmmunitionRunTests: ten minutes of play, - // or until the shooter dies of heat) plus half again and one. The turret drew 14 Ammo with the player in its range; the player drew 27 Ammo + // Crates of ammunition each shooter's hold is stocked with: the measured draw over a run (ScenarioAmmunitionRunTests: at most ten minutes of play, and in + // practice the ~260 s a shooter holding every gun down lasts before it dies of heat; a pilot who vents heat is unmeasured) plus half again and one. The turret drew 14 Ammo with the player in its range; the player drew 27 Ammo // holding every gun down. The guided launchers fire only on a lock, which that run cannot give them, so they carry the default three crates. public const int TurretAmmoCrates = 22, PlayerAmmoCrates = 42, PlayerMissileCrates = 3; diff --git a/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs b/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs index 157ea4f1f..2e490a2a6 100644 --- a/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs +++ b/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs @@ -8,8 +8,8 @@ public sealed class Pursuit : Scenario // cloud breaking a sensor's lock, and well outside the 40 at which AStrongCloseSensorBurnsThrough shows a close // sensor burning through. private const float Astern = 300; - // Crates each shooter's hold is stocked with: the measured draw over a run (ScenarioAmmunitionRunTests: ten minutes of play, or until the - // shooter dies of heat) plus half again and one where the hold has room. The player laid four crates of Mines and drew + // Crates each shooter's hold is stocked with: the measured draw over a run (ScenarioAmmunitionRunTests: at most ten minutes of play, and in + // practice the ~250-270 s a shooter holding every gun down lasts before it dies of heat; a pilot who vents heat is unmeasured) plus half again and one where the hold has room. The player laid four crates of Mines and drew // 33 Ammo; its hold takes 54 crates after five consumables and Mines, so its Ammo stops at 39. The pursuer drew 31 Ammo and one Missiles. A launcher // that drew under a reload carries the default three crates. public const int MineCrates = 7, PlayerAmmoCrates = 39, PlayerMissileCrates = 3, PursuerAmmoCrates = 47, PursuerMissileCrates = 3; diff --git a/tests/Aetheria.Shared.Tests/ScenarioAmmunitionRunTests.cs b/tests/Aetheria.Shared.Tests/ScenarioAmmunitionRunTests.cs index 3a1921cbd..43dec542a 100644 --- a/tests/Aetheria.Shared.Tests/ScenarioAmmunitionRunTests.cs +++ b/tests/Aetheria.Shared.Tests/ScenarioAmmunitionRunTests.cs @@ -9,7 +9,7 @@ using Xunit; // the run early. The draw is counted in crates (one reload per crate) and each drawn crate is put back, so the count is not capped by the stock. public sealed partial class RunStartTests { - // Ten minutes: longer than any session the Arcs and Pursuit briefs ask a tester for. + // Ceiling of the window: a shooter holding every gun down dies of heat at ~250-270 s, so the draws are bounded by heat death, not by this. public const float RunSeconds = 600f; // Crates each armed entity of the scenario draws over the run, keyed by (index in the stage's entities, -1 for the player; ammunition name), @@ -50,7 +50,6 @@ public sealed partial class RunStartTests if (playerFires) foreach (var weapon in player.Weapons.Where(weapon => weapon.WeaponData.AmmoType.IsSet())) weapon.Activate(); arena.Update(SimClock.GameStep); - if (false) System.IO.File.AppendAllText(System.Environment.GetEnvironmentVariable("TMPDIR") + "/dbg.txt", $"{scenario.Name} t={tick*SimClock.GameStep:F0} active={player.Active} me={player.Position} " + string.Join(",", player.Weapons.Select(w => w.WeaponData.AmmoType.IsSet() ? w.Ammo + "/" + w.Reserve : "e")) + "\n"); foreach (var (entity, index) in shooters) foreach (var key in entity.Weapons.Where(weapon => weapon.WeaponData.AmmoType.IsSet()).Select(weapon => weapon.WeaponData.AmmoType.Key).Distinct()) { From feb7cf86069ec8fa6547a60817f4e1e60a1ad43f Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 11:53:16 +0000 Subject: [PATCH 043/108] Shaders: GalaxyMap, Clouds, Lightning, SimplexBrush use cultmath_snoise from CultMath.hlsl CPU snoise (CultMath C#) and the GPU shaders now share one implementation, so fBm agrees. Deletes the GPU Noise copies nothing includes any more (Classic 2D/3D, Simplex 3D, SimplexGrad 3D). Background.shader keeps SimplexNoise2D/SimplexNoiseGrad2D: CultMath has no 2D gradient (cultmath_snoise_grad is float3 -> float4 only). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Plugins/GPU Noise/ClassicNoise2D.cginc | 129 ------------ .../GPU Noise/ClassicNoise2D.cginc.meta | 5 - Assets/Plugins/GPU Noise/ClassicNoise3D.cginc | 194 ------------------ .../GPU Noise/ClassicNoise3D.cginc.meta | 5 - Assets/Plugins/GPU Noise/SimplexNoise3D.cginc | 114 ---------- .../GPU Noise/SimplexNoise3D.cginc.meta | 9 - .../GPU Noise/SimplexNoiseGrad3D.cginc | 118 ----------- .../GPU Noise/SimplexNoiseGrad3D.cginc.meta | 9 - 8 files changed, 583 deletions(-) delete mode 100644 Assets/Plugins/GPU Noise/ClassicNoise2D.cginc delete mode 100644 Assets/Plugins/GPU Noise/ClassicNoise2D.cginc.meta delete mode 100644 Assets/Plugins/GPU Noise/ClassicNoise3D.cginc delete mode 100644 Assets/Plugins/GPU Noise/ClassicNoise3D.cginc.meta delete mode 100644 Assets/Plugins/GPU Noise/SimplexNoise3D.cginc delete mode 100644 Assets/Plugins/GPU Noise/SimplexNoise3D.cginc.meta delete mode 100644 Assets/Plugins/GPU Noise/SimplexNoiseGrad3D.cginc delete mode 100644 Assets/Plugins/GPU Noise/SimplexNoiseGrad3D.cginc.meta diff --git a/Assets/Plugins/GPU Noise/ClassicNoise2D.cginc b/Assets/Plugins/GPU Noise/ClassicNoise2D.cginc deleted file mode 100644 index ef6b2e96c..000000000 --- a/Assets/Plugins/GPU Noise/ClassicNoise2D.cginc +++ /dev/null @@ -1,129 +0,0 @@ -// -// Noise Shader Library for Unity - https://github.com/keijiro/NoiseShader -// -// Original work (webgl-noise) Copyright (C) 2011 Stefan Gustavson -// Translation and modification was made by Keijiro Takahashi. -// -// This shader is based on the webgl-noise GLSL shader. For further details -// of the original shader, please see the following description from the -// original source code. -// - -// -// GLSL textureless classic 2D noise "cnoise", -// with an RSL-style periodic variant "pnoise". -// Author: Stefan Gustavson (stefan.gustavson@liu.se) -// Version: 2011-08-22 -// -// Many thanks to Ian McEwan of Ashima Arts for the -// ideas for permutation and gradient selection. -// -// Copyright (c) 2011 Stefan Gustavson. All rights reserved. -// Distributed under the MIT license. See LICENSE file. -// https://github.com/ashima/webgl-noise -// - -float4 mod(float4 x, float4 y) -{ - return x - y * floor(x / y); -} - -float4 mod289(float4 x) -{ - return x - floor(x / 289.0) * 289.0; -} - -float4 permute(float4 x) -{ - return mod289(((x*34.0)+1.0)*x); -} - -float4 taylorInvSqrt(float4 r) -{ - return (float4)1.79284291400159 - r * 0.85373472095314; -} - -float2 fade(float2 t) { - return t*t*t*(t*(t*6.0-15.0)+10.0); -} - -// Classic Perlin noise -float cnoise(float2 P) -{ - float4 Pi = floor(P.xyxy) + float4(0.0, 0.0, 1.0, 1.0); - float4 Pf = frac (P.xyxy) - float4(0.0, 0.0, 1.0, 1.0); - Pi = mod289(Pi); // To avoid truncation effects in permutation - float4 ix = Pi.xzxz; - float4 iy = Pi.yyww; - float4 fx = Pf.xzxz; - float4 fy = Pf.yyww; - - float4 i = permute(permute(ix) + iy); - - float4 gx = frac(i / 41.0) * 2.0 - 1.0 ; - float4 gy = abs(gx) - 0.5 ; - float4 tx = floor(gx + 0.5); - gx = gx - tx; - - float2 g00 = float2(gx.x,gy.x); - float2 g10 = float2(gx.y,gy.y); - float2 g01 = float2(gx.z,gy.z); - float2 g11 = float2(gx.w,gy.w); - - float4 norm = taylorInvSqrt(float4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); - g00 *= norm.x; - g01 *= norm.y; - g10 *= norm.z; - g11 *= norm.w; - - float n00 = dot(g00, float2(fx.x, fy.x)); - float n10 = dot(g10, float2(fx.y, fy.y)); - float n01 = dot(g01, float2(fx.z, fy.z)); - float n11 = dot(g11, float2(fx.w, fy.w)); - - float2 fade_xy = fade(Pf.xy); - float2 n_x = lerp(float2(n00, n01), float2(n10, n11), fade_xy.x); - float n_xy = lerp(n_x.x, n_x.y, fade_xy.y); - return 2.3 * n_xy; -} - -// Classic Perlin noise, periodic variant -float pnoise(float2 P, float2 rep) -{ - float4 Pi = floor(P.xyxy) + float4(0.0, 0.0, 1.0, 1.0); - float4 Pf = frac (P.xyxy) - float4(0.0, 0.0, 1.0, 1.0); - Pi = mod(Pi, rep.xyxy); // To create noise with explicit period - Pi = mod289(Pi); // To avoid truncation effects in permutation - float4 ix = Pi.xzxz; - float4 iy = Pi.yyww; - float4 fx = Pf.xzxz; - float4 fy = Pf.yyww; - - float4 i = permute(permute(ix) + iy); - - float4 gx = frac(i / 41.0) * 2.0 - 1.0 ; - float4 gy = abs(gx) - 0.5 ; - float4 tx = floor(gx + 0.5); - gx = gx - tx; - - float2 g00 = float2(gx.x,gy.x); - float2 g10 = float2(gx.y,gy.y); - float2 g01 = float2(gx.z,gy.z); - float2 g11 = float2(gx.w,gy.w); - - float4 norm = taylorInvSqrt(float4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); - g00 *= norm.x; - g01 *= norm.y; - g10 *= norm.z; - g11 *= norm.w; - - float n00 = dot(g00, float2(fx.x, fy.x)); - float n10 = dot(g10, float2(fx.y, fy.y)); - float n01 = dot(g01, float2(fx.z, fy.z)); - float n11 = dot(g11, float2(fx.w, fy.w)); - - float2 fade_xy = fade(Pf.xy); - float2 n_x = lerp(float2(n00, n01), float2(n10, n11), fade_xy.x); - float n_xy = lerp(n_x.x, n_x.y, fade_xy.y); - return 2.3 * n_xy; -} diff --git a/Assets/Plugins/GPU Noise/ClassicNoise2D.cginc.meta b/Assets/Plugins/GPU Noise/ClassicNoise2D.cginc.meta deleted file mode 100644 index ff437e70a..000000000 --- a/Assets/Plugins/GPU Noise/ClassicNoise2D.cginc.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: e1b0b5fd6a4e44923b40d856017562e1 -ShaderImporter: - defaultTextures: [] - userData: diff --git a/Assets/Plugins/GPU Noise/ClassicNoise3D.cginc b/Assets/Plugins/GPU Noise/ClassicNoise3D.cginc deleted file mode 100644 index 738f6d12a..000000000 --- a/Assets/Plugins/GPU Noise/ClassicNoise3D.cginc +++ /dev/null @@ -1,194 +0,0 @@ -// -// Noise Shader Library for Unity - https://github.com/keijiro/NoiseShader -// -// Original work (webgl-noise) Copyright (C) 2011 Stefan Gustavson -// Translation and modification was made by Keijiro Takahashi. -// -// This shader is based on the webgl-noise GLSL shader. For further details -// of the original shader, please see the following description from the -// original source code. -// - -// -// GLSL textureless classic 3D noise "cnoise", -// with an RSL-style periodic variant "pnoise". -// Author: Stefan Gustavson (stefan.gustavson@liu.se) -// Version: 2011-10-11 -// -// Many thanks to Ian McEwan of Ashima Arts for the -// ideas for permutation and gradient selection. -// -// Copyright (c) 2011 Stefan Gustavson. All rights reserved. -// Distributed under the MIT license. See LICENSE file. -// https://github.com/ashima/webgl-noise -// - -float3 mod(float3 x, float3 y) -{ - return x - y * floor(x / y); -} - -float3 mod289(float3 x) -{ - return x - floor(x / 289.0) * 289.0; -} - -float4 mod289(float4 x) -{ - return x - floor(x / 289.0) * 289.0; -} - -float4 permute(float4 x) -{ - return mod289(((x*34.0)+1.0)*x); -} - -float4 taylorInvSqrt(float4 r) -{ - return (float4)1.79284291400159 - r * 0.85373472095314; -} - -float3 fade(float3 t) { - return t*t*t*(t*(t*6.0-15.0)+10.0); -} - -// Classic Perlin noise -float cnoise(float3 P) -{ - float3 Pi0 = floor(P); // Integer part for indexing - float3 Pi1 = Pi0 + (float3)1.0; // Integer part + 1 - Pi0 = mod289(Pi0); - Pi1 = mod289(Pi1); - float3 Pf0 = frac(P); // Fractional part for interpolation - float3 Pf1 = Pf0 - (float3)1.0; // Fractional part - 1.0 - float4 ix = float4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - float4 iy = float4(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - float4 iz0 = (float4)Pi0.z; - float4 iz1 = (float4)Pi1.z; - - float4 ixy = permute(permute(ix) + iy); - float4 ixy0 = permute(ixy + iz0); - float4 ixy1 = permute(ixy + iz1); - - float4 gx0 = ixy0 / 7.0; - float4 gy0 = frac(floor(gx0) / 7.0) - 0.5; - gx0 = frac(gx0); - float4 gz0 = (float4)0.5 - abs(gx0) - abs(gy0); - float4 sz0 = step(gz0, (float4)0.0); - gx0 -= sz0 * (step((float4)0.0, gx0) - 0.5); - gy0 -= sz0 * (step((float4)0.0, gy0) - 0.5); - - float4 gx1 = ixy1 / 7.0; - float4 gy1 = frac(floor(gx1) / 7.0) - 0.5; - gx1 = frac(gx1); - float4 gz1 = (float4)0.5 - abs(gx1) - abs(gy1); - float4 sz1 = step(gz1, (float4)0.0); - gx1 -= sz1 * (step((float4)0.0, gx1) - 0.5); - gy1 -= sz1 * (step((float4)0.0, gy1) - 0.5); - - float3 g000 = float3(gx0.x,gy0.x,gz0.x); - float3 g100 = float3(gx0.y,gy0.y,gz0.y); - float3 g010 = float3(gx0.z,gy0.z,gz0.z); - float3 g110 = float3(gx0.w,gy0.w,gz0.w); - float3 g001 = float3(gx1.x,gy1.x,gz1.x); - float3 g101 = float3(gx1.y,gy1.y,gz1.y); - float3 g011 = float3(gx1.z,gy1.z,gz1.z); - float3 g111 = float3(gx1.w,gy1.w,gz1.w); - - float4 norm0 = taylorInvSqrt(float4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - - float4 norm1 = taylorInvSqrt(float4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - - float n000 = dot(g000, Pf0); - float n100 = dot(g100, float3(Pf1.x, Pf0.y, Pf0.z)); - float n010 = dot(g010, float3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, float3(Pf1.x, Pf1.y, Pf0.z)); - float n001 = dot(g001, float3(Pf0.x, Pf0.y, Pf1.z)); - float n101 = dot(g101, float3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, float3(Pf0.x, Pf1.y, Pf1.z)); - float n111 = dot(g111, Pf1); - - float3 fade_xyz = fade(Pf0); - float4 n_z = lerp(float4(n000, n100, n010, n110), float4(n001, n101, n011, n111), fade_xyz.z); - float2 n_yz = lerp(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = lerp(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; -} - -// Classic Perlin noise, periodic variant -float pnoise(float3 P, float3 rep) -{ - float3 Pi0 = mod(floor(P), rep); // Integer part, modulo period - float3 Pi1 = mod(Pi0 + (float3)1.0, rep); // Integer part + 1, mod period - Pi0 = mod289(Pi0); - Pi1 = mod289(Pi1); - float3 Pf0 = frac(P); // Fractional part for interpolation - float3 Pf1 = Pf0 - (float3)1.0; // Fractional part - 1.0 - float4 ix = float4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - float4 iy = float4(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - float4 iz0 = (float4)Pi0.z; - float4 iz1 = (float4)Pi1.z; - - float4 ixy = permute(permute(ix) + iy); - float4 ixy0 = permute(ixy + iz0); - float4 ixy1 = permute(ixy + iz1); - - float4 gx0 = ixy0 / 7.0; - float4 gy0 = frac(floor(gx0) / 7.0) - 0.5; - gx0 = frac(gx0); - float4 gz0 = (float4)0.5 - abs(gx0) - abs(gy0); - float4 sz0 = step(gz0, (float4)0.0); - gx0 -= sz0 * (step((float4)0.0, gx0) - 0.5); - gy0 -= sz0 * (step((float4)0.0, gy0) - 0.5); - - float4 gx1 = ixy1 / 7.0; - float4 gy1 = frac(floor(gx1) / 7.0) - 0.5; - gx1 = frac(gx1); - float4 gz1 = (float4)0.5 - abs(gx1) - abs(gy1); - float4 sz1 = step(gz1, (float4)0.0); - gx1 -= sz1 * (step((float4)0.0, gx1) - 0.5); - gy1 -= sz1 * (step((float4)0.0, gy1) - 0.5); - - float3 g000 = float3(gx0.x,gy0.x,gz0.x); - float3 g100 = float3(gx0.y,gy0.y,gz0.y); - float3 g010 = float3(gx0.z,gy0.z,gz0.z); - float3 g110 = float3(gx0.w,gy0.w,gz0.w); - float3 g001 = float3(gx1.x,gy1.x,gz1.x); - float3 g101 = float3(gx1.y,gy1.y,gz1.y); - float3 g011 = float3(gx1.z,gy1.z,gz1.z); - float3 g111 = float3(gx1.w,gy1.w,gz1.w); - - float4 norm0 = taylorInvSqrt(float4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - float4 norm1 = taylorInvSqrt(float4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - - float n000 = dot(g000, Pf0); - float n100 = dot(g100, float3(Pf1.x, Pf0.y, Pf0.z)); - float n010 = dot(g010, float3(Pf0.x, Pf1.y, Pf0.z)); - float n110 = dot(g110, float3(Pf1.x, Pf1.y, Pf0.z)); - float n001 = dot(g001, float3(Pf0.x, Pf0.y, Pf1.z)); - float n101 = dot(g101, float3(Pf1.x, Pf0.y, Pf1.z)); - float n011 = dot(g011, float3(Pf0.x, Pf1.y, Pf1.z)); - float n111 = dot(g111, Pf1); - - float3 fade_xyz = fade(Pf0); - float4 n_z = lerp(float4(n000, n100, n010, n110), float4(n001, n101, n011, n111), fade_xyz.z); - float2 n_yz = lerp(n_z.xy, n_z.zw, fade_xyz.y); - float n_xyz = lerp(n_yz.x, n_yz.y, fade_xyz.x); - return 2.2 * n_xyz; -} diff --git a/Assets/Plugins/GPU Noise/ClassicNoise3D.cginc.meta b/Assets/Plugins/GPU Noise/ClassicNoise3D.cginc.meta deleted file mode 100644 index b4dd551ab..000000000 --- a/Assets/Plugins/GPU Noise/ClassicNoise3D.cginc.meta +++ /dev/null @@ -1,5 +0,0 @@ -fileFormatVersion: 2 -guid: 3ba1abd1cb44c47b68fbb577c6c4ba3e -ShaderImporter: - defaultTextures: [] - userData: diff --git a/Assets/Plugins/GPU Noise/SimplexNoise3D.cginc b/Assets/Plugins/GPU Noise/SimplexNoise3D.cginc deleted file mode 100644 index 0b7add240..000000000 --- a/Assets/Plugins/GPU Noise/SimplexNoise3D.cginc +++ /dev/null @@ -1,114 +0,0 @@ -// -// Noise Shader Library for Unity - https://github.com/keijiro/NoiseShader -// -// Original work (webgl-noise) Copyright (C) 2011 Ashima Arts. -// Translation and modification was made by Keijiro Takahashi. -// -// This shader is based on the webgl-noise GLSL shader. For further details -// of the original shader, please see the following description from the -// original source code. -// - -// -// Description : Array and textureless GLSL 2D/3D/4D simplex -// noise functions. -// Author : Ian McEwan, Ashima Arts. -// Maintainer : ijm -// Lastmod : 20110822 (ijm) -// License : Copyright (C) 2011 Ashima Arts. All rights reserved. -// Distributed under the MIT License. See LICENSE file. -// https://github.com/ashima/webgl-noise -// - -float3 mod289(float3 x) -{ - return x - floor(x / 289.0) * 289.0; -} - -float4 mod289(float4 x) -{ - return x - floor(x / 289.0) * 289.0; -} - -float4 permute(float4 x) -{ - return mod289((x * 34.0 + 1.0) * x); -} - -float4 taylorInvSqrt(float4 r) -{ - return 1.79284291400159 - r * 0.85373472095314; -} - -float snoise(float3 v) -{ - const float2 C = float2(1.0 / 6.0, 1.0 / 3.0); - - // First corner - float3 i = floor(v + dot(v, C.yyy)); - float3 x0 = v - i + dot(i, C.xxx); - - // Other corners - float3 g = step(x0.yzx, x0.xyz); - float3 l = 1.0 - g; - float3 i1 = min(g.xyz, l.zxy); - float3 i2 = max(g.xyz, l.zxy); - - // x1 = x0 - i1 + 1.0 * C.xxx; - // x2 = x0 - i2 + 2.0 * C.xxx; - // x3 = x0 - 1.0 + 3.0 * C.xxx; - float3 x1 = x0 - i1 + C.xxx; - float3 x2 = x0 - i2 + C.yyy; - float3 x3 = x0 - 0.5; - - // Permutations - i = mod289(i); // Avoid truncation effects in permutation - float4 p = - permute(permute(permute(i.z + float4(0.0, i1.z, i2.z, 1.0)) - + i.y + float4(0.0, i1.y, i2.y, 1.0)) - + i.x + float4(0.0, i1.x, i2.x, 1.0)); - - // Gradients: 7x7 points over a square, mapped onto an octahedron. - // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) - float4 j = p - 49.0 * floor(p / 49.0); // mod(p,7*7) - - float4 x_ = floor(j / 7.0); - float4 y_ = floor(j - 7.0 * x_); // mod(j,N) - - float4 x = (x_ * 2.0 + 0.5) / 7.0 - 1.0; - float4 y = (y_ * 2.0 + 0.5) / 7.0 - 1.0; - - float4 h = 1.0 - abs(x) - abs(y); - - float4 b0 = float4(x.xy, y.xy); - float4 b1 = float4(x.zw, y.zw); - - //float4 s0 = float4(lessThan(b0, 0.0)) * 2.0 - 1.0; - //float4 s1 = float4(lessThan(b1, 0.0)) * 2.0 - 1.0; - float4 s0 = floor(b0) * 2.0 + 1.0; - float4 s1 = floor(b1) * 2.0 + 1.0; - float4 sh = -step(h, 0.0); - - float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; - float4 a1 = b1.xzyw + s1.xzyw * sh.zzww; - - float3 g0 = float3(a0.xy, h.x); - float3 g1 = float3(a0.zw, h.y); - float3 g2 = float3(a1.xy, h.z); - float3 g3 = float3(a1.zw, h.w); - - // Normalise gradients - float4 norm = taylorInvSqrt(float4(dot(g0, g0), dot(g1, g1), dot(g2, g2), dot(g3, g3))); - g0 *= norm.x; - g1 *= norm.y; - g2 *= norm.z; - g3 *= norm.w; - - // Mix final noise value - float4 m = max(0.6 - float4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0); - m = m * m; - m = m * m; - - float4 px = float4(dot(x0, g0), dot(x1, g1), dot(x2, g2), dot(x3, g3)); - return 42.0 * dot(m, px); -} diff --git a/Assets/Plugins/GPU Noise/SimplexNoise3D.cginc.meta b/Assets/Plugins/GPU Noise/SimplexNoise3D.cginc.meta deleted file mode 100644 index 612bd9ef0..000000000 --- a/Assets/Plugins/GPU Noise/SimplexNoise3D.cginc.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: b577a94f58a1398409bfcfe9cd5dbf99 -timeCreated: 1448788105 -licenseType: Pro -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/GPU Noise/SimplexNoiseGrad3D.cginc b/Assets/Plugins/GPU Noise/SimplexNoiseGrad3D.cginc deleted file mode 100644 index 4cfef835a..000000000 --- a/Assets/Plugins/GPU Noise/SimplexNoiseGrad3D.cginc +++ /dev/null @@ -1,118 +0,0 @@ -// -// Noise Shader Library for Unity - https://github.com/keijiro/NoiseShader -// -// Original work (webgl-noise) Copyright (C) 2011 Ashima Arts. -// Translation and modification was made by Keijiro Takahashi. -// -// This shader is based on the webgl-noise GLSL shader. For further details -// of the original shader, please see the following description from the -// original source code. -// - -// -// Description : Array and textureless GLSL 2D/3D/4D simplex -// noise functions. -// Author : Ian McEwan, Ashima Arts. -// Maintainer : ijm -// Lastmod : 20110822 (ijm) -// License : Copyright (C) 2011 Ashima Arts. All rights reserved. -// Distributed under the MIT License. See LICENSE file. -// https://github.com/ashima/webgl-noise -// - -float3 mod289(float3 x) -{ - return x - floor(x / 289.0) * 289.0; -} - -float4 mod289(float4 x) -{ - return x - floor(x / 289.0) * 289.0; -} - -float4 permute(float4 x) -{ - return mod289((x * 34.0 + 1.0) * x); -} - -float4 taylorInvSqrt(float4 r) -{ - return 1.79284291400159 - r * 0.85373472095314; -} - -float3 snoise_grad(float3 v) -{ - const float2 C = float2(1.0 / 6.0, 1.0 / 3.0); - - // First corner - float3 i = floor(v + dot(v, C.yyy)); - float3 x0 = v - i + dot(i, C.xxx); - - // Other corners - float3 g = step(x0.yzx, x0.xyz); - float3 l = 1.0 - g; - float3 i1 = min(g.xyz, l.zxy); - float3 i2 = max(g.xyz, l.zxy); - - // x1 = x0 - i1 + 1.0 * C.xxx; - // x2 = x0 - i2 + 2.0 * C.xxx; - // x3 = x0 - 1.0 + 3.0 * C.xxx; - float3 x1 = x0 - i1 + C.xxx; - float3 x2 = x0 - i2 + C.yyy; - float3 x3 = x0 - 0.5; - - // Permutations - i = mod289(i); // Avoid truncation effects in permutation - float4 p = - permute(permute(permute(i.z + float4(0.0, i1.z, i2.z, 1.0)) - + i.y + float4(0.0, i1.y, i2.y, 1.0)) - + i.x + float4(0.0, i1.x, i2.x, 1.0)); - - // Gradients: 7x7 points over a square, mapped onto an octahedron. - // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) - float4 j = p - 49.0 * floor(p / 49.0); // mod(p,7*7) - - float4 x_ = floor(j / 7.0); - float4 y_ = floor(j - 7.0 * x_); // mod(j,N) - - float4 x = (x_ * 2.0 + 0.5) / 7.0 - 1.0; - float4 y = (y_ * 2.0 + 0.5) / 7.0 - 1.0; - - float4 h = 1.0 - abs(x) - abs(y); - - float4 b0 = float4(x.xy, y.xy); - float4 b1 = float4(x.zw, y.zw); - - //float4 s0 = float4(lessThan(b0, 0.0)) * 2.0 - 1.0; - //float4 s1 = float4(lessThan(b1, 0.0)) * 2.0 - 1.0; - float4 s0 = floor(b0) * 2.0 + 1.0; - float4 s1 = floor(b1) * 2.0 + 1.0; - float4 sh = -step(h, 0.0); - - float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; - float4 a1 = b1.xzyw + s1.xzyw * sh.zzww; - - float3 g0 = float3(a0.xy, h.x); - float3 g1 = float3(a0.zw, h.y); - float3 g2 = float3(a1.xy, h.z); - float3 g3 = float3(a1.zw, h.w); - - // Normalise gradients - float4 norm = taylorInvSqrt(float4(dot(g0, g0), dot(g1, g1), dot(g2, g2), dot(g3, g3))); - g0 *= norm.x; - g1 *= norm.y; - g2 *= norm.z; - g3 *= norm.w; - - // Compute gradient of noise function at P - float4 m = max(0.6 - float4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0); - float4 m2 = m * m; - float4 m3 = m2 * m; - float4 m4 = m2 * m2; - float3 grad = - -6.0 * m3.x * x0 * dot(x0, g0) + m4.x * g0 + - -6.0 * m3.y * x1 * dot(x1, g1) + m4.y * g1 + - -6.0 * m3.z * x2 * dot(x2, g2) + m4.z * g2 + - -6.0 * m3.w * x3 * dot(x3, g3) + m4.w * g3; - return 42.0 * grad; -} diff --git a/Assets/Plugins/GPU Noise/SimplexNoiseGrad3D.cginc.meta b/Assets/Plugins/GPU Noise/SimplexNoiseGrad3D.cginc.meta deleted file mode 100644 index 250b646fa..000000000 --- a/Assets/Plugins/GPU Noise/SimplexNoiseGrad3D.cginc.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: a7111eafc2463224faacf7be3bddb9a4 -timeCreated: 1449292284 -licenseType: Pro -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: From b6c428d6827a63710ee931c4c317196cc9bc8038 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 12:08:15 +0000 Subject: [PATCH 044/108] Shaders: GalaxyMap, Clouds, SimplexBrush and Lightning.compute call cultmath_snoise The previous commit deleted the GPU Noise includes; this one carries the call-site edits it described. Release map notes Background's remaining 2D gradient copy. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Shaders/Brushes/SimplexBrush.shader | 4 ++-- Assets/Shaders/Clouds.shader | 6 +++--- Assets/Shaders/Compute/Lightning/Lightning.compute | 4 ++-- Assets/Shaders/GalaxyMap.shader | 6 +++--- docs/aetheria-release-map.md | 4 +++- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Assets/Shaders/Brushes/SimplexBrush.shader b/Assets/Shaders/Brushes/SimplexBrush.shader index 3a6bf56e5..af54035b2 100644 --- a/Assets/Shaders/Brushes/SimplexBrush.shader +++ b/Assets/Shaders/Brushes/SimplexBrush.shader @@ -25,7 +25,7 @@ Category { #pragma target 2.0 #include "UnityCG.cginc" - #include "Assets/Plugins/GPU Noise/SimplexNoise3D.cginc" + #include "Packages/org.gamecult.cultmath/Shaders/CultMath.hlsl" float _Depth; float _Power; @@ -68,7 +68,7 @@ Category { fixed4 frag (v2f i) : SV_Target { float dist = length(i.texcoord - float2(.5,.5)); - return powerPulse(dist * 2,_Power) * (_Depth * abs(snoise(float3(i.texcoord1.xy*_Frequency,_Time.y*_Speed)))+_Constant); + return powerPulse(dist * 2,_Power) * (_Depth * abs(cultmath_snoise(float3(i.texcoord1.xy*_Frequency,_Time.y*_Speed)))+_Constant); } ENDCG } diff --git a/Assets/Shaders/Clouds.shader b/Assets/Shaders/Clouds.shader index 11e3fe0a3..ccbda8835 100644 --- a/Assets/Shaders/Clouds.shader +++ b/Assets/Shaders/Clouds.shader @@ -29,7 +29,7 @@ #pragma fragment frag #include "UnityCG.cginc" - #include "Assets/Plugins/GPU Noise/SimplexNoise3D.cginc" + #include "Packages/org.gamecult.cultmath/Shaders/CultMath.hlsl" struct appdata { @@ -64,7 +64,7 @@ float sum = 0; for(int i = 0; i < 6; i++) { - sum += snoise(p * freq + Parallax * ParallaxDirection) * amp; + sum += cultmath_snoise(p * freq + Parallax * ParallaxDirection) * amp; parallax /= ParallaxLacunarity; freq *= NoiseLacunarity; amp *= NoiseGain; @@ -83,7 +83,7 @@ fixed4 frag (v2f i) : SV_Target { float3 p = float3(i.uv,_Time.x*Speed); - float noise = saturate((1-abs(snoise(p*NoiseFrequency/2))) * fbm(p)); + float noise = saturate((1-abs(cultmath_snoise(p*NoiseFrequency/2))) * fbm(p)); return noise * _Color * (1-length(i.uv)/FadeDistance); } ENDCG diff --git a/Assets/Shaders/Compute/Lightning/Lightning.compute b/Assets/Shaders/Compute/Lightning/Lightning.compute index 0750006b9..7edd707d4 100644 --- a/Assets/Shaders/Compute/Lightning/Lightning.compute +++ b/Assets/Shaders/Compute/Lightning/Lightning.compute @@ -5,7 +5,7 @@ #define NUM_THREAD_X 64 #include "LightningVertex.cginc" -#include "Assets/Plugins/GPU Noise/SimplexNoise2D.cginc" +#include "Packages/org.gamecult.cultmath/Shaders/CultMath.hlsl" struct Node { @@ -46,7 +46,7 @@ float fbm(float2 p) float sum = 0; for(int i = 0; i < 4; i++) { - sum += snoise(p * freq) * amp; + sum += cultmath_snoise(p * freq) * amp; freq *= _NoiseLacunarity; amp *= _NoiseGain; } diff --git a/Assets/Shaders/GalaxyMap.shader b/Assets/Shaders/GalaxyMap.shader index 567396a35..109cd96d0 100644 --- a/Assets/Shaders/GalaxyMap.shader +++ b/Assets/Shaders/GalaxyMap.shader @@ -36,7 +36,7 @@ Shader "Unlit/GalaxyMap" #pragma fragment frag #include "UnityCG.cginc" - #include "Assets/Plugins/GPU Noise/SimplexNoise2D.cginc" + #include "Packages/org.gamecult.cultmath/Shaders/CultMath.hlsl" struct appdata { @@ -86,8 +86,8 @@ Shader "Unlit/GalaxyMap" for(int i = 0; i < octaves; i++) { if(i<4) - sum += (1-abs(snoise(p * freq))) * amp; - else sum += abs(snoise(p * freq)) * amp; + sum += (1-abs(cultmath_snoise(p * freq))) * amp; + else sum += abs(cultmath_snoise(p * freq)) * amp; freq *= NoiseLacunarity; amp *= NoiseGain; } diff --git a/docs/aetheria-release-map.md b/docs/aetheria-release-map.md index 18f9b6941..72e96f22e 100644 --- a/docs/aetheria-release-map.md +++ b/docs/aetheria-release-map.md @@ -7459,7 +7459,9 @@ That file's Cut 4 (AI heading planner) and Cut 5 (combat facing) are carried as is `stage.Generated("Djinni")`, `EvasionTermTests.cs:520`, so the target's fit follows the galaxy). The cause is 0.3.0's breaking `snoise` kernel (its CHANGELOG), read in C# by `Settings.cs:72-73` (galaxy cloud density), `GlobalData.cs:30` and `Environment.cs:132,144`. Shaders use the GPU Noise plugin, not - CultMath (`Background.shader:39`), so nothing on the GPU moves. Every other DemoTerminus test passes. + CultMath (`Background.shader:39`), so nothing on the GPU moved at 0.3.0. GalaxyMap, Clouds, SimplexBrush and + Lightning.compute now include `CultMath.hlsl`; Background keeps its 2D gradient copy because CultMath has no 2D + `snoise_grad`. Every other DemoTerminus test passes. Between the tags CultMath also adds `phacelle` (MPL-2.0 files), `cellular`, `smin_grad`, the `*_grad` noises and `BoundedLeastSquares`; no existing signature changes. - **TA9. The pin guard.** `Directory.Build.targets:21` conditions `VerifyCultLibRevision` on a From 3c78dbcbd1cc8cc74d740cd1436fd601f78791c9 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 12:10:37 +0000 Subject: [PATCH 045/108] Fauna map B29: Aetheria pins cultmath-unity-v0.5.0 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- docs/aetheria-fauna-map.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/aetheria-fauna-map.md b/docs/aetheria-fauna-map.md index b698baf41..05034c92a 100644 --- a/docs/aetheria-fauna-map.md +++ b/docs/aetheria-fauna-map.md @@ -398,7 +398,7 @@ the lore branch `eureka/aetheria-fauna-lore` `74c7e212`, note `Open Water` (`OW` | # | Question | Result | |---|---|---| | B28 | What does CultMath already give a node library? | Integer PCG hashes `pcg`, `pcg3d`, `pcg4d` (Jarzynski and Olano), "integer-only, so dxc and C# agree bit for bit" (`packages/cultmath/src/CultMath/math.cs:393-426`, `shaders/CultMath.hlsl:396-426`). `cellular(float3)`: Worley F1 and F2 - F1 with analytic gradients, jitter from `pcg3d` of the integer cell, 3D, unweighted (`math.cs:849-975`, `CultMath.hlsl:440-503`). `smin_grad` (`math.cs:831-847`, `CultMath.hlsl:428-437`). `distance_to_segment` in C# only (`math.cs:319`; no HLSL twin). No weighted cellular, no diagram over explicit weighted sites, no site-graph gate. | -| B29 | How does CultMath own parity? | Two legs, one owner each (`packages/cultmath/docs/design.md:202-206`): HLSL against C# by the mirror test, which compiles the text of `CultMath.hlsl` as C# and compares float32 bit patterns (`design.md:118-124`), plus a clean `dxc -T lib_6_3` compile (`design.md:114-116`); GLSL against C# by golden fixtures run on a device. The mirror proves the composition in the text, not that a GPU agrees (`design.md:119-121`); device HLSL runs are consumers' today (Asura `gpu-snoise-parity`; Aetheria `FlowFieldParityVerify`). CultMath ships a Unity compute smoke (`packages/cultmath/scripts/unity-smoke/`). Aetheria pins `cultmath-unity-v0.4.1` (`Packages/manifest.json`). | +| B29 | How does CultMath own parity? | Two legs, one owner each (`packages/cultmath/docs/design.md:202-206`): HLSL against C# by the mirror test, which compiles the text of `CultMath.hlsl` as C# and compares float32 bit patterns (`design.md:118-124`), plus a clean `dxc -T lib_6_3` compile (`design.md:114-116`); GLSL against C# by golden fixtures run on a device. The mirror proves the composition in the text, not that a GPU agrees (`design.md:119-121`); device HLSL runs are consumers' today (Asura `gpu-snoise-parity`; Aetheria `FlowFieldParityVerify`). CultMath ships a Unity compute smoke (`packages/cultmath/scripts/unity-smoke/`). Aetheria pins `cultmath-unity-v0.5.0` (`Packages/manifest.json`). | | B30 | Does Aetheria already keep a math twin outside CultMath? | Yes. `FlowField` uses CultMath's `math`, but its `Tri`, `Tri3` and `Tri3D` are Aetheria functions (`FlowField.cs:66-72`) whose HLSL twin is `Volumetric.cginc`, pinned by Aetheria's own `FlowFieldParityVerify` (`RelativeTolerance` 1.5e-4). That is a second parity owner beside CultMath. | | B31 | What is parked in CultMath that a DAG would use? | The tape: steps 2-5 (expression graph lowered to bytecode with C# evaluators, pruning, an HLSL interpreter, meshing) are parked until Asura is stable (`docs/cultmath-tape-target.md:3-8`, ruling `tape-target-unparks-when-asura-stable`). "Truth and lowerings" (`:84-92`): the field is a typed CultCache document, and the CPU evaluator and the HLSL interpreter are lowerings of it. Step 1 (intervals) and affine forms are on main. | | B32 | Do the candidates make filaments? (`docs/research/2026-10-14-trophic-dag-probe/`, README there; wells orbit, slope terms on, t = 0) | `skein` draws strands between neighbouring wells, bent by the flow (`density_skein.png`); `lattice` draws a fine cellular web, dense on the shoulders, dim elsewhere, with no long links (`density_lattice.png`); `skein-web` draws both: strands from well to well with a web hanging off them (`density_skein-web.png`, `layer_L2-krill.png`). Correlation with the B20 Physarum map at 64x32 blocks (this measures the envelope, not filaments: a block is 62 u, wider than a strand): band .512, lattice .359, skein-web .296, krill .277, skein .225, slack .171. Hosted krill at 16 u: band 2,075, skein-web 1,475, skein 639, lattice 419. | From b1dae6218e80eeaf28a260d0a3754ed179dc95d3 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 12:43:37 +0000 Subject: [PATCH 046/108] Entity.ItemFits: an equipped item is judged without its own cells, so a gun moves within its hardpoint The public ItemFits(item, coord) the inventory drag asks counted the dragged equipped item's own cells as occupied, so a nudge overlapping its current cells was refused. The private rule now takes the item being moved as an excluded occupant. TryEquip and TryFindSpace pass none and stay strict, so equipping an equipped item twice is still refused; the UI keeps TryUnequip then TryEquip (cargo bay emptiness rule). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Entity.cs | 23 +++++--- .../HardpointOwnershipTests.cs | 59 +++++++++++++++++++ 2 files changed, 74 insertions(+), 8 deletions(-) diff --git a/Assets/Scripts/ServerShared/Entity.cs b/Assets/Scripts/ServerShared/Entity.cs index 2394a6134..43d9729d9 100644 --- a/Assets/Scripts/ServerShared/Entity.cs +++ b/Assets/Scripts/ServerShared/Entity.cs @@ -1525,7 +1525,8 @@ public abstract class Entity // Check whether the given item will fit when its origin is placed at the given coordinate. For hardpoint gear, // hardpoint is the one hardpoint the item would occupy there (HardpointAt); Tool gear occupies none. - private bool ItemFits(EquippableItemData itemData, HullData hullData, EquippableItem item, int2 hullCoord, out HardpointData hardpoint) + private bool ItemFits(EquippableItemData itemData, HullData hullData, EquippableItem item, int2 hullCoord, out HardpointData hardpoint, + EquippedItem moving = null) { hardpoint = null; // Items without specific hardpoints on the ship can be freely rotated and placed anywhere @@ -1538,13 +1539,13 @@ public abstract class Entity // general gear may take it until hardpoint gear claims it, which is the same rule // UnoccupiedSpace reports, so what generation is offered and what equipping accepts agree. var itemCoord = hullCoord + itemData.Shape.Rotate(i, item.Rotation); - if (!hullData.InteriorCells[itemCoord] || GearOccupancy[itemCoord.x, itemCoord.y] != null) + if (!hullData.InteriorCells[itemCoord] || !IsFree(itemCoord.x, itemCoord.y, moving)) return false; } } else { - hardpoint = HardpointAt(itemData, hullData, hullCoord); + hardpoint = HardpointAt(itemData, hullData, hullCoord, moving); if (hardpoint == null) return false; item.Rotation = hardpoint.Rotation; } @@ -1552,27 +1553,33 @@ public abstract class Entity return true; } + // A cell is free when no gear occupies it, or when the only occupant is the item being moved: a re-place of + // equipped gear is judged against the hull minus that item's own cells (the caller unequips, then equips). + private bool IsFree(int x, int y, EquippedItem moving) => GearOccupancy[x, y] == null || GearOccupancy[x, y] == moving; + // The one placement rule for hardpoint gear. At this origin the item lies within a hardpoint of its type, turned to // that hardpoint's rotation (HardpointData.TakesAt, the fit rule); its own cells are free, since a hardpoint's // leftover cells may hold general gear (operator, 2026-09-30: "saving slots in a hardpoint can be a valid tradeoff // for crowded ships"); and that hardpoint holds no other hardpoint item, since it holds one at most. - private HardpointData HardpointAt(EquippableItemData itemData, HullData hullData, int2 hullCoord) + private HardpointData HardpointAt(EquippableItemData itemData, HullData hullData, int2 hullCoord, EquippedItem moving) { foreach (var hardpoint in hullData.Hardpoints) { if (!hardpoint.TakesAt(itemData, hullCoord - hardpoint.Position)) continue; var ownCellsFree = itemData.Shape.Coordinates .Select(v => hullCoord + itemData.Shape.Rotate(v, hardpoint.Rotation)) - .All(c => GearOccupancy[c.x, c.y] == null); + .All(c => IsFree(c.x, c.y, moving)); var holdsAnother = hardpoint.Shape.Coordinates .Select(v => GearOccupancy[hardpoint.Position.x + v.x, hardpoint.Position.y + v.y]) - .Any(occupant => occupant != null && occupant.Data.HardpointType != HardpointType.Tool); + .Any(occupant => occupant != null && occupant != moving && occupant.Data.HardpointType != HardpointType.Tool); if (ownCellsFree && !holdsAnother) return hardpoint; } return null; } - // Check whether the given item will fit when its origin is placed at the given coordinate on the hull + // Check whether the given item will fit when its origin is placed at the given coordinate on the hull. An item that + // is already equipped here is judged without its own cells, so a gun can be moved within its own hardpoint; + // TryEquip stays strict (it never sees an item as its own occupant), so equipping an equipped item twice is refused. public bool ItemFits(EquippableItem item, int2 hullCoord) { // Don't allow equipping while deployed @@ -1580,7 +1587,7 @@ public abstract class Entity var itemData = ItemManager.GetData(item); var hullData = ItemManager.GetData(Hull) as HullData; - return ItemFits(itemData, hullData, item, hullCoord, out _); + return ItemFits(itemData, hullData, item, hullCoord, out _, Equipment.FirstOrDefault(e => e.EquippableItem == item)); } public bool TryFindSpace(EquippableItem item, out int2 hullCoord) diff --git a/tests/Aetheria.Shared.Tests/HardpointOwnershipTests.cs b/tests/Aetheria.Shared.Tests/HardpointOwnershipTests.cs index 2b8fa2270..1ddc1d10b 100644 --- a/tests/Aetheria.Shared.Tests/HardpointOwnershipTests.cs +++ b/tests/Aetheria.Shared.Tests/HardpointOwnershipTests.cs @@ -142,6 +142,65 @@ public sealed partial class RunStartTests Assert.Null(entity.EquippedHull.Hardpoint); } + private static Shape Bar(int width) + { + var bar = new Shape(width, 1); + foreach (var cell in bar.AllCoordinates) bar[cell] = true; + return bar; + } + + // Scenarios batch-4 minor: dragging an equipped gun within its own hardpoint. The UI asks ItemFits about the dragged + // item at its current and nudged origin, then TryUnequip and TryEquip at the target. The gun's own cells are not + // occupied against itself, so the nudge that overlaps its current cells is accepted and the sequence lands there. + [Fact] + public void AnEquippedGunCanBeMovedWithinItsOwnHardpoint() + { + var hull = ScratchHull("Minor Drag Mount", 9, Mount(HardpointType.Ballistic, 1, 1, Bar(3))); + var gun = ScratchGear("Minor Drag Gun", HardpointType.Ballistic, Bar(2)); + var entity = BareHull(hull); + var unit = Instance(gun); + Assert.True(entity.TryEquip(unit, int2(1, 1))); + var equipped = entity.Equipment.Single(i => i.Data == gun); + + Assert.True(entity.ItemFits(unit, int2(1, 1)), "its current origin"); + Assert.True(entity.ItemFits(unit, int2(2, 1)), "nudged one cell, overlapping its own cells"); + + Assert.NotNull(entity.TryUnequip(equipped)); + Assert.True(entity.TryEquip(unit, int2(2, 1))); + Assert.Equal(int2(2, 1), entity.Equipment.Single(i => i.Data == gun).Position); + Assert.Same(hull.Hardpoints[0], entity.Equipment.Single(i => i.Data == gun).Hardpoint); + } + + // Ignoring the item's own cells does not ignore anyone else's: a second hardpoint item cannot share the hardpoint, + // and TryEquip never treats an item as its own occupant, so equipping an equipped item again is refused. + [Fact] + public void MovingAnEquippedItemStillRespectsOtherOccupantsAndTryEquipStaysStrict() + { + var hull = ScratchHull("Minor Drag Strict", 9, Mount(HardpointType.Ballistic, 1, 1, Bar(4))); + var gun = ScratchGear("Minor Strict Gun", HardpointType.Ballistic, Bar(2)); + var other = ScratchGear("Minor Strict Other", HardpointType.Ballistic, Bar(1)); + var entity = BareHull(hull); + var unit = Instance(gun); + Assert.True(entity.TryEquip(unit, int2(1, 1))); + Assert.False(entity.TryEquip(Instance(other), int2(3, 1)), "the hardpoint holds one hardpoint item"); + Assert.False(entity.TryEquip(unit, int2(2, 1)), "TryEquip is strict: no duplicate of an equipped item"); + Assert.Single(entity.Equipment, i => i.Data == gun); + } + + // A tool dragged within its own cells is judged the same way. + [Fact] + public void AnEquippedToolCanBeMovedOverItsOwnCells() + { + var hull = ScratchHull("Minor Drag Tool Hull", 9); + var tool = ScratchGear("Minor Drag Tool", HardpointType.Tool, Bar(2)); + var entity = BareHull(hull); + var unit = Instance(tool); + Assert.True(entity.TryEquip(unit, int2(1, 1))); + Assert.True(entity.ItemFits(unit, int2(2, 1)), "nudged over its own cell"); + Assert.False(entity.TryEquip(unit, int2(2, 1)), "TryEquip never sees an item as its own occupant"); + Assert.Single(entity.Equipment, i => i.Data == tool); + } + // The design's cells, turned to a rotation, moved so the lowest x and y are zero. Written here from the cells alone // (the game's turn directions, up to translation), so it is not Shape.Rotate checking itself. private static HashSet<(int x, int y)> Normalized(IEnumerable<int2> cells, ItemRotation rotation) From 4c6dcfea739f231acbbb914011b262f85afebb1b Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 12:43:37 +0000 Subject: [PATCH 047/108] AetherDb station-reactor-spread [apply]: station reactor products regain their sources' quality spread f458206c7 authored the five per-manufacturer station reactor products with bare ProductRole entries (the .5 / .15 default). The command copies each source product's Mean and StandardDeviation per role to a role still at the default, and was applied to the catalog. TwoAiDigest repinned for the catalog move. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- GameData/Aetheria.cc | 2 +- .../DeterminismLedgerTests.cs | 5 +- .../StationReactorSpreadTests.cs | 99 +++++++++++++++++++ tools/AetherDb/Program.cs | 1 + tools/AetherDb/StationReactorSpreadCommand.cs | 82 +++++++++++++++ 5 files changed, 187 insertions(+), 2 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/StationReactorSpreadTests.cs create mode 100644 tools/AetherDb/StationReactorSpreadCommand.cs diff --git a/GameData/Aetheria.cc b/GameData/Aetheria.cc index da60f2dd3..f4cfdc4a3 100644 --- a/GameData/Aetheria.cc +++ b/GameData/Aetheria.cc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:319c14830b174e4bd58fe849b1300f38d7724d91027e47a03a5c121741d38e51 +oid sha256:9edc8434524f43f751c89416479cf07fba03b424f266cb8bfc1870bd46eef6a7 size 220537 diff --git a/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs b/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs index 31b71dba0..c7b5cb79a 100644 --- a/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs +++ b/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs @@ -54,7 +54,10 @@ public sealed partial class RunStartTests // moved the digest and returned it to 52fbb10d, which master already measured before this cut. The authored-cargo and // ammunition-data blob of this cut moved nothing (52fbb10d measured with it merged in). Fixtures run ThrustScale=1 while play // uses 0.1, so this digest pins the fight's logic, not the shipped feel. - private const string TwoAiPinnedDigest = "52fbb10df2559829a11f3a38aae0783f3f1858b0499f6f46794a267a747adacb"; + // Repinned a ninth time, once (scenarios-batch4-minors): the catalog restores the five station-reactor products' quality + // spread (station-reactor-spread), and that blob alone moved the digest (the same tree with the old catalog measured 52fbb10d; + // the path from role spread to the fight was not traced). + private const string TwoAiPinnedDigest = "9c70a3ee234fb3b879f721a4a4abf13dd83bf56fd8733690d356b89b8a392258"; private const float TwoAiSeconds = 60f; [Fact] diff --git a/tests/Aetheria.Shared.Tests/StationReactorSpreadTests.cs b/tests/Aetheria.Shared.Tests/StationReactorSpreadTests.cs new file mode 100644 index 000000000..41161975a --- /dev/null +++ b/tests/Aetheria.Shared.Tests/StationReactorSpreadTests.cs @@ -0,0 +1,99 @@ +using System; +using System.IO; +using System.Linq; +using GameCult.Caching; +using Xunit; + +// station-reactor-spread (aetheria-release follow-up scenarios-batch4-minors): a station reactor's product keeps the +// quality spread of the reactor product it was scaled from. The mint reads a product's Roles (Mean, StandardDeviation) per +// design role, and a role missing or left at the unauthored default draws a flat .5 / .15 instead of the maker's spread. +public sealed class StationReactorSpreadTests : IDisposable +{ + private readonly string _root = Path.Combine(Path.GetTempPath(), "aetheria-station-spread-" + Guid.NewGuid().ToString("N")); + private string Catalog => Path.Combine(_root, "Aetheria.cc"); + + public StationReactorSpreadTests() => Directory.CreateDirectory(_root); + public void Dispose() => Directory.Delete(_root, true); + + // Read the way the mint does (ItemManager.Mint): the product's own Roles, matched by role name. + [Fact] + public void ShippedStationReactorProductsCarryTheirSourcesSpread() + { + using var cache = RestoredHullsTests.OpenCatalog(); + var products = cache.GetAll<FactionProductData>().ToArray(); + FactionProductData Find(string name, string maker) => + products.Single(p => p.Name == name && cache.Get(p.Manufacturer)?.ShortName == maker); + + foreach (var (stationName, sourceName, maker) in StationReactorSpreadCommand.Rows) + { + var station = Find(stationName, maker); + var source = Find(sourceName, maker); + Assert.NotEmpty(station.Roles); + foreach (var role in station.Roles) + { + var from = source.Roles.Single(r => r.Role == role.Role); + Assert.Equal(from.Mean, role.Mean); + Assert.Equal(from.StandardDeviation, role.StandardDeviation); + } + Assert.Contains(station.Roles, r => r.Mean != .5f || r.StandardDeviation != .15f); + } + } + + private void Seed() + { + using var cache = AetheriaStores.Open(Catalog, catalogWritable: true); + cache.Upsert(new VerseGrammar { Revision = 1 }); + var maker = cache.Upsert(new Faction { Name = "Maker", ShortName = "M" }); + var gear = cache.Upsert(new GearData { Name = "Lamp", Hardpoint = HardpointType.Sensors, Shape = new Shape(), Price = 10 }); + var design = new CultRecordRef<CraftedItemData>(gear.Key); + cache.Upsert(new FactionProductData + { + Name = "Source", Design = design, Manufacturer = maker, + Roles = { new ProductRole { Role = "core", Mean = .7f, StandardDeviation = .05f }, new ProductRole { Role = "regulator", Mean = .3f, StandardDeviation = .2f } } + }); + cache.Upsert(new FactionProductData + { + Name = "Source Station", Design = design, Manufacturer = maker, + Roles = { new ProductRole { Role = "core" }, new ProductRole { Role = "regulator", Mean = .9f, StandardDeviation = .01f } } + }); + cache.FlushAsync().Wait(); + } + + private static readonly (string Station, string Source, string Maker)[] Fixture = { ("Source Station", "Source", "M") }; + + private string Run(bool apply) + { + using var cache = AetheriaStores.Open(Catalog, catalogWritable: apply); + var output = new StringWriter(); + Assert.Equal(0, StationReactorSpreadCommand.Run(cache, apply, output, Fixture)); + cache.FlushAsync().Wait(); + return output.ToString(); + } + + private ProductRole RoleOf(string role) + { + using var cache = AetheriaStores.Open(Catalog); + return cache.GetAll<FactionProductData>().Single(p => p.Name == "Source Station").Roles.Single(r => r.Role == role); + } + + // A role at the unauthored default takes the source's pair, a role tuned in Studio is kept, a dry run writes nothing, + // and a second apply has nothing to do. + [Fact] + public void CopiesOnlyUnauthoredRolesAndReplaysToNothing() + { + Seed(); + var before = File.ReadAllBytes(Catalog); + Assert.Contains("core", Run(apply: false)); + Assert.Equal(before, File.ReadAllBytes(Catalog)); + + Run(apply: true); + Assert.Equal(.7f, RoleOf("core").Mean, 3); + Assert.Equal(.05f, RoleOf("core").StandardDeviation, 3); + Assert.Equal(.9f, RoleOf("regulator").Mean, 3); + Assert.Equal(.01f, RoleOf("regulator").StandardDeviation, 3); + + var written = File.ReadAllBytes(Catalog); + Assert.Contains("No changes", Run(apply: true)); + Assert.Equal(written, File.ReadAllBytes(Catalog)); + } +} diff --git a/tools/AetherDb/Program.cs b/tools/AetherDb/Program.cs index 5d3d18e93..2caaaed4b 100644 --- a/tools/AetherDb/Program.cs +++ b/tools/AetherDb/Program.cs @@ -59,6 +59,7 @@ public static class Program case "inspection-scanner": return InspectionScannerCatalog(args.Contains("apply")); case "product-lines": return ProductLinesCommand.Run(args.Skip(1).ToArray()); case "minor-power-factions": return MinorPowerFactionsCommand.Run(args.Skip(1).ToArray()); + case "station-reactor-spread": return StationReactorSpreadCommand.Run(AetherDb.Open(catalogWritable: args.Contains("apply")).Cache, args.Contains("apply"), Console.Out); case "assembly-from-maker": return AssemblyFromMakerCommand.Run(AetherDb.Open(catalogWritable: args.Contains("apply")).Cache, args.Contains("apply"), Console.Out); case "place-names": Console.OutputEncoding = new System.Text.UTF8Encoding(false); diff --git a/tools/AetherDb/StationReactorSpreadCommand.cs b/tools/AetherDb/StationReactorSpreadCommand.cs new file mode 100644 index 000000000..6f7064fb3 --- /dev/null +++ b/tools/AetherDb/StationReactorSpreadCommand.cs @@ -0,0 +1,82 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using GameCult.Caching; + +// station-reactor-spread [apply] (aetheria-release follow-up scenarios-batch4-minors): the per-manufacturer station reactors +// (f458206c7) were authored as scaled copies of each maker's largest reactor, but their products were authored with a bare +// ProductRole { Role } for each role, which is the .5 / .15 default, so they lost the source product's quality spread. This +// gives each station product the Mean and StandardDeviation the source product holds for the same role. It writes only a role +// still at the default pair, so a spread tuned in Studio survives every replay, and a second apply has nothing to do. Replays +// before assembly-from-maker (which derives from role means) when that command has an unauthored maker to fill. Dry run +// unless apply. +public static class StationReactorSpreadCommand +{ + // The role pair an unauthored ProductRole carries (ProductRole's field defaults). + private static readonly ProductRole Unauthored = new ProductRole(); + + // (station product, source product, maker short name): the source is the maker's product of the reactor the station + // design was scaled from. + public static readonly (string Station, string Source, string Maker)[] Rows = + { + ("Steadfast Station", "Steadfast", "R&D"), + ("Manhattan Station", "Manhattan", "Zhestokost"), + ("Notorious Station", "Notorious", "Lucent"), + ("Vulcan Station", "Vulcan", "AU"), + ("MoveOnPro Station", "MoveOnPro", "NiteLife"), + }; + + public static int Run(CultCache cache, bool apply, TextWriter output, (string Station, string Source, string Maker)[] rows = null) + { + var products = cache.GetAll<FactionProductData>().ToArray(); + FactionProductData Find(string name, string maker) + { + var found = products.Where(p => p.Name == name && cache.Get(p.Manufacturer)?.ShortName == maker).ToArray(); + if (found.Length != 1) throw new InvalidOperationException($"Station reactor row \"{name}\" by {maker}: {found.Length} products match."); + return found[0]; + } + + var changed = new List<FactionProductData>(); + foreach (var (stationName, sourceName, maker) in rows ?? Rows) + { + var station = Find(stationName, maker); + var source = Find(sourceName, maker); + foreach (var role in station.Roles) + { + var from = source.Roles.SingleOrDefault(r => r.Role == role.Role) + ?? throw new InvalidOperationException($"\"{sourceName}\" holds no \"{role.Role}\" role to copy to \"{stationName}\"."); + if (role.Mean != Unauthored.Mean || role.StandardDeviation != Unauthored.StandardDeviation) continue; + if (from.Mean == role.Mean && from.StandardDeviation == role.StandardDeviation) continue; + output.WriteLine($"{stationName} ({maker}) {role.Role}: {role.Mean:0.###}±{role.StandardDeviation:0.###} -> {from.Mean:0.###}±{from.StandardDeviation:0.###}"); + role.Mean = from.Mean; + role.StandardDeviation = from.StandardDeviation; + if (!changed.Contains(station)) changed.Add(station); + } + } + + if (changed.Count == 0) + { + output.WriteLine("No changes."); + return 0; + } + + if (!apply) + { + output.WriteLine($"\nDry run. Pass \"apply\" to write {changed.Count} products."); + return 0; + } + + foreach (var product in changed) CultRecordRefs.Validate(product); + cache.Commit(batch => + { + foreach (var product in changed) batch.Upsert(typeof(FactionProductData), product, cache.RefOf(product).Key); + }); + output.WriteLine($"\nWrote {changed.Count} products in Aetheria.cc"); + return 0; + } +} From 156d7c5a19fe31eabaeb305dfe5930c619609e1d Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 13:10:13 +0000 Subject: [PATCH 048/108] Determinism ledger: record why the station-reactor spread moves the two-AI digest Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs b/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs index c7b5cb79a..7b7182400 100644 --- a/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs +++ b/tests/Aetheria.Shared.Tests/DeterminismLedgerTests.cs @@ -56,7 +56,8 @@ public sealed partial class RunStartTests // uses 0.1, so this digest pins the fight's logic, not the shipped feel. // Repinned a ninth time, once (scenarios-batch4-minors): the catalog restores the five station-reactor products' quality // spread (station-reactor-spread), and that blob alone moved the digest (the same tree with the old catalog measured 52fbb10d; - // the path from role spread to the fight was not traced). + // traced: only Notorious Station moves it, because the zone's station Zenith carries a Notorious Station reactor lot whose + // minted quality changes with the role spread, and Snapshot hashes every zone entity's heat and shield). private const string TwoAiPinnedDigest = "9c70a3ee234fb3b879f721a4a4abf13dd83bf56fd8733690d356b89b8a392258"; private const float TwoAiSeconds = 60f; From ff54fe7b463b99ad490b5530085f25e34cab9cfa Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 09:50:22 +0000 Subject: [PATCH 049/108] Pin CultLib abd1a92e: element ids on every list element type, tests follow the new wire and write rules Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../ServerShared/Behaviors/Behaviors.cs | 4 ++ Assets/Scripts/ServerShared/Corporations.cs | 3 + .../Scripts/ServerShared/EntitySerializer.cs | 3 + Assets/Scripts/ServerShared/FactionProduct.cs | 3 + Assets/Scripts/ServerShared/InputLayout.cs | 8 ++- Assets/Scripts/ServerShared/ItemData.cs | 9 +++ Assets/Scripts/ServerShared/Loadout.cs | 3 + Assets/Scripts/ServerShared/Provenance.cs | 6 ++ Assets/Scripts/ServerShared/Recipes.cs | 6 ++ Assets/Scripts/ServerShared/SavedGame.cs | 9 +++ Assets/Scripts/ServerShared/ShipAuthoring.cs | 9 +++ Assets/Scripts/ServerShared/StationKinds.cs | 3 + Assets/Scripts/ServerShared/VerseGrammar.cs | 3 + Assets/Scripts/ServerShared/ZoneData.cs | 15 +++++ Directory.Build.props | 4 +- docs/element-ids.md | 29 ++++++++++ tests/Aetheria.Shared.Tests/ElementIdBlind.cs | 57 +++++++++++++++++++ .../ElementIdUpgradeTests.cs | 56 ++++++++++++++++++ tests/Aetheria.Shared.Tests/EmissionTests.cs | 2 +- .../InspectionScannerCommandTests.cs | 2 +- .../LaunchSuppressorCommandTests.cs | 2 +- .../LaunchSuppressorTests.cs | 2 +- tests/Aetheria.Shared.Tests/ListenerTests.cs | 2 +- tests/Aetheria.Shared.Tests/PaintModeTests.cs | 2 +- tests/Aetheria.Shared.Tests/ScannerTests.cs | 2 +- .../ShipAuthoringTests.cs | 16 ++---- .../ShipModCatalogTests.cs | 2 +- .../Aetheria.Shared.Tests/ShipProductTests.cs | 2 +- tests/Aetheria.Shared.Tests/ShipRigTests.cs | 4 +- tests/Aetheria.Shared.Tests/SignatureTests.cs | 2 +- .../SmokeRoundsCommandTests.cs | 2 +- .../Aetheria.Shared.Tests/VapourCloudTests.cs | 2 +- tools/AetherDb/EconomyCommand.cs | 4 ++ 33 files changed, 251 insertions(+), 27 deletions(-) create mode 100644 docs/element-ids.md create mode 100644 tests/Aetheria.Shared.Tests/ElementIdBlind.cs create mode 100644 tests/Aetheria.Shared.Tests/ElementIdUpgradeTests.cs diff --git a/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs b/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs index 6b899ee35..300229d3f 100644 --- a/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs +++ b/Assets/Scripts/ServerShared/Behaviors/Behaviors.cs @@ -6,6 +6,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using GameCult.Caching; using MessagePack; using Newtonsoft.Json; using CultMath; @@ -212,4 +213,7 @@ public abstract class BehaviorData { return base.ToString().FormatTypeName(); } + + // Element identity: minted by the cache on write; "" means unset. + [Key(37)] [CultElementId] public string Id = ""; } \ No newline at end of file diff --git a/Assets/Scripts/ServerShared/Corporations.cs b/Assets/Scripts/ServerShared/Corporations.cs index e527606d9..080f42aac 100644 --- a/Assets/Scripts/ServerShared/Corporations.cs +++ b/Assets/Scripts/ServerShared/Corporations.cs @@ -84,5 +84,8 @@ public class FactionPlace // treats an invalid entry as absent; AetherDb place-names refuses a table that holds one. public static bool IsValidName(string name) => !string.IsNullOrEmpty(name) && name == name.Trim() && !name.StartsWith("EAC-", StringComparison.OrdinalIgnoreCase); + + // Element identity: minted by the cache on write; "" means unset. + [Key(2)] [CultElementId] public string Id = ""; } diff --git a/Assets/Scripts/ServerShared/EntitySerializer.cs b/Assets/Scripts/ServerShared/EntitySerializer.cs index 7f0f04ebd..9aefe5a19 100644 --- a/Assets/Scripts/ServerShared/EntitySerializer.cs +++ b/Assets/Scripts/ServerShared/EntitySerializer.cs @@ -294,4 +294,7 @@ public abstract class EntityPack return _price; } + + // Element identity: minted by the cache on write; "" means unset. + [Key(23)] [CultElementId] public string Id = ""; } diff --git a/Assets/Scripts/ServerShared/FactionProduct.cs b/Assets/Scripts/ServerShared/FactionProduct.cs index 14f7af57d..87ac72f7d 100644 --- a/Assets/Scripts/ServerShared/FactionProduct.cs +++ b/Assets/Scripts/ServerShared/FactionProduct.cs @@ -61,6 +61,9 @@ public class ProductRole [Inspectable, JsonProperty("standardDeviation"), Key(2)] public float StandardDeviation = .15f; + + // Element identity: minted by the cache on write; "" means unset. + [Key(3)] [CultElementId] public string Id = ""; } // A bin of one of the maker's lines (ruling maker-design-tiers-allowed): the line it bins (the same design and maker, itself diff --git a/Assets/Scripts/ServerShared/InputLayout.cs b/Assets/Scripts/ServerShared/InputLayout.cs index a688598b2..7e942c519 100644 --- a/Assets/Scripts/ServerShared/InputLayout.cs +++ b/Assets/Scripts/ServerShared/InputLayout.cs @@ -29,7 +29,10 @@ public class InputLayout Union(0, typeof(InputLayoutRowSpacer)), Union(1, typeof(InputLayoutKeyRow)) ] -public abstract class InputLayoutRow { } +public abstract class InputLayoutRow { + // Element identity: minted by the cache on write; "" means unset. + [Key(1)] [CultElementId] public string Id = ""; +} [MessagePackObject, JsonObject(MemberSerialization.OptIn)] public class InputLayoutRowSpacer : InputLayoutRow @@ -52,6 +55,9 @@ public class InputLayoutKeyRow : InputLayoutRow public abstract class InputLayoutColumn { [Key(0), JsonProperty("width")] public float Width; + + // Element identity: minted by the cache on write; "" means unset. + [Key(5)] [CultElementId] public string Id = ""; } [MessagePackObject, JsonObject(MemberSerialization.OptIn)] diff --git a/Assets/Scripts/ServerShared/ItemData.cs b/Assets/Scripts/ServerShared/ItemData.cs index 72c07fc9a..ab9c9dcfc 100644 --- a/Assets/Scripts/ServerShared/ItemData.cs +++ b/Assets/Scripts/ServerShared/ItemData.cs @@ -348,6 +348,9 @@ public class ItemRole [Inspectable, JsonProperty("count"), Key(1)] public int Count = 1; + + // Element identity: minted by the cache on write; "" means unset. + [Key(2)] [CultElementId] public string Id = ""; } [CultDocument("aetheria.compoundcommoditydata", "1"), Inspectable, MessagePackObject] @@ -635,6 +638,9 @@ public class HardpointData } private static Dictionary<HardpointType, float3> _tintColors; + + // Element identity: minted by the cache on write; "" means unset. + [Key(8)] [CultElementId] public string Id = ""; } // What a PerformanceStat reads to resolve one number: the lot it prices quality against, and the per-context @@ -680,6 +686,9 @@ public class StatTerm // The design role whose part quality this term reads; unset reads the item's effective quality (Lot.EffectiveQuality). // Njordr states the same rule as a derivation over dimensions; this is that rule with one dimension. [Inspectable, JsonProperty("role"), Key(2)] public string Role; + + // Element identity: minted by the cache on write; "" means unset. + [Key(3)] [CultElementId] public string Id = ""; } [MessagePackObject, JsonObject(MemberSerialization.OptIn)] diff --git a/Assets/Scripts/ServerShared/Loadout.cs b/Assets/Scripts/ServerShared/Loadout.cs index 4866aa406..b423eb1a0 100644 --- a/Assets/Scripts/ServerShared/Loadout.cs +++ b/Assets/Scripts/ServerShared/Loadout.cs @@ -28,6 +28,9 @@ public class LoadoutSlot [Key(1)] public ItemRotation Rotation; [Key(2)] public CultRecordRef<EquippableItemData> Design; [Key(3)] public CultRecordRef<FactionProductData> Product; // unset: design-only, chosen at materialization + + // Element identity: minted by the cache on write; "" means unset. + [Key(4)] [CultElementId] public string Id = ""; } // Why a faction has no boss Loadout to build; see Loadouts.BossOf. diff --git a/Assets/Scripts/ServerShared/Provenance.cs b/Assets/Scripts/ServerShared/Provenance.cs index 4121332d6..25a4a6175 100644 --- a/Assets/Scripts/ServerShared/Provenance.cs +++ b/Assets/Scripts/ServerShared/Provenance.cs @@ -92,6 +92,9 @@ public class Lot foreach (var fill in Roles) sum += Math.Min(fill.Quality, Quality); return sum / Roles.Count; } + + // Element identity: minted by the cache on write; "" means unset. + [Key(5)] [CultElementId] public string Id = ""; } // One filled slot: the design's role name and how good the part that went into it turned out to be. Stats read it through @@ -101,6 +104,9 @@ public class RoleFill { [Key(0)] public string Role; [Key(1)] public float Quality; + + // Element identity: minted by the cache on write; "" means unset. + [Key(2)] [CultElementId] public string Id = ""; } // Who built a lot, where, and from what. Terminus mints Attributed placeholders; Produced and Extracted are the diff --git a/Assets/Scripts/ServerShared/Recipes.cs b/Assets/Scripts/ServerShared/Recipes.cs index e434a84a5..f9aa3ee4a 100644 --- a/Assets/Scripts/ServerShared/Recipes.cs +++ b/Assets/Scripts/ServerShared/Recipes.cs @@ -63,6 +63,9 @@ public class CommodityCount [JsonProperty("count"), Key(1)] public int Count = 1; + + // Element identity: minted by the cache on write; "" means unset. + [Key(2)] [CultElementId] public string Id = ""; } // A region gate's trade with the world beyond it: what the outside buys and sells, at what price and at most how fast. @@ -96,6 +99,9 @@ public class OutsideMarketRow [JsonProperty("ratePerHour"), Key(4)] public float RatePerHour; + + // Element identity: minted by the cache on write; "" means unset. + [Key(5)] [CultElementId] public string Id = ""; } // The one reader of recipes: which recipe makes a good, a recipe's role slots (RoleInputsOf), which commodities fill a role, and diff --git a/Assets/Scripts/ServerShared/SavedGame.cs b/Assets/Scripts/ServerShared/SavedGame.cs index 88ff8c9bf..5f42de446 100644 --- a/Assets/Scripts/ServerShared/SavedGame.cs +++ b/Assets/Scripts/ServerShared/SavedGame.cs @@ -78,6 +78,9 @@ public class SavedStanding [Key(1)] public FactionRelationship Relationship; + + // Element identity: minted by the cache on write; "" means unset. + [Key(2)] [CultElementId] public string Id = ""; } [MessagePackObject] @@ -88,6 +91,9 @@ public class SavedProvince [Key(1)] public CultRecordRef<ProvinceData> Type; + + // Element identity: minted by the cache on write; "" means unset. + [Key(2)] [CultElementId] public string Id = ""; } // The run's lifecycle over the run store. Only Commit creates SavedGame, SavedZone and ProvenanceLedger records; @@ -301,6 +307,9 @@ public class SavedZone ] public abstract class SavedActionBarBinding { + + // Element identity: minted by the cache on write; "" means unset. + [Key(2)] [CultElementId] public string Id = ""; } [MessagePackObject] diff --git a/Assets/Scripts/ServerShared/ShipAuthoring.cs b/Assets/Scripts/ServerShared/ShipAuthoring.cs index 3962fa468..8441d0332 100644 --- a/Assets/Scripts/ServerShared/ShipAuthoring.cs +++ b/Assets/Scripts/ServerShared/ShipAuthoring.cs @@ -33,6 +33,9 @@ public sealed class ShipJoint [Key(2)] public float[] Axes; [Key(3)] public float[] Min; [Key(4)] public float[] Max; + + // Element identity, derived from the bone id so it never changes across rewrites. + [Key(5)] [CultElementId(nameof(Id))] public string ElementId = ""; } [MessagePackObject] @@ -50,6 +53,9 @@ public sealed class ShipAnchor [Key(4)] public int Order; // On a weapon-mount anchor: the id of the nearest joint above its node in the model; null or empty is a fixed mount. [Key(5)] public string Joint; + + // Element identity, derived from the anchor id so it never changes across rewrites. + [Key(6)] [CultElementId(nameof(Id))] public string ElementId = ""; } // Evaluated or baked Grease Pencil stroke coordinates in Blender's right-handed Z-up @@ -64,6 +70,9 @@ public sealed class ShipPolyline [Key(4)] public float[] Opacities; [Key(5)] public bool Cyclic; [Key(6)] public float[] Color; + + // Element identity: minted by the cache on write; "" means unset. + [Key(7)] [CultElementId] public string Id = ""; } public static class ShipAuthoringStore diff --git a/Assets/Scripts/ServerShared/StationKinds.cs b/Assets/Scripts/ServerShared/StationKinds.cs index dad1ce2aa..eb2662eee 100644 --- a/Assets/Scripts/ServerShared/StationKinds.cs +++ b/Assets/Scripts/ServerShared/StationKinds.cs @@ -35,6 +35,9 @@ public class StationKindStandIn // The kind whose model this faction builds in place of the owning kind's. [JsonProperty("kind"), Key(1)] public CultRecordRef<StationKindData> Kind; + + // Element identity: minted by the cache on write; "" means unset. + [Key(2)] [CultElementId] public string Id = ""; } // The one owner of which kinds a faction builds, which kind a station gets, and which hull kind stands in. diff --git a/Assets/Scripts/ServerShared/VerseGrammar.cs b/Assets/Scripts/ServerShared/VerseGrammar.cs index 00e24833d..1219e70b6 100644 --- a/Assets/Scripts/ServerShared/VerseGrammar.cs +++ b/Assets/Scripts/ServerShared/VerseGrammar.cs @@ -40,6 +40,9 @@ public class VerseRole { [Key(1)] public string Name; [Key(2)] public VerseReferentKind Binds; + + // Element identity: minted by the cache on write; "" means unset. + [Key(3)] [CultElementId] public string Id = ""; } // The actor is the invoking subject and is never a role. diff --git a/Assets/Scripts/ServerShared/ZoneData.cs b/Assets/Scripts/ServerShared/ZoneData.cs index a08895aaa..e76963a43 100644 --- a/Assets/Scripts/ServerShared/ZoneData.cs +++ b/Assets/Scripts/ServerShared/ZoneData.cs @@ -67,6 +67,9 @@ public class ChunkWearPack [JsonProperty("brokenUntil"), Key(3)] public double? BrokenUntil; + + // Element identity: minted by the cache on write; "" means unset. + [Key(4)] [CultElementId] public string Id = ""; } [JsonObject(MemberSerialization.OptIn)] @@ -149,6 +152,9 @@ public class FieldYield [JsonProperty("regional"), Key(2)] public bool Regional; + + // Element identity: minted by the cache on write; "" means unset. + [Key(3)] [CultElementId] public string Id = ""; } // Ore geography (rulings provinces-within-regions, ores-are-regional): a kind of ground, authored. A region deals its @@ -182,6 +188,9 @@ public class ProvinceKindWeight [JsonProperty("weight"), Key(1)] public float Weight = 1; + + // Element identity: minted by the cache on write; "" means unset. + [Key(2)] [CultElementId] public string Id = ""; } [MessagePackObject, JsonObject(MemberSerialization.OptIn)] @@ -192,6 +201,9 @@ public class ProvinceOre [JsonProperty("weight"), Key(1)] public float Weight = 1; + + // Element identity: minted by the cache on write; "" means unset. + [Key(2)] [CultElementId] public string Id = ""; } // Mining Cut 3 (Q16 B): the one owner of which kind a belt is. Ore geography: and of what it yields. @@ -485,6 +497,9 @@ public class Asteroid [JsonProperty("rotationSpeed"), Key(3)] public float RotationSpeed; + + // Element identity: minted by the cache on write; "" means unset. + [Key(4)] [CultElementId] public string Id = ""; } [CultDocument("aetheria.orbitdata", "1"), MessagePackObject, JsonObject(MemberSerialization.OptIn)] diff --git a/Directory.Build.props b/Directory.Build.props index 05d5e4d22..66ff67e19 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,8 +2,8 @@ <PropertyGroup> <CultLibRoot Condition="'$(CultLibRoot)' == '' and '$(CULTLIB_ROOT)' != ''">$(CULTLIB_ROOT)</CultLibRoot> <CultLibRoot Condition="'$(CultLibRoot)' == ''">$(MSBuildThisFileDirectory)..\CultLib</CultLibRoot> - <!-- CultCache: caching-unity-v2.0.0 / cultlib-unity-v2.0.1 in Packages/manifest.json. --> - <CultLibRevision>b8fc5eb07720a187a0421424ac2cb3aa2966ca1d</CultLibRevision> + <!-- CultCache: abd1a92e (CultLib 3.0.0 unreleased; the Unity manifest tags still pin 2.0.x until a release is tagged). --> + <CultLibRevision>abd1a92eb24e1af3fc7cdd1bf98a88dbdebc2938</CultLibRevision> <CultMathRoot Condition="'$(CultMathRoot)' == '' and '$(CULTMATH_ROOT)' != ''">$(CULTMATH_ROOT)</CultMathRoot> <CultMathRoot Condition="'$(CultMathRoot)' == ''">$(CultLibRoot)</CultMathRoot> <!-- CultMath: cultmath-unity-v0.5.0 in Packages/manifest.json. --> diff --git a/docs/element-ids.md b/docs/element-ids.md new file mode 100644 index 000000000..31cc92e17 --- /dev/null +++ b/docs/element-ids.md @@ -0,0 +1,29 @@ +# Element ids and the CultLib pin (abd1a92e) + +CultLib 3.0 (unreleased; headless pin `abd1a92e`, `Directory.Build.props`) gives every element of an object list an identity. Every +element type reachable through a list of a `[CultDocument]` type carries one string member with `[Key(n)]` and `[CultElementId]`; +the registry refuses to open otherwise, naming the type and list. + +- **Where the slot goes.** A union base takes the member above its subclasses' highest key. `BehaviorData.Id` is key 37, so an + array-format behavior is 38 slots on the wire (`PaintModeTests`, `ShipRigTests` pin it). A new `BehaviorData` subclass must keep + its keys below 37 or move the slot, which is a wire change. +- **Derived ids.** `ShipJoint` and `ShipAnchor` already had a readable `Id`; CultLib refuses a readable id inside a marked member, + so each gained a trailing `ElementId` marked `[CultElementId(nameof(Id))]`. +- **Minting.** A writer mints random ids for elements that have none. A store written before ids (every file under `GameData/`) + loads with ids minted in memory and persists them on its next write; `CultCache.MintElementIds()` does that in one pass. + `ElementIdUpgradeTests` opens a copy of the shipped catalog, mints, flushes and reopens it. +- **Comparing content.** Random ids differ between two writes of the same content. Tests that compare bytes use + `ElementIdBlind`. +- **One list element is one object.** The same instance twice in a list is refused (`CultElementIdException`). +- **Retyping.** Writing a different type onto a held key is refused unless the record is removed first + (`EconomyAuthor.Write` does). + +## The bump is one-way + +A store holding element ids is format v3 (single file) or v5 (directory). A pin older than `abd1a92e` can open a single-file v3 +store without error and drops the ids on its next write (CultLib #98). So: upgrade readers before writers, keep a pre-upgrade +copy of any real store (`GameData/Aetheria.cc` and the mod packages are tracked in git; player saves and run stores are not), +and do not roll the pin back after a store has been written under the new one. + +The Unity manifest (`Packages/manifest.json`) still pins `caching-unity-v2.0.0` / `cultlib-unity-v2.0.1`; those move when CultLib +tags a Unity release of 3.0. Until then the editor and the headless build consume different CultLib revisions. diff --git a/tests/Aetheria.Shared.Tests/ElementIdBlind.cs b/tests/Aetheria.Shared.Tests/ElementIdBlind.cs new file mode 100644 index 000000000..6c340ea8f --- /dev/null +++ b/tests/Aetheria.Shared.Tests/ElementIdBlind.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections; +using System.Linq; +using System.Reflection; +using GameCult.Caching; +using GameCult.Caching.MessagePack; +using MessagePack; + +// Element ids are minted at random when a record is written, so two writes of the same content differ in exactly those slots. +// A test that asks "is this the same content" compares the bytes with every element id blank. +public static class ElementIdBlind +{ + private static readonly MessagePackSerializerOptions Options = CultDocumentMessagePackSerialization.OptionsFor(typeof(ItemData).Assembly); + + // The document's bytes with every [CultElementId] member blank, on a copy: the document is untouched. + public static byte[] Pack(object document, Type type = null) + { + type ??= document.GetType(); + var copy = MessagePackSerializer.Deserialize(type, MessagePackSerializer.Serialize(type, document, Options), Options); + Blank(copy); + return MessagePackSerializer.Serialize(type, copy, Options); + } + + // A stored payload of the schema, re-encoded with every element id blank. + public static byte[] Payload(CultDocumentRegistry registry, string schemaId, byte[] payload) + { + var type = registry.GetRequiredBySchemaId(schemaId).DocumentType; + var value = MessagePackSerializer.Deserialize(type, payload, Options); + Blank(value); + return MessagePackSerializer.Serialize(type, value, Options); + } + + private static void Blank(object value) + { + if (value == null || value is string || value.GetType().IsPrimitive || value.GetType().IsEnum) return; + if (value is IEnumerable items && !(value is string)) + { + foreach (var item in items) Blank(item); + return; + } + for (var type = value.GetType(); type != null && type != typeof(object); type = type.BaseType) + foreach (var member in type.GetMembers(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)) + { + if (member is FieldInfo field) + { + if (field.GetCustomAttribute<CultElementIdAttribute>() != null) field.SetValue(value, ""); + else if (!field.FieldType.IsPrimitive && field.GetCustomAttribute<IgnoreMemberAttribute>() == null && field.GetCustomAttribute<KeyAttribute>() != null) + Blank(field.GetValue(value)); + } + else if (member is PropertyInfo property && property.GetIndexParameters().Length == 0 && property.GetCustomAttribute<KeyAttribute>() != null) + { + if (property.GetCustomAttribute<CultElementIdAttribute>() != null) property.SetValue(value, ""); + else Blank(property.GetValue(value)); + } + } + } +} diff --git a/tests/Aetheria.Shared.Tests/ElementIdUpgradeTests.cs b/tests/Aetheria.Shared.Tests/ElementIdUpgradeTests.cs new file mode 100644 index 000000000..7a38e4622 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/ElementIdUpgradeTests.cs @@ -0,0 +1,56 @@ +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using GameCult.Caching; +using Xunit; + +// The CultLib pin that requires element ids (abd1a92e) reads the stores written before it (b8fc5eb0 and older), which carry none. +// The shipped GameData stores are those stores, byte for byte: they have never been rewritten under the new pin. +// Upgrading is one-way: once a store is written under the new pin it holds element ids, and an older pin can read it only by +// dropping them (CultLib #98). Readers upgrade before writers. +public class ElementIdUpgradeTests +{ + private static string Shipped => Path.Combine(RunStartTests.FindRepoRoot(), "GameData", "Aetheria.cc"); + + [Fact] + public async Task AStoreWrittenBeforeElementIdsOpensMintsThemOnceAndKeepsEveryRecord() + { + using var directory = new TempDirectory(); + var copy = Path.Combine(directory.Path, "Aetheria.cc"); + File.Copy(Shipped, copy); + + int records, minted; + using (var cache = AetheriaStores.Open(copy, catalogWritable: true, registry: TestCatalog.Registry())) + { + records = cache.AllStoredDocuments.Count(); + Assert.True(records > 0); + minted = cache.MintElementIds(); + Assert.True(minted > 0, "the shipped catalog predates element ids; opening it must have minted some"); + Assert.Equal(0, cache.MintElementIds()); + await cache.FlushAsync(); + } + + using var reopened = AetheriaStores.Open(copy, registry: TestCatalog.Registry()); + Assert.Equal(records, reopened.AllStoredDocuments.Count()); + Assert.Equal(0, reopened.MintElementIds()); + foreach (var hull in reopened.GetAll<HullData>()) + { + var ids = hull.Hardpoints.Select(hardpoint => hardpoint.Id).ToArray(); + Assert.All(ids, id => Assert.False(string.IsNullOrEmpty(id))); + Assert.Equal(ids.Length, ids.Distinct().Count()); + } + } + + [Fact] + public void EveryShippedModPackageStillLoads() + { + var packages = Directory.GetDirectories(Path.Combine(RunStartTests.FindRepoRoot(), "GameData", "Mods")); + Assert.NotEmpty(packages); + foreach (var package in packages) + { + var (hull, visual, _) = ShipAuthoringStore.Load(Path.Combine(package, "ship.cc")); + Assert.NotNull(hull); + Assert.NotNull(visual); + } + } +} diff --git a/tests/Aetheria.Shared.Tests/EmissionTests.cs b/tests/Aetheria.Shared.Tests/EmissionTests.cs index 831f6f520..da8d99e6d 100644 --- a/tests/Aetheria.Shared.Tests/EmissionTests.cs +++ b/tests/Aetheria.Shared.Tests/EmissionTests.cs @@ -281,7 +281,7 @@ public sealed partial class ContactRevealTests var reader = new MessagePackReader(sensor); Assert.Equal(2, reader.ReadArrayHeader()); Assert.Equal(5, reader.ReadInt32()); - Assert.Equal(14, reader.ReadArrayHeader()); + Assert.Equal(38, reader.ReadArrayHeader()); for (var slot = 0; slot < 13; slot++) reader.Skip(); Assert.Equal(2f, MessagePackSerializer.Deserialize<PerformanceStat>(ref reader, EmissionWire).Min); Assert.Equal(2f, JObject.Parse(JsonConvert.SerializeObject(new SensorData { InterceptFactor = Const(2) }))["interceptFactor"].ToObject<PerformanceStat>().Min); diff --git a/tests/Aetheria.Shared.Tests/InspectionScannerCommandTests.cs b/tests/Aetheria.Shared.Tests/InspectionScannerCommandTests.cs index e2d453f51..8dbc47873 100644 --- a/tests/Aetheria.Shared.Tests/InspectionScannerCommandTests.cs +++ b/tests/Aetheria.Shared.Tests/InspectionScannerCommandTests.cs @@ -22,7 +22,7 @@ public sealed class InspectionScannerCommandTests : IDisposable private readonly string[] _shippedProducts; private static byte[] Pack(GearData design) => - MessagePackSerializer.Serialize(design, CultDocumentMessagePackSerialization.OptionsFor(typeof(GearData).Assembly)); + ElementIdBlind.Pack(design, typeof(GearData)); private static string Describe(CultCache cache, FactionProductData product) => $"{cache.Get(product.Design).Name} | {product.Name} | {cache.Get(product.Manufacturer).ShortName} | {product.Description} | " + diff --git a/tests/Aetheria.Shared.Tests/LaunchSuppressorCommandTests.cs b/tests/Aetheria.Shared.Tests/LaunchSuppressorCommandTests.cs index 90c1d3873..47cc9a29e 100644 --- a/tests/Aetheria.Shared.Tests/LaunchSuppressorCommandTests.cs +++ b/tests/Aetheria.Shared.Tests/LaunchSuppressorCommandTests.cs @@ -22,7 +22,7 @@ public sealed class LaunchSuppressorCommandTests : IDisposable private readonly string[] _shippedProducts; private static byte[] Pack(GearData design) => - MessagePackSerializer.Serialize(design, CultDocumentMessagePackSerialization.OptionsFor(typeof(GearData).Assembly)); + ElementIdBlind.Pack(design, typeof(GearData)); private static string Describe(CultCache cache, FactionProductData product) => $"{cache.Get(product.Design).Name} | {product.Name} | {cache.Get(product.Manufacturer).ShortName} | {product.Description} | " + diff --git a/tests/Aetheria.Shared.Tests/LaunchSuppressorTests.cs b/tests/Aetheria.Shared.Tests/LaunchSuppressorTests.cs index eb2ed3ab8..d3dd3ae03 100644 --- a/tests/Aetheria.Shared.Tests/LaunchSuppressorTests.cs +++ b/tests/Aetheria.Shared.Tests/LaunchSuppressorTests.cs @@ -299,7 +299,7 @@ public sealed partial class ContactRevealTests var reader = new MessagePackReader(bytes); Assert.Equal(2, reader.ReadArrayHeader()); Assert.Equal(49, reader.ReadInt32()); // loot-2 holds 48; a key reused across branches would collide on the wire - Assert.Equal(4, reader.ReadArrayHeader()); // Group is key 0, then the three stats + Assert.Equal(38, reader.ReadArrayHeader()); // array-format union: the base's element id sits at key 37, so every behavior row is 38 long; Group is key 0, then the three stats var back = Assert.IsType<LaunchSuppressorData>(MessagePackSerializer.Deserialize<BehaviorData>(bytes, options)); Assert.Equal(.25f, back.Factor.Min); diff --git a/tests/Aetheria.Shared.Tests/ListenerTests.cs b/tests/Aetheria.Shared.Tests/ListenerTests.cs index 9fe4abf81..1bf1059ae 100644 --- a/tests/Aetheria.Shared.Tests/ListenerTests.cs +++ b/tests/Aetheria.Shared.Tests/ListenerTests.cs @@ -203,7 +203,7 @@ public sealed partial class ContactRevealTests var reader = new MessagePackReader(bytes); Assert.Equal(2, reader.ReadArrayHeader()); Assert.Equal(50, reader.ReadInt32()); - Assert.Equal(2, reader.ReadArrayHeader()); // Group is key 0, then Multiple + Assert.Equal(38, reader.ReadArrayHeader()); // array-format union: the base's element id sits at key 37, so every behavior row is 38 long; Group is key 0, then Multiple var back = Assert.IsType<ListenerData>(MessagePackSerializer.Deserialize<BehaviorData>(bytes, options)); Assert.Equal(2.5f, back.Multiple.Min); diff --git a/tests/Aetheria.Shared.Tests/PaintModeTests.cs b/tests/Aetheria.Shared.Tests/PaintModeTests.cs index 89b6fb39f..ab195813f 100644 --- a/tests/Aetheria.Shared.Tests/PaintModeTests.cs +++ b/tests/Aetheria.Shared.Tests/PaintModeTests.cs @@ -724,7 +724,7 @@ public sealed class PaintModeTests : IDisposable var reader = new MessagePackReader(bytes); Assert.Equal(2, reader.ReadArrayHeader()); Assert.Equal(5, reader.ReadInt32()); - Assert.Equal(14, reader.ReadArrayHeader()); + Assert.Equal(38, reader.ReadArrayHeader()); for (var slot = 0; slot < 12; slot++) reader.Skip(); Assert.Equal(90f, MessagePackSerializer.Deserialize<PerformanceStat>(ref reader, WireOptions).Min); diff --git a/tests/Aetheria.Shared.Tests/ScannerTests.cs b/tests/Aetheria.Shared.Tests/ScannerTests.cs index b470d2ae0..7184659b2 100644 --- a/tests/Aetheria.Shared.Tests/ScannerTests.cs +++ b/tests/Aetheria.Shared.Tests/ScannerTests.cs @@ -484,7 +484,7 @@ public sealed partial class ContactRevealTests var reader = new MessagePackReader(bytes); Assert.Equal(2, reader.ReadArrayHeader()); Assert.Equal(51, reader.ReadInt32()); // sensor-catalog holds 50; a key reused across branches would collide on the wire - Assert.Equal(4, reader.ReadArrayHeader()); // Group is key 0, then the three stats + Assert.Equal(38, reader.ReadArrayHeader()); // array-format union: the base's element id sits at key 37, so every behavior row is 38 long; Group is key 0, then the three stats reader.Skip(); Assert.Equal(200f, MessagePackSerializer.Deserialize<PerformanceStat>(ref reader, options).Min); // key 1 Range Assert.Equal(2f, MessagePackSerializer.Deserialize<PerformanceStat>(ref reader, options).Min); // key 2 ScanTime diff --git a/tests/Aetheria.Shared.Tests/ShipAuthoringTests.cs b/tests/Aetheria.Shared.Tests/ShipAuthoringTests.cs index 850e83dfd..7ed2b84be 100644 --- a/tests/Aetheria.Shared.Tests/ShipAuthoringTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipAuthoringTests.cs @@ -180,24 +180,20 @@ public sealed class ShipAuthoringTests Assert.IsAssignableFrom<MessagePackSerializationException>(pull.InnerException); } - // A store header with a nil format stamp is refused by the runtime with NotSupportedException; Load names the file. + // A store header with a nil format stamp is refused by the runtime with CultStoreUnreadableException; Load names the file. [Fact] public void LoadNamesTheFileWhoseFormatStampIsNil() { using var directory = new TempDirectory(); var path = Path.Combine(directory.Path, "nilstamp.cc"); - File.WriteAllBytes(path, CultDocumentMessagePackSerialization.SerializeSnapshot(new CultPersistedStoreSnapshot - { - FormatVersion = null, - SchemaCatalog = Array.Empty<CultSchemaCatalogEntry>(), - Records = Array.Empty<CultPersistedRecord>(), - })); + // The runtime no longer writes a store without a format stamp, so the header is spelled by hand: [nil, [], []]. + File.WriteAllBytes(path, new byte[] { 0x93, 0xC0, 0x90, 0x90 }); var error = Assert.Throws<InvalidOperationException>(() => ShipAuthoringStore.Load(path)); Assert.Contains(path, error.Message); - Assert.IsType<NotSupportedException>(error.InnerException); + Assert.IsType<CultStoreUnreadableException>(error.InnerException); } - // A store format this runtime does not know is refused on read with NotSupportedException from the attach; Load names the file. + // A store format this runtime does not know is refused on read with CultStoreUnreadableException from the attach; Load names the file. [Fact] public async Task LoadNamesTheFileWhoseStoreFormatIsNewer() { @@ -213,7 +209,7 @@ public sealed class ShipAuthoringTests File.WriteAllBytes(path, CultDocumentMessagePackSerialization.SerializeSnapshot(snapshot)); var error = Assert.Throws<InvalidOperationException>(() => ShipAuthoringStore.Load(path)); Assert.Contains(path, error.Message); - Assert.IsType<NotSupportedException>(error.InnerException); + Assert.IsType<CultStoreUnreadableException>(error.InnerException); } // Decodes one record's payload of the named schema to its slot array, lets the edit change it, and stores it again. diff --git a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs index cbda4266b..f2b51496f 100644 --- a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs @@ -796,7 +796,7 @@ public sealed class ShipModCatalogTests : IDisposable // Every stored record's key, schema and payload bytes. StoredAt is a write timestamp, not record content. private static Dictionary<string, string> Records(string path) => GameCult.Caching.MessagePack.CultDocumentMessagePackSerialization.DeserializeSnapshot(File.ReadAllBytes(path)).Records - .ToDictionary(record => record.Key, record => record.SchemaId + ":" + Convert.ToHexString(record.Payload)); + .ToDictionary(record => record.Key, record => record.SchemaId + ":" + Convert.ToHexString(ElementIdBlind.Payload(TestCatalog.Registry(), record.SchemaId, record.Payload))); private void AssertOnlyTheDerivedFile() { diff --git a/tests/Aetheria.Shared.Tests/ShipProductTests.cs b/tests/Aetheria.Shared.Tests/ShipProductTests.cs index e14950b0d..82f094e88 100644 --- a/tests/Aetheria.Shared.Tests/ShipProductTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipProductTests.cs @@ -331,7 +331,7 @@ public sealed class ShipProductTests : IDisposable var path = Package("mod.skiff", "Skiffhull", 0); var bare = Path.Combine(ShipFixture.WritePackage(Mods, "mod.bare", "Barehull", tweak: ship => ship.Hull.Behaviors.Clear()), "ship.cc"); var twin = Path.Combine(ShipFixture.WritePackage(Mods, "mod.twin", "Twinhull", - tweak: ship => ship.Hull.Behaviors.Add(ship.Hull.Behaviors.OfType<VelocityLimitData>().First())), "ship.cc"); + tweak: ship => ship.Hull.Behaviors.Add(new VelocityLimitData())), "ship.cc"); void RefusedAndUntouched(string file, params string[] flags) { var before = File.ReadAllBytes(file); diff --git a/tests/Aetheria.Shared.Tests/ShipRigTests.cs b/tests/Aetheria.Shared.Tests/ShipRigTests.cs index 4bed1989b..34581f34a 100644 --- a/tests/Aetheria.Shared.Tests/ShipRigTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipRigTests.cs @@ -833,7 +833,7 @@ public sealed class ShipRigTests : IDisposable var options = CultDocumentMessagePackSerialization.OptionsFor(typeof(HardpointData).Assembly); var hardpoint = new HardpointData { Type = HardpointType.Thruster, Shape = new Shape(), Transform = "t", FiringArc = 40f, Row = "left" }; var fields = MessagePackSerializer.Deserialize<object[]>(MessagePackSerializer.Serialize(hardpoint, options), options); - Assert.Equal(8, fields.Length); + Assert.Equal(9, fields.Length); Assert.Equal(40f, Convert.ToSingle(fields[6])); Assert.Equal("left", fields[7]); Assert.Null(MessagePackSerializer.Deserialize<object[]>(MessagePackSerializer.Serialize(new HardpointData { Shape = new Shape() }, options), options)[7]); @@ -842,7 +842,7 @@ public sealed class ShipRigTests : IDisposable thruster.Thrust.Max = 5f; thruster.Slew.Max = 90f; var slew = MessagePackSerializer.Deserialize<object[]>(MessagePackSerializer.Serialize(thruster, options), options); - Assert.Equal(7, slew.Length); + Assert.Equal(38, slew.Length); // the behavior base's element id is key 37 Assert.Equal(MessagePackSerializer.ConvertToJson(MessagePackSerializer.Serialize(thruster.Slew, options), options), MessagePackSerializer.ConvertToJson(MessagePackSerializer.Serialize(slew[6], options), options)); Assert.NotEqual(MessagePackSerializer.ConvertToJson(MessagePackSerializer.Serialize(thruster.Thrust, options), options), diff --git a/tests/Aetheria.Shared.Tests/SignatureTests.cs b/tests/Aetheria.Shared.Tests/SignatureTests.cs index 50d0bc824..21bdd7644 100644 --- a/tests/Aetheria.Shared.Tests/SignatureTests.cs +++ b/tests/Aetheria.Shared.Tests/SignatureTests.cs @@ -501,7 +501,7 @@ public sealed class SignatureTests : IDisposable var reader = new MessagePackReader(bytes); Assert.Equal(2, reader.ReadArrayHeader()); Assert.Equal(22, reader.ReadInt32()); - Assert.Equal(4, reader.ReadArrayHeader()); + Assert.Equal(38, reader.ReadArrayHeader()); reader.Skip(); // Group Assert.Equal(1f, MessagePackSerializer.Deserialize<PerformanceStat>(ref reader, Options).Min); Assert.Equal(2f, MessagePackSerializer.Deserialize<PerformanceStat>(ref reader, Options).Min); diff --git a/tests/Aetheria.Shared.Tests/SmokeRoundsCommandTests.cs b/tests/Aetheria.Shared.Tests/SmokeRoundsCommandTests.cs index 40a47eec6..83013d766 100644 --- a/tests/Aetheria.Shared.Tests/SmokeRoundsCommandTests.cs +++ b/tests/Aetheria.Shared.Tests/SmokeRoundsCommandTests.cs @@ -21,7 +21,7 @@ public sealed class SmokeRoundsCommandTests : IDisposable private readonly Dictionary<string, byte[]> _shipped = new Dictionary<string, byte[]>(); private static byte[] Pack(WeaponItemData design) => - MessagePackSerializer.Serialize(design, CultDocumentMessagePackSerialization.OptionsFor(typeof(WeaponItemData).Assembly)); + ElementIdBlind.Pack(design, typeof(WeaponItemData)); public SmokeRoundsCommandTests() { diff --git a/tests/Aetheria.Shared.Tests/VapourCloudTests.cs b/tests/Aetheria.Shared.Tests/VapourCloudTests.cs index 6945de2a8..3cd4ab34a 100644 --- a/tests/Aetheria.Shared.Tests/VapourCloudTests.cs +++ b/tests/Aetheria.Shared.Tests/VapourCloudTests.cs @@ -419,7 +419,7 @@ public sealed class VapourCloudTests : IDisposable var reader = new MessagePackReader(bytes); Assert.Equal(2, reader.ReadArrayHeader()); Assert.Equal(42, reader.ReadInt32()); - Assert.Equal(4, reader.ReadArrayHeader()); + Assert.Equal(38, reader.ReadArrayHeader()); reader.Skip(); Assert.Equal(1f, MessagePackSerializer.Deserialize<PerformanceStat>(ref reader, options).Min); Assert.Equal(2f, MessagePackSerializer.Deserialize<PerformanceStat>(ref reader, options).Min); diff --git a/tools/AetherDb/EconomyCommand.cs b/tools/AetherDb/EconomyCommand.cs index cf536cd9e..83349a1c0 100644 --- a/tools/AetherDb/EconomyCommand.cs +++ b/tools/AetherDb/EconomyCommand.cs @@ -45,6 +45,10 @@ public sealed class EconomyAuthor private void Write(Type type, object document, CultRecordKey key) { if (!_touched.Contains(key.Value)) _touched.Add(key.Value); + // A cache refuses to write one type onto a key another type holds (write ownership by written type): a batch that turns + // a compound good into a raw one removes the old record first. + var held = _catalog.Get(key); + if (held != null && held.GetType() != type) _catalog.Remove(key); _catalog.UpsertAsync(type, document, key).GetAwaiter().GetResult(); } } From 9512e35d6280223f852b9258dc9945e27ad543ae Mon Sep 17 00:00:00 2001 From: Nibu <nibu@gamecult.org> Date: Wed, 11 Nov 2026 09:57:46 +0000 Subject: [PATCH 050/108] EmissionTests: launcher row is 38 slots with the element id Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/EmissionTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Aetheria.Shared.Tests/EmissionTests.cs b/tests/Aetheria.Shared.Tests/EmissionTests.cs index da8d99e6d..68ee5854d 100644 --- a/tests/Aetheria.Shared.Tests/EmissionTests.cs +++ b/tests/Aetheria.Shared.Tests/EmissionTests.cs @@ -291,7 +291,7 @@ public sealed partial class ContactRevealTests reader = new MessagePackReader(bytes); Assert.Equal(2, reader.ReadArrayHeader()); reader.Skip(); // the arm's union index - Assert.Equal(37, reader.ReadArrayHeader()); // 35 and 36 are the weapon base's EffectiveRange and DamageAtMaxRange + Assert.Equal(38, reader.ReadArrayHeader()); // 35 and 36 are the weapon base's EffectiveRange and DamageAtMaxRange, 37 the element id for (var slot = 0; slot < 34; slot++) reader.Skip(); Assert.Equal(3f, MessagePackSerializer.Deserialize<PerformanceStat>(ref reader, EmissionWire).Min); Assert.Equal(3f, JObject.Parse(JsonConvert.SerializeObject(new LauncherData { InterceptFactor = Const(3) }))["interceptFactor"].ToObject<PerformanceStat>().Min); From 6cb7b9455170e48404a87bbe112147b6cd65d51b Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 10:12:39 +0000 Subject: [PATCH 051/108] element-ids doc: the old pin refuses v3, shipped mod packages are not rewritable, Unity cannot compile the attribute yet Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- docs/element-ids.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/element-ids.md b/docs/element-ids.md index 31cc92e17..386dcfc31 100644 --- a/docs/element-ids.md +++ b/docs/element-ids.md @@ -20,10 +20,15 @@ the registry refuses to open otherwise, naming the type and list. ## The bump is one-way -A store holding element ids is format v3 (single file) or v5 (directory). A pin older than `abd1a92e` can open a single-file v3 -store without error and drops the ids on its next write (CultLib #98). So: upgrade readers before writers, keep a pre-upgrade -copy of any real store (`GameData/Aetheria.cc` and the mod packages are tracked in git; player saves and run stores are not), -and do not roll the pin back after a store has been written under the new one. +A store holding element ids is format v3 (single file) or v5 (directory). The previous pin, `b8fc5eb0`, refuses a v3 store loudly +(`NotSupportedException: Store format cultcache.store.v3 is not readable`; checked by Soul on PR 12). CultLib #98 (`7002c252`) records +that some intermediate pins read a single-file v3 store silently and drop the ids on the next write. So: upgrade readers before +writers, keep a pre-upgrade copy of any real store (`GameData/Aetheria.cc` and the mod packages are tracked in git; player saves and +run stores are not), and do not roll the pin back after a store has been written under the new one. + +Shipped mod packages (`GameData/Mods/*/ship.cc`) hold values in retired `HullData` slots 21 and 22. They read, but the new CultLib +refuses to write over them (`CultSchemaConflictException`), so an in-place rewrite of those two files fails until their schema ids are +declared compatible or the files are regenerated. A rewritten catalog is about 15% larger: every behavior row is 38 slots, mostly nil. The Unity manifest (`Packages/manifest.json`) still pins `caching-unity-v2.0.0` / `cultlib-unity-v2.0.1`; those move when CultLib -tags a Unity release of 3.0. Until then the editor and the headless build consume different CultLib revisions. +tags a Unity release of 3.0. Until then the Unity editor cannot compile `[CultElementId]` (the plugin DLLs at those tags lack the attribute): this branch is headless-only and must not merge to master before a Unity-consumable CultLib exists. From 7675296ec4e1f64957a61b26e8369a2f51793625 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 13:09:14 +0000 Subject: [PATCH 052/108] Pin CultLib cultlib-unity-v3.0.0 (7225835d) and CultMath cultmath-unity-v0.5.1 (f1edfa45) in the manifest and the headless build The v3.0.0 plugin GameCult.Caching.dll exports CultElementIdAttribute; caching-unity stays at v2.0.0 (editor tooling, unchanged). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Directory.Build.props | 8 ++++---- Packages/manifest.json | 4 ++-- Packages/packages-lock.json | 10 +++++----- docs/aetheria-fauna-map.md | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 66ff67e19..62160b34f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,12 +2,12 @@ <PropertyGroup> <CultLibRoot Condition="'$(CultLibRoot)' == '' and '$(CULTLIB_ROOT)' != ''">$(CULTLIB_ROOT)</CultLibRoot> <CultLibRoot Condition="'$(CultLibRoot)' == ''">$(MSBuildThisFileDirectory)..\CultLib</CultLibRoot> - <!-- CultCache: abd1a92e (CultLib 3.0.0 unreleased; the Unity manifest tags still pin 2.0.x until a release is tagged). --> - <CultLibRevision>abd1a92eb24e1af3fc7cdd1bf98a88dbdebc2938</CultLibRevision> + <!-- CultCache: cultlib-unity-v3.0.0 in Packages/manifest.json. --> + <CultLibRevision>7225835d11fd08a3de2a2ef24742fc351b3b08fb</CultLibRevision> <CultMathRoot Condition="'$(CultMathRoot)' == '' and '$(CULTMATH_ROOT)' != ''">$(CULTMATH_ROOT)</CultMathRoot> <CultMathRoot Condition="'$(CultMathRoot)' == ''">$(CultLibRoot)</CultMathRoot> - <!-- CultMath: cultmath-unity-v0.5.0 in Packages/manifest.json. --> - <CultMathRevision>7a8933b085468e1fc6f9d3bce4a85e7d101aaca3</CultMathRevision> + <!-- CultMath: cultmath-unity-v0.5.1 in Packages/manifest.json. --> + <CultMathRevision>f1edfa458dd8e7e107214e9d9884254359475b8c</CultMathRevision> <GitExecutable Condition="'$(GitExecutable)' == '' and Exists('C:\Program Files\Git\cmd\git.exe')">C:\Program Files\Git\cmd\git.exe</GitExecutable> <GitExecutable Condition="'$(GitExecutable)' == ''">git</GitExecutable> </PropertyGroup> diff --git a/Packages/manifest.json b/Packages/manifest.json index 7693bd94f..ef01307a8 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -53,7 +53,7 @@ "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0", "org.gamecult.caching.unity": "https://github.com/GameCult/CultLib.git?path=/src/GameCult.Unity/Assets/Caching#caching-unity-v2.0.0", - "org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v2.0.1", - "org.gamecult.cultmath": "https://github.com/GameCult/CultLib.git?path=/packages/cultmath/unity/org.gamecult.cultmath#cultmath-unity-v0.5.0" + "org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v3.0.0", + "org.gamecult.cultmath": "https://github.com/GameCult/CultLib.git?path=/packages/cultmath/unity/org.gamecult.cultmath#cultmath-unity-v0.5.1" } } diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 919cf94d1..4db845c3b 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -265,20 +265,20 @@ "hash": "42dce3611a81adc5c5fac54cadbaa5637d6022d3" }, "org.gamecult.cultlib": { - "version": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v2.0.1", + "version": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v3.0.0", "depth": 0, "source": "git", "dependencies": { - "org.gamecult.cultmath": "0.5.0" + "org.gamecult.cultmath": "0.5.1" }, - "hash": "b8fc5eb07720a187a0421424ac2cb3aa2966ca1d" + "hash": "7225835d11fd08a3de2a2ef24742fc351b3b08fb" }, "org.gamecult.cultmath": { - "version": "https://github.com/GameCult/CultLib.git?path=/packages/cultmath/unity/org.gamecult.cultmath#cultmath-unity-v0.5.0", + "version": "https://github.com/GameCult/CultLib.git?path=/packages/cultmath/unity/org.gamecult.cultmath#cultmath-unity-v0.5.1", "depth": 0, "source": "git", "dependencies": {}, - "hash": "7a8933b085468e1fc6f9d3bce4a85e7d101aaca3" + "hash": "f1edfa458dd8e7e107214e9d9884254359475b8c" }, "com.unity.modules.accessibility": { "version": "1.0.0", diff --git a/docs/aetheria-fauna-map.md b/docs/aetheria-fauna-map.md index 05034c92a..5276db97e 100644 --- a/docs/aetheria-fauna-map.md +++ b/docs/aetheria-fauna-map.md @@ -398,7 +398,7 @@ the lore branch `eureka/aetheria-fauna-lore` `74c7e212`, note `Open Water` (`OW` | # | Question | Result | |---|---|---| | B28 | What does CultMath already give a node library? | Integer PCG hashes `pcg`, `pcg3d`, `pcg4d` (Jarzynski and Olano), "integer-only, so dxc and C# agree bit for bit" (`packages/cultmath/src/CultMath/math.cs:393-426`, `shaders/CultMath.hlsl:396-426`). `cellular(float3)`: Worley F1 and F2 - F1 with analytic gradients, jitter from `pcg3d` of the integer cell, 3D, unweighted (`math.cs:849-975`, `CultMath.hlsl:440-503`). `smin_grad` (`math.cs:831-847`, `CultMath.hlsl:428-437`). `distance_to_segment` in C# only (`math.cs:319`; no HLSL twin). No weighted cellular, no diagram over explicit weighted sites, no site-graph gate. | -| B29 | How does CultMath own parity? | Two legs, one owner each (`packages/cultmath/docs/design.md:202-206`): HLSL against C# by the mirror test, which compiles the text of `CultMath.hlsl` as C# and compares float32 bit patterns (`design.md:118-124`), plus a clean `dxc -T lib_6_3` compile (`design.md:114-116`); GLSL against C# by golden fixtures run on a device. The mirror proves the composition in the text, not that a GPU agrees (`design.md:119-121`); device HLSL runs are consumers' today (Asura `gpu-snoise-parity`; Aetheria `FlowFieldParityVerify`). CultMath ships a Unity compute smoke (`packages/cultmath/scripts/unity-smoke/`). Aetheria pins `cultmath-unity-v0.5.0` (`Packages/manifest.json`). | +| B29 | How does CultMath own parity? | Two legs, one owner each (`packages/cultmath/docs/design.md:202-206`): HLSL against C# by the mirror test, which compiles the text of `CultMath.hlsl` as C# and compares float32 bit patterns (`design.md:118-124`), plus a clean `dxc -T lib_6_3` compile (`design.md:114-116`); GLSL against C# by golden fixtures run on a device. The mirror proves the composition in the text, not that a GPU agrees (`design.md:119-121`); device HLSL runs are consumers' today (Asura `gpu-snoise-parity`; Aetheria `FlowFieldParityVerify`). CultMath ships a Unity compute smoke (`packages/cultmath/scripts/unity-smoke/`). Aetheria pins `cultmath-unity-v0.5.1` (`Packages/manifest.json`). | | B30 | Does Aetheria already keep a math twin outside CultMath? | Yes. `FlowField` uses CultMath's `math`, but its `Tri`, `Tri3` and `Tri3D` are Aetheria functions (`FlowField.cs:66-72`) whose HLSL twin is `Volumetric.cginc`, pinned by Aetheria's own `FlowFieldParityVerify` (`RelativeTolerance` 1.5e-4). That is a second parity owner beside CultMath. | | B31 | What is parked in CultMath that a DAG would use? | The tape: steps 2-5 (expression graph lowered to bytecode with C# evaluators, pruning, an HLSL interpreter, meshing) are parked until Asura is stable (`docs/cultmath-tape-target.md:3-8`, ruling `tape-target-unparks-when-asura-stable`). "Truth and lowerings" (`:84-92`): the field is a typed CultCache document, and the CPU evaluator and the HLSL interpreter are lowerings of it. Step 1 (intervals) and affine forms are on main. | | B32 | Do the candidates make filaments? (`docs/research/2026-10-14-trophic-dag-probe/`, README there; wells orbit, slope terms on, t = 0) | `skein` draws strands between neighbouring wells, bent by the flow (`density_skein.png`); `lattice` draws a fine cellular web, dense on the shoulders, dim elsewhere, with no long links (`density_lattice.png`); `skein-web` draws both: strands from well to well with a web hanging off them (`density_skein-web.png`, `layer_L2-krill.png`). Correlation with the B20 Physarum map at 64x32 blocks (this measures the envelope, not filaments: a block is 62 u, wider than a strand): band .512, lattice .359, skein-web .296, krill .277, skein .225, slack .171. Hosted krill at 16 u: band 2,075, skein-web 1,475, skein 639, lattice 419. | From 344ef3265c88657ba5689a7269d69ed98605bae1 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 13:09:14 +0000 Subject: [PATCH 053/108] Regenerate the shipped mod ship.cc files off the retired HullData slots; blind element ids only where they are irrelevant AetherDb ship-authoring regenerate rewrites a package under the current schema and requires it to read back identical. ElementIdUpgradeTests gains content preservation and a shipped-packages-writable check; ShipModCatalogTests compares mod records unblinded where the same packages are composed twice. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- GameData/Mods/aetheria.nakovalnya/ship.cc | 4 +- GameData/Mods/aetheria.wren/ship.cc | 4 +- docs/element-ids.md | 23 +++--- .../ElementIdUpgradeTests.cs | 70 ++++++++++++++++++- .../ShipModCatalogTests.cs | 14 ++-- tools/AetherDb/ShipAuthoringCommands.cs | 36 +++++++++- 6 files changed, 133 insertions(+), 18 deletions(-) diff --git a/GameData/Mods/aetheria.nakovalnya/ship.cc b/GameData/Mods/aetheria.nakovalnya/ship.cc index ebe05cd33..1def7b776 100644 --- a/GameData/Mods/aetheria.nakovalnya/ship.cc +++ b/GameData/Mods/aetheria.nakovalnya/ship.cc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:87d8cbcca252460d1ec2bfeb895c1447ab185172a4a4449b237a297b83ea5057 -size 40059 +oid sha256:0228aa7ec3a2e060bd49e46aa64f52eea4c4cdb25951c164646c1d031ad17851 +size 30457 diff --git a/GameData/Mods/aetheria.wren/ship.cc b/GameData/Mods/aetheria.wren/ship.cc index d81f9bba5..71b71ef5a 100644 --- a/GameData/Mods/aetheria.wren/ship.cc +++ b/GameData/Mods/aetheria.wren/ship.cc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6b1744dfa7dd6c5325ca3bd04fba941408cdc1255c06d1fc0d52fa67c97dc100 -size 10514 +oid sha256:096ea08f7fe85b44c343b57dfbc84fd82b2ec1d450cc1eb49efc3c238f9a9678 +size 10528 diff --git a/docs/element-ids.md b/docs/element-ids.md index 386dcfc31..87446b7e5 100644 --- a/docs/element-ids.md +++ b/docs/element-ids.md @@ -1,6 +1,6 @@ -# Element ids and the CultLib pin (abd1a92e) +# Element ids and the CultLib pin (cultlib-unity-v3.0.0) -CultLib 3.0 (unreleased; headless pin `abd1a92e`, `Directory.Build.props`) gives every element of an object list an identity. Every +CultLib 3.0.0 (Unity tag `cultlib-unity-v3.0.0`, commit `7225835d`, which is the headless pin in `Directory.Build.props`; CultMath `cultmath-unity-v0.5.1`, `f1edfa45`) gives every element of an object list an identity. Every element type reachable through a list of a `[CultDocument]` type carries one string member with `[Key(n)]` and `[CultElementId]`; the registry refuses to open otherwise, naming the type and list. @@ -20,15 +20,22 @@ the registry refuses to open otherwise, naming the type and list. ## The bump is one-way -A store holding element ids is format v3 (single file) or v5 (directory). The previous pin, `b8fc5eb0`, refuses a v3 store loudly +A store holding element ids is format v3 (single file) or v5 (directory). The previous pin (`cultlib-unity-v2.0.1`, `b8fc5eb0`) refuses a v3 store loudly (`NotSupportedException: Store format cultcache.store.v3 is not readable`; checked by Soul on PR 12). CultLib #98 (`7002c252`) records that some intermediate pins read a single-file v3 store silently and drop the ids on the next write. So: upgrade readers before writers, keep a pre-upgrade copy of any real store (`GameData/Aetheria.cc` and the mod packages are tracked in git; player saves and run stores are not), and do not roll the pin back after a store has been written under the new one. -Shipped mod packages (`GameData/Mods/*/ship.cc`) hold values in retired `HullData` slots 21 and 22. They read, but the new CultLib -refuses to write over them (`CultSchemaConflictException`), so an in-place rewrite of those two files fails until their schema ids are -declared compatible or the files are regenerated. A rewritten catalog is about 15% larger: every behavior row is 38 slots, mostly nil. +The shipped mod packages (`GameData/Mods/aetheria.wren/ship.cc`, `aetheria.nakovalnya/ship.cc`) once held values in the retired +`HullData` slots 21 and 22 (Wwise sound bank and audio stats), which the new CultLib refuses to write over +(`CultSchemaConflictException`). They were regenerated with `AetherDb ship-authoring regenerate <ship.cc> apply`, which loads the +records, writes them into a fresh file under the current schema, requires them to read back identical and replaces the file. Both +now hold persisted element ids and nil in slots 21 and 22; `EveryShippedModPackageCanBeWrittenOver` fails if a package regresses. +A mod file that fails the same way is regenerated the same way. A rewritten catalog is about 15% larger: every behavior row is 38 +slots, mostly nil. -The Unity manifest (`Packages/manifest.json`) still pins `caching-unity-v2.0.0` / `cultlib-unity-v2.0.1`; those move when CultLib -tags a Unity release of 3.0. Until then the Unity editor cannot compile `[CultElementId]` (the plugin DLLs at those tags lack the attribute): this branch is headless-only and must not merge to master before a Unity-consumable CultLib exists. +The Unity manifest (`Packages/manifest.json`) pins `org.gamecult.cultlib` at `cultlib-unity-v3.0.0` and `org.gamecult.cultmath` at +`cultmath-unity-v0.5.1` (the version v3.0.0 depends on). `org.gamecult.caching.unity` stays at `caching-unity-v2.0.0`: it is editor +tooling, unchanged in v3.0.0. The v3.0.0 plugin `GameCult.Caching.dll` exports `CultElementIdAttribute` (sealed, fields and +properties, one optional `derivedFrom` argument), the shape `ServerShared` uses. The Unity editor compile of this branch has not +been run; the headless build and tests are the evidence so far. diff --git a/tests/Aetheria.Shared.Tests/ElementIdUpgradeTests.cs b/tests/Aetheria.Shared.Tests/ElementIdUpgradeTests.cs index 7a38e4622..d94222635 100644 --- a/tests/Aetheria.Shared.Tests/ElementIdUpgradeTests.cs +++ b/tests/Aetheria.Shared.Tests/ElementIdUpgradeTests.cs @@ -1,10 +1,12 @@ +using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using GameCult.Caching; using Xunit; -// The CultLib pin that requires element ids (abd1a92e) reads the stores written before it (b8fc5eb0 and older), which carry none. +// CultLib 3.0 requires element ids and reads the stores written before it (2.0 and older), which carry none. // The shipped GameData stores are those stores, byte for byte: they have never been rewritten under the new pin. // Upgrading is one-way: once a store is written under the new pin it holds element ids, and an older pin can read it only by // dropping them (CultLib #98). Readers upgrade before writers. @@ -41,6 +43,31 @@ public class ElementIdUpgradeTests } } + // Upgrading assigns ids and changes nothing else: every record of the old-format file decodes, once the id members are + // blank, to the same bytes before and after the mint, flush and reopen. + [Fact] + public async Task UpgradingKeepsEveryFieldOfEveryRecordAndOnlyAddsIds() + { + using var directory = new TempDirectory(); + var copy = Path.Combine(directory.Path, "Aetheria.cc"); + File.Copy(Shipped, copy); + var registry = TestCatalog.Registry(); + Dictionary<string, string> Content(string path) => + GameCult.Caching.MessagePack.CultDocumentMessagePackSerialization.DeserializeSnapshot(File.ReadAllBytes(path)).Records + .ToDictionary(record => record.Key, record => record.SchemaId + ":" + Convert.ToHexString(ElementIdBlind.Payload(registry, record.SchemaId, record.Payload))); + var before = Content(copy); + + using (var cache = AetheriaStores.Open(copy, catalogWritable: true, registry: TestCatalog.Registry())) + { + Assert.True(cache.MintElementIds() > 0); + await cache.FlushAsync(); + } + + var after = Content(copy); + Assert.Equal(before.Count, after.Count); + foreach (var record in before) Assert.True(after[record.Key] == record.Value, $"{record.Key} changed content when its element ids were minted"); + } + [Fact] public void EveryShippedModPackageStillLoads() { @@ -53,4 +80,45 @@ public class ElementIdUpgradeTests Assert.NotNull(visual); } } + + // A package whose file still holds a retired slot reads but cannot be written over (CultSchemaConflictException). + [Fact] + public void EveryShippedModPackageCanBeWrittenOver() + { + foreach (var package in Directory.GetDirectories(Path.Combine(RunStartTests.FindRepoRoot(), "GameData", "Mods"))) + { + using var directory = new TempDirectory(); + var copy = Path.Combine(directory.Path, "ship.cc"); + File.Copy(Path.Combine(package, "ship.cc"), copy); + var (hull, visual, products) = ShipAuthoringStore.Load(copy); + using (var cache = ShipAuthoringStore.Open(copy, writable: true)) + { + ShipAuthoringStore.Write(cache, hull, visual); + foreach (var product in products) ShipAuthoringStore.WriteProduct(cache, visual.Id, product); + cache.FlushAsync().GetAwaiter().GetResult(); + } + Assert.Equal(visual.Id, ShipAuthoringStore.Load(copy).Visual.Id); + } + } + + // The tool that regenerated the shipped packages: a dry run touches nothing, apply keeps every record's content. + [Fact] + public void RegenerateDryRunLeavesTheFileAndApplyKeepsTheContent() + { + using var directory = new TempDirectory(); + var copy = Path.Combine(directory.Path, "ship.cc"); + File.Copy(Path.Combine(RunStartTests.FindRepoRoot(), "GameData", "Mods", "aetheria.wren", "ship.cc"), copy); + var bytes = File.ReadAllBytes(copy); + var (hull, visual, products) = ShipAuthoringStore.Load(copy); + + Assert.Equal(0, ShipAuthoringCommands.Run(new[] { "regenerate", copy })); + Assert.Equal(bytes, File.ReadAllBytes(copy)); + Assert.Equal(0, ShipAuthoringCommands.Run(new[] { "regenerate", copy, "apply" })); + + var (hull2, visual2, products2) = ShipAuthoringStore.Load(copy); + Assert.Equal(ElementIdBlind.Pack(hull), ElementIdBlind.Pack(hull2)); + Assert.Equal(ElementIdBlind.Pack(visual), ElementIdBlind.Pack(visual2)); + Assert.Equal(products.Length, products2.Length); + Assert.Equal(new[] { copy }, Directory.GetFiles(directory.Path).Where(file => !file.EndsWith(".lock")).ToArray()); + } } diff --git a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs index f2b51496f..f439eecc9 100644 --- a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs @@ -624,7 +624,8 @@ public sealed class ShipModCatalogTests : IDisposable ShipModCatalog.Compose(Shipped, second, secondMods); ShipModCatalog.Compose(Shipped, Path.Combine(_directory.Path, "Derived3", "Aetheria.modded.cc"), firstMods); - Assert.Equal(Records(Derived), Records(second)); + // Two packages written separately carry separately minted ids: same content, ids blank. + Assert.Equal(Records(Derived, blindMods: true), Records(second, blindMods: true)); Assert.Equal(Records(Derived), Records(Path.Combine(_directory.Path, "Derived3", "Aetheria.modded.cc"))); Assert.Contains(ShipModCatalog.HullKey("mod.c").Value, Records(Derived).Keys); } @@ -793,10 +794,15 @@ public sealed class ShipModCatalogTests : IDisposable ShipModCatalog.PackageOf(cache, hull, Mods)).Message); } - // Every stored record's key, schema and payload bytes. StoredAt is a write timestamp, not record content. - private static Dictionary<string, string> Records(string path) => + // Every stored record's key, schema and payload bytes. StoredAt is a write timestamp, not record content. The shipped + // catalog holds no element ids, so each open mints new random ones for the records Compose copies from it; those are + // always compared with ids blank. A mod package's records carry the ids its ship.cc persisted and are compared as stored, + // unless the two sides are packages written separately (blindMods), where each write minted its own. + private static Dictionary<string, string> Records(string path, bool blindMods = false) => GameCult.Caching.MessagePack.CultDocumentMessagePackSerialization.DeserializeSnapshot(File.ReadAllBytes(path)).Records - .ToDictionary(record => record.Key, record => record.SchemaId + ":" + Convert.ToHexString(ElementIdBlind.Payload(TestCatalog.Registry(), record.SchemaId, record.Payload))); + .ToDictionary(record => record.Key, record => record.SchemaId + ":" + Convert.ToHexString( + !blindMods && ShipModCatalog.IsModKey(new CultRecordKey(record.Key)) ? record.Payload + : ElementIdBlind.Payload(TestCatalog.Registry(), record.SchemaId, record.Payload))); private void AssertOnlyTheDerivedFile() { diff --git a/tools/AetherDb/ShipAuthoringCommands.cs b/tools/AetherDb/ShipAuthoringCommands.cs index 841da957e..458ae4038 100644 --- a/tools/AetherDb/ShipAuthoringCommands.cs +++ b/tools/AetherDb/ShipAuthoringCommands.cs @@ -1,4 +1,5 @@ using GameCult.Caching; +using GameCult.Caching.MessagePack; using System; using System.Collections.Generic; using System.Globalization; @@ -8,7 +9,7 @@ using System.Linq; // Uses the existing database executable; mod authoring does not earn another binary target. public static class ShipAuthoringCommands { - private const string Usage = "ship-authoring create <ship.cc> <stable-id> <name> [--like <shipped hull name>] | starter <mods-dir> <stable-id> <name> --like <shipped hull name> | inspect <ship.cc> | centre <ship.cc> | validate <ship.cc> | product <ship.cc> <maker> (--name <name> [--description <text>] [--not-offered] | --remove) | price <ship.cc> <price> | stats <ship.cc> [--mass m] [--durability d] [--armor a] [--drag x] [--top-speed v] | compose <shipped.cc> <derived.cc> <mods-dir>"; + private const string Usage = "ship-authoring create <ship.cc> <stable-id> <name> [--like <shipped hull name>] | starter <mods-dir> <stable-id> <name> --like <shipped hull name> | regenerate <ship.cc> [apply] | inspect <ship.cc> | centre <ship.cc> | validate <ship.cc> | product <ship.cc> <maker> (--name <name> [--description <text>] [--not-offered] | --remove) | price <ship.cc> <price> | stats <ship.cc> [--mass m] [--durability d] [--armor a] [--drag x] [--top-speed v] | compose <shipped.cc> <derived.cc> <mods-dir>"; private static readonly string[] StatFlags = { "--mass", "--durability", "--armor", "--drag", "--top-speed" }; @@ -84,6 +85,39 @@ public static class ShipAuthoringCommands Console.WriteLine($"Wrote a flyable starter package {path}; replace its stand-in model through Blender and Package, then set price and product."); return 0; } + if (args[0] == "regenerate" && (args.Length == 2 || args.Length == 3 && args[2] == "apply")) + { + // A package written before a record dropped a persisted slot cannot be written over (CultSchemaConflictException, + // retired slots stay read-only). Its decoded records go into a fresh file under today's schema, which must read + // back identical, and the fresh file replaces the old only with `apply`. Retired slots are the only content lost. + var (hull, ship, products) = ShipAuthoringStore.Load(args[1]); + var fresh = Path.GetFullPath(args[1]) + ".regenerating"; + File.Delete(fresh); + try + { + using (var cache = ShipAuthoringStore.Open(fresh, writable: true)) + { + ShipAuthoringStore.Write(cache, hull, ship); + foreach (var product in products) ShipAuthoringStore.WriteProduct(cache, ship.Id, product); + cache.FlushAsync().Wait(); + } + var (hull2, ship2, products2) = ShipAuthoringStore.Load(fresh); + ShipAuthoringStore.ValidateLoaded(hull2, ship2, products2); + var options = CultDocumentMessagePackSerialization.OptionsFor(typeof(HullData).Assembly); + byte[] Pack<T>(T value) => MessagePack.MessagePackSerializer.Serialize(value, options); + var same = Pack(hull).AsSpan().SequenceEqual(Pack(hull2)) && Pack(ship).AsSpan().SequenceEqual(Pack(ship2)) && + products.Length == products2.Length && + products.OrderBy(p => p.Manufacturer.Key.Value, StringComparer.Ordinal).Zip( + products2.OrderBy(p => p.Manufacturer.Key.Value, StringComparer.Ordinal), + (a, b) => Pack(a).AsSpan().SequenceEqual(Pack(b))).All(equal => equal); + if (!same) throw new InvalidOperationException($"{ship.Id}: the regenerated file does not read back as the records that went in; {args[1]} is untouched."); + Console.WriteLine($"{ship.Id}: {new FileInfo(args[1]).Length} bytes -> {new FileInfo(fresh).Length} bytes, {hull.Hardpoints.Count} hardpoints, {ship.Anchors.Count} anchors, {products.Length} products read back identical."); + if (args.Length == 3) File.Move(fresh, args[1], overwrite: true); + else Console.WriteLine("Dry run; add apply to replace the file."); + } + finally { File.Delete(fresh); File.Delete(fresh + ".lock"); } + return 0; + } if (args[0] == "price" && args.Length == 3) { // Judged before the file is touched: a refusal leaves it byte-identical. From 7f148f08f13b4f0870809998e2d70febf7001e4a Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Wed, 11 Nov 2026 13:44:28 +0000 Subject: [PATCH 054/108] element-ids doc: retired slots held placeholders, and why nakovalnya shrank Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- docs/element-ids.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/element-ids.md b/docs/element-ids.md index 87446b7e5..b4ae9584a 100644 --- a/docs/element-ids.md +++ b/docs/element-ids.md @@ -26,13 +26,14 @@ that some intermediate pins read a single-file v3 store silently and drop the id writers, keep a pre-upgrade copy of any real store (`GameData/Aetheria.cc` and the mod packages are tracked in git; player saves and run stores are not), and do not roll the pin back after a store has been written under the new one. -The shipped mod packages (`GameData/Mods/aetheria.wren/ship.cc`, `aetheria.nakovalnya/ship.cc`) once held values in the retired -`HullData` slots 21 and 22 (Wwise sound bank and audio stats), which the new CultLib refuses to write over +The shipped mod packages (`GameData/Mods/aetheria.wren/ship.cc`, `aetheria.nakovalnya/ship.cc`) held only default +placeholders (`0` and `[]`) in the retired `HullData` slots 21 and 22, which the new CultLib refuses to write over (`CultSchemaConflictException`). They were regenerated with `AetherDb ship-authoring regenerate <ship.cc> apply`, which loads the records, writes them into a fresh file under the current schema, requires them to read back identical and replaces the file. Both now hold persisted element ids and nil in slots 21 and 22; `EveryShippedModPackageCanBeWrittenOver` fails if a package regresses. A mod file that fails the same way is regenerated the same way. A rewritten catalog is about 15% larger: every behavior row is 38 -slots, mostly nil. +slots, mostly nil. A regenerated ship package can still shrink: the old nakovalnya file stored its floats as float64 and the +fresh write stores the typed `float` fields as float32 (40059 to 30457 bytes; each value equals the old one rounded to float32). The Unity manifest (`Packages/manifest.json`) pins `org.gamecult.cultlib` at `cultlib-unity-v3.0.0` and `org.gamecult.cultmath` at `cultmath-unity-v0.5.1` (the version v3.0.0 depends on). `org.gamecult.caching.unity` stays at `caching-unity-v2.0.0`: it is editor From b367f80e6d13c9a9dae716d02f9065611c5bb510 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 09:47:53 +0000 Subject: [PATCH 055/108] Credits screen: one attribution list in Shared, reachable from the main menu Twemoji, Playdead and the Noun Project icon credits, held against the licence files under Assets by CreditsTests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Credits.cs | 73 +++++++++++++++++ Assets/Scripts/ServerShared/Credits.cs.meta | 11 +++ Assets/Scripts/UI/MainMenu.cs | 32 ++++++++ tests/Aetheria.Shared.Tests/CreditsTests.cs | 89 +++++++++++++++++++++ 4 files changed, 205 insertions(+) create mode 100644 Assets/Scripts/ServerShared/Credits.cs create mode 100644 Assets/Scripts/ServerShared/Credits.cs.meta create mode 100644 tests/Aetheria.Shared.Tests/CreditsTests.cs diff --git a/Assets/Scripts/ServerShared/Credits.cs b/Assets/Scripts/ServerShared/Credits.cs new file mode 100644 index 000000000..3501ed2c9 --- /dev/null +++ b/Assets/Scripts/ServerShared/Credits.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +// The third-party attributions the shipped game must show the player. One list, owned here: the credits screen only +// renders it, and CreditsTests holds it against the licence files in Assets. Unity-free so the headless build checks it. +public class Credit +{ + public string Name; + public string Licence; + // What the licence requires shown: copyright holders, and any change notice. + public string Notice; + // The licence file in the repo that carries the full text and that this entry answers for. + public string LicenceFile; +} + +public static class Credits +{ + public const string TwemojiFile = "Assets/Fonts/Emoji/LICENSE.txt"; + public const string PlaydeadFile = "Assets/Plugins/Playdead/LICENSE.txt"; + public const string NounProjectFile = "Assets/Resources/Sprites/Attribution.txt"; + // Where the player build loads the Noun Project credit lines from (Resources path, no extension). + public const string NounProjectResource = "Sprites/Attribution"; + + // The full list. The Noun Project icon credits are the lines of its attribution file, whose text the caller supplies + // (Unity reads it as a Resources TextAsset; tests read it from disk), so the file stays the one copy of those names. + public static IReadOnlyList<Credit> All(string nounProjectAttribution) + { + var credits = new List<Credit> + { + new Credit + { + Name = "Twemoji", + Licence = "CC BY 4.0", + Notice = "Copyright (c) 2022-present Jason Sofonia & Justine De Caires; copyright (c) 2014-2021 Twitter. " + + "Graphics licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). " + + "Converted to a colour font; the artwork itself is not edited.", + LicenceFile = TwemojiFile + }, + new Credit + { + Name = "Playdead temporal anti-aliasing", + Licence = "MIT", + Notice = "Copyright (c) 2015 Playdead", + LicenceFile = PlaydeadFile + }, + new Credit + { + Name = "Noun Project icons", + Licence = "Noun Project attribution licence", + Notice = string.Join("\n", NounProjectLines(nounProjectAttribution)), + LicenceFile = NounProjectFile + } + }; + Validate(credits); + return credits; + } + + // The icon credit lines of the attribution file: everything after its "Noun Project" heading. + public static IEnumerable<string> NounProjectLines(string attribution) => + (attribution ?? "").Split('\n').Select(line => line.Trim()).Where(line => line.Length > 0).Skip(1); + + // Throws on an entry a player-facing screen could not honestly show. + public static void Validate(IReadOnlyList<Credit> credits) + { + foreach (var credit in credits) + if (string.IsNullOrWhiteSpace(credit.Name) || string.IsNullOrWhiteSpace(credit.Licence) || + string.IsNullOrWhiteSpace(credit.Notice) || string.IsNullOrWhiteSpace(credit.LicenceFile)) + throw new InvalidOperationException($"Credit '{credit.Name}' is missing its name, licence, notice or licence file"); + var duplicate = credits.GroupBy(credit => credit.LicenceFile).FirstOrDefault(group => group.Count() > 1); + if (duplicate != null) throw new InvalidOperationException($"Licence file {duplicate.Key} is credited twice"); + } +} diff --git a/Assets/Scripts/ServerShared/Credits.cs.meta b/Assets/Scripts/ServerShared/Credits.cs.meta new file mode 100644 index 000000000..e88730bb6 --- /dev/null +++ b/Assets/Scripts/ServerShared/Credits.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b3333d3c0203441fbadd64fad27b60e5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/UI/MainMenu.cs b/Assets/Scripts/UI/MainMenu.cs index 9eef387ca..88600e516 100644 --- a/Assets/Scripts/UI/MainMenu.cs +++ b/Assets/Scripts/UI/MainMenu.cs @@ -136,9 +136,41 @@ public class MainMenu : MonoBehaviour ShowSettings(); Fade(true); }); + _nextMenu.panel.AddButton("Credits", + () => + { + ShowCredits(); + Fade(true); + }); _nextMenu.panel.AddButton("Quit", Application.Quit); } + // The third-party attributions the build must show, one button per entry with its notice in the detail pane. The + // list is Credits.All; this only renders it. + private void ShowCredits() + { + var credits = Credits.All(Resources.Load<TextAsset>(Credits.NounProjectResource).text); + Next("credits"); + _nextMenu.detail.gameObject.SetActive(true); + _nextMenu.detail.Title.text = _nextMenu.panel.Title.text; + _nextMenu.detail.Title.color = Color.clear; + var selected = 0; + _nextMenu.detail.AddProperty(() => credits[selected].Name); + _nextMenu.detail.AddProperty(() => credits[selected].Licence); + _nextMenu.detail.AddProperty(() => credits[selected].Notice); + for (var i = 0; i < credits.Count; i++) + { + var index = i; + _nextMenu.panel.AddButton(credits[i].Name, () => selected = index); + } + _nextMenu.panel.AddButton("Back", + () => + { + ShowMain(); + Fade(false); + }); + } + // New Game: every way to set up a run, each with its brief. A release build lists only the modes; the other ways // to set up a run and the test arenas are listed only in editor and development builds. private void ShowScenarios() diff --git a/tests/Aetheria.Shared.Tests/CreditsTests.cs b/tests/Aetheria.Shared.Tests/CreditsTests.cs new file mode 100644 index 000000000..8f2691cf7 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/CreditsTests.cs @@ -0,0 +1,89 @@ +using System; +using System.IO; +using System.Linq; +using Xunit; + +namespace Aetheria.Shared.Tests +{ + // The credits list against the repo's own licence files and the main menu that must reach it. + public class CreditsTests + { + private static string Root() + { + var dir = new DirectoryInfo(AppContext.BaseDirectory); + while (dir != null && !File.Exists(Path.Combine(dir.FullName, "Assets", "Scripts", "UI", "MainMenu.cs"))) dir = dir.Parent; + return dir?.FullName ?? throw new InvalidOperationException("repo root not found"); + } + + private static string Read(string relative) => File.ReadAllText(Path.Combine(Root(), relative)); + + private static System.Collections.Generic.IReadOnlyList<Credit> Load() => Credits.All(Read(Credits.NounProjectFile)); + + [Fact] + public void EveryLicenceFileUnderAssetsIsCredited() + { + var root = Root(); + var found = Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*", SearchOption.AllDirectories) + .Where(path => !path.EndsWith(".meta")) + .Where(path => { var name = Path.GetFileName(path); return name.StartsWith("LICENSE", StringComparison.OrdinalIgnoreCase) || name.StartsWith("Attribution", StringComparison.OrdinalIgnoreCase); }) + .Select(path => Path.GetRelativePath(root, path).Replace('\\', '/')) + .ToArray(); + Assert.Contains(Credits.TwemojiFile, found); + var credited = Load().Select(credit => credit.LicenceFile).ToHashSet(); + Assert.Empty(found.Where(path => !credited.Contains(path))); + Assert.Empty(credited.Where(path => !File.Exists(Path.Combine(root, path)))); + } + + [Fact] + public void TwemojiComesFirstWithTheHoldersItsLicenceNames() + { + var twemoji = Load()[0]; + Assert.Equal("Twemoji", twemoji.Name); + Assert.Contains("CC BY 4.0", twemoji.Licence); + Assert.Contains("Jason Sofonia & Justine De Caires", Read(Credits.TwemojiFile)); + Assert.Contains("Jason Sofonia & Justine De Caires", twemoji.Notice); + Assert.Contains("Twitter", twemoji.Notice); + } + + [Fact] + public void EveryIconCreditInTheAttributionFileIsShown() + { + var lines = Credits.NounProjectLines(Read(Credits.NounProjectFile)).ToArray(); + Assert.True(lines.Length > 50); + var notice = Load().Single(credit => credit.LicenceFile == Credits.NounProjectFile).Notice.Split('\n'); + Assert.Equal(lines, notice); + } + + [Fact] + public void EntriesNameTheirLicenceAndHolder() + { + foreach (var credit in Load()) + { + Assert.False(string.IsNullOrWhiteSpace(credit.Name)); + Assert.False(string.IsNullOrWhiteSpace(credit.Licence)); + Assert.False(string.IsNullOrWhiteSpace(credit.Notice)); + } + Assert.Contains("Playdead", Read(Credits.PlaydeadFile)); + Assert.Contains("Playdead", Load().Single(credit => credit.LicenceFile == Credits.PlaydeadFile).Notice); + } + + [Fact] + public void AnEmptyEntryIsRefused() + { + Assert.Throws<InvalidOperationException>(() => Credits.Validate(new[] { new Credit { Name = "x", Licence = "", Notice = "n", LicenceFile = "f" } })); + } + + // The Unity menu is not compilable headlessly, so this reads its source: the main menu must offer Credits and + // the Credits screen must render the Shared list. It proves the wiring exists, not that the screen draws. + [Fact] + public void MainMenuOffersACreditsPathThatRendersTheList() + { + var menu = Read("Assets/Scripts/UI/MainMenu.cs"); + var main = menu.Substring(menu.IndexOf("private void ShowMain()", StringComparison.Ordinal)); + main = main.Substring(0, main.IndexOf("private void ShowScenarios()", StringComparison.Ordinal)); + Assert.Contains("AddButton(\"Credits\"", main); + Assert.Contains("ShowCredits()", main); + Assert.Contains("Credits.All(", menu); + } + } +} From 16cb82d096dabec3007396b8069bbf4ab9b155e8 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 12:43:50 +0000 Subject: [PATCH 056/108] Credits: credit every third-party work whose own text states holder and licence; test discovers all licence-like files Adds Liberation Sans (OFL), UniRx, KDTree, webgl-noise simplex noise and ambientCG to the list. CreditsTests now matches LICEN[CS]E, COPYING, NOTICE, README, SOURCES, OFL files under Assets and requires each to be credited or listed as reviewed-not-credited with a reason; credit notices are checked against what their files state. The attribution heading is checked rather than skipped, the test states independent expectations, and the split Hurricane line is joined. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Resources/Sprites/Attribution.txt | 3 +- Assets/Scripts/ServerShared/Credits.cs | 58 +++++++- tests/Aetheria.Shared.Tests/CreditsTests.cs | 154 +++++++++++++++++--- 3 files changed, 189 insertions(+), 26 deletions(-) diff --git a/Assets/Resources/Sprites/Attribution.txt b/Assets/Resources/Sprites/Attribution.txt index 666742406..8ca89fb1b 100644 --- a/Assets/Resources/Sprites/Attribution.txt +++ b/Assets/Resources/Sprites/Attribution.txt @@ -2,8 +2,7 @@ Noun Project Tornado by Bart Laubsch Alien Abduction by Bart Laubsch -Hurricane by icon 54 from -Smashicons Space by Ben Davis +Hurricane by icon 54 from Smashicons Space by Ben Davis Space 2 - Solid by Ben Davis Filter by Karthik Aathis Search by il Capitano diff --git a/Assets/Scripts/ServerShared/Credits.cs b/Assets/Scripts/ServerShared/Credits.cs index 3501ed2c9..3bb0af84b 100644 --- a/Assets/Scripts/ServerShared/Credits.cs +++ b/Assets/Scripts/ServerShared/Credits.cs @@ -19,6 +19,13 @@ public static class Credits public const string TwemojiFile = "Assets/Fonts/Emoji/LICENSE.txt"; public const string PlaydeadFile = "Assets/Plugins/Playdead/LICENSE.txt"; public const string NounProjectFile = "Assets/Resources/Sprites/Attribution.txt"; + public const string LiberationFile = "Assets/TextMesh Pro/Fonts/LiberationSans - OFL.txt"; + public const string UniRxFile = "Assets/Plugins/UniRx/ReadMe.txt"; + public const string AmbientCgFile = "Assets/Materials/PBR/SOURCES.md"; + public const string KdTreeFile = "Assets/Scripts/ServerShared/NIH/KDTree/KDTree.cs"; + public const string SimplexNoiseFile = "Assets/Plugins/GPU Noise/SimplexNoise2D.cginc"; + // The first line of the attribution file; the icon credits are the lines after it. + public const string NounProjectHeading = "Noun Project"; // Where the player build loads the Noun Project credit lines from (Resources path, no extension). public const string NounProjectResource = "Sprites/Attribution"; @@ -45,6 +52,44 @@ public static class Credits LicenceFile = PlaydeadFile }, new Credit + { + Name = "Liberation Sans", + Licence = "SIL Open Font License 1.1", + Notice = "Digitized data copyright (c) 2010 Google Corporation with Reserved Font Arimo, Tinos and Cousine. " + + "Copyright (c) 2012 Red Hat, Inc. with Reserved Font Name Liberation.", + LicenceFile = LiberationFile + }, + new Credit + { + Name = "UniRx", + Licence = "MIT", + Notice = "Created by Yoshifumi Kawai (neuecc)", + LicenceFile = UniRxFile + }, + new Credit + { + Name = "KDTree", + Licence = "MIT", + Notice = "Copyright (c) 2018 Vili Volčini / viliwonka", + LicenceFile = KdTreeFile + }, + new Credit + { + Name = "webgl-noise simplex noise", + Licence = "MIT", + Notice = "Copyright (C) 2011 Ashima Arts. Author: Ian McEwan, Ashima Arts " + + "(https://github.com/ashima/webgl-noise). Translated to Unity shaders and modified by Keijiro Takahashi " + + "(https://github.com/keijiro/NoiseShader).", + LicenceFile = SimplexNoiseFile + }, + new Credit + { + Name = "ambientCG PBR materials", + Licence = "CC0 1.0 Universal", + Notice = "Texture sets from ambientCG (https://ambientcg.com), public domain", + LicenceFile = AmbientCgFile + }, + new Credit { Name = "Noun Project icons", Licence = "Noun Project attribution licence", @@ -56,9 +101,16 @@ public static class Credits return credits; } - // The icon credit lines of the attribution file: everything after its "Noun Project" heading. - public static IEnumerable<string> NounProjectLines(string attribution) => - (attribution ?? "").Split('\n').Select(line => line.Trim()).Where(line => line.Length > 0).Skip(1); + // The icon credit lines of the attribution file: everything after its "Noun Project" heading, one line per icon (the + // file's "Other" sub-heading and its lines follow in the same list). A file that does not open with the heading is + // refused rather than having its first line dropped. + public static IEnumerable<string> NounProjectLines(string attribution) + { + var lines = (attribution ?? "").Split('\n').Select(line => line.Trim()).Where(line => line.Length > 0).ToArray(); + if (lines.Length < 2 || lines[0] != NounProjectHeading) + throw new InvalidOperationException($"{NounProjectFile} must open with the heading '{NounProjectHeading}' followed by icon credits"); + return lines.Skip(1); + } // Throws on an entry a player-facing screen could not honestly show. public static void Validate(IReadOnlyList<Credit> credits) diff --git a/tests/Aetheria.Shared.Tests/CreditsTests.cs b/tests/Aetheria.Shared.Tests/CreditsTests.cs index 8f2691cf7..b346f1fca 100644 --- a/tests/Aetheria.Shared.Tests/CreditsTests.cs +++ b/tests/Aetheria.Shared.Tests/CreditsTests.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Linq; +using System.Text.RegularExpressions; using Xunit; namespace Aetheria.Shared.Tests @@ -19,41 +20,151 @@ namespace Aetheria.Shared.Tests private static System.Collections.Generic.IReadOnlyList<Credit> Load() => Credits.All(Read(Credits.NounProjectFile)); - [Fact] - public void EveryLicenceFileUnderAssetsIsCredited() + // A file under Assets that looks like a licence, attribution, notice, readme or sources list. Each one is either + // credited (the credit names it as its LicenceFile) or reviewed below with the reason it is not. + private static readonly Regex LicenceLike = new Regex( + @"^(LICEN[CS]E|COPYING|NOTICE|README|SOURCES|_SOURCES|Attribution)|OFL", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); + + private static readonly string[] SkippedDirectories = { "bin", "obj", "Library" }; + + // Discovered files whose own text names no holder and no licence, so there is nothing true to credit. A new + // licence-like file is not here until someone has read it and written the reason. + private static readonly System.Collections.Generic.Dictionary<string, string> ReviewedNotCredited = new System.Collections.Generic.Dictionary<string, string> + { + ["Assets/Scripts/ServerShared/NIH/LinqFaster/readme.txt"] = "usage guide for LinqFaster; names no holder and no licence", + ["Assets/Plugins/LowPoly_AsteroidsPack/README.pdf"] = "how to customise the asteroid pack; names no holder and no licence", + ["Assets/Plugins/Celestial Body/Textures/_Sources.txt"] = "URLs of the source textures only; states no licence", + }; + + // Bundled works with no licence-like file at all, found by reading Assets. Their licences are not stated in the + // repo, so they are not credited; each path must still exist, so this list cannot go stale unnoticed. + private static readonly string[] UnlicensedWorks = + { + "Assets/Fonts/Ubuntu", + "Assets/Fonts/Retro", + "Assets/Plugins/Ink", + "Assets/Plugins/GPUTrail", + "Assets/Plugins/com.unity.uiextensions", + "Assets/Shaders/StableFluids", + }; + + // What each credited file itself states, written here independently of the credit text: these strings must + // appear in the file and in the credit's notice. + private static readonly (string file, string[] stated)[] Holders = + { + (Credits.TwemojiFile, new[] { "Jason Sofonia & Justine De Caires", "Twitter", "CC BY 4.0" }), + (Credits.PlaydeadFile, new[] { "Playdead" }), + (Credits.LiberationFile, new[] { "Google Corporation", "Red Hat, Inc." }), + (Credits.UniRxFile, new[] { "Yoshifumi Kawai" }), + (Credits.KdTreeFile, new[] { "Vili Vol\u010dini / viliwonka" }), + (Credits.SimplexNoiseFile, new[] { "Ashima Arts", "Ian McEwan", "Keijiro Takahashi" }), + (Credits.AmbientCgFile, new[] { "ambientCG" }), + }; + + private static string[] LicenceLikeFiles() { var root = Root(); - var found = Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*", SearchOption.AllDirectories) + return Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*", SearchOption.AllDirectories) .Where(path => !path.EndsWith(".meta")) - .Where(path => { var name = Path.GetFileName(path); return name.StartsWith("LICENSE", StringComparison.OrdinalIgnoreCase) || name.StartsWith("Attribution", StringComparison.OrdinalIgnoreCase); }) .Select(path => Path.GetRelativePath(root, path).Replace('\\', '/')) + .Where(path => !path.Split('/').Any(segment => SkippedDirectories.Contains(segment))) + .Where(path => LicenceLike.IsMatch(Path.GetFileName(path))) + .OrderBy(path => path, StringComparer.Ordinal) .ToArray(); - Assert.Contains(Credits.TwemojiFile, found); - var credited = Load().Select(credit => credit.LicenceFile).ToHashSet(); - Assert.Empty(found.Where(path => !credited.Contains(path))); - Assert.Empty(credited.Where(path => !File.Exists(Path.Combine(root, path)))); } + // The ways a licence-like file can be accounted for; shared so the mutations in the report hit the same rule. + private static string[] Unaccounted(string[] found, System.Collections.Generic.IEnumerable<string> credited) => + found.Where(path => !credited.Contains(path) && !ReviewedNotCredited.ContainsKey(path)).ToArray(); + [Fact] - public void TwemojiComesFirstWithTheHoldersItsLicenceNames() + public void EveryLicenceLikeFileUnderAssetsIsCreditedOrReviewed() + { + var root = Root(); + var found = LicenceLikeFiles(); + Assert.Contains(Credits.TwemojiFile, found); + Assert.Contains(Credits.LiberationFile, found); + var credited = Load().Select(credit => credit.LicenceFile).ToArray(); + Assert.Equal(Array.Empty<string>(), Unaccounted(found, credited)); + Assert.Equal(Array.Empty<string>(), credited.Where(path => !File.Exists(Path.Combine(root, path))).ToArray()); + Assert.Equal(Array.Empty<string>(), ReviewedNotCredited.Keys.Where(path => !found.Contains(path)).ToArray()); + Assert.Equal(Array.Empty<string>(), ReviewedNotCredited.Keys.Where(path => credited.Contains(path)).ToArray()); + Assert.Equal(Array.Empty<string>(), UnlicensedWorks.Where(path => !Directory.Exists(Path.Combine(root, path))).ToArray()); + } + + // Every holder the licence file states is in the credit that answers for it; the notices are typed into + // Credits.cs, so this is what keeps them true to the files. + [Fact] + public void EveryCreditShowsTheHoldersItsOwnFileStates() + { + var credits = Load(); + Assert.Equal(Holders.Select(h => h.file).Append(Credits.NounProjectFile).OrderBy(f => f, StringComparer.Ordinal), + credits.Select(credit => credit.LicenceFile).OrderBy(f => f, StringComparer.Ordinal)); + foreach (var (file, stated) in Holders) + { + var text = Normal(Read(file)); + var notice = Normal(credits.Single(credit => credit.LicenceFile == file).Notice); + foreach (var holder in stated) + { + Assert.True(text.Contains(Normal(holder)), $"{file} does not state '{holder}'"); + Assert.True(notice.Contains(Normal(holder)), $"the credit for {file} omits '{holder}'"); + } + // And every copyright line the file carries, whatever the table above says. + foreach (var line in Read(file).Split('\n')) + { + var match = CopyrightLine.Match(line); + if (!match.Success) continue; + var body = Regex.Replace(match.Groups[1].Value.Replace("[", "").Replace("]", "").Trim(), @"(\s*All rights reserved)?\.?$", "", RegexOptions.IgnoreCase); + Assert.True(notice.Contains(Normal(body)), $"the credit for {file} omits its copyright line '{body}'"); + } + } + } + + private static readonly Regex CopyrightLine = new Regex(@"copyright\s*(?:\(c\)|\u00a9)?\s*(\[?\d.*)$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); + + // Dash variants and case folded, so the file's en dash and the screen's hyphen compare equal. + private static string Normal(string text) => text.Replace('\u2013', '-').Replace('\u2014', '-').Replace("\r", "").ToLowerInvariant(); + + [Fact] + public void TwemojiComesFirst() { var twemoji = Load()[0]; Assert.Equal("Twemoji", twemoji.Name); Assert.Contains("CC BY 4.0", twemoji.Licence); - Assert.Contains("Jason Sofonia & Justine De Caires", Read(Credits.TwemojiFile)); - Assert.Contains("Jason Sofonia & Justine De Caires", twemoji.Notice); - Assert.Contains("Twitter", twemoji.Notice); } + // The expectations are stated here, not derived from the parser: 81 icon credits between the heading and the + // "Other" sub-heading's two artists, named at the ends and at the line that was once split across two. [Fact] public void EveryIconCreditInTheAttributionFileIsShown() { - var lines = Credits.NounProjectLines(Read(Credits.NounProjectFile)).ToArray(); - Assert.True(lines.Length > 50); + var text = Read(Credits.NounProjectFile); + Assert.StartsWith(Credits.NounProjectHeading, text.TrimStart('\uFEFF')); + var lines = Credits.NounProjectLines(text).ToArray(); + Assert.Equal(82, lines.Length); + Assert.Equal("Tornado by Bart Laubsch", lines[0]); + Assert.Equal("Alien Abduction by Bart Laubsch", lines[1]); + Assert.Equal("Hurricane by icon 54 from Smashicons Space by Ben Davis", lines[2]); + Assert.Equal("Space 2 - Solid by Ben Davis", lines[3]); + Assert.Contains("Other", lines); + Assert.Equal("Missile War Weapon by Freepik", lines[^1]); + // One credit per line: every line but the sub-heading names an artist and does not stop mid-sentence. + foreach (var line in lines.Where(line => line != "Other")) + { + Assert.Contains(" by ", line, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotMatch(@"\s(from|by)$", line); + } var notice = Load().Single(credit => credit.LicenceFile == Credits.NounProjectFile).Notice.Split('\n'); Assert.Equal(lines, notice); } + [Fact] + public void AnAttributionFileWithoutItsHeadingIsRefused() + { + Assert.Throws<InvalidOperationException>(() => Credits.NounProjectLines("Tornado by Bart Laubsch\nAlien Abduction by Bart Laubsch").ToArray()); + Assert.Throws<InvalidOperationException>(() => Credits.NounProjectLines("Noun Project\n\n").ToArray()); + } + [Fact] public void EntriesNameTheirLicenceAndHolder() { @@ -63,8 +174,6 @@ namespace Aetheria.Shared.Tests Assert.False(string.IsNullOrWhiteSpace(credit.Licence)); Assert.False(string.IsNullOrWhiteSpace(credit.Notice)); } - Assert.Contains("Playdead", Read(Credits.PlaydeadFile)); - Assert.Contains("Playdead", Load().Single(credit => credit.LicenceFile == Credits.PlaydeadFile).Notice); } [Fact] @@ -73,17 +182,20 @@ namespace Aetheria.Shared.Tests Assert.Throws<InvalidOperationException>(() => Credits.Validate(new[] { new Credit { Name = "x", Licence = "", Notice = "n", LicenceFile = "f" } })); } - // The Unity menu is not compilable headlessly, so this reads its source: the main menu must offer Credits and - // the Credits screen must render the Shared list. It proves the wiring exists, not that the screen draws. + // The Unity menu is not compilable headlessly, so this reads its source with comments removed (a commented-out + // button or call must not satisfy it): the main menu must offer Credits, and ShowCredits must build the Shared + // list. It proves the wiring exists, not that the screen draws. [Fact] public void MainMenuOffersACreditsPathThatRendersTheList() { - var menu = Read("Assets/Scripts/UI/MainMenu.cs"); + var menu = Regex.Replace(Read("Assets/Scripts/UI/MainMenu.cs"), @"/\*.*?\*/|//[^\n]*", "", RegexOptions.Singleline); var main = menu.Substring(menu.IndexOf("private void ShowMain()", StringComparison.Ordinal)); - main = main.Substring(0, main.IndexOf("private void ShowScenarios()", StringComparison.Ordinal)); + main = main.Substring(0, main.IndexOf("private void ShowCredits()", StringComparison.Ordinal)); Assert.Contains("AddButton(\"Credits\"", main); Assert.Contains("ShowCredits()", main); - Assert.Contains("Credits.All(", menu); + var credits = menu.Substring(menu.IndexOf("private void ShowCredits()", StringComparison.Ordinal)); + credits = credits.Substring(0, credits.IndexOf("private void ShowScenarios()", StringComparison.Ordinal)); + Assert.Contains("Credits.All(", credits); } } } From 390b4c7a457bff9bd87e2e4149f0057cea7d8832 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 12:48:52 +0000 Subject: [PATCH 057/108] Credits screen: one row per notice line, refuse a missing attribution file, follow the New Game focus handling ShowCredits renders the selected credit as property rows instead of one multi-line label, refuses with a dialog when the attribution TextAsset is missing or malformed, takes list rows out of automatic navigation, steps with Up/Down on the focused Back button and leaves on Cancel. ScenarioPicker's focus hold moves to FocusHold so both screens share it. The menu wiring test now strips comments before matching. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/UI/MainMenu.cs | 80 +++++++++++++++------ Assets/Scripts/UI/ScenarioPicker.cs | 30 ++++---- tests/Aetheria.Shared.Tests/CreditsTests.cs | 7 +- 3 files changed, 83 insertions(+), 34 deletions(-) diff --git a/Assets/Scripts/UI/MainMenu.cs b/Assets/Scripts/UI/MainMenu.cs index 88600e516..e7aba3357 100644 --- a/Assets/Scripts/UI/MainMenu.cs +++ b/Assets/Scripts/UI/MainMenu.cs @@ -7,7 +7,9 @@ using System.Threading; using System.Threading.Tasks; using TMPro; using UniRx; +using UniRx.Triggers; using UnityEngine; +using UnityEngine.EventSystems; using UnityEngine.SceneManagement; using UnityEngine.UI; using static CultMath.math; @@ -139,36 +141,74 @@ public class MainMenu : MonoBehaviour _nextMenu.panel.AddButton("Credits", () => { - ShowCredits(); - Fade(true); + if (ShowCredits()) Fade(true); }); _nextMenu.panel.AddButton("Quit", Application.Quit); } - // The third-party attributions the build must show, one button per entry with its notice in the detail pane. The - // list is Credits.All; this only renders it. - private void ShowCredits() + // The third-party attributions the build must show, one button per entry; the selected entry's name, licence and one + // row per notice line fill the detail pane. The list is Credits.All; this only renders it. The screen follows the + // New Game screen: list rows are out of automatic navigation, the focused Back button takes Up and Down to step the + // selection and Cancel to leave, and a click on empty space does not drop that focus. + // False when the list could not be built and a dialog says why; the menu stays where it was. + private bool ShowCredits() { - var credits = Credits.All(Resources.Load<TextAsset>(Credits.NounProjectResource).text); + var attribution = Resources.Load<TextAsset>(Credits.NounProjectResource); + if (attribution == null) + { + Refuse("Credits are unavailable", $"{Credits.NounProjectResource} is missing from this build."); + return false; + } + IReadOnlyList<Credit> credits; + try { credits = Credits.All(attribution.text); } + catch (InvalidOperationException error) + { + Refuse("Credits are unavailable", error.Message); + return false; + } Next("credits"); - _nextMenu.detail.gameObject.SetActive(true); - _nextMenu.detail.Title.text = _nextMenu.panel.Title.text; - _nextMenu.detail.Title.color = Color.clear; - var selected = 0; - _nextMenu.detail.AddProperty(() => credits[selected].Name); - _nextMenu.detail.AddProperty(() => credits[selected].Licence); - _nextMenu.detail.AddProperty(() => credits[selected].Notice); + var list = _nextMenu.panel; + var detail = _nextMenu.detail; + detail.gameObject.SetActive(true); + var focus = new FocusHold(); + var selected = -1; + Button back = null; + void Leave() + { + FocusHold.Focus(null); + focus.Release(); + ShowMain(); + Fade(false); + } + void Select(int index) + { + selected = Mathf.Clamp(index, 0, credits.Count - 1); + var credit = credits[selected]; + detail.Clear(); + detail.Title.text = list.Title.text; + detail.Title.color = Color.clear; + detail.AddProperty(() => credit.Name); + detail.AddProperty(() => credit.Licence); + detail.AddSpacer(); + foreach (var line in credit.Notice.Split('\n')) detail.AddProperty(() => line); + FocusHold.Focus(back.gameObject); + } for (var i = 0; i < credits.Count; i++) { var index = i; - _nextMenu.panel.AddButton(credits[i].Name, () => selected = index); + list.AddButton(credits[i].Name, () => Select(index)).Button.navigation = new Navigation { mode = Navigation.Mode.None }; } - _nextMenu.panel.AddButton("Back", - () => - { - ShowMain(); - Fade(false); - }); + back = list.AddButton("Back", Leave).Button; + back.navigation = new Navigation { mode = Navigation.Mode.None }; + back.OnMoveAsObservable().Subscribe(move => + { + if (move.moveDir == MoveDirection.Up) Select(selected - 1); + else if (move.moveDir == MoveDirection.Down) Select(selected + 1); + }); + back.OnCancelAsObservable().Subscribe(_ => Leave()); + focus.Hold(); + Select(0); + return true; } // New Game: every way to set up a run, each with its brief. A release build lists only the modes; the other ways diff --git a/Assets/Scripts/UI/ScenarioPicker.cs b/Assets/Scripts/UI/ScenarioPicker.cs index e0cd93134..f5f3a1ca4 100644 --- a/Assets/Scripts/UI/ScenarioPicker.cs +++ b/Assets/Scripts/UI/ScenarioPicker.cs @@ -30,7 +30,7 @@ public sealed class ScenarioPicker private static readonly Color Accent = new Color(1, .4458f, .05f); private int _selected; private bool _launched; - private bool _restoreDeselect; + private readonly FocusHold _focus = new FocusHold(); private ScenarioPicker(PropertiesPanel list, PropertiesPanel detail, Action<Scenario> launch, Action back) { @@ -115,7 +115,7 @@ public sealed class ScenarioPicker picker._launchButton.OnCancelAsObservable().Subscribe(_ => picker.Back()); picker.StyleScrollbars(); - picker.HoldFocus(); + picker._focus.Hold(); picker.Select(0); // Layout is not live until the frame after Show; edit mode has no frames. if (Application.isPlaying) Observable.NextFrame().Subscribe(_ => picker.FitViewport()); @@ -229,7 +229,7 @@ public sealed class ScenarioPicker _rows[i].colors = colors; _rows[i].targetGraphic.color = i == _selected ? Accent : _rowFills[i]; } - Focus(_launchButton.gameObject); + FocusHold.Focus(_launchButton.gameObject); Reveal((RectTransform) _rows[_selected].transform); } @@ -253,36 +253,42 @@ public sealed class ScenarioPicker { if (_launched) return; _launched = true; - Focus(null); - ReleaseFocus(); + FocusHold.Focus(null); + _focus.Release(); _launch(Selected); } // Leaves the screen; the same path for the Back button and Cancel. private void Back() { - Focus(null); - ReleaseFocus(); + FocusHold.Focus(null); + _focus.Release(); _back(); } +} - // While the picker is up, a click on empty space must not drop focus from Launch, or the arrows and Enter go dead. - // The input module's flag is scene-wide, so the picker takes it for its own lifetime and gives it back on leaving. - private void HoldFocus() +// Keeps keyboard and gamepad focus on one control while a menu screen is up. While held, a click on empty space must +// not drop focus, or the arrows and Enter go dead. The input module's flag is scene-wide, so the screen takes it for its +// own lifetime and gives it back on leaving. The New Game and Credits screens both use it. +public sealed class FocusHold +{ + private bool _restoreDeselect; + + public void Hold() { if (EventSystem.current == null || !(EventSystem.current.currentInputModule is InputSystemUIInputModule module) || !module.deselectOnBackgroundClick) return; module.deselectOnBackgroundClick = false; _restoreDeselect = true; } - private void ReleaseFocus() + public void Release() { if (!_restoreDeselect) return; _restoreDeselect = false; if (EventSystem.current != null && EventSystem.current.currentInputModule is InputSystemUIInputModule module) module.deselectOnBackgroundClick = true; } - private static void Focus(GameObject target) + public static void Focus(GameObject target) { if (EventSystem.current != null) EventSystem.current.SetSelectedGameObject(target); } diff --git a/tests/Aetheria.Shared.Tests/CreditsTests.cs b/tests/Aetheria.Shared.Tests/CreditsTests.cs index b346f1fca..ed322bef4 100644 --- a/tests/Aetheria.Shared.Tests/CreditsTests.cs +++ b/tests/Aetheria.Shared.Tests/CreditsTests.cs @@ -190,12 +190,15 @@ namespace Aetheria.Shared.Tests { var menu = Regex.Replace(Read("Assets/Scripts/UI/MainMenu.cs"), @"/\*.*?\*/|//[^\n]*", "", RegexOptions.Singleline); var main = menu.Substring(menu.IndexOf("private void ShowMain()", StringComparison.Ordinal)); - main = main.Substring(0, main.IndexOf("private void ShowCredits()", StringComparison.Ordinal)); + main = main.Substring(0, main.IndexOf("private bool ShowCredits()", StringComparison.Ordinal)); Assert.Contains("AddButton(\"Credits\"", main); Assert.Contains("ShowCredits()", main); - var credits = menu.Substring(menu.IndexOf("private void ShowCredits()", StringComparison.Ordinal)); + var credits = menu.Substring(menu.IndexOf("private bool ShowCredits()", StringComparison.Ordinal)); credits = credits.Substring(0, credits.IndexOf("private void ShowScenarios()", StringComparison.Ordinal)); Assert.Contains("Credits.All(", credits); + // A build missing the attribution file refuses with a dialog instead of throwing in the click handler. + Assert.Contains("attribution == null", credits); + Assert.Contains("Refuse(", credits); } } } From 1537bc2c52e72da9615f0512bf78c0f7cdead3f3 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 14:37:48 +0000 Subject: [PATCH 058/108] Credits: credit the Ubuntu and Montserrat fonts from their embedded notices; review unreferenced fonts; stop skipping obj/bin/Library under Assets Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Credits.cs | 17 ++++ tests/Aetheria.Shared.Tests/CreditsTests.cs | 106 ++++++++++++++++++-- 2 files changed, 117 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/ServerShared/Credits.cs b/Assets/Scripts/ServerShared/Credits.cs index 3bb0af84b..cfc3028fb 100644 --- a/Assets/Scripts/ServerShared/Credits.cs +++ b/Assets/Scripts/ServerShared/Credits.cs @@ -20,6 +20,9 @@ public static class Credits public const string PlaydeadFile = "Assets/Plugins/Playdead/LICENSE.txt"; public const string NounProjectFile = "Assets/Resources/Sprites/Attribution.txt"; public const string LiberationFile = "Assets/TextMesh Pro/Fonts/LiberationSans - OFL.txt"; + // Fonts state their holder and licence in their own name tables; these are the font files the credit answers for. + public const string UbuntuFontFile = "Assets/Fonts/Ubuntu/Ubuntu-R.ttf"; + public const string MontserratFontFile = "Assets/Fonts/Ubuntu/Montserrat-Thin.ttf"; public const string UniRxFile = "Assets/Plugins/UniRx/ReadMe.txt"; public const string AmbientCgFile = "Assets/Materials/PBR/SOURCES.md"; public const string KdTreeFile = "Assets/Scripts/ServerShared/NIH/KDTree/KDTree.cs"; @@ -60,6 +63,20 @@ public static class Credits LicenceFile = LiberationFile }, new Credit + { + Name = "Ubuntu and Ubuntu Mono fonts", + Licence = "Ubuntu Font Licence 1.0", + Notice = "Copyright 2011 Canonical Ltd.", + LicenceFile = UbuntuFontFile + }, + new Credit + { + Name = "Montserrat", + Licence = "SIL Open Font License 1.1", + Notice = "Copyright(c) 2014 by Julieta Ulanovsky", + LicenceFile = MontserratFontFile + }, + new Credit { Name = "UniRx", Licence = "MIT", diff --git a/tests/Aetheria.Shared.Tests/CreditsTests.cs b/tests/Aetheria.Shared.Tests/CreditsTests.cs index ed322bef4..8d4a4a6b9 100644 --- a/tests/Aetheria.Shared.Tests/CreditsTests.cs +++ b/tests/Aetheria.Shared.Tests/CreditsTests.cs @@ -25,8 +25,6 @@ namespace Aetheria.Shared.Tests private static readonly Regex LicenceLike = new Regex( @"^(LICEN[CS]E|COPYING|NOTICE|README|SOURCES|_SOURCES|Attribution)|OFL", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); - private static readonly string[] SkippedDirectories = { "bin", "obj", "Library" }; - // Discovered files whose own text names no holder and no licence, so there is nothing true to credit. A new // licence-like file is not here until someone has read it and written the reason. private static readonly System.Collections.Generic.Dictionary<string, string> ReviewedNotCredited = new System.Collections.Generic.Dictionary<string, string> @@ -40,8 +38,6 @@ namespace Aetheria.Shared.Tests // repo, so they are not credited; each path must still exist, so this list cannot go stale unnoticed. private static readonly string[] UnlicensedWorks = { - "Assets/Fonts/Ubuntu", - "Assets/Fonts/Retro", "Assets/Plugins/Ink", "Assets/Plugins/GPUTrail", "Assets/Plugins/com.unity.uiextensions", @@ -61,13 +57,70 @@ namespace Aetheria.Shared.Tests (Credits.AmbientCgFile, new[] { "ambientCG" }), }; + // Fonts that state holder and licence in their own name tables: the credit's LicenceFile is the first font, and + // every font listed must embed the stated string (read from the file, not from the credit) and be shown by the + // credit. The ids are TrueType name ids: 0 is the copyright notice. + private static readonly (string credit, string[] fonts, string embedded)[] FontCredits = + { + (Credits.UbuntuFontFile, new[] { "Assets/Fonts/Ubuntu/Ubuntu-R.ttf", "Assets/Fonts/Ubuntu/Ubuntu-L.ttf", "Assets/Fonts/Ubuntu/Ubuntu-B.ttf", "Assets/Fonts/Ubuntu/UbuntuMono-R.ttf" }, + "Copyright 2011 Canonical Ltd."), + (Credits.MontserratFontFile, new[] { "Assets/Fonts/Ubuntu/Montserrat-Thin.ttf" }, "Copyright(c) 2014 by Julieta Ulanovsky"), + }; + + // Fonts credited through a licence file in the repo (see Holders), not through their own text. + private static readonly string[] FontsCreditedByLicenceFile = { "Assets/Fonts/Emoji/Twemoji.ttf", "Assets/TextMesh Pro/Fonts/LiberationSans.ttf" }; + + // Fonts under Assets that are not credited, each with the reason; every one must be unreferenced by any prefab, + // scene, material or asset outside Assets/Fonts (checked), so shipping it is not a decision made by accident. + private static readonly System.Collections.Generic.Dictionary<string, string> ReviewedFonts = new System.Collections.Generic.Dictionary<string, string> + { + ["Assets/Fonts/Retro/LRT Oksana.ttf"] = "EULA forbids more than personal use; unreferenced; decision owed", + ["Assets/Fonts/Retro/LRT Oksana Bold.ttf"] = "EULA forbids more than personal use; unreferenced; decision owed", + ["Assets/Fonts/Ubuntu/UbuntuMono-B.ttf"] = "unreferenced; same holder and licence as UbuntuMono-R, which the Ubuntu credit covers", + ["Assets/Fonts/ftn_SourceSansPro-Regular.otf"] = "unreferenced; embeds Adobe copyright under the SIL OFL 1.1; credit it if it is ever used", + }; + + private static string[] FontFiles() + { + var root = Root(); + return Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*", SearchOption.AllDirectories) + .Select(path => Path.GetRelativePath(root, path).Replace('\\', '/')) + .Where(path => path.EndsWith(".ttf", StringComparison.OrdinalIgnoreCase) || path.EndsWith(".otf", StringComparison.OrdinalIgnoreCase)) + .OrderBy(path => path, StringComparer.Ordinal) + .ToArray(); + } + + // Every name-table record of a TrueType/OpenType file with the given name id, decoded (platform 3 as UTF-16BE, + // platform 1 as Latin-1). + private static System.Collections.Generic.List<string> NameRecords(string relative, int nameId) + { + var d = File.ReadAllBytes(Path.Combine(Root(), relative)); + int U16(int at) => (d[at] << 8) | d[at + 1]; + long U32(int at) => ((long)d[at] << 24) | ((long)d[at + 1] << 16) | ((long)d[at + 2] << 8) | d[at + 3]; + var found = new System.Collections.Generic.List<string>(); + for (int i = 0, n = U16(4); i < n; i++) + { + var rec = 12 + 16 * i; + if (System.Text.Encoding.ASCII.GetString(d, rec, 4) != "name") continue; + var table = (int)U32(rec + 8); + int count = U16(table + 2), strings = table + U16(table + 4); + for (var j = 0; j < count; j++) + { + var r = table + 6 + 12 * j; + if (U16(r + 6) != nameId) continue; + var text = System.Text.Encoding.GetEncoding(U16(r) == 3 ? "utf-16BE" : "latin1").GetString(d, strings + U16(r + 10), U16(r + 8)); + found.Add(text.Replace("\r", "").Trim()); + } + } + return found; + } + private static string[] LicenceLikeFiles() { var root = Root(); return Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*", SearchOption.AllDirectories) .Where(path => !path.EndsWith(".meta")) .Select(path => Path.GetRelativePath(root, path).Replace('\\', '/')) - .Where(path => !path.Split('/').Any(segment => SkippedDirectories.Contains(segment))) .Where(path => LicenceLike.IsMatch(Path.GetFileName(path))) .OrderBy(path => path, StringComparer.Ordinal) .ToArray(); @@ -98,7 +151,7 @@ namespace Aetheria.Shared.Tests public void EveryCreditShowsTheHoldersItsOwnFileStates() { var credits = Load(); - Assert.Equal(Holders.Select(h => h.file).Append(Credits.NounProjectFile).OrderBy(f => f, StringComparer.Ordinal), + Assert.Equal(Holders.Select(h => h.file).Append(Credits.NounProjectFile).Concat(FontCredits.Select(f => f.credit)).OrderBy(f => f, StringComparer.Ordinal), credits.Select(credit => credit.LicenceFile).OrderBy(f => f, StringComparer.Ordinal)); foreach (var (file, stated) in Holders) { @@ -125,6 +178,47 @@ namespace Aetheria.Shared.Tests // Dash variants and case folded, so the file's en dash and the screen's hyphen compare equal. private static string Normal(string text) => text.Replace('\u2013', '-').Replace('\u2014', '-').Replace("\r", "").ToLowerInvariant(); + // The credit text is typed; the font files are the authority on who holds them. A wrong holder, or a font in the + // family that does not carry it, fails here. + [Fact] + public void FontCreditsShowWhatTheFontsThemselvesEmbed() + { + var credits = Load(); + foreach (var (creditFile, fonts, embedded) in FontCredits) + { + var notice = credits.Single(credit => credit.LicenceFile == creditFile).Notice; + Assert.Equal(creditFile, fonts[0]); + Assert.Contains(embedded, notice); + foreach (var font in fonts) + Assert.True(NameRecords(font, 0).Count > 0 && NameRecords(font, 0).All(record => record.StartsWith(embedded)), + $"{font} does not embed '{embedded}' as its copyright"); + } + Assert.Contains("Ubuntu Font Licence 1.0", NameRecords(Credits.UbuntuFontFile, 0)[0]); + Assert.Contains("Ubuntu Font Licence 1.0", credits.Single(credit => credit.LicenceFile == Credits.UbuntuFontFile).Licence); + Assert.Contains("SIL Open Font License, Version 1.1", NameRecords(Credits.MontserratFontFile, 13)[0]); + Assert.Contains("SIL Open Font License 1.1", credits.Single(credit => credit.LicenceFile == Credits.MontserratFontFile).Licence); + } + + [Fact] + public void EveryFontUnderAssetsIsCreditedOrReviewedAsUnreferenced() + { + var root = Root(); + var accounted = FontCredits.SelectMany(f => f.fonts).Concat(FontsCreditedByLicenceFile).Concat(ReviewedFonts.Keys).ToArray(); + var fonts = FontFiles(); + Assert.Equal(Array.Empty<string>(), fonts.Where(font => !accounted.Contains(font)).ToArray()); + Assert.Equal(Array.Empty<string>(), accounted.Where(font => !fonts.Contains(font)).ToArray()); + // A reviewed font stays out of the credits only while nothing outside Assets/Fonts uses it. + var guids = ReviewedFonts.Keys.ToDictionary(font => font, font => Regex.Match(Read(font + ".meta"), @"guid: (\w+)").Groups[1].Value); + Assert.All(guids.Values, guid => Assert.Equal(32, guid.Length)); + var users = Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*", SearchOption.AllDirectories) + .Select(path => Path.GetRelativePath(root, path).Replace('\\', '/')) + .Where(path => !path.StartsWith("Assets/Fonts/") && new[] { ".prefab", ".unity", ".mat", ".asset", ".controller" }.Any(ext => path.EndsWith(ext))) + .Select(path => (path, text: Read(path))) + .ToArray(); + foreach (var (font, guid) in guids) + Assert.Equal(Array.Empty<string>(), users.Where(user => user.text.Contains(guid)).Select(user => user.path).ToArray()); + } + [Fact] public void TwemojiComesFirst() { From a04c6414e1a644a63c55499b40e0345bd72df2c6 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 16:10:24 +0000 Subject: [PATCH 059/108] Credits test: follow a reviewed font to its SDF asset and fallback tables Prefabs reference the TMP SDF asset made from a font, not the .ttf, so matching the font file guid alone could never fail. The unreferenced-font check now follows the font guid and the guid of every Assets/Fonts file that references a guid already followed (the font's own SDF asset, any SDF asset listing it as a fallback); a file outside Assets/Fonts naming any of them is a use. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/CreditsTests.cs | 27 +++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/CreditsTests.cs b/tests/Aetheria.Shared.Tests/CreditsTests.cs index 8d4a4a6b9..6e9869844 100644 --- a/tests/Aetheria.Shared.Tests/CreditsTests.cs +++ b/tests/Aetheria.Shared.Tests/CreditsTests.cs @@ -207,16 +207,29 @@ namespace Aetheria.Shared.Tests var fonts = FontFiles(); Assert.Equal(Array.Empty<string>(), fonts.Where(font => !accounted.Contains(font)).ToArray()); Assert.Equal(Array.Empty<string>(), accounted.Where(font => !fonts.Contains(font)).ToArray()); - // A reviewed font stays out of the credits only while nothing outside Assets/Fonts uses it. - var guids = ReviewedFonts.Keys.ToDictionary(font => font, font => Regex.Match(Read(font + ".meta"), @"guid: (\w+)").Groups[1].Value); - Assert.All(guids.Values, guid => Assert.Equal(32, guid.Length)); - var users = Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*", SearchOption.AllDirectories) + // A reviewed font stays out of the credits only while nothing outside Assets/Fonts uses it. Prefabs and scenes + // reference the TMP SDF asset made from the font, not the .ttf, so the search follows the font guid, then the + // guid of every file under Assets/Fonts that references a guid already followed: the font's own SDF asset, and + // any other SDF asset carrying it in a fallback table. A use is a file outside Assets/Fonts naming any of them. + var files = Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*", SearchOption.AllDirectories) .Select(path => Path.GetRelativePath(root, path).Replace('\\', '/')) - .Where(path => !path.StartsWith("Assets/Fonts/") && new[] { ".prefab", ".unity", ".mat", ".asset", ".controller" }.Any(ext => path.EndsWith(ext))) + .Where(path => new[] { ".prefab", ".unity", ".mat", ".asset", ".controller" }.Any(ext => path.EndsWith(ext))) .Select(path => (path, text: Read(path))) .ToArray(); - foreach (var (font, guid) in guids) - Assert.Equal(Array.Empty<string>(), users.Where(user => user.text.Contains(guid)).Select(user => user.path).ToArray()); + var inFonts = files.Where(file => file.path.StartsWith("Assets/Fonts/")).ToArray(); + var outside = files.Where(file => !file.path.StartsWith("Assets/Fonts/")).ToArray(); + foreach (var font in ReviewedFonts.Keys) + { + var followed = new System.Collections.Generic.HashSet<string> { Regex.Match(Read(font + ".meta"), @"guid: (\w+)").Groups[1].Value }; + Assert.All(followed, guid => Assert.Equal(32, guid.Length)); + for (var grew = true; grew;) + { + grew = false; + foreach (var file in inFonts.Where(file => followed.Any(guid => file.text.Contains(guid))).ToArray()) + grew |= followed.Add(Regex.Match(Read(file.path + ".meta"), @"guid: (\w+)").Groups[1].Value); + } + Assert.Equal(Array.Empty<string>(), outside.Where(user => followed.Any(guid => user.text.Contains(guid))).Select(user => user.path).ToArray()); + } } [Fact] From 43be42fb529b7dabcc65e5f94221352dae77708b Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 16:16:25 +0000 Subject: [PATCH 060/108] Credits: credit the works whose notice is only a source header; test scans headers Commit 16cb82d09 said every third-party work whose own text states holder and licence was credited. That was false: header-only notices were missed. Now credited, holder and licence taken from each file's own text: Academy of Motion Picture Arts and Sciences (ACES.hlsl, 2015), Unity Technologies 2016 MIT (the built-in shader sources Particle Standard Unlit, StretchedSkybox, MaskedWorldSpaceUI, MaskedWorldSpaceAdditiveUI and the three AdditiveUI shaders), Supyrb 2017 (AdditiveUI shaders; the header states no licence for that portion), and Stefan Gustavson 2011 MIT (Celestial Body SimplexNoise2.cginc). The discovery test now also scans every Copyright line in .shader/.hlsl/.cginc/.cs/.compute under Assets; its holder must appear in a credit notice or in ReviewedHeaders with the reason. Microsoft Open Technologies (UniRx headers, no licence stated, points at a License.txt that is not in the repo) is the one reviewed entry. The Unity headers point at a license.txt that is likewise not in the repo. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Credits.cs | 38 +++++++++++++++ tests/Aetheria.Shared.Tests/CreditsTests.cs | 53 ++++++++++++++++++++- 2 files changed, 89 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/ServerShared/Credits.cs b/Assets/Scripts/ServerShared/Credits.cs index cfc3028fb..2746b6074 100644 --- a/Assets/Scripts/ServerShared/Credits.cs +++ b/Assets/Scripts/ServerShared/Credits.cs @@ -27,6 +27,11 @@ public static class Credits public const string AmbientCgFile = "Assets/Materials/PBR/SOURCES.md"; public const string KdTreeFile = "Assets/Scripts/ServerShared/NIH/KDTree/KDTree.cs"; public const string SimplexNoiseFile = "Assets/Plugins/GPU Noise/SimplexNoise2D.cginc"; + // Works whose notice is only a source-file header; each answers through the file whose header states it. + public const string UnityShaderFile = "Assets/Shaders/Particle Standard Unlit.shader"; + public const string AdditiveUiFile = "Assets/Shaders/AdditiveUI.shader"; + public const string AcesFile = "Assets/Shaders/CustomDoF/ACES.hlsl"; + public const string ClassicNoiseFile = "Assets/Plugins/Celestial Body/Scripts/Shaders/Includes/SimplexNoise2.cginc"; // The first line of the attribution file; the icon credits are the lines after it. public const string NounProjectHeading = "Noun Project"; // Where the player build loads the Noun Project credit lines from (Resources path, no extension). @@ -100,6 +105,39 @@ public static class Credits LicenceFile = SimplexNoiseFile }, new Credit + { + Name = "Celestial Body noise shaders", + Licence = "MIT", + Notice = "Copyright (C) 2011 Ashima Arts. Copyright (C) 2011 by Ashima Arts (Simplex noise). " + + "Copyright (C) 2011 by Stefan Gustavson (Classic noise).", + LicenceFile = ClassicNoiseFile + }, + new Credit + { + Name = "Unity built-in shaders", + Licence = "MIT", + Notice = "Copyright (c) 2016 Unity Technologies. Shader source adapted from Unity's built-in shaders " + + "(Particle Standard Unlit, StretchedSkybox, MaskedWorldSpaceUI, MaskedWorldSpaceAdditiveUI).", + LicenceFile = UnityShaderFile + }, + new Credit + { + Name = "AdditiveUI shaders", + Licence = "MIT for the Unity Technologies portion; the Supyrb portion states no licence", + Notice = "Copyright (c) 2017 Supyrb. All rights reserved. Author: Johannes Deml. " + + "Built on Unity's built-in UI shader, copyright (c) 2016 Unity Technologies, MIT.", + LicenceFile = AdditiveUiFile + }, + new Credit + { + Name = "ACES colour transforms", + Licence = "Academy Color Encoding System licence", + Notice = "Copyright 2015 Academy of Motion Picture Arts and Sciences (A.M.P.A.S.). " + + "Portions contributed by others as indicated. All rights reserved. " + + "Source: https://github.com/ampas/aces-dev", + LicenceFile = AcesFile + }, + new Credit { Name = "ambientCG PBR materials", Licence = "CC0 1.0 Universal", diff --git a/tests/Aetheria.Shared.Tests/CreditsTests.cs b/tests/Aetheria.Shared.Tests/CreditsTests.cs index 6e9869844..625820571 100644 --- a/tests/Aetheria.Shared.Tests/CreditsTests.cs +++ b/tests/Aetheria.Shared.Tests/CreditsTests.cs @@ -34,6 +34,12 @@ namespace Aetheria.Shared.Tests ["Assets/Plugins/Celestial Body/Textures/_Sources.txt"] = "URLs of the source textures only; states no licence", }; + // Copyright lines found in source headers whose holder no credit shows, each with the reason; keyed like HeaderKeys. + private static readonly System.Collections.Generic.Dictionary<string, string> ReviewedHeaders = new System.Collections.Generic.Dictionary<string, string> + { + ["microsoftopen"] = "UniRx files derived from Rx.NET: the header names Microsoft Open Technologies and points at a License.txt that is not in the repo, so no licence is stated; decision owed", + }; + // Bundled works with no licence-like file at all, found by reading Assets. Their licences are not stated in the // repo, so they are not credited; each path must still exist, so this list cannot go stale unnoticed. private static readonly string[] UnlicensedWorks = @@ -55,6 +61,10 @@ namespace Aetheria.Shared.Tests (Credits.KdTreeFile, new[] { "Vili Vol\u010dini / viliwonka" }), (Credits.SimplexNoiseFile, new[] { "Ashima Arts", "Ian McEwan", "Keijiro Takahashi" }), (Credits.AmbientCgFile, new[] { "ambientCG" }), + (Credits.UnityShaderFile, new[] { "Unity Technologies" }), + (Credits.AdditiveUiFile, new[] { "Unity Technologies", "Supyrb", "Johannes Deml" }), + (Credits.AcesFile, new[] { "Academy of Motion Picture Arts and Sciences", "A.M.P.A.S." }), + (Credits.ClassicNoiseFile, new[] { "Ashima Arts", "Stefan Gustavson" }), }; // Fonts that state holder and licence in their own name tables: the credit's LicenceFile is the first font, and @@ -130,6 +140,45 @@ namespace Aetheria.Shared.Tests private static string[] Unaccounted(string[] found, System.Collections.Generic.IEnumerable<string> credited) => found.Where(path => !credited.Contains(path) && !ReviewedNotCredited.ContainsKey(path)).ToArray(); + // The holder keys of every "Copyright ..." line in the source files under Assets: the year (when there is one) and + // the first two words of the holder, letters and digits only, lower case. Credits.cs is the credit text itself. + private static readonly Regex HeaderCopyright = new Regex(@"Copyright\s*(?:\([cC]\))?\s*(?:by\s+)?[<\[]?((?:\d{4}|[A-Z])[^\r\n]*)", RegexOptions.CultureInvariant); + + private static string Key(string text) => new string(text.Where(char.IsLetterOrDigit).ToArray()).ToLowerInvariant(); + + private static System.Collections.Generic.Dictionary<string, string> HeaderKeys() + { + var root = Root(); + var keys = new System.Collections.Generic.Dictionary<string, string>(); + foreach (var path in Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*", SearchOption.AllDirectories) + .Select(path => Path.GetRelativePath(root, path).Replace('\\', '/')) + .Where(path => new[] { ".shader", ".hlsl", ".cginc", ".cs", ".compute" }.Any(ext => path.EndsWith(ext)) && path != "Assets/Scripts/ServerShared/Credits.cs")) + foreach (var line in Read(path).Split('\n')) + foreach (Match match in HeaderCopyright.Matches(line)) + { + var words = Regex.Replace(Regex.Replace(match.Groups[1].Value, @"\.\s.*", ""), @"[<>,]", " ").Split(' ', StringSplitOptions.RemoveEmptyEntries) + .Where(word => word != "by").ToArray(); + var year = words.Length > 0 && Regex.IsMatch(words[0], @"^\d{4}") ? 1 : 0; + if (year == 0 && !Regex.IsMatch(line, @"\([cC]\)")) continue; + keys.TryAdd(Key(string.Concat(words.Take(year + 2))), path); + } + return keys; + } + + // A copyright line in a source header is a notice the licence requires shown, so its holder is in a credit or in + // ReviewedHeaders with the reason; a removed credit, or a newly pasted header, fails here. + [Fact] + public void EveryCopyrightHolderInASourceHeaderIsCreditedOrReviewed() + { + var keys = HeaderKeys(); + Assert.Contains("2015academyof", keys.Keys); + Assert.Contains("2016unitytechnologies", keys.Keys); + Assert.Contains("2017supyrb", keys.Keys); + var shown = Key(string.Join(" ", Load().Select(credit => Normal(credit.Notice)))); + Assert.Equal(Array.Empty<string>(), keys.Where(k => !shown.Contains(k.Key) && !ReviewedHeaders.ContainsKey(k.Key)).Select(k => $"{k.Key} in {k.Value}").ToArray()); + Assert.Equal(Array.Empty<string>(), ReviewedHeaders.Keys.Where(k => !keys.ContainsKey(k)).ToArray()); + } + [Fact] public void EveryLicenceLikeFileUnderAssetsIsCreditedOrReviewed() { @@ -167,7 +216,7 @@ namespace Aetheria.Shared.Tests { var match = CopyrightLine.Match(line); if (!match.Success) continue; - var body = Regex.Replace(match.Groups[1].Value.Replace("[", "").Replace("]", "").Trim(), @"(\s*All rights reserved)?\.?$", "", RegexOptions.IgnoreCase); + var body = Regex.Replace(match.Groups[1].Value.Replace("[", "").Replace("]", "").Trim(), @"(\.\s.*|\s*All rights reserved)?\.?$", "", RegexOptions.IgnoreCase); Assert.True(notice.Contains(Normal(body)), $"the credit for {file} omits its copyright line '{body}'"); } } @@ -176,7 +225,7 @@ namespace Aetheria.Shared.Tests private static readonly Regex CopyrightLine = new Regex(@"copyright\s*(?:\(c\)|\u00a9)?\s*(\[?\d.*)$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); // Dash variants and case folded, so the file's en dash and the screen's hyphen compare equal. - private static string Normal(string text) => text.Replace('\u2013', '-').Replace('\u2014', '-').Replace("\r", "").ToLowerInvariant(); + private static string Normal(string text) => text.Replace('\u2013', '-').Replace('\u2014', '-').Replace("\r", "").Replace(" by ", " ").ToLowerInvariant(); // The credit text is typed; the font files are the authority on who holds them. A wrong holder, or a font in the // family that does not carry it, fails here. From 63403c8441afe5724208a7fc6b8d4b131a589b43 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 16:20:52 +0000 Subject: [PATCH 061/108] Credits: ship the Ubuntu Font Licence 1.0 and SIL OFL 1.1 texts beside the fonts UFL-1.0.txt is the upstream Ubuntu Font Licence 1.0 text (google/fonts ufl/ubuntu/UFL.txt). Montserrat-OFL-1.1.txt is the OFL 1.1 body, byte-for-byte the text already shipped with Liberation Sans, headed by the copyright the Montserrat font embeds (Copyright(c) 2014 by Julieta Ulanovsky) rather than the project's later authors line. The Ubuntu and Montserrat credits now name these files as their LicenceFile; the test checks each carries its licence, sits beside its fonts, and (OFL) the embedded holder. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Fonts/Ubuntu/Montserrat-OFL-1.1.txt | 93 ++++++++++++++++++ .../Fonts/Ubuntu/Montserrat-OFL-1.1.txt.meta | 7 ++ Assets/Fonts/Ubuntu/UFL-1.0.txt | 96 +++++++++++++++++++ Assets/Fonts/Ubuntu/UFL-1.0.txt.meta | 7 ++ Assets/Scripts/ServerShared/Credits.cs | 10 +- tests/Aetheria.Shared.Tests/CreditsTests.cs | 23 +++-- 6 files changed, 221 insertions(+), 15 deletions(-) create mode 100644 Assets/Fonts/Ubuntu/Montserrat-OFL-1.1.txt create mode 100644 Assets/Fonts/Ubuntu/Montserrat-OFL-1.1.txt.meta create mode 100644 Assets/Fonts/Ubuntu/UFL-1.0.txt create mode 100644 Assets/Fonts/Ubuntu/UFL-1.0.txt.meta diff --git a/Assets/Fonts/Ubuntu/Montserrat-OFL-1.1.txt b/Assets/Fonts/Ubuntu/Montserrat-OFL-1.1.txt new file mode 100644 index 000000000..d2fcdf3eb --- /dev/null +++ b/Assets/Fonts/Ubuntu/Montserrat-OFL-1.1.txt @@ -0,0 +1,93 @@ +Copyright(c) 2014 by Julieta Ulanovsky + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. \ No newline at end of file diff --git a/Assets/Fonts/Ubuntu/Montserrat-OFL-1.1.txt.meta b/Assets/Fonts/Ubuntu/Montserrat-OFL-1.1.txt.meta new file mode 100644 index 000000000..c2ea6a451 --- /dev/null +++ b/Assets/Fonts/Ubuntu/Montserrat-OFL-1.1.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dc84a6b2454445f9be69af26e86eb90c +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fonts/Ubuntu/UFL-1.0.txt b/Assets/Fonts/Ubuntu/UFL-1.0.txt new file mode 100644 index 000000000..ae78a8f94 --- /dev/null +++ b/Assets/Fonts/Ubuntu/UFL-1.0.txt @@ -0,0 +1,96 @@ +------------------------------- +UBUNTU FONT LICENCE Version 1.0 +------------------------------- + +PREAMBLE +This licence allows the licensed fonts to be used, studied, modified and +redistributed freely. The fonts, including any derivative works, can be +bundled, embedded, and redistributed provided the terms of this licence +are met. The fonts and derivatives, however, cannot be released under +any other licence. The requirement for fonts to remain under this +licence does not require any document created using the fonts or their +derivatives to be published under this licence, as long as the primary +purpose of the document is not to be a vehicle for the distribution of +the fonts. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this licence and clearly marked as such. This may +include source files, build scripts and documentation. + +"Original Version" refers to the collection of Font Software components +as received under this licence. + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to +a new environment. + +"Copyright Holder(s)" refers to all individuals and companies who have a +copyright ownership of the Font Software. + +"Substantially Changed" refers to Modified Versions which can be easily +identified as dissimilar to the Font Software by users of the Font +Software comparing the Original Version with the Modified Version. + +To "Propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification and with or without charging +a redistribution fee), making available to the public, and in some +countries other activities as well. + +PERMISSION & CONDITIONS +This licence does not grant any rights under trademark law and all such +rights are reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of the Font Software, to propagate the Font Software, subject to +the below conditions: + +1) Each copy of the Font Software must contain the above copyright +notice and this licence. These can be included either as stand-alone +text files, human-readable headers or in the appropriate machine- +readable metadata fields within text or binary files as long as those +fields can be easily viewed by the user. + +2) The font name complies with the following: +(a) The Original Version must retain its name, unmodified. +(b) Modified Versions which are Substantially Changed must be renamed to +avoid use of the name of the Original Version or similar names entirely. +(c) Modified Versions which are not Substantially Changed must be +renamed to both (i) retain the name of the Original Version and (ii) add +additional naming elements to distinguish the Modified Version from the +Original Version. The name of such Modified Versions must be the name of +the Original Version, with "derivative X" where X represents the name of +the new work, appended to that name. + +3) The name(s) of the Copyright Holder(s) and any contributor to the +Font Software shall not be used to promote, endorse or advertise any +Modified Version, except (i) as required by this licence, (ii) to +acknowledge the contribution(s) of the Copyright Holder(s) or (iii) with +their explicit written permission. + +4) The Font Software, modified or unmodified, in part or in whole, must +be distributed entirely under this licence, and must not be distributed +under any other licence. The requirement for fonts to remain under this +licence does not affect any document created using the Font Software, +except any version of the Font Software extracted from a document +created using the Font Software may only be distributed under this +licence. + +TERMINATION +This licence becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER +DEALINGS IN THE FONT SOFTWARE. diff --git a/Assets/Fonts/Ubuntu/UFL-1.0.txt.meta b/Assets/Fonts/Ubuntu/UFL-1.0.txt.meta new file mode 100644 index 000000000..33790c1ab --- /dev/null +++ b/Assets/Fonts/Ubuntu/UFL-1.0.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 331370618a0a473fb6a6837985b38a35 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/ServerShared/Credits.cs b/Assets/Scripts/ServerShared/Credits.cs index 2746b6074..45054187b 100644 --- a/Assets/Scripts/ServerShared/Credits.cs +++ b/Assets/Scripts/ServerShared/Credits.cs @@ -20,9 +20,9 @@ public static class Credits public const string PlaydeadFile = "Assets/Plugins/Playdead/LICENSE.txt"; public const string NounProjectFile = "Assets/Resources/Sprites/Attribution.txt"; public const string LiberationFile = "Assets/TextMesh Pro/Fonts/LiberationSans - OFL.txt"; - // Fonts state their holder and licence in their own name tables; these are the font files the credit answers for. - public const string UbuntuFontFile = "Assets/Fonts/Ubuntu/Ubuntu-R.ttf"; - public const string MontserratFontFile = "Assets/Fonts/Ubuntu/Montserrat-Thin.ttf"; + // Fonts state their holder and licence in their own name tables; the licence texts shipped beside them are these. + public const string UbuntuLicenceFile = "Assets/Fonts/Ubuntu/UFL-1.0.txt"; + public const string MontserratLicenceFile = "Assets/Fonts/Ubuntu/Montserrat-OFL-1.1.txt"; public const string UniRxFile = "Assets/Plugins/UniRx/ReadMe.txt"; public const string AmbientCgFile = "Assets/Materials/PBR/SOURCES.md"; public const string KdTreeFile = "Assets/Scripts/ServerShared/NIH/KDTree/KDTree.cs"; @@ -72,14 +72,14 @@ public static class Credits Name = "Ubuntu and Ubuntu Mono fonts", Licence = "Ubuntu Font Licence 1.0", Notice = "Copyright 2011 Canonical Ltd.", - LicenceFile = UbuntuFontFile + LicenceFile = UbuntuLicenceFile }, new Credit { Name = "Montserrat", Licence = "SIL Open Font License 1.1", Notice = "Copyright(c) 2014 by Julieta Ulanovsky", - LicenceFile = MontserratFontFile + LicenceFile = MontserratLicenceFile }, new Credit { diff --git a/tests/Aetheria.Shared.Tests/CreditsTests.cs b/tests/Aetheria.Shared.Tests/CreditsTests.cs index 625820571..68f9d68da 100644 --- a/tests/Aetheria.Shared.Tests/CreditsTests.cs +++ b/tests/Aetheria.Shared.Tests/CreditsTests.cs @@ -23,7 +23,7 @@ namespace Aetheria.Shared.Tests // A file under Assets that looks like a licence, attribution, notice, readme or sources list. Each one is either // credited (the credit names it as its LicenceFile) or reviewed below with the reason it is not. private static readonly Regex LicenceLike = new Regex( - @"^(LICEN[CS]E|COPYING|NOTICE|README|SOURCES|_SOURCES|Attribution)|OFL", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); + @"^(LICEN[CS]E|COPYING|NOTICE|README|SOURCES|_SOURCES|Attribution|UFL)|OFL", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); // Discovered files whose own text names no holder and no licence, so there is nothing true to credit. A new // licence-like file is not here until someone has read it and written the reason. @@ -67,14 +67,14 @@ namespace Aetheria.Shared.Tests (Credits.ClassicNoiseFile, new[] { "Ashima Arts", "Stefan Gustavson" }), }; - // Fonts that state holder and licence in their own name tables: the credit's LicenceFile is the first font, and - // every font listed must embed the stated string (read from the file, not from the credit) and be shown by the + // Fonts that state holder and licence in their own name tables: the credit's LicenceFile is the licence text shipped + // beside them (which must carry the licence and the stated holder), and every font listed must embed the stated string (read from the file, not from the credit) and be shown by the // credit. The ids are TrueType name ids: 0 is the copyright notice. private static readonly (string credit, string[] fonts, string embedded)[] FontCredits = { - (Credits.UbuntuFontFile, new[] { "Assets/Fonts/Ubuntu/Ubuntu-R.ttf", "Assets/Fonts/Ubuntu/Ubuntu-L.ttf", "Assets/Fonts/Ubuntu/Ubuntu-B.ttf", "Assets/Fonts/Ubuntu/UbuntuMono-R.ttf" }, + (Credits.UbuntuLicenceFile, new[] { "Assets/Fonts/Ubuntu/Ubuntu-R.ttf", "Assets/Fonts/Ubuntu/Ubuntu-L.ttf", "Assets/Fonts/Ubuntu/Ubuntu-B.ttf", "Assets/Fonts/Ubuntu/UbuntuMono-R.ttf" }, "Copyright 2011 Canonical Ltd."), - (Credits.MontserratFontFile, new[] { "Assets/Fonts/Ubuntu/Montserrat-Thin.ttf" }, "Copyright(c) 2014 by Julieta Ulanovsky"), + (Credits.MontserratLicenceFile, new[] { "Assets/Fonts/Ubuntu/Montserrat-Thin.ttf" }, "Copyright(c) 2014 by Julieta Ulanovsky"), }; // Fonts credited through a licence file in the repo (see Holders), not through their own text. @@ -236,16 +236,19 @@ namespace Aetheria.Shared.Tests foreach (var (creditFile, fonts, embedded) in FontCredits) { var notice = credits.Single(credit => credit.LicenceFile == creditFile).Notice; - Assert.Equal(creditFile, fonts[0]); + var licenceText = Read(creditFile); + Assert.Contains(creditFile.Contains("UFL") ? "UBUNTU FONT LICENCE Version 1.0" : "SIL OPEN FONT LICENSE Version 1.1", licenceText); + Assert.True(Path.GetDirectoryName(creditFile) == Path.GetDirectoryName(fonts[0]).Replace('\\', '/'), "licence text sits beside its fonts"); + if (creditFile.Contains("OFL")) Assert.Contains(embedded, licenceText); Assert.Contains(embedded, notice); foreach (var font in fonts) Assert.True(NameRecords(font, 0).Count > 0 && NameRecords(font, 0).All(record => record.StartsWith(embedded)), $"{font} does not embed '{embedded}' as its copyright"); } - Assert.Contains("Ubuntu Font Licence 1.0", NameRecords(Credits.UbuntuFontFile, 0)[0]); - Assert.Contains("Ubuntu Font Licence 1.0", credits.Single(credit => credit.LicenceFile == Credits.UbuntuFontFile).Licence); - Assert.Contains("SIL Open Font License, Version 1.1", NameRecords(Credits.MontserratFontFile, 13)[0]); - Assert.Contains("SIL Open Font License 1.1", credits.Single(credit => credit.LicenceFile == Credits.MontserratFontFile).Licence); + Assert.Contains("Ubuntu Font Licence 1.0", NameRecords(FontCredits[0].fonts[0], 0)[0]); + Assert.Contains("Ubuntu Font Licence 1.0", credits.Single(credit => credit.LicenceFile == Credits.UbuntuLicenceFile).Licence); + Assert.Contains("SIL Open Font License, Version 1.1", NameRecords(FontCredits[1].fonts[0], 13)[0]); + Assert.Contains("SIL Open Font License 1.1", credits.Single(credit => credit.LicenceFile == Credits.MontserratLicenceFile).Licence); } [Fact] From 2071cea6e727a4e6ae1bb467f11b4772508ad662 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 16:32:03 +0000 Subject: [PATCH 062/108] Credits test: header scan catches (c) and copyright-sign notices, lowercase copyright, 'Copyright:', every holder on a line, whole holder compared Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/CreditsTests.cs | 43 ++++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/CreditsTests.cs b/tests/Aetheria.Shared.Tests/CreditsTests.cs index 68f9d68da..acce8d59e 100644 --- a/tests/Aetheria.Shared.Tests/CreditsTests.cs +++ b/tests/Aetheria.Shared.Tests/CreditsTests.cs @@ -37,7 +37,7 @@ namespace Aetheria.Shared.Tests // Copyright lines found in source headers whose holder no credit shows, each with the reason; keyed like HeaderKeys. private static readonly System.Collections.Generic.Dictionary<string, string> ReviewedHeaders = new System.Collections.Generic.Dictionary<string, string> { - ["microsoftopen"] = "UniRx files derived from Rx.NET: the header names Microsoft Open Technologies and points at a License.txt that is not in the repo, so no licence is stated; decision owed", + ["microsoftopentechnologiesinc"] = "UniRx files derived from Rx.NET: the header names Microsoft Open Technologies and points at a License.txt that is not in the repo, so no licence is stated; decision owed", }; // Bundled works with no licence-like file at all, found by reading Assets. Their licences are not stated in the @@ -140,12 +140,30 @@ namespace Aetheria.Shared.Tests private static string[] Unaccounted(string[] found, System.Collections.Generic.IEnumerable<string> credited) => found.Where(path => !credited.Contains(path) && !ReviewedNotCredited.ContainsKey(path)).ToArray(); - // The holder keys of every "Copyright ..." line in the source files under Assets: the year (when there is one) and - // the first two words of the holder, letters and digits only, lower case. Credits.cs is the credit text itself. - private static readonly Regex HeaderCopyright = new Regex(@"Copyright\s*(?:\([cC]\))?\s*(?:by\s+)?[<\[]?((?:\d{4}|[A-Z])[^\r\n]*)", RegexOptions.CultureInvariant); + // Every copyright marker in a source header: "Copyright", "copyright", "(c)" (not the tail of an identifier), the copyright sign, "Copyright (c)", with an optional + // colon and "by". A line is scanned marker by marker: a holder runs to the next marker or the end of the line, so a + // second holder on the same line is a holder of its own. Credits.cs is the credit text itself, so it is not scanned. + private const string Marker = @"(?:copyright(?:\s*(?:\(c\)|\u00a9))?|(?<!\w)\(c\)|\u00a9)"; + private static readonly Regex HeaderCopyright = new Regex( + Marker + @"(?<explicit>\s*:)?\s*(?:by\s+)?[<\[]?(?<holder>.+?)(?=" + Marker + @"|$)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); private static string Key(string text) => new string(text.Where(char.IsLetterOrDigit).ToArray()).ToLowerInvariant(); + // The holders a line of source states: the text after each marker, cut at the end of its sentence, as keys. A holder + // is a year or a capitalised name; "copyright notice" in licence prose names nobody. Without a year the marker must + // be "(c)", the copyright sign or a colon, so "Copyright Notice" prose is not a holder either. + private static System.Collections.Generic.IEnumerable<string> LineHolders(string line) + { + foreach (Match match in HeaderCopyright.Matches(line)) + { + var holder = Regex.Replace(match.Groups["holder"].Value.Trim(), @"(\.(\s.*)?|\s*All rights reserved.*)$", "", RegexOptions.IgnoreCase).Trim(' ', '\t', ',', ';', '>', ']'); + var marked = Regex.IsMatch(match.Value.Substring(0, match.Groups["holder"].Index - match.Index), @"\(c\)|\u00a9|:", RegexOptions.IgnoreCase); + var year = Regex.IsMatch(holder, @"^\d{4}"); + if (holder.Length == 0 || !(year || (marked && char.IsUpper(holder[0])))) continue; + yield return Key(Normal(holder)); + } + } + private static System.Collections.Generic.Dictionary<string, string> HeaderKeys() { var root = Root(); @@ -154,14 +172,8 @@ namespace Aetheria.Shared.Tests .Select(path => Path.GetRelativePath(root, path).Replace('\\', '/')) .Where(path => new[] { ".shader", ".hlsl", ".cginc", ".cs", ".compute" }.Any(ext => path.EndsWith(ext)) && path != "Assets/Scripts/ServerShared/Credits.cs")) foreach (var line in Read(path).Split('\n')) - foreach (Match match in HeaderCopyright.Matches(line)) - { - var words = Regex.Replace(Regex.Replace(match.Groups[1].Value, @"\.\s.*", ""), @"[<>,]", " ").Split(' ', StringSplitOptions.RemoveEmptyEntries) - .Where(word => word != "by").ToArray(); - var year = words.Length > 0 && Regex.IsMatch(words[0], @"^\d{4}") ? 1 : 0; - if (year == 0 && !Regex.IsMatch(line, @"\([cC]\)")) continue; - keys.TryAdd(Key(string.Concat(words.Take(year + 2))), path); - } + foreach (var key in LineHolders(line)) + keys.TryAdd(key, path); return keys; } @@ -171,11 +183,12 @@ namespace Aetheria.Shared.Tests public void EveryCopyrightHolderInASourceHeaderIsCreditedOrReviewed() { var keys = HeaderKeys(); - Assert.Contains("2015academyof", keys.Keys); + Assert.Contains(Key("2015 Academy of Motion Picture Arts and Sciences (A.M.P.A.S"), keys.Keys); Assert.Contains("2016unitytechnologies", keys.Keys); Assert.Contains("2017supyrb", keys.Keys); - var shown = Key(string.Join(" ", Load().Select(credit => Normal(credit.Notice)))); - Assert.Equal(Array.Empty<string>(), keys.Where(k => !shown.Contains(k.Key) && !ReviewedHeaders.ContainsKey(k.Key)).Select(k => $"{k.Key} in {k.Value}").ToArray()); + // The whole holder is compared, not a prefix of it, against each credit's notice on its own. + var shown = Load().Select(credit => Key(Normal(credit.Notice))).ToArray(); + Assert.Equal(Array.Empty<string>(), keys.Where(k => !shown.Any(notice => notice.Contains(k.Key)) && !ReviewedHeaders.ContainsKey(k.Key)).Select(k => $"{k.Key} in {k.Value}").ToArray()); Assert.Equal(Array.Empty<string>(), ReviewedHeaders.Keys.Where(k => !keys.ContainsKey(k)).ToArray()); } From 50ab1cd7f48e698ee60abc58c67cbe271c693b7a Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 16:33:18 +0000 Subject: [PATCH 063/108] Credits: credit uiextensions' BezierPath (Tulleken); review the credit-only lines in StableFluids, Triplanar and uiextensions Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Credits.cs | 9 +++++++ tests/Aetheria.Shared.Tests/CreditsTests.cs | 26 +++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/Assets/Scripts/ServerShared/Credits.cs b/Assets/Scripts/ServerShared/Credits.cs index 45054187b..9b7ac4226 100644 --- a/Assets/Scripts/ServerShared/Credits.cs +++ b/Assets/Scripts/ServerShared/Credits.cs @@ -31,6 +31,7 @@ public static class Credits public const string UnityShaderFile = "Assets/Shaders/Particle Standard Unlit.shader"; public const string AdditiveUiFile = "Assets/Shaders/AdditiveUI.shader"; public const string AcesFile = "Assets/Shaders/CustomDoF/ACES.hlsl"; + public const string BezierPathFile = "Assets/Plugins/com.unity.uiextensions/Runtime/Scripts/Utilities/BezierPath.cs"; public const string ClassicNoiseFile = "Assets/Plugins/Celestial Body/Scripts/Shaders/Includes/SimplexNoise2.cginc"; // The first line of the attribution file; the icon credits are the lines after it. public const string NounProjectHeading = "Noun Project"; @@ -138,6 +139,14 @@ public static class Credits LicenceFile = AcesFile }, new Credit + { + Name = "Bezier path (UI Extensions)", + Licence = "No named licence; permissive grant in the file header", + Notice = "Author: Herman Tulleken, dev.mag.org.za (http://devmag.org.za/2011/04/05/bzier-curves-a-tutorial/). " + + "Use this code as you wish, at your own risk.", + LicenceFile = BezierPathFile + }, + new Credit { Name = "ambientCG PBR materials", Licence = "CC0 1.0 Universal", diff --git a/tests/Aetheria.Shared.Tests/CreditsTests.cs b/tests/Aetheria.Shared.Tests/CreditsTests.cs index acce8d59e..2ef34f354 100644 --- a/tests/Aetheria.Shared.Tests/CreditsTests.cs +++ b/tests/Aetheria.Shared.Tests/CreditsTests.cs @@ -40,6 +40,31 @@ namespace Aetheria.Shared.Tests ["microsoftopentechnologiesinc"] = "UniRx files derived from Rx.NET: the header names Microsoft Open Technologies and points at a License.txt that is not in the repo, so no licence is stated; decision owed", }; + // Source headers that credit someone ("Credit X", "Based on ...", a source URL) without stating a copyright holder or + // a licence, so there is no true notice to show. Each is the exact line the file carries and the reason it is not a + // credit; the test reads the file, so a line that moves or goes cannot leave a stale entry. + private static readonly (string file, string line, string reason)[] ReviewedAttributionLines = + { + ("Assets/Shaders/StableFluids/Fluid.cs", "// https://github.com/keijiro/StableFluids", "names Keijiro's StableFluids as the source; states no holder and no licence"), + ("Assets/Shaders/StableFluids/Fluid.shader", "// https://github.com/keijiro/StableFluids", "names Keijiro's StableFluids as the source; states no holder and no licence"), + ("Assets/Shaders/StableFluids/Fluid.compute", "// Based on https://github.com/keijiro/StableFluids", "names Keijiro's StableFluids as the source; states no holder and no licence"), + ("Assets/Plugins/Celestial Body/Scripts/Shaders/Includes/Triplanar.cginc", "// Based on: medium.com/@bgolus/normal-mapping-for-a-triplanar-shader-10bf39dca05a", "cites bgolus's article for the technique; states no holder and no licence"), + ("Assets/Plugins/com.unity.uiextensions/Runtime/Scripts/Primitives/UILineTextureRenderer.cs", "/// Credit jonbro5556", "names a contributor; states no copyright and no licence"), + ("Assets/Plugins/com.unity.uiextensions/Runtime/Scripts/Primitives/UILineRenderer.cs", "/// Credit jack.sydorenko, firagon", "names contributors; states no copyright and no licence"), + ("Assets/Plugins/com.unity.uiextensions/Runtime/Scripts/Primitives/UILineRendererList.cs", "/// Credit jack.sydorenko, firagon", "names contributors; states no copyright and no licence"), + ("Assets/Plugins/com.unity.uiextensions/Runtime/Scripts/Utilities/CableCurve.cs", "/// Credit Farfarer", "names a contributor; states no copyright and no licence"), + ("Assets/Plugins/com.unity.uiextensions/Editor/BezierLineRendererEditor.cs", "///Credit Jason Horsburgh", "names a contributor; states no copyright and no licence"), + }; + + [Fact] + public void ReviewedAttributionLinesAreStillInTheirFiles() + { + Assert.Equal(Array.Empty<string>(), ReviewedAttributionLines + .Where(entry => !File.Exists(Path.Combine(Root(), entry.file)) || !Read(entry.file).Replace("\r", "").Split('\n').Any(line => line.Trim('\uFEFF', ' ', '\t') == entry.line)) + .Select(entry => $"{entry.line} in {entry.file}").ToArray()); + Assert.All(ReviewedAttributionLines, entry => Assert.False(string.IsNullOrWhiteSpace(entry.reason))); + } + // Bundled works with no licence-like file at all, found by reading Assets. Their licences are not stated in the // repo, so they are not credited; each path must still exist, so this list cannot go stale unnoticed. private static readonly string[] UnlicensedWorks = @@ -65,6 +90,7 @@ namespace Aetheria.Shared.Tests (Credits.AdditiveUiFile, new[] { "Unity Technologies", "Supyrb", "Johannes Deml" }), (Credits.AcesFile, new[] { "Academy of Motion Picture Arts and Sciences", "A.M.P.A.S." }), (Credits.ClassicNoiseFile, new[] { "Ashima Arts", "Stefan Gustavson" }), + (Credits.BezierPathFile, new[] { "Herman Tulleken", "Use this code as you wish" }), }; // Fonts that state holder and licence in their own name tables: the credit's LicenceFile is the licence text shipped From 61cea7d8c7a5fe2e8a209bca0a17c33ea355c806 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 16:52:06 +0000 Subject: [PATCH 064/108] Credits test: header holders must equal a credited holder; scan Copyright followed by a bare name Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/CreditsTests.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/CreditsTests.cs b/tests/Aetheria.Shared.Tests/CreditsTests.cs index 2ef34f354..9479e31e3 100644 --- a/tests/Aetheria.Shared.Tests/CreditsTests.cs +++ b/tests/Aetheria.Shared.Tests/CreditsTests.cs @@ -175,6 +175,11 @@ namespace Aetheria.Shared.Tests private static string Key(string text) => new string(text.Where(char.IsLetterOrDigit).ToArray()).ToLowerInvariant(); + // Words that follow "copyright" in licence and header prose and name no holder ("copyright notice", "COPYRIGHT HOLDERS BE + // LIABLE", "copyright laws"); a capitalised word after a bare "Copyright" is a holder unless it is one of these. + private static readonly string[] ProseAfterCopyright = + { "Notice", "Notices", "Holder", "Holders", "Owner", "Owners", "Law", "Laws", "Act", "Protection", "Statement", "Header", "Information", "Status", "Line", "Lines", "Text", "Licence", "License", "Material", "Works", "Work", "File", "Files" }; + // The holders a line of source states: the text after each marker, cut at the end of its sentence, as keys. A holder // is a year or a capitalised name; "copyright notice" in licence prose names nobody. Without a year the marker must // be "(c)", the copyright sign or a colon, so "Copyright Notice" prose is not a holder either. @@ -185,7 +190,9 @@ namespace Aetheria.Shared.Tests var holder = Regex.Replace(match.Groups["holder"].Value.Trim(), @"(\.(\s.*)?|\s*All rights reserved.*)$", "", RegexOptions.IgnoreCase).Trim(' ', '\t', ',', ';', '>', ']'); var marked = Regex.IsMatch(match.Value.Substring(0, match.Groups["holder"].Index - match.Index), @"\(c\)|\u00a9|:", RegexOptions.IgnoreCase); var year = Regex.IsMatch(holder, @"^\d{4}"); - if (holder.Length == 0 || !(year || (marked && char.IsUpper(holder[0])))) continue; + // "Copyright Epic Games, Inc." names a holder with no year or sign; licence prose after the word does not. + var named = holder.Length > 0 && char.IsUpper(holder[0]) && !ProseAfterCopyright.Contains(Regex.Match(holder, @"^\w+").Value, StringComparer.OrdinalIgnoreCase); + if (holder.Length == 0 || !(year || (named && (marked || Regex.IsMatch(match.Value, "^copyright", RegexOptions.IgnoreCase))))) continue; yield return Key(Normal(holder)); } } @@ -212,9 +219,10 @@ namespace Aetheria.Shared.Tests Assert.Contains(Key("2015 Academy of Motion Picture Arts and Sciences (A.M.P.A.S"), keys.Keys); Assert.Contains("2016unitytechnologies", keys.Keys); Assert.Contains("2017supyrb", keys.Keys); - // The whole holder is compared, not a prefix of it, against each credit's notice on its own. - var shown = Load().Select(credit => Key(Normal(credit.Notice))).ToArray(); - Assert.Equal(Array.Empty<string>(), keys.Where(k => !shown.Any(notice => notice.Contains(k.Key)) && !ReviewedHeaders.ContainsKey(k.Key)).Select(k => $"{k.Key} in {k.Value}").ToArray()); + // The whole holder must equal a holder some credit's notice states, read by the same extractor: a bare year, a short + // name, or a prefix of a credited name is a different key and fails. + var shown = Load().SelectMany(credit => credit.Notice.Split('\n')).SelectMany(LineHolders).ToHashSet(); + Assert.Equal(Array.Empty<string>(), keys.Where(k => !shown.Contains(k.Key) && !ReviewedHeaders.ContainsKey(k.Key)).Select(k => $"{k.Key} in {k.Value}").ToArray()); Assert.Equal(Array.Empty<string>(), ReviewedHeaders.Keys.Where(k => !keys.ContainsKey(k)).ToArray()); } From 2b3278ba3d9dd954deed41a36c52cda4bf668f93 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@noreply.eureka.gamecult.org> Date: Thu, 12 Nov 2026 22:42:48 +0000 Subject: [PATCH 065/108] Mining cut 4: rocks take blasts and shots through the one fire path (#18) --- Assets/Scripts/ServerShared/FireControl.cs | 304 +++++++++--- .../ServerShared/Targeting/BeltTargets.cs | 3 +- Assets/Scripts/ServerShared/Zone.cs | 27 +- .../Aetheria.Shared.Tests/MiningCut3Tests.cs | 20 +- .../Aetheria.Shared.Tests/MiningCut4aTests.cs | 279 +++++++++++ .../Aetheria.Shared.Tests/MiningCut4bTests.cs | 458 ++++++++++++++++++ 6 files changed, 999 insertions(+), 92 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/MiningCut4aTests.cs create mode 100644 tests/Aetheria.Shared.Tests/MiningCut4bTests.cs diff --git a/Assets/Scripts/ServerShared/FireControl.cs b/Assets/Scripts/ServerShared/FireControl.cs index 1581e3457..6cd860ab3 100644 --- a/Assets/Scripts/ServerShared/FireControl.cs +++ b/Assets/Scripts/ServerShared/FireControl.cs @@ -84,10 +84,10 @@ public static class FireControl // Whether the shooter's next round from this weapon is refused: the weapons ask before they spend anything, so // a refused round costs no ammo, energy, sound, heat, wear or visibility (operator ruling 2026-09-30). The // answer is Solve's own -- there is no second copy of the arming test. - public static bool Refuses(Weapon weapon, Entity shooter) => Refuses(weapon, shooter, shooter.Target.Value.Entity); + public static bool Refuses(Weapon weapon, Entity shooter) => Refuses(weapon, shooter, shooter.Target.Value); // The same answer against a target the shooter's pilot has commanded but not yet applied. - public static bool Refuses(Weapon weapon, Entity shooter, Entity target) => + public static bool Refuses(Weapon weapon, Entity shooter, TargetRef target) => !IsMineLayer(weapon) && Solve(weapon, weapon.Item, shooter, target).Outcome == FireOutcome.Refused; // A mine layer lays a body, not a round: it is never refused, never arc-gated, and Fire routes it to Lay. @@ -139,27 +139,18 @@ public static class FireControl // The one owner of a gun's solution against its subject (the designated target; ruling controls-solution-subject). // Bears: the gun can engage the subject, so the player fires on it without the aim. Free: the aim is inside the // arc, so the gun can fire along it. Direction: where a round from this gun travels and where its barrel points -- - // the subject's intercept when it bears, else the arc-clamped aim. A chunk subject bears through its pose and - // flies the aim, as an untargeted round (Subject is null for it). Derived on every read and never stored: turrets + // the subject's intercept when it bears (a rock's too), else the arc-clamped aim. Subject is null for a rock. Derived on every read and never stored: turrets // traverse instantly in the simulation. Traverse is the weapon's Tracking (ruling mount-arc-gun-traverse), priced in // TrackingRate; this holds no slew state, and a rig's slew is presentation. It never prices; HitProbability is the one price. public static GunSolution Solution(Weapon weapon, Entity shooter, TargetRef subject) { - var bears = false; - if (subject.Entity != null) bears = Bears(weapon, shooter, subject.Entity, out _); - else if (subject.Chunk is ChunkId chunk) - { - var at = shooter.Zone.ChunkPose(chunk.Field, chunk.Index).xy; - bears = InArc(weapon.Item, float3(at.x, 0, at.y) - shooter.Position); - } + var bears = Bears(weapon, shooter, subject, out _); return new GunSolution { Subject = subject.Entity, Bears = bears, Free = InArc(weapon.Item, shooter.Aim), - Direction = bears && subject.Entity != null - ? TravelDirection(weapon, shooter, subject.Entity) - : AimDirection(weapon.Item, shooter) + Direction = bears ? TravelDirection(weapon, shooter, subject) : AimDirection(weapon.Item, shooter) }; } @@ -224,8 +215,8 @@ public static class FireControl return degrees(abs(offset.x * relativeVelocity.y - offset.y * relativeVelocity.x) / (range * range)); } - public static float AngularVelocity(Entity source, Entity target) => - AngularVelocity((target.Position - source.Position).xz, target.Velocity - source.Velocity); + public static float AngularVelocity(Entity source, TargetRef target) => + AngularVelocity((PositionOf(source, target) - source.Position).xz, VelocityOf(source, target) - source.Velocity); // The gun's rate times the ship's gear over the unaided baseline (ruling tracking-per-gun, "gun times ship"): the // one product of the two. An unauthored gun is +infinity and so is its rate whatever the gear reads: a mount with no @@ -241,14 +232,31 @@ public static class FireControl // be judged against another. This is the one function; CombatState (and FireControl.Fire below) both call // it instead of touching CultMath.first_order_intercept directly. Planar: source velocity is never fed in // (no shooter here leads its own motion into the shot), matching every existing call site this replaces. - public static float3 PredictedIntercept(Weapon weapon, Entity source, Entity target) + // Mining Cut 4b: a target is an entity or a rock; its position and velocity come from PositionOf and VelocityOf. + public static float3 PredictedIntercept(Weapon weapon, Entity source, TargetRef target) { - var targetVelocity = float3(target.Velocity.x, 0, target.Velocity.y); + var position = PositionOf(source, target); + var velocity = VelocityOf(source, target); return weapon.Velocity > .01f - ? first_order_intercept(source.Position, float3.zero, weapon.Velocity, target.Position, targetVelocity) - : target.Position; + ? first_order_intercept(source.Position, float3.zero, weapon.Velocity, position, float3(velocity.x, 0, velocity.y)) + : position; } + // Where a target is now: an entity's position, a rock's pose at the shooter's height (everything here is planar). + private static float3 PositionOf(Entity source, TargetRef target) + { + if (target.Chunk is ChunkId chunk) + { + var at = source.Zone.ChunkPose(chunk.Field, chunk.Index).xy; + return float3(at.x, source.Position.y, at.y); + } + return target.Entity.Position; + } + + // How fast a target moves: an entity's velocity, a rock's from Zone.ChunkVelocity, the one owner. + private static float2 VelocityOf(Entity source, TargetRef target) => + target.Chunk is ChunkId chunk ? source.Zone.ChunkVelocity(chunk) : target.Entity.Velocity; + // Cut 3, R1/R3: the targeting solution (0b table) -- pure, no draw, recomputed fresh on every call. AI // reads this to decide whether a shot is worth taking; the HUD reads it to draw a number; Fire below reads // it once, at the instant the trigger is pulled, and freezes the result into the shot (R10, Q6). Two reads @@ -263,13 +271,13 @@ public static class FireControl // freezes (R10), gated exactly as HitProbability gates. Nothing about the target's facing or silhouette // enters here; that is Silhouette's and PSpread's job, priced fresh by HitProbability below and again, // live, by Commit at the commit tick. 0 the moment any gate closes. - private static float PFire(Weapon weapon, Entity source, Entity target) => PFire(weapon, source, target, out _, out _, out _); + private static float PFire(Weapon weapon, Entity source, TargetRef target) => PFire(weapon, source, target, out _, out _, out _); // The `out range` overload is HitProbability's own gate call -- one computation of `target.Position - // source.Position`, not two. HitProbability used to recompute its own copy for PSpread, which is exactly // the kind of split authority Cut 3 named as the risk (two places computing the same vector, free to // drift or to have their subtraction order flipped in only one of them). - private static float PFire(Weapon weapon, Entity source, Entity target, out float range) => + private static float PFire(Weapon weapon, Entity source, TargetRef target, out float range) => PFire(weapon, source, target, out range, out _, out _); // The one answer to "does the shooter hold valid targeting data on this target": visible, in range and locked @@ -279,25 +287,29 @@ public static class FireControl // visible, out of range) already denies the target. Planar (R7: the simulation is 2D): the range gate, the // burst reach and the range clamp all measure the same distance, so a target's height never moves one of // them without the others. - public static bool Designated(Weapon weapon, Entity source, Entity target, out float range) + // Mining Cut 4b: a rock is designated by the same range gates, seen when Entity.ChunkVisible says so; a + // LockWeapon (a launcher) is never designated on a rock (ruling Q12 = A, 2026-09-30). + public static bool Designated(Weapon weapon, Entity source, TargetRef target, out float range) { range = 0f; - if (target == null) return false; - range = length((target.Position - source.Position).xz); - return source.VisibleEntities.Contains(target) && range >= weapon.MinRange && range <= weapon.Range && + if (target.IsNone) return false; + range = length((PositionOf(source, target) - source.Position).xz); + var inRange = range >= weapon.MinRange && range <= weapon.Range; + if (target.Chunk is ChunkId chunk) return inRange && !(weapon is LockWeapon) && source.ChunkVisible(chunk); + return source.VisibleEntities.Contains(target.Entity) && inRange && !(weapon is LockWeapon lockWeapon && !lockWeapon.IsLocked); } // Whether this gun can engage this target: designated and inside the arc. The one test of it; PFire prices a shot // at zero unless it holds, and Solution reads it to decide whether the gun fires on the target. `designated` is // the answer above, kept apart for Solve's burst flight: a designated target out of arc still sets the burst range. - public static bool Bears(Weapon weapon, Entity source, Entity target, out float range) => + public static bool Bears(Weapon weapon, Entity source, TargetRef target, out float range) => Bears(weapon, source, target, out range, out _); - private static bool Bears(Weapon weapon, Entity source, Entity target, out float range, out bool designated) + private static bool Bears(Weapon weapon, Entity source, TargetRef target, out float range, out bool designated) { designated = Designated(weapon, source, target, out range); - return designated && InArc(weapon.Item, target.Position - source.Position); + return designated && InArc(weapon.Item, PositionOf(source, target) - source.Position); } // `designated` is the answer above. `inArc` is Bears, asked only once a target is designated. @@ -305,13 +317,14 @@ public static class FireControl // (operator rulings 2026-09-30): without valid data it has no target and bursts at max range; with data but // out of arc it bursts at the target's range, along the aim. The HUD reads Designated and the // arc from Solve and Inspect and decides nothing. - private static float PFire(Weapon weapon, Entity source, Entity target, out float range, out bool designated, out bool inArc) + private static float PFire(Weapon weapon, Entity source, TargetRef target, out float range, out bool designated, out bool inArc) { inArc = Bears(weapon, source, target, out range, out designated); if (!inArc) return 0f; var settings = source.ItemManager.GameplaySettings; - var info = source.EntityInfoGathered.TryGetValue(target, out var gathered) ? gathered : 0f; + var info = target.Chunk is ChunkId chunk ? source.ChunkInfo(chunk) + : source.EntityInfoGathered.TryGetValue(target.Entity, out var gathered) ? gathered : 0f; return Accuracy(source) * PSensor(settings, Resolution(source), info); } @@ -364,22 +377,33 @@ public static class FireControl return (sil, pSpread, evasion); } - public static float HitProbability(Weapon weapon, Entity source, Entity target) => + public static float HitProbability(Weapon weapon, Entity source, TargetRef target) => HitProbability(weapon, source, target, (AimTarget?) null); // Priced on `aim` rather than the source's aim slot: the aim its pilot commands this step. - public static float HitProbability(Weapon weapon, Entity source, Entity target, AimTarget aim) => + public static float HitProbability(Weapon weapon, Entity source, TargetRef target, AimTarget aim) => HitProbability(weapon, source, target, (AimTarget?) aim); // A null aim reads source.ResolvedAim, after the gate, so a gated-out shot reads nothing more. - private static float HitProbability(Weapon weapon, Entity source, Entity target, AimTarget? aim) + // Mining Cut 4b: a rock is priced by the same factors as a ship at equal range, precision and info -- its disc + // through the same integrator, its evasion 0 (a rock is not a Ship), and no aim point: the disc is aimed at. + private static float HitProbability(Weapon weapon, Entity source, TargetRef target, AimTarget? aim) { var pFire = PFire(weapon, source, target, out var range); if (pFire <= 0f) return 0f; - var targetHull = source.ItemManager.GetData(target.Hull) as HullData; - var (sil, pSpread, evasion) = Forecast(weapon, source, target, targetHull, Precision(source), range, aim ?? source.ResolvedAim); - return pFire * PMount(AngularVelocity(source, target), TrackingRate(weapon, source)) * pSpread * sil.POnHull * PDeviation(evasion, Tracking(source)); + var pMount = PMount(AngularVelocity(source, target), TrackingRate(weapon, source)); + if (target.Chunk is ChunkId chunk) + { + var mass = RockMass(source.Zone, chunk, Precision(source), out var span); + var pSpreadRock = PSpread(weapon.Spread, span, range, source.ItemManager.GameplaySettings.SchematicCellSize); + return pFire * pMount * pSpreadRock * mass * PDeviation(0f, Tracking(source)); + } + + var entity = target.Entity; + var targetHull = source.ItemManager.GetData(entity.Hull) as HullData; + var (sil, pSpread, evasion) = Forecast(weapon, source, entity, targetHull, Precision(source), range, aim ?? source.ResolvedAim); + return pFire * pMount * pSpread * sil.POnHull * PDeviation(evasion, Tracking(source)); } // Presentation only: the debug HUD's view of exactly the factors HitProbability multiplies. It computes @@ -457,7 +481,7 @@ public static class FireControl // at Fire (R10); HitProbability and Inspect recompute it fresh, at the current source/target positions, // for their forecast. Below a length of 1e-6 (point-blank, source and intercept coincide) it falls back // to world +z, the same fallback Apply used before this cut (`:463`). - public static float2 TravelDirection(Weapon weapon, Entity source, Entity target) + public static float2 TravelDirection(Weapon weapon, Entity source, TargetRef target) { var toIntercept = (PredictedIntercept(weapon, source, target) - source.Position).xz; return lengthsq(toIntercept) < 1e-6f ? float2(0, 1) : normalize(toIntercept); @@ -505,12 +529,21 @@ public static class FireControl // The commit price's deviation: what the target has already moved off the frozen forecast, plus what it can and // does move off the line of fire (Evasion). The second part applies at any flight time, so an instant weapon // (flight time 0, realized deviation 0) still feels a jinking target. - public static float DeviationProbability(PendingShot shot, float now, out float deviation) + // Mining Cut 4b: a rock's deviation is where its pose is now against that projection, with no evasion; its + // zone is the shooter's (a shot that outlives its shooter is resolved by Step, which passes the zone it runs in). + public static float DeviationProbability(PendingShot shot, float now, out float deviation) => + DeviationProbability(shot.Source?.Zone, shot, now, out deviation); + + private static float DeviationProbability(Zone zone, PendingShot shot, float now, out float deviation) { + deviation = 0f; + if (shot.Target == null && shot.Chunk == null) return 1f; var elapsed = now - shot.FireTime; var predicted = shot.FireTargetPosition + shot.FireTargetVelocity * elapsed; - deviation = shot.Target == null ? 0f : length((shot.Target.Position - predicted).xz) + Evasion(shot.Target, shot.TravelDirection); - return shot.Target == null ? 1f : PDeviation(deviation, shot.Tracking); + deviation = shot.Chunk is ChunkId chunk + ? length(zone.ChunkPose(chunk.Field, chunk.Index).xy - predicted.xz) + : length((shot.Target.Position - predicted).xz) + Evasion(shot.Target, shot.TravelDirection); + return PDeviation(deviation, shot.Tracking); } // How far a target can and does move off the line of fire in the solution window: the term DeviationProbability @@ -608,7 +641,7 @@ public static class FireControl // BurstReach the planar distance from the shooter at which the payload is delivered (a direct round's target, a fused // round's burst point, 0 for an untargeted direct round), which Fire's range factor reads for every outcome. Refused: a fused round whose blast // radius (its arming distance) exceeds the weapon's Range; it cannot be fired. - public static FireSolution Solve(Weapon weapon, EquippedItem item, Entity source, Entity target) + public static FireSolution Solve(Weapon weapon, EquippedItem item, Entity source, TargetRef target) { var pFire = PFire(weapon, source, target, out var fireRange, out var designated, out var inArc); @@ -639,14 +672,14 @@ public static class FireControl // that leaves the zone cancels it like any other. A round whose Range is shorter than the arming distance // cannot be fired at all: it is refused, per round, where Range is read after Execute refreshed it (a // burst's later rounds and a power-starved Range included). - var engaged = fuse != null && !(designated && inArc) ? null : target; + var engaged = fuse != null && !(designated && inArc) ? TargetRef.None : target; var origin = source.Position; var travelDirection = Solution(weapon, source, target).Direction; var arming = fuse != null ? blastRadius : 0f; - var burstPosition = engaged != null ? engaged.Position : origin; + var burstPosition = !engaged.IsNone ? PositionOf(source, engaged) : origin; var flightDistance = 0f; - if (fuse != null && engaged != null) + if (fuse != null && !engaged.IsNone) { // Nothing bursts beyond max range: an intercept a receding target leads the round past Range is // pulled back along its own line to Range. @@ -662,7 +695,7 @@ public static class FireControl burstPosition = Armed(origin, travelDirection, arming, origin + float3(travelDirection.x, 0, travelDirection.y) * reach); flightDistance = max(reach, arming); } - else if (engaged != null) flightDistance = fireRange; + else if (!engaged.IsNone) flightDistance = fireRange; var solution = new FireSolution { @@ -710,8 +743,7 @@ public static class FireControl Lay(weapon, item, source); return 0; } - // Mining Cut 3: a chunk target fires as an untargeted round until Cut 4 routes shots at chunks. - var target = source.Target.Value.Entity; + var target = source.Target.Value; var now = zone.Time - age; // R1's engage gate and the shooter-side probability, evaluated now and frozen: nothing at commit time @@ -721,7 +753,7 @@ public static class FireControl var solution = Solve(weapon, item, source, target); if (solution.Outcome == FireOutcome.Refused) return 0; // The mount factor is frozen with the shooter-side probability: nothing at commit time re-reads the sweep. - var pFire = solution.PFire * (solution.Engaged != null ? PMount(AngularVelocity(source, solution.Engaged), TrackingRate(weapon, source)) : 1f); + var pFire = solution.PFire * (!solution.Engaged.IsNone ? PMount(AngularVelocity(source, solution.Engaged), TrackingRate(weapon, source)) : 1f); var fireRange = solution.FireRange; var engaged = solution.Engaged; var travelDirection = solution.TravelDirection; @@ -732,10 +764,11 @@ public static class FireControl var targetVelocity = float3.zero; var targetPosition = origin; - if (engaged != null) + if (!engaged.IsNone) { - targetVelocity = float3(engaged.Velocity.x, 0, engaged.Velocity.y); - targetPosition = engaged.Position - targetVelocity * age; + var velocity = VelocityOf(source, engaged); + targetVelocity = float3(velocity.x, 0, velocity.y); + targetPosition = PositionOf(source, engaged) - targetVelocity * age; } var flightTime = weapon.Velocity > .01f ? solution.FlightDistance / weapon.Velocity : 0f; @@ -746,7 +779,8 @@ public static class FireControl { ShotId = zone.NextShotId(), Source = source, - Target = engaged, + Target = engaged.Entity, + Chunk = engaged.Chunk, Weapon = item, Aimed = aim.Item, AimedMount = aim.Mount, @@ -773,7 +807,7 @@ public static class FireControl // The commit horizon exists so the target's facing can be read late (Bearing timing). A round fired at // nothing has no facing to read, so it commits at Fire: its burst point is decided from the poses of // the moment it leaves, and a Contact round short of max range can arrive as early as it truly does. - CommitTime = fuse != null && engaged == null ? now : now + max(0f, flightTime - commitHorizon), + CommitTime = fuse != null && engaged.IsNone ? now : now + max(0f, flightTime - commitHorizon), BurstPosition = burstPosition, Fuse = fuse, BlastRadius = blastRadius, @@ -861,7 +895,7 @@ public static class FireControl { var shot = shots[i]; - var targetGone = shot.Target != null && !zone.Entities.Contains(shot.Target); + var targetGone = TargetGone(zone, shot); if (targetGone) { // Cut 11 (Soul C4): a shot whose target has left the zone resolves as a miss whichever @@ -908,7 +942,7 @@ public static class FireControl if (i < 0) continue; var shot = shots[i]; - var targetGone = shot.Target != null && !zone.Entities.Contains(shot.Target); + var targetGone = TargetGone(zone, shot); if (targetGone) { // As in the commit walk: a shot whose target left the zone in this step resolves as a miss. @@ -930,6 +964,10 @@ public static class FireControl } } + // A shot's target has left the zone, or a rock it flies at no longer exists (broken in flight): the shot is a miss. + private static bool TargetGone(Zone zone, PendingShot shot) => + (shot.Target != null && !zone.Entities.Contains(shot.Target)) || (shot.Chunk is ChunkId chunk && !zone.ChunkExists(chunk)); + // R3/R4: the one roll. p_base was frozen at fire, PFire carrying the mount factor; the only thing measured live is how far the target has // actually strayed, by now, from where a straight-line projection of its fire-time velocity said it would // be -- forgiven by the targeting system's Tracking, likewise frozen at fire. @@ -945,15 +983,25 @@ public static class FireControl // (bearing) -- is read live, here, at the commit tick. The Cut 7 guard extends to cover the new factors: // when PFire x pDeviation is already 0, no Silhouette is built. Shared by Commit's own roll and by the // debug HUD's forecast (TheHudEstimateIsTheCommitPrice) -- one function, one commit-time price. - public static float CommitProbability(PendingShot shot, float now, out Silhouette sil) + public static float CommitProbability(PendingShot shot, float now, out Silhouette sil) => + CommitProbability(shot.Source?.Zone, shot, now, out sil); + + // Mining Cut 4b: a rock's price is PFire x PDeviation x PSpread(span 2R) x the disc's mass; it reads no hull. + private static float CommitProbability(Zone zone, PendingShot shot, float now, out Silhouette sil) { sil = default; - if (shot.Target == null) return 0f; + if (shot.Target == null && shot.Chunk == null) return 0f; - var pDeviation = DeviationProbability(shot, now, out _); + var pDeviation = DeviationProbability(zone, shot, now, out _); var p = shot.PFire * pDeviation; if (p <= 0f) return 0f; + if (shot.Chunk is ChunkId chunk) + { + var mass = RockMass(zone, chunk, shot.Precision, out var span); + return p * PSpread(shot.Spread, span, shot.FireRange, zone.SchematicCellSize) * mass; + } + var bearing = Bearing(shot.Target, shot.TravelDirection); var hullData = shot.Target.ItemManager.GetData(shot.Target.Hull) as HullData; sil = Silhouette(shot.Target, hullData, shot.Aimed, bearing, shot.Precision, null, shot.AimedMount); @@ -984,7 +1032,7 @@ public static class FireControl // drawing once is the documented way to get a correlated first output, and a follow-up to give // CultMath.Random a mixed-seed entry point of its own is recorded for a separate CultLib cut. var random = new Random(SimulationDice.Mix((zone.CombatSeed * 2654435761u) ^ (uint) shot.ShotId | 1u)); - var p = CommitProbability(shot, now, out var sil); + var p = CommitProbability(zone, shot, now, out var sil); var hit = p > 0f && random.NextFloat() < p; var cell = int2.zero; @@ -993,7 +1041,8 @@ public static class FireControl var shielded = false; var shieldBroken = false; - if (hit) + // A rock hit has no lane and no shield: Cell, Bearing and Lateral stay zero (Apply wears the rock). + if (hit && shot.Chunk == null) { // Cut 12.2: the same silhouette pOnHull drew its mass from -- same bearing (live, at this commit // tick), same sigma (the frozen Precision). A shot that passed the roll always lands on metal (R3: @@ -1189,6 +1238,12 @@ public static class FireControl return; } + if (shot.Chunk is ChunkId rock) + { + ApplyRockHit(zone, shot, rock); + return; + } + switch (shot.Fuse) { case null: @@ -1201,6 +1256,27 @@ public static class FireControl } } + // Mining Cut 4b: a committed hit on a rock. A round without a fuse wears the rock by its Damage (the falloff was + // read at Fire) and publishes one absorb on the zone's ChunkCapabilities (through Publish, at height 0 like a blast's), at the + // rock's surface facing the shot and before the wear shrinks it. A contact or delayed round detonates at the rock's centre as it arrives (the + // arming rule kept), through Detonate, the one area owner. + private static void ApplyRockHit(Zone zone, PendingShot shot, ChunkId rock) + { + if (!shot.Outcome.Hit) return; + + var centre = zone.ChunkPose(rock.Field, rock.Index).xy; + if (shot.Fuse == null) + { + var direction = float3(shot.TravelDirection.x, 0, shot.TravelDirection.y); + var surface = centre - shot.TravelDirection * zone.ChunkRadius(rock); + Publish(zone.ChunkCapabilities, AbsorbLayer.Hull, float3(surface.x, 0f, surface.y), direction, shot.Damage, shot.DamageType); + zone.Wear(rock, shot.Damage); + return; + } + var point = Armed(shot.FireOrigin, shot.TravelDirection, shot.BlastRadius, float3(centre.x, shot.FireOrigin.y, centre.y)).xz; + Detonate(zone, point, shot.BlastRadius, shot.Damage, shot.DamageType); + } + // Cut 12.3 (docs/fire-control-cut.md, "How a direct hit travels"): replaces Entity.ApplyHit's 0.5-step // march and Entity.DamageSchematic's even split over the whole hit shape. Spread is width (Q12-2 = A): // 2n+1 parallel lanes, sharing the shot's damage evenly over whichever lanes actually meet metal -- the @@ -1221,7 +1297,7 @@ public static class FireControl if (shot.Outcome.Shielded) { - Publish(shot.Target, AbsorbLayer.Shield, ImpactPoint(shot.Target, shot.Outcome.Cell), + Publish(shot.Target.Capabilities, AbsorbLayer.Shield, ImpactPoint(shot.Target, shot.Outcome.Cell), float3(shot.TravelDirection.x, 0, shot.TravelDirection.y), shot.Damage, shot.DamageType); shot.Target.Shield.TakeHit(shot.DamageType, shot.Damage); return; @@ -1266,7 +1342,7 @@ public static class FireControl for (var li = 0; li < laneCount; li++) ArrayPool<LaneCell>.Shared.Return(buffers[li]); - Publish(target, AbsorbLayer.Hull, ImpactPoint(target, shot.Outcome.Cell), + Publish(target.Capabilities, AbsorbLayer.Hull, ImpactPoint(target, shot.Outcome.Cell), float3(shot.TravelDirection.x, 0, shot.TravelDirection.y), shot.Damage, shot.DamageType); target.DamageHull(hullDamage); } @@ -1278,17 +1354,18 @@ public static class FireControl return float3(world.x, target.Position.y, world.y); } - // The one publisher of an absorbed impact: once per receiver, on its Capabilities, before the damage it reports. - private static void Publish(Entity receiver, AbsorbLayer layer, float3 position, float3 direction, float magnitude, DamageType damageType) => - receiver.Capabilities.PublishAbsorb(new AbsorbEvent(position, direction, magnitude, damageType, layer)); + // The one publisher of an absorbed impact: once per receiver, on its CapabilityEvents (an entity's, or the zone's + // for a rock), before the damage it reports. + private static void Publish(CapabilityEvents receiver, AbsorbLayer layer, float3 position, float3 direction, float magnitude, DamageType damageType) => + receiver.PublishAbsorb(new AbsorbEvent(position, direction, magnitude, damageType, layer)); - // A blast's impact on one entity: at the blast point (on the entity's height), travelling from the blast out through - // the entity's centre, or zero when they coincide. - private static void PublishBlast(Entity entity, float2 blast, AbsorbLayer layer, float magnitude, DamageType damageType) + // A blast's impact on one receiver: at the blast point (at the receiver's height), travelling from the blast out + // through the receiver's planar centre, or zero when they coincide. An entity and a rock go through it alike. + private static void PublishBlast(CapabilityEvents receiver, float2 centre, float height, float2 blast, AbsorbLayer layer, float magnitude, DamageType damageType) { - var away = entity.Position.xz - blast; + var away = centre - blast; var direction = lengthsq(away) > 0f ? normalize(away) : float2.zero; - Publish(entity, layer, float3(blast.x, entity.Position.y, blast.y), float3(direction.x, 0, direction.y), magnitude, damageType); + Publish(receiver, layer, float3(blast.x, height, blast.y), float3(direction.x, 0, direction.y), magnitude, damageType); } // Cut 12.4(b) (docs/fire-control-cut.md, "Where P is"): a contact or delayed blast needs a committed hit -- @@ -1593,6 +1670,7 @@ public static class FireControl ShotId = shot.ShotId, Source = shot.Source, Target = shot.Target, + Chunk = shot.Chunk, Weapon = shot.Weapon, Result = result, Shielded = shielded, @@ -1607,7 +1685,13 @@ public static class FireControl // Cut 12.4(b) (docs/fire-control-cut.md, "Area, per entity"): the one owner of blast damage -- a blast is // an area, not a bundle of rays (Q12-7 dissolved the ray model's remainder question along with the rays - // themselves). Splash's signature with the point made planar (R7). Callers: Apply's three fuse branches. Nothing draws: every candidate entity in radius takes its share, unconditionally. + // themselves). Splash's signature with the point made planar (R7). Callers: Apply's three fuse branches and + // Zone's mine step. Nothing draws: every candidate entity in radius takes its share, unconditionally. + // + // Mining cut 4a (docs/mining-cut-refresh.md, Q10 = A): this is also the one owner of blast area over rocks. + // After the entity pass, every unbroken rock whose disc the blast disc overlaps takes its lens share of the + // damage -- damage * lens / (pi r^2), the cells' own normaliser -- through Zone.Wear, and publishes one absorb + // on Zone.ChunkCapabilities first. Overlapping bodies each take their own overlap; shares off every body are lost. // // For each candidate (an entity whose centre lies within radius plus half its own hull diagonal -- // CandidatesIncludeHullsWhoseCentreIsOutsideTheRadius, which Splash's centre-distance cull could not pass): @@ -1673,7 +1757,7 @@ public static class FireControl { if (shield.CanTakeHit(damageType, totalShare)) { - PublishBlast(entity, worldPlanar, AbsorbLayer.Shield, totalShare, damageType); + PublishBlast(entity.Capabilities, entity.Position.xz, entity.Position.y, worldPlanar, AbsorbLayer.Shield, totalShare, damageType); shield.TakeHit(damageType, totalShare); continue; } @@ -1703,11 +1787,37 @@ public static class FireControl for (var i = 0; i < amounts.Length; i++) hullTotal += amounts[i]; } - PublishBlast(entity, worldPlanar, AbsorbLayer.Hull, totalShare, damageType); + PublishBlast(entity.Capabilities, entity.Position.xz, entity.Position.y, worldPlanar, AbsorbLayer.Hull, totalShare, damageType); entity.DamageHull(hullTotal); } + + if (!(radius > 0f) || zone.AsteroidBelts.Count == 0) return; // no area, or no rocks to cover + // Rocks, through the targeting index (no observer: entities stay out of it). Reach is exact on a rock's + // centre, so it is the blast radius plus the widest any rock can be. Walked in (field, index) order so the + // order of wear -- and any later dice on it -- is fixed. + var rocks = _rockScratch ??= new List<TargetCandidate>(); + zone.Targets.Within(new TargetSearch(worldPlanar, radius + Zone.LargestChunkRadius(zone.Settings)), rocks); + rocks.RemoveAll(c => !c.Target.Chunk.HasValue); + rocks.Sort((a, b) => + { + var byField = string.CompareOrdinal(a.Target.Chunk.Value.Field.Value, b.Target.Chunk.Value.Field.Value); + return byField != 0 ? byField : a.Target.Chunk.Value.Index.CompareTo(b.Target.Chunk.Value.Index); + }); + var discArea = PI * radius * radius; + foreach (var rock in rocks) + { + var chunk = rock.Target.Chunk.Value; + if (!zone.ChunkExists(chunk)) continue; + var centre = zone.ChunkPose(chunk.Field, chunk.Index).xy; + var share = damage * CircleCircleOverlap(length(centre - worldPlanar), radius, zone.ChunkRadius(chunk)) / discArea; + if (!(share > 0f)) continue; + PublishBlast(zone.ChunkCapabilities, centre, 0f, worldPlanar, AbsorbLayer.Hull, share, damageType); + zone.Wear(chunk, share); + } } + [ThreadStatic] private static List<TargetCandidate> _rockScratch; + // Whether the disc reaches any occupied hull cell of the entity: Detonate's own coverage test (the same // ToSchematicPoint, SchematicCellSize and CircleSquareOverlap), so what triggers a mine and what its blast // reaches are one geometry. @@ -1721,6 +1831,19 @@ public static class FireControl return false; } + // Mining cut 4a: the exact area shared by two discs at centre distance d -- the lens. Exactly zero when they are + // disjoint or tangent, and the smaller disc's whole area when one contains the other. + public static float CircleCircleOverlap(float d, float r1, float r2) + { + if (r1 <= 0f || r2 <= 0f || d >= r1 + r2) return 0f; + var small = min(r1, r2); + if (d <= abs(r1 - r2)) return PI * small * small; + var a = (d * d + r1 * r1 - r2 * r2) / (2f * d * r1); + var b = (d * d + r2 * r2 - r1 * r1) / (2f * d * r2); + var k = (-d + r1 + r2) * (d + r1 - r2) * (d - r1 + r2) * (d + r1 + r2); + return r1 * r1 * acos(clamp(a, -1f, 1f)) + r2 * r2 * acos(clamp(b, -1f, 1f)) - .5f * sqrt(max(0f, k)); + } + // Cut 12.4(b) (docs/fire-control-cut.md, "Exact overlap, in float"): the exact area of a unit square, // centred on `cell` (the unit square centred on its integer coordinate, the same convention every other // frame rule uses), that lies inside a disc of radius `r` centred at `diskCentre` -- both in the same @@ -1876,9 +1999,7 @@ public static class FireControl var aimPoint = ResolveAimPoint(target, hull, aimed, mount); var a = dot(aimPoint, ell); - var pOnHull = 0f; - for (var i = 0; i < count; i++) - pOnHull += Phi((intervals[i].Hi - a) / sigma) - Phi((intervals[i].Lo - a) / sigma); + var pOnHull = Mass(new ReadOnlySpan<Interval>(intervals, 0, count), a, sigma); var span = count > 0 ? intervals[count - 1].Hi - intervals[0].Lo : 0f; @@ -1894,6 +2015,27 @@ public static class FireControl }; } + // The one Gaussian integrator: the mass a normal of `sigma` about `aim` puts inside the merged, disjoint + // `intervals`. A hull's shadow and a rock's disc (one interval about its aim) both read it. + private static float Mass(ReadOnlySpan<Interval> intervals, float aim, float sigma) + { + var mass = 0f; + foreach (var interval in intervals) + mass += Phi((interval.Hi - aim) / sigma) - Phi((interval.Lo - aim) / sigma); + return mass; + } + + // A rock is a disc of radius R schematic cells aimed at its centre: one interval [-R, R] about the aim, span 2R. + // The one price of it, read by HitProbability's forecast and by Commit, at the rock's radius now. + private static float RockMass(Zone zone, ChunkId chunk, float precision, out float span) + { + var radius = zone.ChunkCells(chunk); + span = 2f * radius; + Span<Interval> disc = stackalloc Interval[1]; + disc[0] = new Interval { Lo = -radius, Hi = radius }; + return saturate(Mass(disc, 0f, Sigma(precision))); + } + // Phi(z) = 1/2 (1 + erf(z / sqrt(2))): the standard normal CDF, CultMath's erf the one function underneath // every Gaussian-mass sum this cut computes. private static float Phi(float z) => .5f * (1f + erf(z * (1f / SQRT2))); @@ -2054,6 +2196,9 @@ public struct PendingShot public int ShotId; public Entity Source; public Entity Target; + // Mining Cut 4b: the rock a shot flies at, frozen at Fire; at most one of Target and Chunk is set. Unity reads + // Target only, so a rock shot draws untargeted until the Unity follow-up (mining-unity-chunk-presentation). + public ChunkId? Chunk; public EquippedItem Weapon; public EquippedItem Aimed; // The mount the aim was at, when it was at a mount rather than an item (Entity.ResolvedAim at Fire), frozen with Aimed: @@ -2113,7 +2258,7 @@ public struct PendingShot // A fused round with no target: where it bursts is decided at its commit (the first hull its aim line meets), so its // damage reads the falloff there rather than at Fire. - public bool DeliveredAtCommit => Fuse != null && Target == null; + public bool DeliveredAtCommit => Fuse != null && Target == null && Chunk == null; } // What a round does when fired (FireControl.Solve): Direct resolves against its target, Burst detonates at a @@ -2147,7 +2292,7 @@ public struct FireSolution public float FireRange; // Whether the shooter holds valid targeting data on the target (Designated); the HUD and the agents read it here. public bool Designated; - public Entity Engaged; + public TargetRef Engaged; public float2 TravelDirection; public float3 BurstPosition; public WeaponFuse? Fuse; @@ -2313,6 +2458,7 @@ public sealed class ShotOutcome public int ShotId; public Entity Source; public Entity Target; + public ChunkId? Chunk; public EquippedItem Weapon; // What the commit decided, typed: a shot rolled and missed, rolled and hit, or was a fused round with no // target and so burst without rolling, or a proximity round whose roll missed but which detonates anyway diff --git a/Assets/Scripts/ServerShared/Targeting/BeltTargets.cs b/Assets/Scripts/ServerShared/Targeting/BeltTargets.cs index 3e12536c3..a64e0c624 100644 --- a/Assets/Scripts/ServerShared/Targeting/BeltTargets.cs +++ b/Assets/Scripts/ServerShared/Targeting/BeltTargets.cs @@ -48,8 +48,7 @@ public sealed class BeltTargets : ITargetProvider _zone = zone; _field = field; _data = data; - var size = settings.AsteroidSize; - _largestRadius = size.Exponent > 0 ? max(abs(size.Minimum), abs(size.Maximum)) : float.PositiveInfinity; + _largestRadius = Zone.LargestChunkRadius(settings); var count = data.Asteroids.Length; _periods = new double[count]; diff --git a/Assets/Scripts/ServerShared/Zone.cs b/Assets/Scripts/ServerShared/Zone.cs index 6ba9ef7d7..d0c5b5330 100644 --- a/Assets/Scripts/ServerShared/Zone.cs +++ b/Assets/Scripts/ServerShared/Zone.cs @@ -62,6 +62,9 @@ public class Zone // the entities, and one provider per belt. The reticle, cycling and any range query over rocks go through it; // nothing else scans a belt. public readonly TargetingIndex Targets = new TargetingIndex(); + // Mining cut 4a: the receiver of every rock impact FireControl.Detonate publishes. Notification only: a presenter + // subscribes once per zone, and nothing in ServerShared reads it. + public readonly CapabilityEvents ChunkCapabilities = new CapabilityEvents(); private readonly List<Sun> _suns = new List<Sun>(); private HashSet<CultRecordKey> _updatedOrbits = new HashSet<CultRecordKey>(); @@ -674,6 +677,14 @@ public class Zone return belt.DamagedSize(chunk.Index, wear.Damage, Settings); } + // No rock of any belt, whole or worn, is wider than this (AsteroidSize's bound over every argument, so over the + // Asteroid.Size range the generator writes). The index's visibility bound and a blast's query reach both use it. + public static float LargestChunkRadius(PlanetSettings settings) + { + var size = settings.AsteroidSize; + return size.Exponent > 0 ? max(abs(size.Minimum), abs(size.Maximum)) : float.PositiveInfinity; + } + // Cut 2: the only writer of chunk wear. Returns whether this hit broke the chunk. The break threshold is // strictly greater-than, matching the deleted per-tick miner's own comparison against accumulated damage: // damage exactly equal to hitpoints does not yet break the chunk, only damage that exceeds them does. @@ -715,6 +726,20 @@ public class Zone return AsteroidBelts[belt].Pose(index, time, parentPosition, size); } + // Mining Cut 4b: the one owner of a chunk's planar velocity, the central difference of the pose function at zone + // time. Derived on every read, never stored: the intercept, the fire-time projection and the mount's sweep all + // read it here. + public float2 ChunkVelocity(ChunkId chunk) + { + const double h = .05; + var ahead = ChunkPose(chunk.Field, chunk.Index, _time + h).xy; + var behind = ChunkPose(chunk.Field, chunk.Index, _time - h).xy; + return (ahead - behind) / (float) (2 * h); + } + + // A chunk's radius in schematic cells: what visibility and a shot's silhouette both measure it in. + public float ChunkCells(ChunkId chunk) => ChunkRadius(chunk) / SchematicCellSize; + // Mining Cut 3 (docs/mining-cut-refresh.md): how bright a chunk is -- Reflector's rule (cross-section × the light // on it), with the field kind's reflectivity per schematic cell times the chunk's area in cells. Computed when // asked; nothing about it is stored. A worn chunk shrinks and dims; a broken one, or one of a kindless belt, is dark. @@ -723,7 +748,7 @@ public class Zone if (!ChunkExists(chunk)) return 0f; var kind = _itemManager.ItemData.Get(((AsteroidBeltData) Planets[chunk.Field]).Kind); if (kind == null) return 0f; - var cells = ChunkRadius(chunk) / _itemManager.GameplaySettings.SchematicCellSize; + var cells = ChunkCells(chunk); return kind.CrossSection * PI * cells * cells * GetLight(ChunkPose(chunk.Field, chunk.Index).xy); } diff --git a/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs b/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs index dc6ffd628..76a67472a 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs @@ -32,7 +32,7 @@ public sealed partial class MiningCut3Tests : IDisposable Directory.Delete(_root, true); } - private static PerformanceStat Constant(float v) => new PerformanceStat { Min = v, Max = v }; + internal static PerformanceStat Constant(float v) => new PerformanceStat { Min = v, Max = v }; private static GameplaySettings GameSettings() => new GameplaySettings { @@ -49,7 +49,7 @@ public sealed partial class MiningCut3Tests : IDisposable // Every sun carries a well (the belts circle in it, c = 9), one sun whose light reaches 1000 units, and the chunk // curves MiningCut2Tests uses, so sizes and wear vary over the fixture's range. - private static PlanetSettings PlanetSettings(float lightRadius = 1000f) => new PlanetSettings + internal static PlanetSettings PlanetSettings(float lightRadius = 1000f) => new PlanetSettings { WellStrength = new ExponentialCurve { Constant = 9f }, RocheLimit = new ExponentialCurve { Constant = 1f }, @@ -66,7 +66,7 @@ public sealed partial class MiningCut3Tests : IDisposable Keys = new[] { new float4(0, 1, 0, 0), new float4(1, .3f, 0, 0) } }; - private sealed class Scene + internal sealed class Scene { public CultCache Cache; public ItemManager Items; @@ -81,16 +81,16 @@ public sealed partial class MiningCut3Tests : IDisposable // A belt around the sun: its chunks orbit the origin at their own distances, so at zone time 0 a chunk of // phase p sits at distance × (cos 2πp, sin 2πp). `kind` null leaves the belt kindless, for the zone to assign. - private sealed class BeltSpec + internal sealed class BeltSpec { public Asteroid[] Asteroids; public FieldKindData Kind; } - private static Asteroid Rock(float distance, float phase = 0f, float size = .5f) => + internal static Asteroid Rock(float distance, float phase = 0f, float size = .5f) => new Asteroid { Distance = distance, Phase = phase, Size = size, RotationSpeed = .1f }; - private Scene BuildScene(FieldKindData[] kinds = null, params BeltSpec[] belts) => BuildSceneAt(float2.zero, kinds, belts); + internal Scene BuildScene(FieldKindData[] kinds = null, params BeltSpec[] belts) => BuildSceneAt(float2.zero, kinds, belts); // The same scene with its sun, and so every belt centre, at `sunAt`. private Scene BuildSceneAt(float2 sunAt, FieldKindData[] kinds, params BeltSpec[] belts) => @@ -165,10 +165,10 @@ public sealed partial class MiningCut3Tests : IDisposable return scene; } - private static FieldKindData Kind(string name, float crossSection, float weight = 1f) => + internal static FieldKindData Kind(string name, float crossSection, float weight = 1f) => new FieldKindData { Name = name, CrossSection = crossSection, GenerationWeight = weight }; - private static BeltSpec Belt(FieldKindData kind, params Asteroid[] asteroids) => new BeltSpec { Kind = kind, Asteroids = asteroids }; + internal static BeltSpec Belt(FieldKindData kind, params Asteroid[] asteroids) => new BeltSpec { Kind = kind, Asteroids = asteroids }; // A chunk's planar position now (zone time never advances in these tests). private static float2 At(Scene s, ChunkId chunk) => s.Zone.ChunkPose(chunk.Field, chunk.Index).xy; @@ -180,14 +180,14 @@ public sealed partial class MiningCut3Tests : IDisposable return kind.CrossSection * PI * cells * cells * s.Zone.GetLight(At(s, chunk)); } - private static GearData Gear(string name, BehaviorData behavior) => new GearData + internal static GearData Gear(string name, BehaviorData behavior) => new GearData { Name = name, Hardpoint = HardpointType.Tool, Shape = new Shape(), Durability = 1, MinimumTemperature = -1000, MaximumTemperature = 1000, OptimalTemperature = 0, PlateauWidth = 2000, Behaviors = { behavior } }; - private static EquippableItem Mint(Scene s, ItemData design) => new EquippableItem + internal static EquippableItem Mint(Scene s, ItemData design) => new EquippableItem { Data = s.Cache.RefOf<ItemData>(design), Durability = design is EquippableItemData equippable ? equippable.Durability : 0, diff --git a/tests/Aetheria.Shared.Tests/MiningCut4aTests.cs b/tests/Aetheria.Shared.Tests/MiningCut4aTests.cs new file mode 100644 index 000000000..7d43c86d3 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/MiningCut4aTests.cs @@ -0,0 +1,279 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +using System; +using System.Collections.Generic; +using System.Linq; +using CultMath; +using UniRx; +using Xunit; +using static CultMath.math; +using float2 = CultMath.float2; +using float3 = CultMath.float3; + +// Mining cut 4a (docs/mining-cut-refresh.md, Q10 = A): a blast's disc is shared by area over whatever it covers, hull +// cells or rocks, through FireControl.Detonate; each worn rock publishes one absorb on Zone.ChunkCapabilities. Reuses +// MiningCut3Tests' belt fixture (a partial of that class), so a filter on these tests names the methods below. +public sealed partial class MiningCut3Tests +{ + // A one-rock belt: the rock at phase 0 sits on +x of the belt centre, `size` its authored size. + private (Scene scene, ChunkId rock) OneRock(float size = .5f, float distance = 200f) + { + var kind = Kind("Asteroid", 4f); + var s = BuildScene(new[] { kind }, Belt(kind, Rock(distance, 0f, size))); + return (s, new ChunkId(s.Belts[0], 0)); + } + + private static List<AbsorbEvent> Absorbs(Scene s, List<IDisposable> subs) + { + var list = new List<AbsorbEvent>(); + subs.Add(s.Zone.ChunkCapabilities.Absorb.Subscribe(list.Add)); + return list; + } + + // The area of a disc at the origin of radius r1 and a disc at (d, 0) of radius r2, by midpoint integration of the + // chord overlap -- no formula of the code under test. + private static double NumericLens(double d, double r1, double r2) + { + var lo = Math.Max(-r1, d - r2); + var hi = Math.Min(r1, d + r2); + if (hi <= lo) return 0; + const int n = 400000; + var h = (hi - lo) / n; + var area = 0.0; + for (var i = 0; i < n; i++) + { + var x = lo + (i + .5) * h; + var a = Math.Sqrt(Math.Max(0, r1 * r1 - x * x)); + var b = Math.Sqrt(Math.Max(0, r2 * r2 - (x - d) * (x - d))); + area += 2 * Math.Min(a, b) * h; + } + return area; + } + + // The area of a disc centred (cx, cy) of radius r inside the axis-aligned rectangle, by the same integration. + private static double NumericDiscInRect(double cx, double cy, double r, double x0, double x1, double y0, double y1) + { + var lo = Math.Max(cx - r, x0); + var hi = Math.Min(cx + r, x1); + if (hi <= lo) return 0; + const int n = 400000; + var h = (hi - lo) / n; + var area = 0.0; + for (var i = 0; i < n; i++) + { + var x = lo + (i + .5) * h; + var half = Math.Sqrt(Math.Max(0, r * r - (x - cx) * (x - cx))); + area += Math.Max(0, Math.Min(cy + half, y1) - Math.Max(cy - half, y0)) * h; + } + return area; + } + + [Theory] + [InlineData(5f, 3f, 4f)] + [InlineData(1f, 3f, 4f)] + [InlineData(6.5f, 3f, 4f)] + [InlineData(2.5f, 2f, 5f)] + [InlineData(3f, 3f, 3f)] + public void CircleCircleOverlapIsTheLens(float d, float r1, float r2) + { + var expected = NumericLens(d, r1, r2); + Assert.Equal(expected, FireControl.CircleCircleOverlap(d, r1, r2), 3); + Assert.Equal(expected, FireControl.CircleCircleOverlap(d, r2, r1), 3); + } + + [Fact] + public void CircleCircleOverlapIsExactAtTheLimits() + { + Assert.Equal(0f, FireControl.CircleCircleOverlap(7f, 3f, 4f)); // tangent + Assert.Equal(0f, FireControl.CircleCircleOverlap(8f, 3f, 4f)); // disjoint + Assert.Equal(PI * 9f, FireControl.CircleCircleOverlap(1f, 3f, 4f), 3); // contained: the smaller disc + Assert.Equal(PI * 9f, FireControl.CircleCircleOverlap(0f, 4f, 3f), 3); // concentric + Assert.Equal(PI * 9f, FireControl.CircleCircleOverlap(1f, 3f, 4f), 3); + Assert.Equal(0f, FireControl.CircleCircleOverlap(0f, 0f, 3f)); + } + + [Fact] + public void ABlastBesideAnUntargetedRockWearsIt() + { + var (s, rock) = OneRock(); + var at = At(s, rock); + var radius = 5f; + var offset = 3f; + var undamaged = s.Zone.ChunkRadius(rock); + FireControl.Detonate(s.Zone, at + float2(offset, 0), radius, 10f, DamageType.Kinetic); + + var share = (float) (10.0 * NumericLens(offset, radius, undamaged) / (Math.PI * radius * radius)); + Assert.True(share > 0f); + Assert.Equal(s.Zone.AsteroidBelts[rock.Field].DamagedSize(rock.Index, share, s.Zone.Settings), s.Zone.ChunkRadius(rock), 3); + } + + [Fact] + public void ABlastSharesItsDiscOverCellsAndRocksByArea() + { + var (s, rock) = OneRock(); + var rockAt = At(s, rock); + var rockRadius = s.Zone.ChunkRadius(rock); + var ship = SpawnShip(s, rockAt + float2(-12f, 0f)); + var radius = 6f; + var blast = rockAt + float2(-5.5f, 0f); + var damage = 1f; + var subs = new List<IDisposable>(); + var hullAbsorbs = new List<AbsorbEvent>(); + subs.Add(ship.Capabilities.Absorb.Subscribe(hullAbsorbs.Add)); + var rockAbsorbs = Absorbs(s, subs); + + FireControl.Detonate(s.Zone, blast, radius, damage, DamageType.Kinetic); + foreach (var sub in subs) sub.Dispose(); + + // The hull is a 5 x 5 block of 2-unit cells about its position; the rock a disc; the two do not overlap. + var p = ship.Position.xz; + var area = Math.PI * radius * radius; + var hullArea = NumericDiscInRect(blast.x, blast.y, radius, p.x - 5, p.x + 5, p.y - 5, p.y + 5); + var rockArea = NumericLens(length(rockAt - blast), radius, rockRadius); + Assert.True(hullArea > 0 && rockArea > 0 && hullArea + rockArea < area, "fixture: both covered, some of the disc lost"); + var hull = Assert.Single(hullAbsorbs); + var worn = Assert.Single(rockAbsorbs); + Assert.Equal(damage * hullArea / area, hull.Magnitude, 4); + Assert.Equal(damage * rockArea / area, worn.Magnitude, 4); + var lost = damage * (area - hullArea - rockArea) / area; + Assert.Equal(damage, hull.Magnitude + worn.Magnitude + lost, 4); + } + + [Fact] + public void ARockWhoseCentreIsOutsideTheBlastIsStillWorn() + { + // The widest rock (size 1, radius 9) and a small blast: the blast radius 3 plus the rock's 9 exceeds the + // 8 between them, yet the centre is far outside the blast disc. + var (s, rock) = OneRock(size: 1f); + var at = At(s, rock); + var radius = 3f; + Assert.Equal(9f, s.Zone.ChunkRadius(rock), 3); + var subs = new List<IDisposable>(); + var absorbs = Absorbs(s, subs); + FireControl.Detonate(s.Zone, at + float2(8f, 0f), radius, 10f, DamageType.Kinetic); + subs.ForEach(x => x.Dispose()); + + var worn = Assert.Single(absorbs); + Assert.Equal(10.0 * NumericLens(8, radius, 9) / (Math.PI * radius * radius), worn.Magnitude, 4); + Assert.True(s.Zone.ChunkRadius(rock) < 9f); + } + + [Fact] + public void ATangentOrDistantBlastWearsNothing() + { + var (s, rock) = OneRock(); + var at = At(s, rock); + var radius = s.Zone.ChunkRadius(rock); + var subs = new List<IDisposable>(); + var absorbs = Absorbs(s, subs); + FireControl.Detonate(s.Zone, at + float2(2f * radius, 0f), radius, 10f, DamageType.Kinetic); + FireControl.Detonate(s.Zone, at + float2(60f, 0f), 5f, 10f, DamageType.Kinetic); + subs.ForEach(x => x.Dispose()); + + Assert.Empty(absorbs); + Assert.Equal(radius, s.Zone.ChunkRadius(rock)); + } + + [Fact] + public void ABrokenRockTakesNothingAndPublishesNothing() + { + var (s, rock) = OneRock(); + var at = At(s, rock); + Assert.True(s.Zone.Wear(rock, 1e6f)); + var subs = new List<IDisposable>(); + var absorbs = Absorbs(s, subs); + FireControl.Detonate(s.Zone, at, 8f, 10f, DamageType.Kinetic); + subs.ForEach(x => x.Dispose()); + + Assert.Empty(absorbs); + Assert.False(s.Zone.ChunkExists(rock)); + Assert.Equal(0f, s.Zone.ChunkRadius(rock)); + } + + [Fact] + public void EachWornRockPublishesOneAbsorb() + { + var kind = Kind("Asteroid", 4f); + // Two rocks side by side and a third out of reach, listed out of order of their distance. + var s = BuildScene(new[] { kind }, Belt(kind, Rock(200f, 0f, .5f), Rock(300f, 0f, .5f), Rock(205f, 0f, .5f))); + var a = new ChunkId(s.Belts[0], 0); + var b = new ChunkId(s.Belts[0], 2); + var far = new ChunkId(s.Belts[0], 1); + var blast = (At(s, a) + At(s, b)) / 2f; + var radius = 8f; + var damage = 10f; + var seen = new List<(AbsorbEvent e, float aRadius, float bRadius)>(); + using var sub = s.Zone.ChunkCapabilities.Absorb.Subscribe(e => seen.Add((e, s.Zone.ChunkRadius(a), s.Zone.ChunkRadius(b)))); + var undamagedA = s.Zone.ChunkRadius(a); + var undamagedB = s.Zone.ChunkRadius(b); + + FireControl.Detonate(s.Zone, blast, radius, damage, DamageType.Kinetic); + + Assert.Equal(2, seen.Count); + Assert.All(seen, x => Assert.Equal(AbsorbLayer.Hull, x.e.Layer)); + Assert.All(seen, x => Assert.Equal(0f, x.e.Position.y)); + // Walked in index order; each absorb lands before its own rock's wear, and the first rock's wear is already + // done when the second is published. + Assert.Equal(undamagedA, seen[0].aRadius); + Assert.Equal(undamagedB, seen[0].bRadius); + Assert.True(seen[1].aRadius < undamagedA); + Assert.Equal(undamagedB, seen[1].bRadius); + Assert.Equal(damage * NumericLens(length(At(s, a) - blast), radius, undamagedA) / (Math.PI * radius * radius), seen[0].e.Magnitude, 4); + Assert.Equal(damage * NumericLens(length(At(s, b) - blast), radius, undamagedB) / (Math.PI * radius * radius), seen[1].e.Magnitude, 4); + // The direction runs from the blast out through the rock. + var away = normalize(At(s, a) - blast); + Assert.Equal(away.x, seen[0].e.Direction.x, 4); + Assert.Equal(away.y, seen[0].e.Direction.z, 4); + Assert.Equal(s.Zone.AsteroidBelts[far.Field].UndamagedSize(far.Index, s.Zone.Settings), s.Zone.ChunkRadius(far)); + } + + // The walk is fixed: (field ordinal, index), whatever order the targeting index yields. Two belts, rocks scattered + // so the index's own order is not the sorted one; the absorbs come in sorted order. + [Fact] + public void RocksAreWornInFieldThenIndexOrder() + { + var kind = Kind("Asteroid", 4f); + var s = BuildScene(new[] { kind }, + Belt(kind, Rock(200f, .7f, .5f), Rock(200f, .1f, .5f), Rock(200f, .4f, .5f)), + Belt(kind, Rock(200f, .9f, .5f), Rock(200f, .2f, .5f))); + var rocks = new[] { 0, 1, 2 }.Select(i => new ChunkId(s.Belts[0], i)).Concat(new[] { 0, 1 }.Select(i => new ChunkId(s.Belts[1], i))).ToList(); + var blast = float2.zero; + var seen = new List<AbsorbEvent>(); + using var sub = s.Zone.ChunkCapabilities.Absorb.Subscribe(seen.Add); + + FireControl.Detonate(s.Zone, blast, 400f, 1000f, DamageType.Kinetic); + + Assert.Equal(rocks.Count, seen.Count); + var expected = rocks.OrderBy(r => r.Field.Value, StringComparer.Ordinal).ThenBy(r => r.Index).ToList(); + for (var i = 0; i < expected.Count; i++) + { + var away = normalize(At(s, expected[i]) - blast); + Assert.Equal(away.x, seen[i].Direction.x, 3); + Assert.Equal(away.y, seen[i].Direction.z, 3); + } + } + + [Fact] + public void AMineBlastWearsRocks() + { + var (s, rock) = OneRock(); + var at = At(s, rock); + var undamaged = s.Zone.ChunkRadius(rock); + var absorbs = new List<AbsorbEvent>(); + using var sub = s.Zone.ChunkCapabilities.Absorb.Subscribe(absorbs.Add); + s.Zone.Lay(new Mine + { + Id = s.Zone.NextBodyId(), Body = new KinematicBody { Position = at + float2(2f, 0f), Velocity = float2.zero }, + ArmingDelay = 0f, FuseDelay = 100f, Lifetime = 0f, BlastRadius = 6f, Damage = 10f, + DamageType = DamageType.Kinetic, Layer = null, LayerFaction = null + }); + + s.Zone.Update(.001f); + + Assert.Empty(s.Zone.Mines); + Assert.Single(absorbs); + Assert.True(s.Zone.ChunkRadius(rock) < undamaged); + } +} diff --git a/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs b/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs new file mode 100644 index 000000000..351e875a2 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs @@ -0,0 +1,458 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +using System; +using System.Collections.Generic; +using System.Linq; +using CultMath; +using UniRx; +using Xunit; +using static CultMath.math; +using float2 = CultMath.float2; +using float3 = CultMath.float3; + +// Mining Cut 4b (docs/mining-cut-refresh.md, Q12 = A): a shot at a rock goes through FireControl's one fire path +// and wears it; the rock is a disc. The fixture is MiningCut3Tests' belt scene: a shooter at the origin, one rock +// straight ahead (+z, phase .25) at `Distance`, a gun and a targeting system fitted on the shooter. +public sealed class MiningCut4bTests : IDisposable +{ + private const float Distance = 100f; + private readonly MiningCut3Tests _fixtures = new MiningCut3Tests(); + + public void Dispose() => _fixtures.Dispose(); + + private sealed class Rig + { + public MiningCut3Tests.Scene Scene; + public Zone Zone => Scene.Zone; + public Ship Shooter; + public EquippedItem GunItem; + public Weapon Gun; + public ChunkId Rock; + public List<ShotOutcome> Resolved = new List<ShotOutcome>(); + } + + private static InstantWeaponData Behavior(bool launcher, float damage, float velocity, float spread, float effective = float.PositiveInfinity) + { + InstantWeaponData data = launcher ? new LockWeaponData + { + LockSpeed = MiningCut3Tests.Constant(1000), SensorImpact = MiningCut3Tests.Constant(1), LockAngle = MiningCut3Tests.Constant(180), + DirectionImpact = MiningCut3Tests.Constant(1), Decay = MiningCut3Tests.Constant(1) + } : new InstantWeaponData(); + data.Damage = MiningCut3Tests.Constant(damage); + data.Range = MiningCut3Tests.Constant(500f); + data.MinRange = MiningCut3Tests.Constant(0); + data.EffectiveRange = MiningCut3Tests.Constant(effective); + data.DamageAtMaxRange = 0f; + data.Velocity = MiningCut3Tests.Constant(velocity); + data.Spread = MiningCut3Tests.Constant(spread); + data.DamageSpread = MiningCut3Tests.Constant(0); + data.Penetration = MiningCut3Tests.Constant(0); + data.Count = MiningCut3Tests.Constant(1); + data.BurstTime = MiningCut3Tests.Constant(0); + data.Cooldown = MiningCut3Tests.Constant(1000); + return data; + } + + // `precision` 1 gives sigma 1 cell; accuracy 1 and a resolution that asks little of the info make PSensor 1. + private Rig Build(bool sensor = true, bool launcher = false, float damage = 10f, float velocity = 0f, float spread = 0f, + float precision = 1f, float effective = float.PositiveInfinity, WeaponFuse? fuse = null, float blastRadius = 0f, + float rockSize = 0f, float crossSection = 20f, bool target = true, float tracking = 1000000f) + { + var kind = MiningCut3Tests.Kind("Asteroid", crossSection); + var scene = _fixtures.BuildScene(new[] { kind }, MiningCut3Tests.Belt(kind, MiningCut3Tests.Rock(Distance, .25f, rockSize))); + var gear = MiningCut3Tests.Gear("Targeting", new TargetingSystemData + { + Accuracy = MiningCut3Tests.Constant(1f), Resolution = MiningCut3Tests.Constant(1000f), + Precision = MiningCut3Tests.Constant(precision), Tracking = MiningCut3Tests.Constant(tracking) + }); + scene.Cache.Upsert(gear); + var gun = new WeaponItemData + { + Name = "Gun", Hardpoint = HardpointType.Sensors, Shape = new Shape(), Durability = 1, + MinimumTemperature = -1000, MaximumTemperature = 1000, OptimalTemperature = 0, PlateauWidth = 2000, + Fuse = fuse, BlastRadius = blastRadius, + Behaviors = { Behavior(launcher, damage, velocity, spread, effective) } + }; + scene.Cache.Upsert(gun); + + var shape = new Shape(5, 5); + foreach (var cell in shape.AllCoordinates) shape[cell] = true; + var hull = new HullData + { + Name = "Gunship", HullType = HullType.Ship, Shape = shape, Durability = 10, Mass = 1000, + Hardpoints = { new HardpointData { Type = HardpointType.Sensors, Position = new int2(0, 0), Shape = new Shape() } } + }; + scene.Cache.Upsert(hull); + var shooter = new Ship(scene.Items, scene.Zone, MiningCut3Tests.Mint(scene, hull), new EntitySettings()); + if (sensor) Assert.True(shooter.TryEquip(MiningCut3Tests.Mint(scene, scene.Eye)), "eye"); + Assert.True(shooter.TryEquip(MiningCut3Tests.Mint(scene, gear)), "targeting"); + var minted = MiningCut3Tests.Mint(scene, gun); + Assert.True(shooter.TryEquip(minted, new int2(0, 0)), "gun"); + scene.Zone.Admit(shooter, piloted: false); + shooter.Position = float3.zero; + shooter.Direction = float2(0, 1); + shooter.Aim = float3(0, 0, 1); + + shooter.Update(.05f); // the fitted sensor becomes active on its first tick; zone time does not advance + shooter.Position = float3.zero; + shooter.Velocity = float2.zero; + var item = shooter.Equipment.Single(x => x.EquippableItem == minted); + var rig = new Rig + { + Scene = scene, Shooter = shooter, GunItem = item, Gun = (Weapon) item.Behaviors.Single(b => b is Weapon), + Rock = new ChunkId(scene.Belts[0], 0) + }; + scene.Zone.ShotResolved.Subscribe(outcome => rig.Resolved.Add(outcome)); + if (target && sensor) Assert.True(shooter.SetTarget(rig.Rock), "target"); + return rig; + } + + private static float Phi(double z) => (float) (.5 * (1 + erf((float) (z / Math.Sqrt(2))))); + + // The rock's radius in cells is the one the zone reports, sigma the targeting system's (floored at half a cell). + private static float Disc(Rig rig) + { + var sigma = max(1f / FireControl.Precision(rig.Shooter), .5f); + var radius = rig.Zone.ChunkCells(rig.Rock); + return Phi(radius / sigma) - Phi(-radius / sigma); + } + + // PSensor as the rule states it, for a gear that wants only the detection threshold plus a thousandth of the rest. + private static float Sensor(Rig rig, float info) + { + var th = rig.Scene.Items.GameplaySettings.TargetDetectionInfoThreshold; + return saturate(unlerp(th, th + (1f - th) / 1000f, info)); + } + + // ==== one fire path ==== + + // Accuracy, PSensor, PSpread, Sigma and PMount price a rock exactly as a ship at equal range, precision and info: + // a two-cell ship (span 2, centre-aimed) and a rock one cell in radius (span 2) are the same disc to the gun, and + // an unauthored gun follows anything, so the mount is 1 for both. + [Fact] + public void ARockShotUsesTheSameFactors() + { + var rig = Build(spread: 4f, precision: 1f, crossSection: 1f); + var s = rig.Scene; + Assert.Equal(1f, rig.Zone.ChunkCells(rig.Rock), 4); + var info = rig.Shooter.ChunkInfo(rig.Rock); + Assert.True(info > .11f && info < 1f, $"the rock's info {info} should be visible and unsaturated"); + + var hull = new HullData { Name = "Pair", HullType = HullType.Ship, Shape = new Shape(2, 2), Durability = 10, Mass = 1000 }; + foreach (var cell in hull.Shape.AllCoordinates) hull.Shape[cell] = true; + s.Cache.Upsert(hull); + var at = rig.Zone.ChunkPose(rig.Rock.Field, rig.Rock.Index).xy; + var ship = new Ship(s.Items, rig.Zone, MiningCut3Tests.Mint(s, hull), new EntitySettings()); + rig.Zone.Admit(ship, piloted: false); + ship.Position = float3(at.x, 0, at.y); + ship.Direction = float2(0, 1); + rig.Shooter.EntityInfoGathered[ship] = info; + rig.Shooter.VisibleEntities.Add(ship); + + var rock = FireControl.HitProbability(rig.Gun, rig.Shooter, rig.Rock); + var vessel = FireControl.HitProbability(rig.Gun, rig.Shooter, ship); + Assert.InRange(rock, .05f, .99f); + Assert.Equal(vessel, rock, 4); + } + + [Fact] + public void AnUnseenRockCannotBeFiredOn() + { + var blind = Build(sensor: false); + Assert.False(FireControl.Designated(blind.Gun, blind.Shooter, blind.Rock, out var range)); + Assert.Equal(Distance, range, 2); + Assert.Equal(0f, FireControl.HitProbability(blind.Gun, blind.Shooter, blind.Rock)); + Assert.False(FireControl.Solve(blind.Gun, blind.GunItem, blind.Shooter, blind.Rock).Designated); + + var sighted = Build(); + Assert.True(FireControl.Designated(sighted.Gun, sighted.Shooter, sighted.Rock, out _)); + Assert.True(FireControl.HitProbability(sighted.Gun, sighted.Shooter, sighted.Rock) > 0f); + } + + // Q12 = A: a launcher (a LockWeapon) is never designated on a rock, locked or not. + [Fact] + public void LaunchersCannotFireOnARock() + { + var launcher = Build(launcher: true); + Assert.False(FireControl.Designated(launcher.Gun, launcher.Shooter, launcher.Rock, out _)); + Assert.Equal(0f, FireControl.HitProbability(launcher.Gun, launcher.Shooter, launcher.Rock)); + var plain = Build(); + Assert.True(FireControl.Designated(plain.Gun, plain.Shooter, plain.Rock, out _)); + } + + // POnHull is the closed form Phi(R/sigma) - Phi(-R/sigma): a zero-spread gun with a full sensor reading is priced by the + // disc alone. + [Fact] + public void DiscMassIsTheClosedForm() + { + var rig = Build(spread: 0f, precision: 1f, rockSize: .5f); + var info = rig.Shooter.ChunkInfo(rig.Rock); + var expected = Sensor(rig, info) * Disc(rig); + Assert.InRange(Disc(rig), .5f, .99f); + Assert.Equal(expected, FireControl.HitProbability(rig.Gun, rig.Shooter, rig.Rock), 4); + } + + // Commit's price at fire time is the forecast: for a rock still at the instant it is fired at, one price. + [Fact] + public void TheForecastIsTheCommitPriceForARock() + { + var rig = Build(spread: 4f, precision: 1f, velocity: 50f); + var forecast = FireControl.HitProbability(rig.Gun, rig.Shooter, rig.Rock); + var id = FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); + Assert.True(rig.Zone.TryGetShot(id, out var shot)); + Assert.Equal(rig.Rock, shot.Chunk); + Assert.Null(shot.Target); + Assert.Equal(forecast, FireControl.CommitProbability(shot, shot.FireTime, out _), 4); + } + + // ==== resolution ==== + + private static void Run(Rig rig, float seconds) + { + for (var elapsed = 0f; elapsed < seconds; elapsed += .01f) rig.Zone.Update(.01f); + } + + // A rock hit has no lane and no shield. Hits wear the rock by the shot's Damage after the falloff, and each + // publishes one absorb on the zone's ChunkCapabilities at the rock's surface facing the shot. + [Fact] + public void DirectHitsWearTheRock() + { + var rig = Build(damage: 3f, rockSize: .5f, precision: 1000f, effective: 50f); + var absorbs = new List<AbsorbEvent>(); + var surface = new List<float>(); + rig.Zone.ChunkCapabilities.Absorb.Subscribe(e => + { + absorbs.Add(e); + var centre = rig.Zone.ChunkPose(rig.Rock.Field, rig.Rock.Index).xy; + surface.Add(length(float2(e.Position.x, e.Position.z) - centre) - rig.Zone.ChunkRadius(rig.Rock)); + }); + var before = rig.Zone.ChunkRadius(rig.Rock); + var factor = WeaponData.RangeFactor(0f, 50f, 500f, 0f, Distance); + Assert.InRange(factor, .01f, .99f); + + for (var shot = 0; shot < 12; shot++) + { + FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); + Run(rig, .02f); + } + + var hits = rig.Resolved.Count(o => o.Hit); + Assert.InRange(hits, 1, 12); + Assert.Equal(hits, absorbs.Count); + Assert.All(rig.Resolved.Where(o => o.Hit), o => { Assert.Equal(0, o.Cell.x); Assert.Equal(0, o.Cell.y); Assert.False(o.Shielded); }); + Assert.All(absorbs, e => Assert.Equal(3f * factor, e.Magnitude, 2)); + Assert.All(surface, d => Assert.True(abs(d) < 1e-3f, $"absorb was {d} off the rock's surface")); + Assert.All(absorbs, e => Assert.Equal(AbsorbLayer.Hull, e.Layer)); + var hp = MiningCut3Tests.PlanetSettings().AsteroidHitpoints.Evaluate(.5f); + var expected = MiningCut3Tests.PlanetSettings().AsteroidSize.Evaluate((hp - hits * 3f * factor) / hp * .5f); + Assert.Equal(expected, rig.Zone.ChunkRadius(rig.Rock), 3); + Assert.True(rig.Zone.ChunkRadius(rig.Rock) < before); + } + + // A contact round that hits a rock detonates at its centre as it arrives, through Detonate: a bystander beside it + // takes the blast from the rock's centre, not from the muzzle or from a lane. + [Fact] + public void AContactRoundAtARockDetonatesAtItsCentre() + { + var rig = Build(damage: 10f, fuse: WeaponFuse.Contact, blastRadius: 6f, precision: 1000f, rockSize: .5f); + var s = rig.Scene; + var at = rig.Zone.ChunkPose(rig.Rock.Field, rig.Rock.Index).xy; + var bystander = new Ship(s.Items, rig.Zone, MiningCut3Tests.Mint(s, s.Hull), new EntitySettings()); + rig.Zone.Admit(bystander, piloted: false); + bystander.Position = float3(at.x + 3f, 0, at.y); + var burstAt = new List<float>(); + bystander.Capabilities.Absorb.Subscribe(e => + { + var centre = rig.Zone.ChunkPose(rig.Rock.Field, rig.Rock.Index).xy; + burstAt.Add(length(float2(e.Position.x, e.Position.z) - centre)); + }); + + for (var shot = 0; shot < 12; shot++) + { + FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); + Run(rig, .02f); + } + + Assert.InRange(rig.Resolved.Count(o => o.Hit), 1, 12); + Assert.NotEmpty(burstAt); + Assert.All(burstAt, d => Assert.True(d < 1e-2f, $"blast was {d} from the rock's centre")); + } + + // A rock that no longer exists when its round arrives, broken in flight, resolves as a miss, like a target that + // left the zone: nothing is worn and nothing absorbs. + [Fact] + public void ARockThatBreaksMidFlightIsAMiss() + { + var rig = Build(velocity: 50f, precision: 1000f); + var absorbs = 0; + rig.Zone.ChunkCapabilities.Absorb.Subscribe(_ => absorbs++); + FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); + Assert.Empty(rig.Resolved); + + Assert.True(rig.Zone.Wear(rig.Rock, 1e6f)); + Run(rig, 2.5f); + + var outcome = Assert.Single(rig.Resolved); + Assert.Equal(ShotResult.Miss, outcome.Result); + Assert.Equal(0, absorbs); + Assert.False(rig.Zone.ChunkExists(rig.Rock)); + } + + // The shot's own dice: two zones built alike roll the same sequence of outcomes for the same shot ids. + [Fact] + public void RockDiceAreTheShotsOwn() + { + List<ShotResult> Roll() + { + var rig = Build(precision: 1f); + for (var shot = 0; shot < 20; shot++) + { + FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); + Run(rig, .02f); + } + return rig.Resolved.Select(o => o.Result).ToList(); + } + + var first = Roll(); + var second = Roll(); + Assert.Equal(20, first.Count); + Assert.Contains(ShotResult.Hit, first); + Assert.Contains(ShotResult.Miss, first); + Assert.Equal(first, second); + } + + // A rock's velocity is the pose function's derivative, derived on every read. + [Fact] + public void ARockMovesAtItsPoseVelocity() + { + var rig = Build(); + var velocity = rig.Zone.ChunkVelocity(rig.Rock); + var ahead = rig.Zone.ChunkPose(rig.Rock.Field, rig.Rock.Index, rig.Zone.Time + .5).xy; + var now = rig.Zone.ChunkPose(rig.Rock.Field, rig.Rock.Index).xy; + Assert.True(length(velocity) > 1f); + Assert.True(length(velocity * .5f - (ahead - now)) < .05f * length(ahead - now)); + } + + // A rock is not a Ship: its evasion is 0, so Tracking (the metres of deviation a shooter forgives) never + // discounts the price of a rock. The same rock priced by a tight and by a loose tracker reads one price. + [Fact] + public void ARockEvadesNothing() + { + var tight = Build(spread: 4f, precision: 1f, tracking: 10f); + var loose = Build(spread: 4f, precision: 1f, tracking: 1000000f); + var tightPrice = FireControl.HitProbability(tight.Gun, tight.Shooter, tight.Rock); + var loosePrice = FireControl.HitProbability(loose.Gun, loose.Shooter, loose.Rock); + Assert.InRange(loosePrice, .05f, .99f); + Assert.Equal(loosePrice, tightPrice, 5); + } + + // The lead is the intercept of the rock's pose velocity: the point is where the rock will be when a round of the + // gun's velocity gets there, derived here from the time of flight, not from the code under test. + [Fact] + public void AMovingRockIsLeadAtItsPoseVelocity() + { + var rig = Build(velocity: 50f); + var velocity = rig.Zone.ChunkVelocity(rig.Rock); + var now = rig.Zone.ChunkPose(rig.Rock.Field, rig.Rock.Index).xy; + Assert.True(length(velocity) > 1f); + + var point = FireControl.PredictedIntercept(rig.Gun, rig.Shooter, rig.Rock); + + var flight = length(point.xz - rig.Shooter.Position.xz) / 50f; + var there = now + velocity * flight; + Assert.True(length(point.xz - now) > .5f, "the aim leads the rock"); + Assert.Equal(there.x, point.x, 2); + Assert.Equal(there.y, point.z, 2); + } + + // A rock that breaks after its round committed a hit resolves as a miss through Step's gone rule: the frozen + // outcome says Hit, so only that rule stops the round from absorbing on, and wearing, a rock that is gone. + [Fact] + public void ARockThatBreaksAfterCommitIsAMissNotAFrozenHit() + { + var rig = Build(velocity: 50f, precision: 1000f); + var committed = new List<ShotOutcome>(); + rig.Zone.ShotCommitted.Subscribe(committed.Add); + var absorbs = 0; + rig.Zone.ChunkCapabilities.Absorb.Subscribe(_ => absorbs++); + FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); + for (var waited = 0f; committed.Count == 0 && waited < 3f; waited += .01f) rig.Zone.Update(.01f); + var frozen = Assert.Single(committed); + Assert.True(frozen.Hit, "fixture: the commit rolled a hit"); + Assert.Empty(rig.Resolved); + + Assert.True(rig.Zone.Wear(rig.Rock, 1e6f)); + Run(rig, 2.5f); + + var outcome = Assert.Single(rig.Resolved); + Assert.False(outcome.Hit); + Assert.Equal(0, absorbs); + } + + private static void Wear(Rig rig, WeaponFuse fuse, int shots, out int hits, out List<AbsorbEvent> absorbs, out float worn) + { + var seen = new List<AbsorbEvent>(); + rig.Zone.ChunkCapabilities.Absorb.Subscribe(seen.Add); + for (var shot = 0; shot < shots; shot++) + { + FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); + Run(rig, .02f); + } + hits = rig.Resolved.Count(o => o.Hit); + absorbs = seen; + worn = seen.Sum(e => e.Magnitude); + } + + // A contact round that hits a rock wears it exactly once, by the blast's share through Detonate: one absorb per hit, + // and the rock's wear is the sum of those absorbs' magnitudes, with no Damage added on top. + [Fact] + public void AContactRoundWearsARockExactlyOnce() + { + var rig = Build(damage: 10f, fuse: WeaponFuse.Contact, blastRadius: 6f, precision: 1000f, rockSize: .5f); + Wear(rig, WeaponFuse.Contact, 12, out var hits, out var absorbs, out var worn); + + Assert.InRange(hits, 1, 12); + Assert.Equal(hits, absorbs.Count); + var belt = rig.Zone.AsteroidBelts[rig.Rock.Field]; + Assert.True(rig.Zone.ChunkExists(rig.Rock)); + Assert.Equal(belt.DamagedSize(rig.Rock.Index, worn, rig.Zone.Settings), rig.Zone.ChunkRadius(rig.Rock), 3); + } + + // The same for a proximity round, which detonates at its burst point hit or miss: one absorb per resolved round + // that covers the rock, and no wear beyond them. + [Fact] + public void AProximityRoundWearsARockExactlyOnce() + { + var rig = Build(damage: 10f, fuse: WeaponFuse.Proximity, blastRadius: 6f, precision: 1000f, rockSize: .5f); + Wear(rig, WeaponFuse.Proximity, 12, out _, out var absorbs, out var worn); + + Assert.Equal(12, rig.Resolved.Count); + Assert.NotEmpty(absorbs); + var belt = rig.Zone.AsteroidBelts[rig.Rock.Field]; + Assert.True(rig.Zone.ChunkExists(rig.Rock)); + Assert.Equal(belt.DamagedSize(rig.Rock.Index, worn, rig.Zone.Settings), rig.Zone.ChunkRadius(rig.Rock), 3); + } + + // A rock's absorb has one height rule whoever reports it: a direct hit and a blast both publish at height 0, not at + // the shooter's. + [Fact] + public void ARockAbsorbHasOneHeightRule() + { + var rig = Build(damage: 3f, rockSize: .5f, precision: 1000f); + rig.Shooter.Position = float3(0, 7, 0); + var heights = new List<float>(); + rig.Zone.ChunkCapabilities.Absorb.Subscribe(e => heights.Add(e.Position.y)); + for (var shot = 0; shot < 6; shot++) + { + FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); + Run(rig, .02f); + } + var direct = heights.Count; + FireControl.Detonate(rig.Zone, rig.Zone.ChunkPose(rig.Rock.Field, rig.Rock.Index).xy, 5f, 3f, DamageType.Kinetic); + + Assert.True(direct > 0 && heights.Count > direct); + Assert.All(heights, h => Assert.Equal(0f, h)); + } +} From 3ccb9801854d1610c17ff997f25fc84c68bb1e47 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 23:01:04 +0000 Subject: [PATCH 066/108] Ore sheet: DemoOre batch and tests for the Asteroid ore yields, holdability and prices Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- GameData/Aetheria.cc | 4 +- .../DemoOreSheetTests.cs | 92 +++++++++++++++++++ tools/AetherDb/Economy/DemoOre.cs | 44 +++++++++ 3 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/DemoOreSheetTests.cs create mode 100644 tools/AetherDb/Economy/DemoOre.cs diff --git a/GameData/Aetheria.cc b/GameData/Aetheria.cc index f4cfdc4a3..ef463cde8 100644 --- a/GameData/Aetheria.cc +++ b/GameData/Aetheria.cc @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9edc8434524f43f751c89416479cf07fba03b424f266cb8bfc1870bd46eef6a7 -size 220537 +oid sha256:62a6678e741e296449b6ac8cd8698e071a873ea39bc9c0303abe68887310dceb +size 220731 diff --git a/tests/Aetheria.Shared.Tests/DemoOreSheetTests.cs b/tests/Aetheria.Shared.Tests/DemoOreSheetTests.cs new file mode 100644 index 000000000..24ef521eb --- /dev/null +++ b/tests/Aetheria.Shared.Tests/DemoOreSheetTests.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using CultMath; +using GameCult.Caching; +using Xunit; + +// The interim ore sheet (rulings mining-demo-ore-minimal-yields-now, mining-demo-ore-prices-gear-scale): what the shipped catalog's +// Asteroid belt holds can be carried and sold, so mine, sell, repair closes on the existing stations. +public sealed class DemoOreSheetTests : IDisposable +{ + private static readonly string[] Ores = { "Rock", "New Metals", "Gold" }; + private readonly string _root = Path.Combine(Path.GetTempPath(), "aetheria-demoore-" + Guid.NewGuid().ToString("N")); + + public DemoOreSheetTests() => Directory.CreateDirectory(_root); + public void Dispose() => Directory.Delete(_root, true); + + private CultCache Shipped() + { + var path = Path.Combine(_root, "Aetheria.cc"); + File.Copy(TestCatalog.Repo, path, true); + return AetheriaStores.Open(path, catalogWritable: true, registry: TestCatalog.Registry()); + } + + private static CultRecordRef<FieldKindData> Asteroid(CultCache cache) => + cache.RefOf(cache.GetAll<FieldKindData>().Single(k => k.Name == "Asteroid")); + + [Fact] + public void AsteroidYieldsThreeOresInKeyOrder() + { + using var cache = Shipped(); + var yield = FieldKinds.Yield(Asteroid(cache), default, cache); + var amounts = yield.ToDictionary(y => cache.Get(y.Commodity).Name, y => y.Amount); + Assert.Equal(Ores.OrderBy(n => n).ToArray(), amounts.Keys.OrderBy(n => n).ToArray()); + Assert.Equal(6f, amounts["Rock"]); + Assert.Equal(3f, amounts["New Metals"]); + Assert.Equal(1f, amounts["Gold"]); + Assert.Equal(yield.Select(y => y.Commodity.Key.Value).OrderBy(k => k, StringComparer.Ordinal), yield.Select(y => y.Commodity.Key.Value)); + } + + [Fact] + public void EveryYieldedOreCanBeHeldAndSold() + { + using var cache = Shipped(); + var shape = new Shape(5, 5); + foreach (var cell in shape.AllCoordinates) shape[cell] = true; + var bay = new Shape(4, 4); + foreach (var cell in bay.AllCoordinates) bay[cell] = true; + cache.Upsert(new VerseGrammar { Revision = 1 }); + cache.Upsert(new HullData { Name = "OreSkiff", HullType = HullType.Ship, Shape = shape, Price = 1000, Durability = 10, Armor = 10 }); + cache.Upsert(new CargoBayData { Name = "OreBay", Shape = new Shape(), InteriorShape = bay, Price = 20, Durability = 4 }); + cache.FlushAsync().GetAwaiter().GetResult(); + var items = new ItemManager(1u, cache, new ProvenanceLedger(), AuthoredSettings.Load(RestoredHullsTests.FindRepoRoot()).Read<GameplaySettings>("GameplaySettings"), _ => { }); + var zone = new Zone(items, new PlanetSettings(), new ZonePack(), new GalaxyZone { Name = "Test Zone", Owner = null }, null); + EquippableItem Mint(string design) + { + var data = cache.GetByName<EquippableItemData>(design); + return new EquippableItem + { + Data = cache.RefOf<ItemData>(data), Durability = data.Durability, + Lot = items.Lots.Add(new Lot { Design = cache.RefOf<ItemData>(data), Origin = new Attributed(), Quality = .5f, Roles = new List<RoleFill>() }) + }; + } + var ship = new Ship(items, zone, Mint("OreSkiff"), new EntitySettings()); + Assert.True(ship.TryEquip(Mint("OreBay"), new int2(1, 1))); + + foreach (var (commodity, _) in FieldKinds.Yield(Asteroid(cache), default, cache)) + { + var data = cache.Get(commodity); + Assert.NotNull(data.Shape); + Assert.True(data.Price > 0, data.Name); + Assert.True(data.Mass > 0, data.Name); + Assert.True(ship.CargoBays.Single().TryStore(new SimpleCommodity { Data = cache.RefOf<ItemData>(data), Quantity = 1 }), data.Name); + } + } + + [Fact] + public void TheSheetConverges() + { + var path = Path.Combine(_root, "Converge.cc"); + File.Copy(Path.Combine(RestoredHullsTests.FindRepoRoot(), "GameData", "Aetheria.cc"), path); + var before = File.ReadAllBytes(path); + var output = new StringWriter(); + Assert.Equal(0, EconomyCommand.Author(path, new List<EconomyBatch> { new DemoOre() }, true, output, TestCatalog.Registry(), _root)); + Assert.Equal(before, File.ReadAllBytes(path)); + + using var cache = AetheriaStores.Open(path, registry: TestCatalog.Registry()); + var ids = cache.GetAll<FieldKindData>().Single(k => k.Name == "Asteroid").Yields.Select(y => y.Id).ToArray(); + Assert.Equal(new[] { "a57e0c000001", "a57e0c000002", "a57e0c000003" }, ids); + } +} diff --git a/tools/AetherDb/Economy/DemoOre.cs b/tools/AetherDb/Economy/DemoOre.cs new file mode 100644 index 000000000..df2a2aff2 --- /dev/null +++ b/tools/AetherDb/Economy/DemoOre.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using GameCult.Caching; + +// Interim ore sheet (ruling mining-demo-ore-minimal-yields-now): the Asteroid field kind yields Rock, New Metals and Gold, and those +// three can be held (a 1x1 shape, a mass) and are sold (a price). The economy ores batch may rewrite the yields by element id. +// Prices are ruling mining-demo-ore-prices-gear-scale, gear-scale so the mine, sell, repair loop closes: a retune is an edit here and a rerun. +// Munitions and MunitionsFeed never rewrite these three commodities, so rerunning them does not clobber this sheet. +public sealed class DemoOre : EconomyBatch +{ + private const int RockPrice = 200; + private const int NewMetalsPrice = 1000; + private const int GoldPrice = 5000; + + // Authored element ids (the cache takes a hand-written id only as 12 lowercase hex): asteroid-rock, asteroid-new-metals, asteroid-gold. + private const string RockId = "a57e0c000001"; + private const string NewMetalsId = "a57e0c000002"; + private const string GoldId = "a57e0c000003"; + + public override void Author(EconomyAuthor author) + { + author.Edit<SimpleCommodityData>("Rock", o => { o.Shape = new Shape(); o.Price = RockPrice; }); + author.Edit<SimpleCommodityData>("New Metals", o => { o.Shape = new Shape(); o.Price = NewMetalsPrice; o.Mass = 2; }); + author.Edit<SimpleCommodityData>("Gold", o => { o.Shape = new Shape(); o.Price = GoldPrice; }); + + var kinds = author.Catalog.GetAll<FieldKindData>().Where(k => k.Name == "Asteroid").ToArray(); + if (kinds.Length != 1) throw new InvalidOperationException($"{kinds.Length} field kinds are named 'Asteroid'; the ore sheet needs exactly one."); + var asteroid = kinds[0]; + asteroid.Yields = new List<FieldYield> + { + Yield(author, "Rock", 6, RockId), + Yield(author, "New Metals", 3, NewMetalsId), + Yield(author, "Gold", 1, GoldId) + }; + author.Put(asteroid, author.Catalog.RefOf(asteroid).Key); + } + + private static FieldYield Yield(EconomyAuthor author, string name, float abundance, string id) + { + var item = author.Catalog.GetAll<SimpleCommodityData>().Single(i => i.Name == name); + return new FieldYield { Commodity = new CultRecordRef<SimpleCommodityData>(author.Catalog.RefOf(item).Key), Abundance = abundance, Regional = false, Id = id }; + } +} From f5eeb2e21481db42c78f6762907e4363e9b5a8ac Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 23:00:16 +0000 Subject: [PATCH 067/108] Zone.Wear returns the damage the rock absorbed; a break is ChunkExists Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Zone.cs | 15 ++--- tests/Aetheria.Shared.Tests/DrawnPoseTests.cs | 2 +- .../Aetheria.Shared.Tests/MiningCut2Tests.cs | 62 +++++++++++-------- .../Aetheria.Shared.Tests/MiningCut3Tests.cs | 10 +-- .../Aetheria.Shared.Tests/MiningCut4aTests.cs | 2 +- .../Aetheria.Shared.Tests/MiningCut4bTests.cs | 4 +- .../Aetheria.Shared.Tests/MiningIndexTests.cs | 2 +- 7 files changed, 55 insertions(+), 42 deletions(-) diff --git a/Assets/Scripts/ServerShared/Zone.cs b/Assets/Scripts/ServerShared/Zone.cs index d0c5b5330..7cbde82ef 100644 --- a/Assets/Scripts/ServerShared/Zone.cs +++ b/Assets/Scripts/ServerShared/Zone.cs @@ -685,16 +685,17 @@ public class Zone return size.Exponent > 0 ? max(abs(size.Minimum), abs(size.Maximum)) : float.PositiveInfinity; } - // Cut 2: the only writer of chunk wear. Returns whether this hit broke the chunk. The break threshold is + // Cut 2: the only writer of chunk wear. Returns the damage the rock absorbed: the damage, or the hitpoints it had + // left when the hit broke it; 0 on a chunk that is already broken. Whether it broke is ChunkExists. The break threshold is // strictly greater-than, matching the deleted per-tick miner's own comparison against accumulated damage: // damage exactly equal to hitpoints does not yet break the chunk, only damage that exceeds them does. - // A chunk that is currently broken (zone time < BrokenUntil) absorbs nothing: this hit did not break it - // (it was already broken), and its wear stays zeroed until it respawns and starts fresh. - public bool Wear(ChunkId chunk, float damage) + // A chunk that is currently broken (zone time < BrokenUntil) absorbs nothing, and its wear stays zeroed until it + // respawns and starts fresh. + public float Wear(ChunkId chunk, float damage) { _wear.TryGetValue(chunk, out var wear); if (wear.BrokenUntil.HasValue && wear.BrokenUntil.Value > _time) - return false; + return 0f; var beltData = (AsteroidBeltData) Planets[chunk.Field]; var size = beltData.Asteroids[chunk.Index].Size; @@ -706,11 +707,11 @@ public class Zone { var respawnTime = Settings.AsteroidRespawnTime.Evaluate(size); _wear[chunk] = new ChunkWear { Damage = 0f, BrokenUntil = _time + respawnTime }; - return true; + return max(hitpoints - wear.Damage, 0f); } _wear[chunk] = new ChunkWear { Damage = newDamage, BrokenUntil = null }; - return false; + return damage; } // Cut 1 (docs/mining-cut.md): a chunk's pose is a pure function of zone time, computed when asked. No stored diff --git a/tests/Aetheria.Shared.Tests/DrawnPoseTests.cs b/tests/Aetheria.Shared.Tests/DrawnPoseTests.cs index 37111b114..e7254fac6 100644 --- a/tests/Aetheria.Shared.Tests/DrawnPoseTests.cs +++ b/tests/Aetheria.Shared.Tests/DrawnPoseTests.cs @@ -542,7 +542,7 @@ public sealed class DrawnPoseTests : IDisposable var chunk = new ChunkId(w.Belt, 5); var hitpoints = w.Zone.Settings.AsteroidHitpoints.Evaluate(w.Asteroids[5].Size); var unworn = w.Zone.ChunkRadius(chunk); - Assert.False(w.Zone.Wear(chunk, hitpoints * .9f)); + Assert.False(w.Zone.Breaks(chunk, hitpoints * .9f)); Assert.True(w.Zone.ChunkRadius(chunk) < unworn * .5f, "the rock has shrunk to less than half its size"); Assert.Equal(before, Meshes()); } diff --git a/tests/Aetheria.Shared.Tests/MiningCut2Tests.cs b/tests/Aetheria.Shared.Tests/MiningCut2Tests.cs index 54fc99972..7716e3c9a 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut2Tests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut2Tests.cs @@ -134,9 +134,9 @@ public sealed class MiningCut2Tests : IDisposable var hp = f.Settings.AsteroidHitpoints.Evaluate(f.AsteroidsA[index].Size); // Several partial hits under the threshold: still there, still shrinking. - Assert.False(f.Zone.Wear(chunk, hp * 0.3f)); + Assert.False(f.Zone.Breaks(chunk, hp * 0.3f)); Assert.True(f.Zone.ChunkExists(chunk)); - Assert.False(f.Zone.Wear(chunk, hp * 0.3f)); + Assert.False(f.Zone.Breaks(chunk, hp * 0.3f)); Assert.True(f.Zone.ChunkExists(chunk)); var before = f.Zone.ChunkRadius(chunk); @@ -147,11 +147,11 @@ public sealed class MiningCut2Tests : IDisposable // break condition as strictly greater-than, not greater-or-equal (today's behaviour, kept deliberately // -- see Zone.Wear's own comment). Equal-to-hitpoints must not break the chunk. var remaining = hp - hp * 0.6f; - Assert.False(f.Zone.Wear(chunk, remaining)); + Assert.False(f.Zone.Breaks(chunk, remaining)); Assert.True(f.Zone.ChunkExists(chunk), "damage exactly equal to hitpoints must not break the chunk"); // One more point of damage tips it over. - Assert.True(f.Zone.Wear(chunk, 0.01f)); + Assert.True(f.Zone.Breaks(chunk, 0.01f)); Assert.False(f.Zone.ChunkExists(chunk)); Assert.Equal(0f, f.Zone.ChunkRadius(chunk)); } @@ -165,7 +165,7 @@ public sealed class MiningCut2Tests : IDisposable var hp = f.Settings.AsteroidHitpoints.Evaluate(f.AsteroidsA[index].Size); var respawn = f.Settings.AsteroidRespawnTime.Evaluate(f.AsteroidsA[index].Size); - Assert.True(f.Zone.Wear(chunk, hp + 1f)); + Assert.True(f.Zone.Breaks(chunk, hp + 1f)); Assert.False(f.Zone.ChunkExists(chunk)); // Uneven steps that sum to just under the authored respawn time: still broken. @@ -188,13 +188,13 @@ public sealed class MiningCut2Tests : IDisposable var hp = f.Settings.AsteroidHitpoints.Evaluate(f.AsteroidsB[index].Size); var respawn = f.Settings.AsteroidRespawnTime.Evaluate(f.AsteroidsB[index].Size); - Assert.True(f.Zone.Wear(chunk, hp * 1.5f)); + Assert.True(f.Zone.Breaks(chunk, hp * 1.5f)); f.Zone.Update(respawn + 1f); Assert.True(f.Zone.ChunkExists(chunk)); // A hit well under hitpoints, on the freshly respawned chunk, must not break it -- if the old damage // (or the old broken state) leaked through, this hit alone would already be over any stale threshold. - Assert.False(f.Zone.Wear(chunk, hp * 0.4f)); + Assert.False(f.Zone.Breaks(chunk, hp * 0.4f)); Assert.True(f.Zone.ChunkExists(chunk)); var radius = f.Zone.ChunkRadius(chunk); Assert.True(radius > 0f && radius < f.Zone.AsteroidBelts[f.BeltB].UndamagedSize(index, f.Settings)); @@ -211,7 +211,7 @@ public sealed class MiningCut2Tests : IDisposable var chunkA1 = new ChunkId(f.BeltA, 1); var hpA0 = f.Settings.AsteroidHitpoints.Evaluate(f.AsteroidsA[0].Size); - Assert.True(f.Zone.Wear(chunkA0, hpA0 + 1f)); + Assert.True(f.Zone.Breaks(chunkA0, hpA0 + 1f)); Assert.False(f.Zone.ChunkExists(chunkA0)); Assert.True(f.Zone.ChunkExists(chunkB0), "a different field at the same index must be unaffected"); @@ -230,8 +230,8 @@ public sealed class MiningCut2Tests : IDisposable var hpDamaged = f.Settings.AsteroidHitpoints.Evaluate(f.AsteroidsA[4].Size); var hpBroken = f.Settings.AsteroidHitpoints.Evaluate(f.AsteroidsB[3].Size); - Assert.False(f.Zone.Wear(damaged, hpDamaged * 0.45f)); - Assert.True(f.Zone.Wear(broken, hpBroken + 5f)); + Assert.False(f.Zone.Breaks(damaged, hpDamaged * 0.45f)); + Assert.True(f.Zone.Breaks(broken, hpBroken + 5f)); f.Zone.Update(1.3f); var damagedRadiusBefore = f.Zone.ChunkRadius(damaged); @@ -255,7 +255,7 @@ public sealed class MiningCut2Tests : IDisposable var hp = f.Settings.AsteroidHitpoints.Evaluate(f.AsteroidsA[6].Size); var respawn = f.Settings.AsteroidRespawnTime.Evaluate(f.AsteroidsA[6].Size); - Assert.True(f.Zone.Wear(chunk, hp + 1f)); + Assert.True(f.Zone.Breaks(chunk, hp + 1f)); f.Zone.Update(respawn + 2f); Assert.True(f.Zone.ChunkExists(chunk), "sanity: this chunk must have respawned before packing"); @@ -333,20 +333,20 @@ public sealed class MiningCut2Tests : IDisposable var hp = f.Settings.AsteroidHitpoints.Evaluate(f.AsteroidsA[index].Size); var respawn = f.Settings.AsteroidRespawnTime.Evaluate(f.AsteroidsA[index].Size); - Assert.True(f.Zone.Wear(chunk, hp + 1f)); + Assert.True(f.Zone.Breaks(chunk, hp + 1f)); Assert.False(f.Zone.ChunkExists(chunk)); // A hit well under hitpoints, inside the respawn window: must not break it (it is already broken) and // must not touch BrokenUntil. f.Zone.Update(respawn * 0.2f); - Assert.False(f.Zone.Wear(chunk, hp * 0.1f), "a hit on an already-broken chunk did not break it"); + Assert.False(f.Zone.Breaks(chunk, hp * 0.1f), "a hit on an already-broken chunk did not break it"); Assert.False(f.Zone.ChunkExists(chunk), "must still be absent -- the old bug un-broke it here"); Assert.Equal(0f, f.Zone.ChunkRadius(chunk)); // A second hit, this one alone well over hitpoints, inside the same window: still must not break it // (it is already broken) and must not push BrokenUntil further out. f.Zone.Update(respawn * 0.3f); - Assert.False(f.Zone.Wear(chunk, hp + 50f), "a hit on an already-broken chunk did not break it, even when large"); + Assert.False(f.Zone.Breaks(chunk, hp + 50f), "a hit on an already-broken chunk did not break it, even when large"); Assert.False(f.Zone.ChunkExists(chunk)); // Just under the original respawn time (measured from the original break, not from either re-hit): @@ -360,9 +360,9 @@ public sealed class MiningCut2Tests : IDisposable Assert.Equal(f.Zone.AsteroidBelts[f.BeltA].UndamagedSize(index, f.Settings), f.Zone.ChunkRadius(chunk), 4); // Worn again from fresh: breaks on the normal threshold, not one warped by the earlier no-op hits. - Assert.False(f.Zone.Wear(chunk, hp * 0.9f)); + Assert.False(f.Zone.Breaks(chunk, hp * 0.9f)); Assert.True(f.Zone.ChunkExists(chunk)); - Assert.True(f.Zone.Wear(chunk, hp * 0.2f)); + Assert.True(f.Zone.Breaks(chunk, hp * 0.2f)); Assert.False(f.Zone.ChunkExists(chunk)); } @@ -377,9 +377,9 @@ public sealed class MiningCut2Tests : IDisposable var hp = f.Settings.AsteroidHitpoints.Evaluate(f.AsteroidsB[idx].Size); var respawn = f.Settings.AsteroidRespawnTime.Evaluate(f.AsteroidsB[idx].Size); - Assert.True(f.Zone.Wear(chunk, hp + 1f)); + Assert.True(f.Zone.Breaks(chunk, hp + 1f)); f.Zone.Update(respawn * 0.4f); - Assert.False(f.Zone.Wear(chunk, hp * 0.5f), "re-hit inside the window did not break an already-broken chunk"); + Assert.False(f.Zone.Breaks(chunk, hp * 0.5f), "re-hit inside the window did not break an already-broken chunk"); var pack = f.Zone.PackZone(); var reloaded = new Zone(f.Items, f.Settings, pack, new GalaxyZone { Name = "MiningCut2ReHitReload", Owner = null }, null); @@ -424,7 +424,7 @@ public sealed class MiningCut2Tests : IDisposable var hp = f.Settings.AsteroidHitpoints.Evaluate(f.AsteroidsA[index].Size); var respawn = f.Settings.AsteroidRespawnTime.Evaluate(f.AsteroidsA[index].Size); - Assert.True(f.Zone.Wear(chunk, hp + 1f)); + Assert.True(f.Zone.Breaks(chunk, hp + 1f)); f.Zone.Update(respawn); // zone time now equals BrokenUntil exactly, not "respawn plus a margin". Assert.True(f.Zone.ChunkExists(chunk), "must read as respawned the instant zone time reaches BrokenUntil, not strictly after it"); @@ -458,11 +458,11 @@ public sealed class MiningCut2Tests : IDisposable var hp = f.Settings.AsteroidHitpoints.Evaluate(f.AsteroidsA[index].Size); var respawn = f.Settings.AsteroidRespawnTime.Evaluate(f.AsteroidsA[index].Size); - Assert.True(f.Zone.Wear(chunk, hp + 1f)); + Assert.True(f.Zone.Breaks(chunk, hp + 1f)); f.Zone.Update(respawn); Assert.True(f.Zone.ChunkExists(chunk)); - Assert.True(f.Zone.Wear(chunk, hp + 1f), "a hit on the instant of respawn breaks the respawned chunk again"); + Assert.True(f.Zone.Breaks(chunk, hp + 1f), "a hit on the instant of respawn breaks the respawned chunk again"); Assert.False(f.Zone.ChunkExists(chunk)); } @@ -477,9 +477,9 @@ public sealed class MiningCut2Tests : IDisposable var hp = f.Settings.AsteroidHitpoints.Evaluate(f.AsteroidsA[index].Size); var respawn = f.Settings.AsteroidRespawnTime.Evaluate(f.AsteroidsA[index].Size); - Assert.True(f.Zone.Wear(chunk, hp + 1f)); + Assert.True(f.Zone.Breaks(chunk, hp + 1f)); f.Zone.Update(respawn + 1f); - Assert.False(f.Zone.Wear(chunk, hp * 0.3f)); + Assert.False(f.Zone.Breaks(chunk, hp * 0.3f)); var packed = f.Zone.PackZone().ChunkWear.Find(w => w.Field.Equals(chunk.Field) && w.Index == index); Assert.NotNull(packed); @@ -501,12 +501,12 @@ public sealed class MiningCut2Tests : IDisposable var undamaged = f.Zone.ChunkPose(f.BeltA, index).w; Assert.Equal(f.Zone.AsteroidBelts[f.BeltA].UndamagedSize(index, f.Settings), undamaged, 4); - Assert.False(f.Zone.Wear(chunk, hp * 0.6f)); + Assert.False(f.Zone.Breaks(chunk, hp * 0.6f)); var worn = f.Zone.ChunkPose(f.BeltA, index).w; Assert.Equal(f.Zone.ChunkRadius(chunk), worn, 4); Assert.True(worn < undamaged, "a worn chunk is smaller than an untouched one"); - Assert.True(f.Zone.Wear(chunk, hp)); + Assert.True(f.Zone.Breaks(chunk, hp)); Assert.Equal(0f, f.Zone.ChunkPose(f.BeltA, index).w); } } @@ -520,3 +520,15 @@ internal static class MiningCut2TestExtensions return list; } } + +internal static class ChunkWearTestExtensions +{ + // Wears the chunk and reports whether that hit broke it: Zone.Wear returns the damage absorbed, and a break is + // ChunkExists going from true to false. + public static bool Breaks(this Zone zone, ChunkId chunk, float damage) + { + var there = zone.ChunkExists(chunk); + zone.Wear(chunk, damage); + return there && !zone.ChunkExists(chunk); + } +} diff --git a/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs b/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs index 76a67472a..d020b068e 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs @@ -416,7 +416,7 @@ public sealed partial class MiningCut3Tests : IDisposable var whole = s.Zone.ChunkVisibility(chunk); var hitpoints = PlanetSettings().AsteroidHitpoints.Evaluate(.5f); - Assert.False(s.Zone.Wear(chunk, hitpoints * .5f)); + Assert.False(s.Zone.Breaks(chunk, hitpoints * .5f)); var worn = s.Zone.ChunkVisibility(chunk); Assert.InRange(worn, whole * .05f, whole * .95f); Assert.Equal(ExpectedVisibility(s, chunk, kind), worn, 4); @@ -433,7 +433,7 @@ public sealed partial class MiningCut3Tests : IDisposable Tick((observer, eyeAt)); Assert.True(observer.ChunkVisible(chunk)); - Assert.True(s.Zone.Wear(chunk, PlanetSettings().AsteroidHitpoints.Evaluate(.5f) * 2f)); + Assert.True(s.Zone.Breaks(chunk, PlanetSettings().AsteroidHitpoints.Evaluate(.5f) * 2f)); Assert.Equal(0f, s.Zone.ChunkVisibility(chunk)); Assert.Equal(0f, observer.ChunkInfo(chunk)); Assert.False(observer.SetTarget(chunk)); @@ -487,7 +487,7 @@ public sealed partial class MiningCut3Tests : IDisposable var centre = float2(400, -250); // off the origin, so a query that ignored the belt centre would disagree var s = BuildSceneAt(centre, new[] { kind }, Belt(kind, rocks)); var belt = s.Belts[0]; - Assert.True(s.Zone.Wear(new ChunkId(belt, 5), 1e6f)); // broken + Assert.True(s.Zone.Breaks(new ChunkId(belt, 5), 1e6f)); // broken var found = new List<ChunkId>(); var sawSome = false; @@ -555,7 +555,7 @@ public sealed partial class MiningCut3Tests : IDisposable Assert.True(watcher.SetTarget(second)); Tick((watcher, eyeAt)); Assert.False(watcher.Target.Value.IsNone); - Assert.True(s.Zone.Wear(second, 1e6f)); + Assert.True(s.Zone.Breaks(second, 1e6f)); Tick((watcher, eyeAt)); Assert.True(watcher.Target.Value.IsNone); @@ -565,7 +565,7 @@ public sealed partial class MiningCut3Tests : IDisposable var third = new ChunkId(s.Belts[0], 2); Assert.True(docked.SetTarget(third)); docked.Deactivate(); - Assert.True(s.Zone.Wear(third, 1e6f)); + Assert.True(s.Zone.Breaks(third, 1e6f)); docked.Activate(); Assert.True(docked.Target.Value.IsNone); } diff --git a/tests/Aetheria.Shared.Tests/MiningCut4aTests.cs b/tests/Aetheria.Shared.Tests/MiningCut4aTests.cs index 7d43c86d3..49fc75886 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut4aTests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut4aTests.cs @@ -181,7 +181,7 @@ public sealed partial class MiningCut3Tests { var (s, rock) = OneRock(); var at = At(s, rock); - Assert.True(s.Zone.Wear(rock, 1e6f)); + Assert.True(s.Zone.Breaks(rock, 1e6f)); var subs = new List<IDisposable>(); var absorbs = Absorbs(s, subs); FireControl.Detonate(s.Zone, at, 8f, 10f, DamageType.Kinetic); diff --git a/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs b/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs index 351e875a2..6b263652a 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs @@ -291,7 +291,7 @@ public sealed class MiningCut4bTests : IDisposable FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); Assert.Empty(rig.Resolved); - Assert.True(rig.Zone.Wear(rig.Rock, 1e6f)); + Assert.True(rig.Zone.Breaks(rig.Rock, 1e6f)); Run(rig, 2.5f); var outcome = Assert.Single(rig.Resolved); @@ -383,7 +383,7 @@ public sealed class MiningCut4bTests : IDisposable Assert.True(frozen.Hit, "fixture: the commit rolled a hit"); Assert.Empty(rig.Resolved); - Assert.True(rig.Zone.Wear(rig.Rock, 1e6f)); + Assert.True(rig.Zone.Breaks(rig.Rock, 1e6f)); Run(rig, 2.5f); var outcome = Assert.Single(rig.Resolved); diff --git a/tests/Aetheria.Shared.Tests/MiningIndexTests.cs b/tests/Aetheria.Shared.Tests/MiningIndexTests.cs index e47f9a4a1..a90f8343b 100644 --- a/tests/Aetheria.Shared.Tests/MiningIndexTests.cs +++ b/tests/Aetheria.Shared.Tests/MiningIndexTests.cs @@ -70,7 +70,7 @@ public sealed partial class MiningCut3Tests var centre = float2(-300, 820); var s = BuildSceneAt(centre, 5000f, 1234.5, null, new[] { kind }, Belt(kind, Annulus(rng, 3000, 200f, 900f)), Belt(kind, Annulus(rng, 700, 1000f, 1060f))); - for (var i = 0; i < 40; i++) Assert.True(s.Zone.Wear(new ChunkId(s.Belts[0], i * 73), 1e6f)); + for (var i = 0; i < 40; i++) Assert.True(s.Zone.Breaks(new ChunkId(s.Belts[0], i * 73), 1e6f)); var found = new List<ChunkId>(); var nonEmpty = 0; From 8a31099d991b4971467599059012c0e568db25d9 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Thu, 12 Nov 2026 23:05:07 +0000 Subject: [PATCH 068/108] Mining 5a: a worn rock pays the shooter in ore at the wear site from the shot's dice; overflow floats Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Resources/Settings.asset | 4 +- Assets/Scripts/ServerShared/FireControl.cs | 76 +++++- Assets/Scripts/ServerShared/Settings.cs | 5 + Assets/Scripts/ServerShared/SimulationDice.cs | 3 + .../Aetheria.Shared.Tests/MiningCut3Tests.cs | 2 + .../Aetheria.Shared.Tests/MiningCut4bTests.cs | 10 +- .../Aetheria.Shared.Tests/MiningCut5aTests.cs | 245 ++++++++++++++++++ 7 files changed, 332 insertions(+), 13 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/MiningCut5aTests.cs diff --git a/Assets/Resources/Settings.asset b/Assets/Resources/Settings.asset index 46bee7272..c12d32c99 100644 --- a/Assets/Resources/Settings.asset +++ b/Assets/Resources/Settings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7f09c54dfdb87dffd76fa92365d62c53ce333457b89ccf8ead09093ffffedc42 -size 12525 +oid sha256:711ded55b95c512e3803df7682e44f0a9bb83ad36a384432781dc12dc5dadf0a +size 12630 diff --git a/Assets/Scripts/ServerShared/FireControl.cs b/Assets/Scripts/ServerShared/FireControl.cs index 6cd860ab3..3df60cf50 100644 --- a/Assets/Scripts/ServerShared/FireControl.cs +++ b/Assets/Scripts/ServerShared/FireControl.cs @@ -7,6 +7,7 @@ using System.Buffers; using System.Collections.Generic; using System.Linq; using CultMath; +using GameCult.Caching; using static CultMath.math; using float2 = CultMath.float2; using float3 = CultMath.float3; @@ -1234,7 +1235,7 @@ public static class FireControl // Detonate is still the one blast path. if (shot.Outcome.Result == ShotResult.Burst || shot.Fuse == WeaponFuse.Proximity) { - Detonate(zone, shot.Outcome.BurstPoint, shot.BlastRadius, shot.Damage, shot.DamageType); + Detonate(zone, shot.Outcome.BurstPoint, shot.BlastRadius, shot.Damage, shot.DamageType, shot); return; } @@ -1270,11 +1271,12 @@ public static class FireControl var direction = float3(shot.TravelDirection.x, 0, shot.TravelDirection.y); var surface = centre - shot.TravelDirection * zone.ChunkRadius(rock); Publish(zone.ChunkCapabilities, AbsorbLayer.Hull, float3(surface.x, 0f, surface.y), direction, shot.Damage, shot.DamageType); - zone.Wear(rock, shot.Damage); + var absorbed = zone.Wear(rock, shot.Damage); + Extract(zone, rock, absorbed, shot.Source, SimulationDice.For(zone.DropSeed, SimulationDice.OreStream, (uint) shot.ShotId)); return; } var point = Armed(shot.FireOrigin, shot.TravelDirection, shot.BlastRadius, float3(centre.x, shot.FireOrigin.y, centre.y)).xz; - Detonate(zone, point, shot.BlastRadius, shot.Damage, shot.DamageType); + Detonate(zone, point, shot.BlastRadius, shot.Damage, shot.DamageType, shot); } // Cut 12.3 (docs/fire-control-cut.md, "How a direct hit travels"): replaces Entity.ApplyHit's 0.5-step @@ -1413,7 +1415,7 @@ public static class FireControl // the muzzle than the blast radius is detonated on at the radius, along the round's own flight line. var hullPoint = target.ToWorldPoint(schematicPoint); var worldPoint = Armed(shot.FireOrigin, shot.TravelDirection, shot.BlastRadius, float3(hullPoint.x, shot.FireOrigin.y, hullPoint.y)).xz; - Detonate(target.Zone, worldPoint, shot.BlastRadius, shot.Damage, shot.DamageType); + Detonate(target.Zone, worldPoint, shot.BlastRadius, shot.Damage, shot.DamageType, shot); } // Cut 12.4(b) (docs/fire-control-cut.md, "The penetrator", Q12-8): the one penetration-reach owner, moved @@ -1715,7 +1717,7 @@ public static class FireControl // call: doing so would buy no behaviour, per ProbeC in the cut doc). Leftovers -- unoccupied-cell shares, // and whatever an item's pool does not absorb -- join one entity-wide hull total, applied through one // DamageHull call. - public static void Detonate(Zone zone, float2 worldPlanar, float radius, float damage, DamageType damageType) + public static void Detonate(Zone zone, float2 worldPlanar, float radius, float damage, DamageType damageType, PendingShot? shot = null) { // No distance prefilter: RectDiskOverlap is the one decider of whether the disc touches a hull. A // prefilter measured from Position (the centre of mass) with the bounding box's half-diagonal is not a @@ -1804,6 +1806,9 @@ public static class FireControl return byField != 0 ? byField : a.Target.Chunk.Value.Index.CompareTo(b.Target.Chunk.Value.Index); }); var discArea = PI * radius * radius; + // Mining Cut 5a: a shot's blast pays its Source for the rocks it wears, from the shot's own dice, once for the + // blast, drawn in the rock order above. A mine (no shot) wears rocks and yields nothing. + var dice = shot != null ? SimulationDice.For(zone.DropSeed, SimulationDice.OreStream, (uint) shot.Value.ShotId) : default; foreach (var rock in rocks) { var chunk = rock.Target.Chunk.Value; @@ -1812,7 +1817,66 @@ public static class FireControl var share = damage * CircleCircleOverlap(length(centre - worldPlanar), radius, zone.ChunkRadius(chunk)) / discArea; if (!(share > 0f)) continue; PublishBlast(zone.ChunkCapabilities, centre, 0f, worldPlanar, AbsorbLayer.Hull, share, damageType); - zone.Wear(chunk, share); + var absorbed = zone.Wear(chunk, share); + if (shot != null) Extract(zone, chunk, absorbed, shot.Value.Source, dice); + } + } + + // Mining Cut 5a: the one loot owner of a rock. A worn rock pays the shooter at the wear site, at arrival or detonation, + // from the shot's own dice: the damage it absorbed is that fraction of its hitpoints, and the same fraction of the + // units its size authors (AsteroidYield), so a rock pays its whole yield however many hits break it. Whole units, and + // one Bernoulli draw on the fraction. Each unit draws an ore by weight: the belt's yields for this province, scaled by + // exp(variance x g), g a stable hash of (field, index, ore) in [-1, 1) -- a rock's composition, derived here every call + // and never stored. A shot with no Source (a mine) yields nothing. The units go to the shooter's cargo bays in + // stacks; what does not fit, or everything when the shooter has left the zone, floats at the rock (ruling + // mining-overflow-floats). + // Draw order: the Bernoulli, then one draw per unit. + public static void Extract(Zone zone, ChunkId chunk, float absorbed, Entity shooter, Random dice) + { + if (shooter == null || !(absorbed > 0f)) return; + var settings = zone.Settings; + var belt = zone.AsteroidBelts[chunk.Field]; + var catalog = shooter.ItemManager.ItemData; + var ores = FieldKinds.Yield(belt.Data.Kind, zone.GalaxyZone?.Province?.Type ?? default, catalog); + if (ores.Length == 0) return; + + var size = belt.Data.Asteroids[chunk.Index].Size; + var owed = absorbed / settings.AsteroidHitpoints.Evaluate(size) * settings.AsteroidYield.Evaluate(size); + var units = (int) floor(owed); + if (dice.NextFloat() < owed - units) units++; + if (units == 0) return; + + var weights = new float[ores.Length]; + var total = 0f; + for (var i = 0; i < ores.Length; i++) + { + var g = $"{chunk.Field.Value}:{chunk.Index}:{ores[i].Commodity.Key.Value}".StableHash() / 2147483648.0 - 1.0; + total += weights[i] = ores[i].Amount * (float) Math.Exp(settings.ChunkCompositionVariance * g); + } + var counts = new int[ores.Length]; + for (var unit = 0; unit < units; unit++) + { + var pick = dice.NextFloat() * total; + var ore = 0; + while (ore < ores.Length - 1 && pick >= weights[ore]) pick -= weights[ore++]; + counts[ore]++; + } + + var at = zone.ChunkPose(chunk.Field, chunk.Index).xy; + var velocity = zone.ChunkVelocity(chunk); + var present = zone.Entities.Contains(shooter); + for (var i = 0; i < ores.Length; i++) + { + var key = ores[i].Commodity.Key; + var maxStack = Math.Max(1, ((SimpleCommodityData) catalog.Get(ores[i].Commodity)).MaxStack); + for (var left = counts[i]; left > 0; left -= maxStack) + { + var stack = new SimpleCommodity { Data = new CultRecordRef<ItemData>(key), Quantity = Math.Min(left, maxStack) }; + // A partial store leaves the remainder in Quantity and returns false, so the next bay is offered the rest. + var stored = false; + if (present) foreach (var bay in shooter.CargoBays) if (stored = bay.TryStore(stack)) break; + if (!stored) zone.Release(stack, at, velocity); + } } } diff --git a/Assets/Scripts/ServerShared/Settings.cs b/Assets/Scripts/ServerShared/Settings.cs index 8326f76da..1d83bd692 100644 --- a/Assets/Scripts/ServerShared/Settings.cs +++ b/Assets/Scripts/ServerShared/Settings.cs @@ -29,6 +29,11 @@ public class PlanetSettings public ExponentialLerp AsteroidSize; public ExponentialLerp AsteroidHitpoints; public ExponentialLerp AsteroidRespawnTime; + // Units of ore a whole rock of normalized size s gives (FireControl.Extract), however many hits break it. + public ExponentialLerp AsteroidYield; + // How far a rock's mix of its belt's ores strays from the kind's ratio: each ore's weight is scaled by + // exp(variance x g), g in [-1, 1) a stable hash of (rock, ore). Zero reads the kind's ratio. + public float ChunkCompositionVariance; public float SecureAreaRadiusMultiplier = .45f; diff --git a/Assets/Scripts/ServerShared/SimulationDice.cs b/Assets/Scripts/ServerShared/SimulationDice.cs index adc440299..c8cb9e759 100644 --- a/Assets/Scripts/ServerShared/SimulationDice.cs +++ b/Assets/Scripts/ServerShared/SimulationDice.cs @@ -18,6 +18,9 @@ public static class SimulationDice // seed (CombatSeed): the run seed feeds drops and mines only (ruling run-seed-drops-only), and placement never rides // ItemManager.Random. public const uint ScatterStream = 5; + // The ore a shot's wear of rocks pays, ordinal the shot's ShotId, on the zone's DropSeed (mined ore is a drop): + // FireControl.Extract is the one reader. + public const uint OreStream = 6; // 9.1 (docs/fire-control-cut.md): fmix32, MurmurHash3's 32-bit finalizer -- xor-shift, multiply, // xor-shift, multiply, xor-shift. Diffuses a structured seed (a zone seed XORed with a small, diff --git a/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs b/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs index d020b068e..64e371c07 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs @@ -56,6 +56,8 @@ public sealed partial class MiningCut3Tests : IDisposable AsteroidSize = new ExponentialLerp { Minimum = 2f, Maximum = 9f, Exponent = 1.7f }, AsteroidHitpoints = new ExponentialLerp { Minimum = 20f, Maximum = 220f, Exponent = 1.6f }, AsteroidRespawnTime = new ExponentialLerp { Minimum = 8f, Maximum = 96f, Exponent = 1.2f }, + AsteroidYield = new ExponentialLerp { Minimum = 2f, Maximum = 6f, Exponent = 1f }, + ChunkCompositionVariance = .5f, BodyRadius = new ExponentialCurve(), LightRadius = new ExponentialCurve { Constant = lightRadius } }; diff --git a/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs b/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs index 6b263652a..8502e7d7d 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs @@ -22,7 +22,7 @@ public sealed class MiningCut4bTests : IDisposable public void Dispose() => _fixtures.Dispose(); - private sealed class Rig + internal sealed class Rig { public MiningCut3Tests.Scene Scene; public Zone Zone => Scene.Zone; @@ -56,11 +56,11 @@ public sealed class MiningCut4bTests : IDisposable } // `precision` 1 gives sigma 1 cell; accuracy 1 and a resolution that asks little of the info make PSensor 1. - private Rig Build(bool sensor = true, bool launcher = false, float damage = 10f, float velocity = 0f, float spread = 0f, + internal Rig Build(bool sensor = true, bool launcher = false, float damage = 10f, float velocity = 0f, float spread = 0f, float precision = 1f, float effective = float.PositiveInfinity, WeaponFuse? fuse = null, float blastRadius = 0f, - float rockSize = 0f, float crossSection = 20f, bool target = true, float tracking = 1000000f) + float rockSize = 0f, float crossSection = 20f, bool target = true, float tracking = 1000000f, FieldKindData kind = null) { - var kind = MiningCut3Tests.Kind("Asteroid", crossSection); + kind ??= MiningCut3Tests.Kind("Asteroid", crossSection); var scene = _fixtures.BuildScene(new[] { kind }, MiningCut3Tests.Belt(kind, MiningCut3Tests.Rock(Distance, .25f, rockSize))); var gear = MiningCut3Tests.Gear("Targeting", new TargetingSystemData { @@ -209,7 +209,7 @@ public sealed class MiningCut4bTests : IDisposable // ==== resolution ==== - private static void Run(Rig rig, float seconds) + internal static void Run(Rig rig, float seconds) { for (var elapsed = 0f; elapsed < seconds; elapsed += .01f) rig.Zone.Update(.01f); } diff --git a/tests/Aetheria.Shared.Tests/MiningCut5aTests.cs b/tests/Aetheria.Shared.Tests/MiningCut5aTests.cs new file mode 100644 index 000000000..cd93ca233 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/MiningCut5aTests.cs @@ -0,0 +1,245 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +using System; +using System.Collections.Generic; +using System.Linq; +using CultMath; +using GameCult.Caching; +using Xunit; +using static CultMath.math; + +// Mining Cut 5a (docs/mining-cut-refresh.md): a worn rock pays the shooter in ore at the wear site, from the shot's own +// dice; what does not fit in the hold floats at the rock. The fixtures are Cut 3's belt scene and Cut 4b's rig. +public sealed class MiningCut5aTests : IDisposable +{ + private readonly MiningCut4bTests _rigs = new MiningCut4bTests(); + private readonly MiningCut3Tests _scenes = new MiningCut3Tests(); + + public void Dispose() + { + _rigs.Dispose(); + _scenes.Dispose(); + } + + private static SimpleCommodityData Commodity(string name, int maxStack = 100) => + new SimpleCommodityData { Name = name, Shape = new Shape(), Price = 5, MaxStack = maxStack }; + + // Registers the ores and the kind's yields in the scene's catalog (the kind refs need the stored commodities). + private static void Stock(MiningCut3Tests.Scene scene, FieldKindData kind, params (SimpleCommodityData Ore, float Abundance)[] yields) + { + kind.Yields.Clear(); + foreach (var (ore, abundance) in yields) + { + scene.Cache.Upsert(ore); + kind.Yields.Add(new FieldYield { Commodity = scene.Cache.RefOf(ore), Abundance = abundance }); + } + scene.Cache.Upsert(kind); + } + + private EquippedCargoBay Bay(MiningCut3Tests.Scene scene, Ship ship, int width, int height, string name) + { + var shape = new Shape(width, height); + foreach (var cell in shape.AllCoordinates) shape[cell] = true; + var data = new CargoBayData { Name = name, Shape = new Shape(), InteriorShape = shape, Price = 1, Durability = 4 }; + scene.Cache.Upsert(data); + var bay = new EquippedCargoBay(scene.Items, MiningCut3Tests.Mint(scene, data), new int2(1, 1), ship, name); + ship.CargoBays.Add(bay); + return bay; + } + + private static int Units(IEnumerable<ItemInstance> items, string ore, MiningCut3Tests.Scene scene) => + items.OfType<SimpleCommodity>().Where(c => scene.Items.GetData(c).Name == ore).Sum(c => c.Quantity); + + private static int Units(EquippedCargoBay bay, string ore, MiningCut3Tests.Scene scene) => Units(bay.Cargo.Keys, ore, scene); + + // A rig whose rock (size .5: 4 units, whole) yields `ores`, shooter holding one bay. + private (MiningCut4bTests.Rig Rig, EquippedCargoBay Bay) Mining(int bayWidth = 4, int bayHeight = 4, float damage = 1000f, + WeaponFuse? fuse = null, float velocity = 0f, params (SimpleCommodityData, float)[] ores) + { + var kind = MiningCut3Tests.Kind("Asteroid", 20f); + var rig = _rigs.Build(damage: damage, fuse: fuse, blastRadius: fuse == null ? 0f : 6f, precision: 1000f, rockSize: .5f, velocity: velocity, kind: kind); + Stock(rig.Scene, kind, ores.Length > 0 ? ores : new[] { (Commodity("Rock"), 1f) }); + return (rig, Bay(rig.Scene, rig.Shooter, bayWidth, bayHeight, "Hold")); + } + + private static int Hits(MiningCut4bTests.Rig rig, int cap = 40) + { + for (var shot = 0; shot < cap && !rig.Resolved.Any(o => o.Hit); shot++) + { + // A broken rock cannot be targeted again: the first hit ends the loop. + FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); + MiningCut4bTests.Run(rig, .05f); + } + return rig.Resolved.Count(o => o.Hit); + } + + private static float Hitpoints(MiningCut4bTests.Rig rig) => + rig.Zone.Settings.AsteroidHitpoints.Evaluate(rig.Zone.AsteroidBelts[rig.Rock.Field].Data.Asteroids[rig.Rock.Index].Size); + + [Fact] + public void WearReturnsWhatTheRockAbsorbed() + { + var (rig, _) = Mining(); + var hp = Hitpoints(rig); + Assert.Equal(hp * .3f, rig.Zone.Wear(rig.Rock, hp * .3f), 3); + // The breaking hit absorbs only what the rock had left. + Assert.Equal(hp * .7f, rig.Zone.Wear(rig.Rock, hp * 5f), 3); + Assert.False(rig.Zone.ChunkExists(rig.Rock)); + Assert.Equal(0f, rig.Zone.Wear(rig.Rock, hp)); + } + + // Units owed are absorbed/hitpoints x AsteroidYield(size): a rock pays its whole yield however many hits break it, so + // the mean over many rocks does not depend on how the damage arrives. + [Fact] + public void ARockYieldsItsAuthoredTotalWhateverBreaksIt() + { + const int rocks = 300; + var ore = Commodity("Rock"); + var kind = MiningCut3Tests.Kind("Asteroid", 4f); + var scene = _scenes.BuildScene(new[] { kind }, MiningCut3Tests.Belt(kind, + Enumerable.Range(0, rocks).Select(i => MiningCut3Tests.Rock(150f + i * .1f, i / (float) rocks, .3f)).ToArray())); + Stock(scene, kind, (ore, 1f)); + var ship = new Ship(scene.Items, scene.Zone, MiningCut3Tests.Mint(scene, scene.Hull), new EntitySettings()); + scene.Zone.Admit(ship, piloted: false); + var bay = Bay(scene, ship, 8, 8, "Hold"); + var settings = scene.Zone.Settings; + var hp = settings.AsteroidHitpoints.Evaluate(.3f); + var owed = settings.AsteroidYield.Evaluate(.3f); + + uint ordinal = 0; + void Hit(int rock, float fraction) => + FireControl.Extract(scene.Zone, new ChunkId(scene.Belts[0], rock), scene.Zone.Wear(new ChunkId(scene.Belts[0], rock), hp * fraction), + ship, SimulationDice.For(scene.Zone.DropSeed, SimulationDice.OreStream, ++ordinal)); + + for (var rock = 0; rock < rocks / 2; rock++) Hit(rock, 2f); + var wholeHits = Units(bay.Cargo.Keys.Concat(scene.Zone.FloatingItems.Select(f => f.Item)), "Rock", scene); + for (var rock = rocks / 2; rock < rocks; rock++) for (var part = 0; part < 4; part++) Hit(rock, .25f); + var total = Units(bay.Cargo.Keys.Concat(scene.Zone.FloatingItems.Select(f => f.Item)), "Rock", scene); + var quartered = total - wholeHits; + + // owed = 3.2 per rock; 150 rocks: mean 480, sigma about 4.9 whole, 4.9 quartered. + Assert.InRange(wholeHits, 480 - 30, 480 + 30); + Assert.InRange(quartered, 480 - 30, 480 + 30); + Assert.Equal(3.2f, owed, 3); + } + + [Fact] + public void ADirectHitPaysTheShooter() + { + var (rig, bay) = Mining(ores: new[] { (Commodity("Rock"), 1f), (Commodity("Gold"), 1f) }); + var yields = FieldKinds.Yield(rig.Zone.AsteroidBelts[rig.Rock.Field].Data.Kind, default, rig.Scene.Cache); + Assert.Equal(2, yields.Length); + Assert.Equal(1, Hits(rig)); + Assert.False(rig.Zone.ChunkExists(rig.Rock)); + Assert.Equal(4, Units(bay, "Rock", rig.Scene) + Units(bay, "Gold", rig.Scene)); + Assert.Empty(rig.Zone.FloatingItems); + } + + [Fact] + public void ABlastPaysTheShooter() + { + var (rig, bay) = Mining(fuse: WeaponFuse.Contact, ores: new[] { (Commodity("Rock"), 1f) }); + Hits(rig); + Assert.False(rig.Zone.ChunkExists(rig.Rock)); + Assert.Equal(4, Units(bay, "Rock", rig.Scene)); + } + + [Fact] + public void AMineWearsButYieldsNothing() + { + var (rig, bay) = Mining(); + var at = rig.Zone.ChunkPose(rig.Rock.Field, rig.Rock.Index).xy; + FireControl.Detonate(rig.Zone, at, 6f, 1000f, DamageType.Kinetic); + Assert.False(rig.Zone.ChunkExists(rig.Rock)); + Assert.Empty(bay.Cargo); + Assert.Empty(rig.Zone.FloatingItems); + } + + // Ruling mining-overflow-floats: what the hold cannot take floats at the rock, where another ship can pick it up. + [Fact] + public void AFullHoldReleasesTheOverflow() + { + var grit = Commodity("Grit", maxStack: 2); + var (rig, bay) = Mining(bayWidth: 1, bayHeight: 1, ores: new[] { (grit, 1f) }); + Hits(rig); + + Assert.Equal(2, Units(bay, "Grit", rig.Scene)); + var floating = Assert.Single(rig.Zone.FloatingItems); + Assert.Equal(2, Assert.IsType<SimpleCommodity>(floating.Item).Quantity); + var rock = rig.Zone.ChunkPose(rig.Rock.Field, rig.Rock.Index).xy; + Assert.True(length(floating.Body.Position - rock) < 1f, "the overflow leaves from the rock"); + + var taker = new Ship(rig.Scene.Items, rig.Zone, MiningCut3Tests.Mint(rig.Scene, rig.Scene.Hull), new EntitySettings()); + rig.Zone.Admit(taker, piloted: false); + var takerBay = Bay(rig.Scene, taker, 4, 4, "Taker"); + Assert.True(rig.Zone.TryPickUp(taker, floating.Id)); + Assert.Equal(2, Units(takerBay, "Grit", rig.Scene)); + } + + [Fact] + public void AGoneShooterReleasesEverything() + { + var (rig, bay) = Mining(velocity: 50f); + FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); + rig.Shooter.HeatstrokeDeath.OnNext(UniRx.Unit.Default); + MiningCut4bTests.Run(rig, 3f); + + Assert.Empty(bay.Cargo); + Assert.Equal(4, Units(rig.Zone.FloatingItems.Select(f => f.Item), "Rock", rig.Scene)); + } + + // Two zones of one pack share every key, so the same rocks wear in each: the ore is a function of the dice alone. + private (MiningCut3Tests.Scene Scene, Func<Zone> NewZone, Ship Shooter) Field(int rocks, float size, float variance = .5f, float yield = 4f) + { + var kind = MiningCut3Tests.Kind("Asteroid", 4f); + var scene = _scenes.BuildScene(new[] { kind }, MiningCut3Tests.Belt(kind, + Enumerable.Range(0, rocks).Select(i => MiningCut3Tests.Rock(150f + i, i / (float) rocks, size)).ToArray())); + Stock(scene, kind, (Commodity("Rock"), 1f), (Commodity("Gold"), 1f)); + var ship = new Ship(scene.Items, scene.Zone, MiningCut3Tests.Mint(scene, scene.Hull), new EntitySettings()); + Zone NewZone() + { + var settings = MiningCut3Tests.PlanetSettings(); + settings.ChunkCompositionVariance = variance; + settings.AsteroidYield = new ExponentialLerp { Minimum = yield, Maximum = yield, Exponent = 1f }; + return new Zone(scene.Items, settings, scene.Pack, new GalaxyZone { Name = "MiningCut3", Owner = null }, null); + } + return (scene, NewZone, ship); + } + + // Every rock broken once; the shooter is not in the zone, so everything floats and the floats are the record. + private static (int Rock, int Gold)[] Break(MiningCut3Tests.Scene scene, Zone zone, Ship ship, int rocks, uint seed) => + Enumerable.Range(0, rocks).Select(rock => + { + var chunk = new ChunkId(scene.Belts[0], rock); + var before = zone.FloatingItems.Select(f => f.Item).ToArray(); + FireControl.Extract(zone, chunk, zone.Wear(chunk, 1e6f), ship, SimulationDice.For(seed, SimulationDice.OreStream, (uint) rock)); + var added = zone.FloatingItems.Select(f => f.Item).Except(before).ToArray(); + return (Units(added, "Rock", scene), Units(added, "Gold", scene)); + }).ToArray(); + + [Fact] + public void TheSameShotGivesTheSameOre() + { + var (scene, newZone, ship) = Field(20, .5f); + var first = Break(scene, newZone(), ship, 20, 11); + Assert.Equal(first, Break(scene, newZone(), ship, 20, 11)); + Assert.NotEqual(first, Break(scene, newZone(), ship, 20, 12)); + } + + // Composition is derived from the rock's identity every call: variance 0 reads the kind's ratio, variance above 0 gives + // rocks different mixes, and nothing stores it (a second zone of the pack reads the same mixes from the dice and keys). + [Fact] + public void CompositionVariesByRockAndIsDerived() + { + var (scene, even, ship) = Field(12, 1f, variance: 0f, yield: 600f); + // Equal weights, 600 units a rock: even splits within sampling noise (sigma about 12). + Assert.All(Break(scene, even(), ship, 12, 5), m => Assert.InRange(m.Rock, 240, 360)); + + var (scene2, varied, ship2) = Field(12, 1f, variance: 2f, yield: 600f); + var mixes = Break(scene2, varied(), ship2, 12, 5).Select(m => m.Rock).ToArray(); + Assert.True(mixes.Max() - mixes.Min() > 100, "rocks differ in mix when variance is above zero"); + Assert.Equal(mixes, Break(scene2, varied(), ship2, 12, 5).Select(m => m.Rock)); + } +} From 5a3324d612146e925c1beb2d9a851dc2112846e7 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 02:06:45 +0000 Subject: [PATCH 069/108] Station market absorbs a sold commodity; DemoLoop mine, sell, repair, buy test TrySell: a simple commodity always sells (aetheria-release:ruling:station-market-absorbs-sold-commodity). The station bays take as much of the stack as fits, the market absorbs the rest, full price paid. Crafted items still need a bay. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../Scripts/ServerShared/StationServices.cs | 19 +++-- tests/Aetheria.Shared.Tests/DemoLoopTests.cs | 79 +++++++++++++++++++ .../StationServicesTests.cs | 17 ++++ 3 files changed, 109 insertions(+), 6 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/DemoLoopTests.cs diff --git a/Assets/Scripts/ServerShared/StationServices.cs b/Assets/Scripts/ServerShared/StationServices.cs index 153fc595d..be15fc74e 100644 --- a/Assets/Scripts/ServerShared/StationServices.cs +++ b/Assets/Scripts/ServerShared/StationServices.cs @@ -94,15 +94,22 @@ public static class StationServices public static int BuyableQuantity(ItemManager items, SimpleCommodity stock, int typed, int credits) => Math.Max(1, Math.Min(Math.Min(typed, credits / BuyPrice(items, stock)), stock.Quantity)); - // The sale: the item leaves the bay for one of the station's cargo bays and the station pays SellPrice. False, - // with the item in its bay and the credits unchanged, when no station bay can take it. + // The sale: the item leaves the bay and the station pays SellPrice. A crafted item goes to one of the station's + // cargo bays; false, with the item in its bay and the credits unchanged, when no bay can take it. A simple + // commodity always sells (aetheria-release:ruling:station-market-absorbs-sold-commodity): the bays take as much of + // the stack as fits and the market absorbs the rest, at the full price. public static bool TrySell(EquippedCargoBay from, Entity station, ItemInstance item, ref int credits) { var price = SellPrice(station.ItemManager, item); - var moved = item is SimpleCommodity commodity - ? station.CargoBays.Any(bay => from.TryTransferItem(bay, commodity, commodity.Quantity)) - : station.CargoBays.Any(bay => from.TryTransferItem(bay, (CraftedItemInstance) item)); - if (!moved) return false; + if (item is SimpleCommodity commodity) + { + if (!from.Cargo.ContainsKey(commodity)) return false; + var offered = commodity.Quantity; + for (var quantity = offered; quantity >= 1; quantity--) + if (station.CargoBays.Any(bay => from.TryTransferItem(bay, commodity, quantity))) break; + if (from.Cargo.ContainsKey(commodity)) from.Remove(commodity, commodity.Quantity); + } + else if (!station.CargoBays.Any(bay => from.TryTransferItem(bay, (CraftedItemInstance) item))) return false; credits += price; return true; } diff --git a/tests/Aetheria.Shared.Tests/DemoLoopTests.cs b/tests/Aetheria.Shared.Tests/DemoLoopTests.cs new file mode 100644 index 000000000..7e765174c --- /dev/null +++ b/tests/Aetheria.Shared.Tests/DemoLoopTests.cs @@ -0,0 +1,79 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +using System.Linq; +using CultMath; +using Xunit; + +// The demo loop on the shipped catalog (aetheria-release, mining 5a and the ore sheet): the player's own gun breaks a rock +// through the trigger, the ore lands in the hold, the Pirates station Zenith buys it, repairs the hull and sells a unit back. +public sealed partial class RunStartTests +{ + [Fact] + public void DemoLoop_mine_sell_repair_buy() + { + var (galaxy, arena, staged, failures) = Launch(new DemoTerminus(), Inputs(() => 1)); + Assert.True(failures.Count == 0, string.Join("; ", failures)); + var player = staged.Player; + var belt = arena.Planets.Single(body => body.Value is AsteroidBeltData); + var rock = new ChunkId(belt.Key, 0); + var laser = player.Equipment.Select(equipped => equipped.Behaviors.OfType<Weapon>().FirstOrDefault()) + .First(weapon => weapon != null && weapon.Item.EquippableItem != null && _items.GetData(weapon.Item.EquippableItem).Name == "Light Laser"); + + // Once the ship's stats have settled. + for (var tick = 0; tick < 50; tick++) arena.Update(.02f); + // The belt drifts and the sun's well pulls, so the ship is held where it was put: forty units off the rock. + void Hold() + { + var at = arena.ChunkPose(rock.Field, rock.Index).xy; + player.Position = new float3(at.x, player.Position.y, at.y - 40f); + player.Velocity = float2.zero; + player.Direction = new float2(0, 1); + player.Aim = new float3(0, 0, 1); + } + Hold(); + arena.Update(.02f); + Hold(); + Assert.True(player.SetTarget(rock), "the rock is a target"); + laser.Activate(); + for (var elapsed = 0f; elapsed < 20f && arena.ChunkExists(rock); elapsed += .02f) { Hold(); arena.Update(.02f); } + var info = player.ChunkInfo(rock); + Assert.False(arena.ChunkExists(rock), $"the laser broke the rock: designated {FireControl.Designated(laser, player, rock, out var range)} range {range} info {info} target {player.Target} pos {player.Position} rockpos {arena.ChunkPose(rock.Field, rock.Index)} hp {arena.Settings.AsteroidHitpoints.Evaluate(arena.AsteroidBelts[rock.Field].Data.Asteroids[0].Size)}"); + + var ores = new[] { "Rock", "New Metals", "Gold" }; + var held = player.CargoBays.SelectMany(bay => bay.Cargo.Keys.OfType<SimpleCommodity>().Select(stack => (bay, stack))) + .Where(h => ores.Contains(_items.GetData(h.stack).Name)).ToArray(); + Assert.NotEmpty(held); + Assert.Empty(arena.FloatingItems); + + var zenith = arena.Entities.Single(entity => entity.HullData.Name == "Zenith"); + var credits = 0; + // Every ore stack goes: the market takes it all, whatever the full hold of Zenith has room for. + foreach (var (from, sold) in held) Assert.True(StationServices.TrySell(from, zenith, sold, ref credits), "the market takes the ore"); + Assert.DoesNotContain(player.CargoBays.SelectMany(bay => bay.Cargo.Keys.OfType<SimpleCommodity>()), c => ores.Contains(_items.GetData(c).Name)); + Assert.True(credits > 0, "the station pays for the ore"); + + var cell = Enumerable.Range(0, player.MaxArmor.GetLength(0)).SelectMany(x => Enumerable.Range(0, player.MaxArmor.GetLength(1)).Select(y => (x, y))) + .First(c => player.MaxArmor[c.x, c.y] > 0); + player.Armor[cell.x, cell.y] = 0; + var cost = StationServices.RepairCost(_items, player); + Assert.True(cost > 0); + var paid = credits; + credits += cost; + Assert.True(StationServices.TryRepair(player, ref credits)); + Assert.Equal(paid, credits); + Assert.Equal(player.MaxArmor[cell.x, cell.y], player.Armor[cell.x, cell.y]); + + // Zenith's whole stock is one 16-cell reactor, which fits only an empty 4x4: the player jettisons what the hold + // still carries, then buys it. + var hold = player.CargoBays[0]; + foreach (var leftover in hold.Cargo.Keys.ToArray()) hold.Remove(leftover); + var stock = zenith.CargoBays.SelectMany(bay => bay.Cargo.Keys.OfType<CraftedItemInstance>().Select(piece => (bay, piece))).Single(); + credits = StationServices.BuyPrice(_items, stock.piece); + Assert.Equal(BuyResult.Bought, StationServices.TryBuy(_items, stock.piece, 1, ref credits, + () => stock.bay.TryTransferItem(hold, stock.piece))); + Assert.Equal(0, credits); + Assert.Contains(stock.piece, hold.Cargo.Keys); + } +} diff --git a/tests/Aetheria.Shared.Tests/StationServicesTests.cs b/tests/Aetheria.Shared.Tests/StationServicesTests.cs index 2bf4d3c2f..173f00069 100644 --- a/tests/Aetheria.Shared.Tests/StationServicesTests.cs +++ b/tests/Aetheria.Shared.Tests/StationServicesTests.cs @@ -175,6 +175,23 @@ public sealed class StationServicesTests : IDisposable Assert.Contains(ore, open.Cargo.Keys); } + // The market absorbs a sold commodity (aetheria-release:ruling:station-market-absorbs-sold-commodity): a full hold + // stores what fits, the rest is taken, and the full price is paid; a hold with no room at all still pays. + [Fact] + public void TrySell_commodity_is_paid_in_full_when_the_station_hold_is_full() + { + var from = Ship().CargoBays.Single(); + var ore = Ore(10); + Assert.True(from.TryStore(ore)); + var station = Station(); + while (station.CargoBays[0].TryStore(Mint("Gun"))) { } + var credits = 0; + Assert.True(StationServices.TrySell(from, station, ore, ref credits)); + Assert.Equal(35, credits); + Assert.Empty(from.Cargo.Keys.OfType<SimpleCommodity>()); + Assert.Empty(station.CargoBays[0].Cargo.Keys.OfType<SimpleCommodity>()); + } + [Fact] public void Repair_restores_and_charges() { From 5663361e940f5df77055ea4bd9ec38dd640fed5f Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 02:57:50 +0000 Subject: [PATCH 070/108] Tests: ore dice keyed by ShotId and DropSeed on both fire paths; TrySell of an unheld commodity pays nothing Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../Aetheria.Shared.Tests/MiningCut3Tests.cs | 6 +- .../Aetheria.Shared.Tests/MiningCut4bTests.cs | 3 +- .../Aetheria.Shared.Tests/MiningCut5aTests.cs | 70 ++++++++++++++++++- .../StationServicesTests.cs | 23 ++++++ 4 files changed, 98 insertions(+), 4 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs b/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs index 64e371c07..95dbacd1f 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut3Tests.cs @@ -24,6 +24,9 @@ public sealed partial class MiningCut3Tests : IDisposable private readonly List<CultCache> _caches = new List<CultCache>(); private int _fixtureCount; + // A run seed for the scenes built next: nonzero gives the zone a galaxy carrying it (so Zone.DropSeed differs by it). + internal uint GalaxySeed; + public MiningCut3Tests() => Directory.CreateDirectory(_root); public void Dispose() @@ -163,7 +166,8 @@ public sealed partial class MiningCut3Tests : IDisposable pack.Planets.Add(new CultRecordRef<BodyData>(key)); scene.Belts.Add(key); } - scene.Zone = new Zone(items, PlanetSettings(lightRadius), pack, new GalaxyZone { Name = "MiningCut3", Owner = null }, null); + scene.Zone = new Zone(items, PlanetSettings(lightRadius), pack, new GalaxyZone { Name = "MiningCut3", Owner = null }, + GalaxySeed == 0 ? null : RunSeedFixture.Continue(cache, "MiningCut3", GalaxySeed)); return scene; } diff --git a/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs b/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs index 8502e7d7d..abf4f0dc1 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut4bTests.cs @@ -58,8 +58,9 @@ public sealed class MiningCut4bTests : IDisposable // `precision` 1 gives sigma 1 cell; accuracy 1 and a resolution that asks little of the info make PSensor 1. internal Rig Build(bool sensor = true, bool launcher = false, float damage = 10f, float velocity = 0f, float spread = 0f, float precision = 1f, float effective = float.PositiveInfinity, WeaponFuse? fuse = null, float blastRadius = 0f, - float rockSize = 0f, float crossSection = 20f, bool target = true, float tracking = 1000000f, FieldKindData kind = null) + float rockSize = 0f, float crossSection = 20f, bool target = true, float tracking = 1000000f, FieldKindData kind = null, uint galaxySeed = 0) { + _fixtures.GalaxySeed = galaxySeed; kind ??= MiningCut3Tests.Kind("Asteroid", crossSection); var scene = _fixtures.BuildScene(new[] { kind }, MiningCut3Tests.Belt(kind, MiningCut3Tests.Rock(Distance, .25f, rockSize))); var gear = MiningCut3Tests.Gear("Targeting", new TargetingSystemData diff --git a/tests/Aetheria.Shared.Tests/MiningCut5aTests.cs b/tests/Aetheria.Shared.Tests/MiningCut5aTests.cs index cd93ca233..d71607031 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut5aTests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut5aTests.cs @@ -56,10 +56,10 @@ public sealed class MiningCut5aTests : IDisposable // A rig whose rock (size .5: 4 units, whole) yields `ores`, shooter holding one bay. private (MiningCut4bTests.Rig Rig, EquippedCargoBay Bay) Mining(int bayWidth = 4, int bayHeight = 4, float damage = 1000f, - WeaponFuse? fuse = null, float velocity = 0f, params (SimpleCommodityData, float)[] ores) + WeaponFuse? fuse = null, float velocity = 0f, uint galaxySeed = 0, float rockSize = .5f, params (SimpleCommodityData, float)[] ores) { var kind = MiningCut3Tests.Kind("Asteroid", 20f); - var rig = _rigs.Build(damage: damage, fuse: fuse, blastRadius: fuse == null ? 0f : 6f, precision: 1000f, rockSize: .5f, velocity: velocity, kind: kind); + var rig = _rigs.Build(damage: damage, fuse: fuse, blastRadius: fuse == null ? 0f : 6f, precision: 1000f, rockSize: rockSize, velocity: velocity, kind: kind, galaxySeed: galaxySeed); Stock(rig.Scene, kind, ores.Length > 0 ? ores : new[] { (Commodity("Rock"), 1f) }); return (rig, Bay(rig.Scene, rig.Shooter, bayWidth, bayHeight, "Hold")); } @@ -242,4 +242,70 @@ public sealed class MiningCut5aTests : IDisposable Assert.True(mixes.Max() - mixes.Min() > 100, "rocks differ in mix when variance is above zero"); Assert.Equal(mixes, Break(scene2, varied(), ship2, 12, 5).Select(m => m.Rock)); } + + // ==== the shot's own dice: ShotId and the zone's DropSeed key the ore ==== + + // A rig whose rock outlives many shots and pays hundreds of units a hit, three ores, so a changed key shows in the mix. The rock is + // wider than the blast, so every blast wears it by the same share and only the dice can tell two shots apart. + private (MiningCut4bTests.Rig Rig, EquippedCargoBay Bay) Rich(WeaponFuse? fuse, float damage, uint galaxySeed = 0) + { + var (rig, bay) = Mining(bayWidth: 8, bayHeight: 8, damage: damage, fuse: fuse, galaxySeed: galaxySeed, rockSize: 1f, + ores: new[] { (Commodity("Rock"), 1f), (Commodity("Gold"), 1f), (Commodity("Ice"), 1f) }); + rig.Zone.Settings.AsteroidYield = new ExponentialLerp { Minimum = 6000f, Maximum = 6000f, Exponent = 1f }; + // Composition hashes the belt's record key, which differs per scene; variance 0 leaves the dice alone to vary the ore. + rig.Zone.Settings.ChunkCompositionVariance = 0f; + return (rig, bay); + } + + // Fires until `hits` shots have landed, returning each landed shot's payout (bay and floats together) as (Rock, Gold, Ice). + private static (int, int, int)[] Payouts(MiningCut4bTests.Rig rig, EquippedCargoBay bay, int hits) + { + IEnumerable<ItemInstance> Held() => bay.Cargo.Keys.Concat(rig.Zone.FloatingItems.Select(f => f.Item)); + var paid = new List<(int, int, int)>(); + var before = (0, 0, 0); + for (var shot = 0; shot < 100 && paid.Count < hits; shot++) + { + var landed = rig.Resolved.Count(o => o.Hit); + FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); + MiningCut4bTests.Run(rig, .05f); + if (rig.Resolved.Count(o => o.Hit) == landed) continue; + Assert.True(rig.Zone.ChunkExists(rig.Rock), "the rock must outlive the shots under test"); + var held = Held().ToArray(); + var now = (Units(held, "Rock", rig.Scene), Units(held, "Gold", rig.Scene), Units(held, "Ice", rig.Scene)); + paid.Add((now.Item1 - before.Item1, now.Item2 - before.Item2, now.Item3 - before.Item3)); + before = now; + } + Assert.Equal(hits, paid.Count); + return paid.ToArray(); + } + + // Which ore lands in which slot follows each scene's catalog keys, so scenes compare by the multiset of counts. + private static int[][] Mix(IEnumerable<(int, int, int)> paid) => paid.Select(p => new[] { p.Item1, p.Item2, p.Item3 }.OrderBy(n => n).ToArray()).ToArray(); + + [Theory] + [InlineData(null, 8f)] + [InlineData(WeaponFuse.Contact, 40f)] + public void TwoShotsInOneZonePayDifferentOre(WeaponFuse? fuse, float damage) + { + var (rig, bay) = Rich(fuse, damage); + var paid = Payouts(rig, bay, 2); + Assert.All(paid, p => Assert.True(p.Item1 + p.Item2 + p.Item3 > 100, "a shot pays hundreds of units")); + Assert.NotEqual(paid[0], paid[1]); + } + + [Theory] + [InlineData(null, 8f)] + [InlineData(WeaponFuse.Contact, 40f)] + public void ADifferentRunSeedPaysDifferentOreForTheSameShot(WeaponFuse? fuse, float damage) + { + var (a, bayA) = Rich(fuse, damage, galaxySeed: 7); + var (b, bayB) = Rich(fuse, damage, galaxySeed: 8); + Assert.NotEqual(a.Zone.DropSeed, b.Zone.DropSeed); + Assert.Equal(a.Zone.CombatSeed, b.Zone.CombatSeed); + Assert.NotEqual(Mix(Payouts(a, bayA, 1)), Mix(Payouts(b, bayB, 1))); + // The same seed repeats it. + var (c, bayC) = Rich(fuse, damage, galaxySeed: 7); + var (d, bayD) = Rich(fuse, damage, galaxySeed: 7); + Assert.Equal(Mix(Payouts(c, bayC, 1)), Mix(Payouts(d, bayD, 1))); + } } diff --git a/tests/Aetheria.Shared.Tests/StationServicesTests.cs b/tests/Aetheria.Shared.Tests/StationServicesTests.cs index 173f00069..824ef7158 100644 --- a/tests/Aetheria.Shared.Tests/StationServicesTests.cs +++ b/tests/Aetheria.Shared.Tests/StationServicesTests.cs @@ -192,6 +192,29 @@ public sealed class StationServicesTests : IDisposable Assert.Empty(station.CargoBays[0].Cargo.Keys.OfType<SimpleCommodity>()); } + // A commodity the seller does not hold sells for nothing: not one never stored, and not a stale copy of a stack the sale + // already took. The held stack is untouched, and no credit is paid. + [Fact] + public void TrySell_commodity_not_in_the_hold_pays_nothing() + { + var from = Ship().CargoBays.Single(); + var held = Ore(10); + Assert.True(from.TryStore(held)); + var station = Station(); + var credits = 500; + + Assert.False(StationServices.TrySell(from, station, Ore(10), ref credits)); + Assert.Equal(500, credits); + Assert.Empty(station.CargoBays.Single().Cargo.Keys.OfType<SimpleCommodity>()); + Assert.Equal(10, Assert.Single(from.Cargo.Keys.OfType<SimpleCommodity>()).Quantity); + + Assert.True(StationServices.TrySell(from, station, held, ref credits)); + var paid = credits; + Assert.False(StationServices.TrySell(from, station, held, ref credits)); + Assert.Equal(paid, credits); + Assert.Equal(10, station.CargoBays.Single().Cargo.Keys.OfType<SimpleCommodity>().Sum(c => c.Quantity)); + } + [Fact] public void Repair_restores_and_charges() { From 00a036427df6ed08c7578567713e59fbd57adff5 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 03:00:44 +0000 Subject: [PATCH 071/108] Lot moves to ItemInstance at key 11; stacks merge, split, restore and root by lot Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Entity.cs | 6 +++--- Assets/Scripts/ServerShared/EntitySerializer.cs | 6 +++--- Assets/Scripts/ServerShared/ItemInstance.cs | 9 ++++++--- Assets/Scripts/ServerShared/ItemManager.cs | 5 +++-- Assets/Scripts/ServerShared/SavedGame.cs | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Assets/Scripts/ServerShared/Entity.cs b/Assets/Scripts/ServerShared/Entity.cs index 43d9729d9..b520db17d 100644 --- a/Assets/Scripts/ServerShared/Entity.cs +++ b/Assets/Scripts/ServerShared/Entity.cs @@ -2465,7 +2465,7 @@ public class EquippedCargoBay : EquippedItem // For simple commodities, search for existing item stacks to add to foreach (var cargoItem in Cargo.Keys) { - if (!item.Data.Key.Equals(cargoItem.Data.Key)) continue; + if (!item.Data.Key.Equals(cargoItem.Data.Key) || item.Lot != cargoItem.Lot) continue; var cargoCommodity = (SimpleCommodity) cargoItem; if (cargoCommodity.Quantity >= itemData.MaxStack) continue; @@ -2563,7 +2563,7 @@ public class EquippedCargoBay : EquippedItem ItemsOfType[item.Data.Key] = new List<ItemInstance>(); ItemsOfType[item.Data.Key].Add(item); } - else if (Occupancy[cargoCoord.x, cargoCoord.y] is SimpleCommodity cargoCommodity && cargoCommodity.Data.Key.Equals(item.Data.Key)) + else if (Occupancy[cargoCoord.x, cargoCoord.y] is SimpleCommodity cargoCommodity && cargoCommodity.Data.Key.Equals(item.Data.Key) && cargoCommodity.Lot == item.Lot) { if (cargoCommodity.Quantity + item.Quantity <= itemData.MaxStack) { @@ -2643,7 +2643,7 @@ public class EquippedCargoBay : EquippedItem item.Quantity -= quantity; Mass -= itemData.Mass * quantity; ThermalMass -= itemData.Mass * itemData.SpecificHeat * quantity; - return new SimpleCommodity{Data = item.Data, Quantity = quantity, Rotation = item.Rotation}; + return new SimpleCommodity{Data = item.Data, Lot = item.Lot, Quantity = quantity, Rotation = item.Rotation}; } public void Remove(CraftedItemInstance item) diff --git a/Assets/Scripts/ServerShared/EntitySerializer.cs b/Assets/Scripts/ServerShared/EntitySerializer.cs index 9aefe5a19..73656b87e 100644 --- a/Assets/Scripts/ServerShared/EntitySerializer.cs +++ b/Assets/Scripts/ServerShared/EntitySerializer.cs @@ -60,8 +60,8 @@ public static class EntitySerializer && itemManager.GetData(commodity).MaxStack >= 1) { var maxStack = itemManager.GetData(commodity).MaxStack; - var first = new SimpleCommodity { Data = commodity.Data, Rotation = commodity.Rotation, Quantity = maxStack }; - var rest = new SimpleCommodity { Data = commodity.Data, Rotation = commodity.Rotation, Quantity = commodity.Quantity - maxStack }; + var first = new SimpleCommodity { Data = commodity.Data, Lot = commodity.Lot, Rotation = commodity.Rotation, Quantity = maxStack }; + var rest = new SimpleCommodity { Data = commodity.Data, Lot = commodity.Lot, Rotation = commodity.Rotation, Quantity = commodity.Quantity - maxStack }; if (!bay.TryStore(first, position)) rest.Quantity += first.Quantity; spill.Add((bay, rest)); return; @@ -82,7 +82,7 @@ public static class EntitySerializer var remaining = rest.Quantity; while (remaining > 0) { - var chunk = new SimpleCommodity { Data = rest.Data, Rotation = rest.Rotation, Quantity = Math.Min(remaining, maxStack) }; + var chunk = new SimpleCommodity { Data = rest.Data, Lot = rest.Lot, Rotation = rest.Rotation, Quantity = Math.Min(remaining, maxStack) }; var placed = home.TryStore(chunk) || bays.Where(b => b != home).Any(b => b.TryStore(chunk)); // A refused store may still have topped up a stack; what is left in the chunk found no room. remaining -= Math.Min(remaining, maxStack) - (placed ? 0 : chunk.Quantity); diff --git a/Assets/Scripts/ServerShared/ItemInstance.cs b/Assets/Scripts/ServerShared/ItemInstance.cs index 80a891666..a16553b9f 100644 --- a/Assets/Scripts/ServerShared/ItemInstance.cs +++ b/Assets/Scripts/ServerShared/ItemInstance.cs @@ -24,6 +24,11 @@ public abstract class ItemInstance { [JsonProperty("data"), Key(0)] public CultRecordRef<ItemData> Data; [JsonProperty("rotation"), Key(1)] public ItemRotation Rotation; + + // The lot this unit was minted or mined from: crafted units' design, provenance, workmanship and role fills all + // live there; a mined SimpleCommodity names its Extracted lot (zone, belt, ore). Lot 0 is no lot: bought, staged + // and loadout commodities, and every save from before the field reached SimpleCommodity. + [JsonProperty("lot"), Key(11)] public int Lot; } [Union(0, typeof(CompoundCommodity)), @@ -33,9 +38,7 @@ public abstract class ItemInstance public abstract class CraftedItemInstance : ItemInstance { // Keys 2 (Quality), 9 (Ingredients) and 10 (Product) belonged to fields moved to Lot; do not reuse them. - - // The lot this unit was minted from: its design, provenance, workmanship and role fills all live there. - [JsonProperty("lot"), Key(11)] public int Lot; + // Key 11 (Lot) lives on ItemInstance. } [MessagePackObject, JsonObject(MemberSerialization.OptIn)] diff --git a/Assets/Scripts/ServerShared/ItemManager.cs b/Assets/Scripts/ServerShared/ItemManager.cs index 090fe1545..774abbe83 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -72,8 +72,9 @@ public class ItemManager }; } - // The one resolution path from a crafted instance to the lot it was minted from. - public Lot GetLot(CraftedItemInstance item) => Lots[item.Lot]; + // The one resolution path from an instance to the lot it was minted or mined from. Lot 0 throws: a bought or + // staged commodity has no lot, and the caller asks Lot != 0 first. + public Lot GetLot(ItemInstance item) => Lots[item.Lot]; // Returns stat when not equipped: a null-entity context with no heat, no power and no modifiers. It says so // in its own name (UnequippedStatContext) rather than being a third quiet dialect of the arithmetic. diff --git a/Assets/Scripts/ServerShared/SavedGame.cs b/Assets/Scripts/ServerShared/SavedGame.cs index 5f42de446..21f3f3b71 100644 --- a/Assets/Scripts/ServerShared/SavedGame.cs +++ b/Assets/Scripts/ServerShared/SavedGame.cs @@ -225,7 +225,7 @@ public static class RunSave var roots = zones .SelectMany(zone => zone.Contents?.Entities ?? new List<EntityPack>()) .SelectMany(EntitySerializer.Items) - .OfType<CraftedItemInstance>() + .Where(item => item.Lot != 0) .Select(item => item.Lot); cache.Commit(batch => { From df67c875e349a85a274018ca80950d5636eacf2e Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 03:03:25 +0000 Subject: [PATCH 072/108] FireControl.Extract stamps every mined stack with the Extracted lot of its zone, belt and ore Extracted gains Body at key 2. ItemManager.ExtractedLot finds or mints the lot; its (zone, belt, ore) index is derived from the ledger at construction and never saved. SavedGame roots skip null items and Lot 0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/FireControl.cs | 7 ++++-- Assets/Scripts/ServerShared/ItemManager.cs | 26 ++++++++++++++++++++++ Assets/Scripts/ServerShared/Provenance.cs | 2 ++ Assets/Scripts/ServerShared/SavedGame.cs | 2 +- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/ServerShared/FireControl.cs b/Assets/Scripts/ServerShared/FireControl.cs index 3df60cf50..bb6d48d6c 100644 --- a/Assets/Scripts/ServerShared/FireControl.cs +++ b/Assets/Scripts/ServerShared/FireControl.cs @@ -1864,14 +1864,17 @@ public static class FireControl var at = zone.ChunkPose(chunk.Field, chunk.Index).xy; var velocity = zone.ChunkVelocity(chunk); + var zoneIndex = zone.Galaxy?.Zones == null ? -1 : Array.IndexOf(zone.Galaxy.Zones, zone.GalaxyZone); var present = zone.Entities.Contains(shooter); for (var i = 0; i < ores.Length; i++) { var key = ores[i].Commodity.Key; - var maxStack = Math.Max(1, ((SimpleCommodityData) catalog.Get(ores[i].Commodity)).MaxStack); + var commodity = (SimpleCommodityData) catalog.Get(ores[i].Commodity); + var maxStack = Math.Max(1, commodity.MaxStack); + var lot = counts[i] > 0 ? shooter.ItemManager.ExtractedLot(zoneIndex, chunk.Field, commodity) : 0; for (var left = counts[i]; left > 0; left -= maxStack) { - var stack = new SimpleCommodity { Data = new CultRecordRef<ItemData>(key), Quantity = Math.Min(left, maxStack) }; + var stack = new SimpleCommodity { Data = new CultRecordRef<ItemData>(key), Lot = lot, Quantity = Math.Min(left, maxStack) }; // A partial store leaves the remainder in Quantity and returns false, so the next bay is offered the rest. var stored = false; if (present) foreach (var bay in shooter.CargoBays) if (stored = bay.TryStore(stack)) break; diff --git a/Assets/Scripts/ServerShared/ItemManager.cs b/Assets/Scripts/ServerShared/ItemManager.cs index 774abbe83..c91568efd 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -25,6 +25,11 @@ public class ItemManager public CultCache ItemData { get; } public ProvenanceLedger Lots { get; } + + // (zone index, belt, commodity) -> the Extracted lot minted for it. Derived from Lots at construction and on mint, + // never persisted: a reload rebuilds it from the ledger, so the same source finds the same lot. + private readonly Dictionary<(int, CultRecordKey, CultRecordKey), int> _extracted = + new Dictionary<(int, CultRecordKey, CultRecordKey), int>(); public GameplaySettings GameplaySettings { get; } public ItemManager(uint seed, CultCache itemData, ProvenanceLedger lots, GameplaySettings settings, Action<string> logger) @@ -33,6 +38,9 @@ public class ItemManager Random = new Random(seed); ItemData = itemData; Lots = lots; + foreach (var (id, lot) in lots.Lots) + if (lot.Origin is Extracted extracted) + _extracted[(extracted.Zone, extracted.Body.Key, extracted.Commodity.Key)] = id; GameplaySettings = settings; _logger = logger; } @@ -181,6 +189,24 @@ public class ItemManager return Lots.Add(lot); } + // Mining Cut 5b: the lot of every unit mined from one commodity in one belt of one zone, found or minted. Unbranded + // (Product unset) and unworked (Quality 1, no roles). FireControl.Extract is the only caller. + public int ExtractedLot(int zone, CultRecordKey belt, SimpleCommodityData commodity) + { + var key = (zone, belt, ItemData.RefOf<ItemData>(commodity).Key); + if (_extracted.TryGetValue(key, out var found)) return found; + var id = Lots.Add(new Lot + { + Design = ItemData.RefOf<ItemData>(commodity), + Origin = new Extracted + { + Zone = zone, Body = new CultRecordRef<BodyData>(belt), Commodity = ItemData.RefOf(commodity) + }, + Quality = 1 + }); + return _extracted[key] = id; + } + // The one writer of a crafted instance's Data: copied from the lot's design, never independently set. public CraftedItemInstance CreateInstance(int lot) { diff --git a/Assets/Scripts/ServerShared/Provenance.cs b/Assets/Scripts/ServerShared/Provenance.cs index 25a4a6175..71c260496 100644 --- a/Assets/Scripts/ServerShared/Provenance.cs +++ b/Assets/Scripts/ServerShared/Provenance.cs @@ -137,6 +137,8 @@ public class Produced : Provenance [MessagePackObject] public class Extracted : Provenance { + // Zone is the zone's index in galaxy.Zones (SavedGame's convention), -1 with no galaxy; Body is the belt. [Key(0)] public int Zone; [Key(1)] public CultRecordRef<SimpleCommodityData> Commodity; + [Key(2)] public CultRecordRef<BodyData> Body; } diff --git a/Assets/Scripts/ServerShared/SavedGame.cs b/Assets/Scripts/ServerShared/SavedGame.cs index 21f3f3b71..7c7952494 100644 --- a/Assets/Scripts/ServerShared/SavedGame.cs +++ b/Assets/Scripts/ServerShared/SavedGame.cs @@ -225,7 +225,7 @@ public static class RunSave var roots = zones .SelectMany(zone => zone.Contents?.Entities ?? new List<EntityPack>()) .SelectMany(EntitySerializer.Items) - .Where(item => item.Lot != 0) + .Where(item => item != null && item.Lot != 0) .Select(item => item.Lot); cache.Commit(batch => { From 7d9c4d4844f7adee237176fadd34360c4b166ca4 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 03:03:25 +0000 Subject: [PATCH 073/108] Tests: mined lots, stack merge and split by lot, save GC roots, rebuilt index, old saves read Lot 0 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../Aetheria.Shared.Tests/MiningCut5aTests.cs | 10 +- .../Aetheria.Shared.Tests/MiningCut5bTests.cs | 308 ++++++++++++++++++ 2 files changed, 313 insertions(+), 5 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/MiningCut5bTests.cs diff --git a/tests/Aetheria.Shared.Tests/MiningCut5aTests.cs b/tests/Aetheria.Shared.Tests/MiningCut5aTests.cs index d71607031..04f02164d 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut5aTests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut5aTests.cs @@ -23,11 +23,11 @@ public sealed class MiningCut5aTests : IDisposable _scenes.Dispose(); } - private static SimpleCommodityData Commodity(string name, int maxStack = 100) => + internal static SimpleCommodityData Commodity(string name, int maxStack = 100) => new SimpleCommodityData { Name = name, Shape = new Shape(), Price = 5, MaxStack = maxStack }; // Registers the ores and the kind's yields in the scene's catalog (the kind refs need the stored commodities). - private static void Stock(MiningCut3Tests.Scene scene, FieldKindData kind, params (SimpleCommodityData Ore, float Abundance)[] yields) + internal static void Stock(MiningCut3Tests.Scene scene, FieldKindData kind, params (SimpleCommodityData Ore, float Abundance)[] yields) { kind.Yields.Clear(); foreach (var (ore, abundance) in yields) @@ -38,7 +38,7 @@ public sealed class MiningCut5aTests : IDisposable scene.Cache.Upsert(kind); } - private EquippedCargoBay Bay(MiningCut3Tests.Scene scene, Ship ship, int width, int height, string name) + internal static EquippedCargoBay Bay(MiningCut3Tests.Scene scene, Ship ship, int width, int height, string name) { var shape = new Shape(width, height); foreach (var cell in shape.AllCoordinates) shape[cell] = true; @@ -49,10 +49,10 @@ public sealed class MiningCut5aTests : IDisposable return bay; } - private static int Units(IEnumerable<ItemInstance> items, string ore, MiningCut3Tests.Scene scene) => + internal static int Units(IEnumerable<ItemInstance> items, string ore, MiningCut3Tests.Scene scene) => items.OfType<SimpleCommodity>().Where(c => scene.Items.GetData(c).Name == ore).Sum(c => c.Quantity); - private static int Units(EquippedCargoBay bay, string ore, MiningCut3Tests.Scene scene) => Units(bay.Cargo.Keys, ore, scene); + internal static int Units(EquippedCargoBay bay, string ore, MiningCut3Tests.Scene scene) => Units(bay.Cargo.Keys, ore, scene); // A rig whose rock (size .5: 4 units, whole) yields `ores`, shooter holding one bay. private (MiningCut4bTests.Rig Rig, EquippedCargoBay Bay) Mining(int bayWidth = 4, int bayHeight = 4, float damage = 1000f, diff --git a/tests/Aetheria.Shared.Tests/MiningCut5bTests.cs b/tests/Aetheria.Shared.Tests/MiningCut5bTests.cs new file mode 100644 index 000000000..45f52c144 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/MiningCut5bTests.cs @@ -0,0 +1,308 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using CultMath; +using GameCult.Caching; +using GameCult.Caching.MessagePack; +using MessagePack; +using Xunit; + +// Mining Cut 5b (docs/mining-cut-refresh.md, Cut 5, Q6b = A): a mined unit carries an Extracted lot naming the zone, the belt +// and the ore; stacks merge, split, restore and save by lot. Fixtures are Cut 3's belt scene and Cut 5a's bay and stock helpers. +public sealed class MiningCut5bTests : IDisposable +{ + private readonly MiningCut3Tests _scenes = new MiningCut3Tests(); + private readonly string _root = Path.Combine(Path.GetTempPath(), "aetheria-mining5b-" + Guid.NewGuid().ToString("N")); + private uint _ordinal; + + public MiningCut5bTests() => Directory.CreateDirectory(_root); + + public void Dispose() + { + _scenes.Dispose(); + Directory.Delete(_root, true); + } + + private sealed class Field + { + public MiningCut3Tests.Scene Scene; + public Galaxy Galaxy; + public SimpleCommodityData Ore; + } + + // Two belts of rocks (size .5: 4 whole units a rock), one ore, in a galaxy of three zones. + private Field Build() + { + var ore = MiningCut5aTests.Commodity("Rock"); + var kind = MiningCut3Tests.Kind("Asteroid", 4f); + var scene = _scenes.BuildScene(new[] { kind }, + MiningCut3Tests.Belt(kind, MiningCut3Tests.Rock(150f, 0f), MiningCut3Tests.Rock(155f, .3f)), + MiningCut3Tests.Belt(kind, MiningCut3Tests.Rock(160f, .6f))); + MiningCut5aTests.Stock(scene, kind, (ore, 1f)); + var game = new SavedGame + { + Seed = 5, Factions = new CultRecordRef<Faction>[0], Relationships = new FactionRelationship[0], + HomeZones = new Dictionary<int, int>(), BossZones = new Dictionary<int, int>(), DiscoveredZones = new[] { 0 }, + ActionBarBindings = new SavedActionBarBinding[0], Entrance = 0, Exit = -1 + }; + var zones = Enumerable.Range(0, 3) + .Select(i => new SavedZone { Name = $"Z{i}", AdjacentZones = new int[0], Factions = new int[0], Owner = -1 }).ToArray(); + RunSave.Commit(scene.Cache, game, zones, new ProvenanceLedger()); + return new Field { Scene = scene, Galaxy = new Galaxy(scene.Cache, scene.Cache.GetGlobal<SavedGame>(), _ => { }), Ore = ore }; + } + + private static Zone ZoneOf(Field f, int index) + { + var settings = MiningCut3Tests.PlanetSettings(); + settings.AsteroidYield = new ExponentialLerp { Minimum = 4f, Maximum = 4f, Exponent = 1f }; + return index < 0 + ? new Zone(f.Scene.Items, settings, f.Scene.Pack, new GalaxyZone { Name = "Lone", Owner = null }, null) + : new Zone(f.Scene.Items, settings, f.Scene.Pack, f.Galaxy.Zones[index], f.Galaxy); + } + + private Ship Shooter(Field f, Zone zone) + { + var ship = new Ship(f.Scene.Items, zone, MiningCut3Tests.Mint(f.Scene, f.Scene.Hull), new EntitySettings()); + zone.Admit(ship, piloted: false); + return ship; + } + + private void Mine(Field f, Zone zone, Ship ship, int belt, int rock) + { + var chunk = new ChunkId(f.Scene.Belts[belt], rock); + FireControl.Extract(zone, chunk, zone.Wear(chunk, 1e6f), ship, SimulationDice.For(zone.DropSeed, SimulationDice.OreStream, ++_ordinal)); + } + + private static SimpleCommodity[] Stacks(EquippedCargoBay bay) => bay.Cargo.Keys.OfType<SimpleCommodity>().OrderBy(s => s.Lot).ToArray(); + + [Fact] + public void MinedUnitsCarryAnExtractedLotNamingZoneBeltAndOre() + { + var f = Build(); + var zone = ZoneOf(f, 2); + var ship = Shooter(f, zone); + var bay = MiningCut5aTests.Bay(f.Scene, ship, 4, 4, "Hold"); + Mine(f, zone, ship, 1, 0); + + var stack = Assert.Single(Stacks(bay)); + Assert.Equal(4, stack.Quantity); + Assert.NotEqual(0, stack.Lot); + var lot = f.Scene.Items.GetLot(stack); + var origin = Assert.IsType<Extracted>(lot.Origin); + Assert.Equal(2, origin.Zone); + Assert.Equal(f.Scene.Belts[1], origin.Body.Key); + Assert.Equal(stack.Data.Key, origin.Commodity.Key); + Assert.Equal(stack.Data.Key, lot.Design.Key); + Assert.Equal(1f, lot.Quality); + Assert.Equal(default, lot.Product); + } + + [Fact] + public void AZoneWithNoGalaxyIsMinus1() + { + var f = Build(); + var zone = ZoneOf(f, -1); + var ship = Shooter(f, zone); + var bay = MiningCut5aTests.Bay(f.Scene, ship, 4, 4, "Hold"); + Mine(f, zone, ship, 0, 0); + Assert.Equal(-1, Assert.IsType<Extracted>(f.Scene.Items.GetLot(Assert.Single(Stacks(bay))).Origin).Zone); + } + + [Fact] + public void UnitsFromOneSourceStack_UnitsFromTwoSourcesDoNot() + { + var f = Build(); + var zone = ZoneOf(f, 1); + var ship = Shooter(f, zone); + var bay = MiningCut5aTests.Bay(f.Scene, ship, 4, 4, "Hold"); + Mine(f, zone, ship, 0, 0); + Mine(f, zone, ship, 0, 1); + var one = Assert.Single(Stacks(bay)); + Assert.Equal(8, one.Quantity); + + Mine(f, zone, ship, 1, 0); + var stacks = Stacks(bay); + Assert.Equal(new[] { 8, 4 }, stacks.Select(s => s.Quantity)); + Assert.NotEqual(stacks[0].Lot, stacks[1].Lot); + Assert.Equal(2, f.Scene.Items.Lots.Lots.Values.Count(l => l.Origin is Extracted)); + // Two lots of one ore still total one commodity for the market and the hold. + Assert.Equal(12, MiningCut5aTests.Units(bay, "Rock", f.Scene)); + } + + // TryFindSpace and the at-coordinate store both look for a stack to top up: a stack of another lot is not one. + [Fact] + public void ASearchAndAStoreIgnoreAStackOfAnotherLot() + { + var f = Build(); + var zone = ZoneOf(f, 0); + var ship = Shooter(f, zone); + var bay = MiningCut5aTests.Bay(f.Scene, ship, 1, 1, "Hold"); + var key = new CultRecordRef<ItemData>(f.Scene.Cache.RefOf(f.Ore).Key); + SimpleCommodity Units(int lot, int quantity) => new SimpleCommodity { Data = key, Lot = lot, Quantity = quantity }; + + Assert.True(bay.TryStore(Units(7, 90))); + Assert.False(bay.TryFindSpace(Units(8, 5), out _)); + Assert.True(bay.TryFindSpace(Units(7, 5), out _)); + var other = Units(8, 5); + Assert.False(bay.TryStore(other, new int2(0, 0))); + Assert.Equal(90, Assert.Single(bay.Cargo.Keys.OfType<SimpleCommodity>()).Quantity); + Assert.Equal(5, other.Quantity); + Assert.True(bay.TryStore(Units(7, 5), new int2(0, 0))); + Assert.Equal(95, Assert.Single(bay.Cargo.Keys.OfType<SimpleCommodity>()).Quantity); + } + + [Fact] + public void ASplitStackKeepsItsLot() + { + var f = Build(); + var zone = ZoneOf(f, 0); + var ship = Shooter(f, zone); + var bay = MiningCut5aTests.Bay(f.Scene, ship, 4, 4, "Hold"); + Mine(f, zone, ship, 0, 0); + var stack = Assert.Single(Stacks(bay)); + + var part = bay.Remove(stack, 3); + Assert.Equal(3, part.Quantity); + Assert.Equal(stack.Lot, part.Lot); + Assert.NotEqual(0, part.Lot); + Assert.Equal(1, stack.Quantity); + } + + // A saved stack above its design's MaxStack comes back as several stacks, every one of the saved lot. + [Fact] + public void ARestoredOversizeStackKeepsItsLot() + { + var f = Build(); + var zone = ZoneOf(f, 0); + var ship = Shooter(f, zone); + var bay = MiningCut5aTests.Bay(f.Scene, ship, 4, 4, "Hold"); + for (var rock = 0; rock < 2; rock++) Mine(f, zone, ship, 0, rock); + var lot = Assert.Single(Stacks(bay)).Lot; + + var pack = EntitySerializer.Pack(ship); + f.Ore.MaxStack = 3; + var restored = EntitySerializer.Unpack(f.Scene.Items, zone, pack); + + var stacks = restored.CargoBays.SelectMany(Stacks).ToArray(); + Assert.Equal(8, stacks.Sum(s => s.Quantity)); + Assert.True(stacks.Length >= 3); + Assert.All(stacks, s => Assert.Equal(lot, s.Lot)); + } + + private CultCache Open() => AetheriaStores.Open(Path.Combine(_root, "Aetheria.cc"), Path.Combine(_root, "run.cc"), Path.Combine(_root, "player.cc")); + + private static ShipPack PackHolding(params ItemInstance[] stacks) => new ShipPack + { + Name = "ship", Hull = new EquippableItem(), + Equipment = Array.Empty<(int2, EquippableItem)>(), CargoBays = Array.Empty<(int2, EquippableItem)>(), + DockingBays = Array.Empty<(int2, EquippableItem)>(), + CargoContents = new[] { stacks.Select((s, i) => (new int2(i, 0), s)).ToArray() }, + DockingBayContents = Array.Empty<(int2, ItemInstance)[]>(), Children = Array.Empty<EntityPack>(), + Temperature = new float[0, 0], Armor = new float[0, 0], Conductivity = new bool2[0, 0], + DockingBayAssignments = Array.Empty<int>(), Settings = new EntitySettings(), WeaponGroups = Array.Empty<int[]>() + }; + + // The ledger as the run file holds it after a save of ships holding `held`. + private ProvenanceLedger SaveAndReload(ProvenanceLedger live, params ItemInstance[] held) + { + using (var cache = AetheriaStores.Open(Path.Combine(_root, "Aetheria.cc"), catalogWritable: true)) + { + cache.Commit(batch => batch.Upsert(new VerseGrammar { Revision = 1 })); + } + using (var cache = Open()) + { + var game = new SavedGame + { + Factions = new CultRecordRef<Faction>[0], Relationships = new FactionRelationship[0], + HomeZones = new Dictionary<int, int>(), BossZones = new Dictionary<int, int>(), DiscoveredZones = new[] { 0 }, + ActionBarBindings = new SavedActionBarBinding[0], Exit = -1 + }; + var zone = new SavedZone + { + Name = "Zone 0", AdjacentZones = Array.Empty<int>(), Factions = Array.Empty<int>(), Owner = -1, + Contents = new ZonePack { Entities = new List<EntityPack> { PackHolding(held) } } + }; + RunSave.Commit(cache, game, new[] { zone }, live); + } + using (var cache = Open()) return RunSave.Lots(cache); + } + + [Fact] + public void AMinedStackSurvivesSaveGc() + { + var f = Build(); + var zone = ZoneOf(f, 1); + var ship = Shooter(f, zone); + var bay = MiningCut5aTests.Bay(f.Scene, ship, 4, 4, "Hold"); + Mine(f, zone, ship, 0, 0); + Mine(f, zone, ship, 1, 0); + var held = Stacks(bay); + Assert.Equal(2, held.Length); + // A third lot nobody holds: floated and gone, or never collected. + var orphan = f.Scene.Items.ExtractedLot(1, new CultRecordKey("elsewhere"), f.Ore); + + var saved = SaveAndReload(f.Scene.Items.Lots, held); + + Assert.Equal(held.Select(s => s.Lot).OrderBy(i => i), saved.Lots.Keys.OrderBy(i => i)); + Assert.DoesNotContain(orphan, saved.Lots.Keys); + var origin = Assert.IsType<Extracted>(saved[held[0].Lot].Origin); + Assert.Equal(1, origin.Zone); + Assert.Equal(f.Scene.Belts[0], origin.Body.Key); + } + + [Fact] + public void TheLotIndexIsRebuiltOnContinue() + { + var f = Build(); + var zone = ZoneOf(f, 1); + var ship = Shooter(f, zone); + var bay = MiningCut5aTests.Bay(f.Scene, ship, 4, 4, "Hold"); + Mine(f, zone, ship, 0, 0); + var held = Assert.Single(Stacks(bay)); + + var saved = SaveAndReload(f.Scene.Items.Lots, held); + var continued = new ItemManager(1u, f.Scene.Cache, saved, RunSaveTests.TestSettings(), _ => { }); + + Assert.Equal(held.Lot, continued.ExtractedLot(1, f.Scene.Belts[0], f.Ore)); + Assert.Single(saved.Lots); + var next = continued.ExtractedLot(1, f.Scene.Belts[1], f.Ore); + Assert.NotEqual(held.Lot, next); + Assert.Equal(2, saved.Lots.Count); + // Zone and ore tell lots apart as the belt does. + Assert.NotEqual(next, continued.ExtractedLot(2, f.Scene.Belts[1], f.Ore)); + } + + // A save from before the field reached SimpleCommodity: Data, Rotation, Quantity and nothing else. + [Fact] + public void OldSavesReadLotZero() + { + var f = Build(); + var options = CultDocumentMessagePackSerialization.OptionsFor(typeof(ItemInstance).Assembly); + var key = new CultRecordRef<ItemData>(f.Scene.Cache.RefOf(f.Ore).Key); + var buffer = new System.Buffers.ArrayBufferWriter<byte>(); + var writer = new MessagePackWriter(buffer); + writer.WriteArrayHeader(2); + writer.Write(0); // Union(0, SimpleCommodity) + writer.WriteArrayHeader(3); + MessagePackSerializer.Serialize(ref writer, key, options); + MessagePackSerializer.Serialize(ref writer, ItemRotation.None, options); + writer.Write(7); + writer.Flush(); + + var old = Assert.IsType<SimpleCommodity>(MessagePackSerializer.Deserialize<ItemInstance>(buffer.WrittenMemory, options)); + Assert.Equal(7, old.Quantity); + Assert.Equal(0, old.Lot); + Assert.Equal(key.Key, old.Data.Key); + + // A lot rides the wire; a Lot-0 stack is no root, so the old stack saves no lot. + var back = MessagePackSerializer.Deserialize<ItemInstance>(MessagePackSerializer.Serialize<ItemInstance>( + new SimpleCommodity { Data = key, Quantity = 2, Lot = 9 }, options), options); + Assert.Equal(9, back.Lot); + Assert.Empty(SaveAndReload(new ProvenanceLedger(), old).Lots); + } +} From d3572c01906653d231310ab7fa625db63a106e9c Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 03:55:32 +0000 Subject: [PATCH 074/108] Save roots: every crafted item roots at Lot 0 too; pin zero-draw mint guard and both root sides Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/SavedGame.cs | 4 +- .../Aetheria.Shared.Tests/MiningCut5bTests.cs | 52 ++++++++++++++++--- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/Assets/Scripts/ServerShared/SavedGame.cs b/Assets/Scripts/ServerShared/SavedGame.cs index 7c7952494..cf225ab8b 100644 --- a/Assets/Scripts/ServerShared/SavedGame.cs +++ b/Assets/Scripts/ServerShared/SavedGame.cs @@ -222,10 +222,12 @@ public static class RunSave .Select(stored => stored.Key) .ToArray(); game.Zones = keys.Select(key => new CultRecordRef<SavedZone>(key)).ToArray(); + // Every crafted item roots, Lot 0 included: a crafted item with no lot is corruption and Reachable throws on it. + // A SimpleCommodity roots only when it names a lot; Lot 0 is bought, staged or loadout stock. var roots = zones .SelectMany(zone => zone.Contents?.Entities ?? new List<EntityPack>()) .SelectMany(EntitySerializer.Items) - .Where(item => item != null && item.Lot != 0) + .Where(item => item != null && (item is CraftedItemInstance || item.Lot != 0)) .Select(item => item.Lot); cache.Commit(batch => { diff --git a/tests/Aetheria.Shared.Tests/MiningCut5bTests.cs b/tests/Aetheria.Shared.Tests/MiningCut5bTests.cs index 45f52c144..9ad960a77 100644 --- a/tests/Aetheria.Shared.Tests/MiningCut5bTests.cs +++ b/tests/Aetheria.Shared.Tests/MiningCut5bTests.cs @@ -196,9 +196,9 @@ public sealed class MiningCut5bTests : IDisposable private CultCache Open() => AetheriaStores.Open(Path.Combine(_root, "Aetheria.cc"), Path.Combine(_root, "run.cc"), Path.Combine(_root, "player.cc")); - private static ShipPack PackHolding(params ItemInstance[] stacks) => new ShipPack + private static ShipPack PackHolding(int hullLot, params ItemInstance[] stacks) => new ShipPack { - Name = "ship", Hull = new EquippableItem(), + Name = "ship", Hull = new EquippableItem { Lot = hullLot }, Equipment = Array.Empty<(int2, EquippableItem)>(), CargoBays = Array.Empty<(int2, EquippableItem)>(), DockingBays = Array.Empty<(int2, EquippableItem)>(), CargoContents = new[] { stacks.Select((s, i) => (new int2(i, 0), s)).ToArray() }, @@ -207,9 +207,13 @@ public sealed class MiningCut5bTests : IDisposable DockingBayAssignments = Array.Empty<int>(), Settings = new EntitySettings(), WeaponGroups = Array.Empty<int[]>() }; + // The ship's hull is a crafted item and roots like any other, so the fixture gives it a lot of its own. + private int _hullLot; + // The ledger as the run file holds it after a save of ships holding `held`. private ProvenanceLedger SaveAndReload(ProvenanceLedger live, params ItemInstance[] held) { + _hullLot = live.Add(new Lot { Design = default, Origin = new Attributed(), Quality = 1f, Roles = new List<RoleFill>() }); using (var cache = AetheriaStores.Open(Path.Combine(_root, "Aetheria.cc"), catalogWritable: true)) { cache.Commit(batch => batch.Upsert(new VerseGrammar { Revision = 1 })); @@ -225,13 +229,46 @@ public sealed class MiningCut5bTests : IDisposable var zone = new SavedZone { Name = "Zone 0", AdjacentZones = Array.Empty<int>(), Factions = Array.Empty<int>(), Owner = -1, - Contents = new ZonePack { Entities = new List<EntityPack> { PackHolding(held) } } + Contents = new ZonePack { Entities = new List<EntityPack> { PackHolding(_hullLot, held) } } }; RunSave.Commit(cache, game, new[] { zone }, live); } using (var cache = Open()) return RunSave.Lots(cache); } + // An ore the draw never picks mints no lot: the ledger gains nothing for it, only for the ore that was drawn. + [Fact] + public void AnOreThatDrawsZeroUnitsMintsNoLot() + { + var f = Build(); + var dud = MiningCut5aTests.Commodity("Dud"); + MiningCut5aTests.Stock(f.Scene, f.Scene.Kinds[0], (f.Ore, 1f), (dud, 1e-12f)); + var zone = ZoneOf(f, 0); + var ship = Shooter(f, zone); + var bay = MiningCut5aTests.Bay(f.Scene, ship, 4, 4, "Hold"); + var before = f.Scene.Items.Lots.Lots.Count; + Mine(f, zone, ship, 0, 0); + + Assert.Equal(4, MiningCut5aTests.Units(bay, "Rock", f.Scene)); + Assert.Equal(0, MiningCut5aTests.Units(bay, "Dud", f.Scene)); + Assert.Equal(before + 1, f.Scene.Items.Lots.Lots.Count); + Assert.Equal(1, f.Scene.Items.Lots.Lots.Values.Count(l => l.Origin is Extracted)); + } + + // A crafted item with no lot is corruption and the save says so; a SimpleCommodity at Lot 0 is ordinary stock. + [Fact] + public void ACraftedItemAtLotZeroFailsTheSaveLoudly() + { + var f = Build(); + var crafted = new EquippableItem { Data = f.Scene.Cache.RefOf<ItemData>(f.Scene.Hull), Lot = 0 }; + var thrown = Assert.Throws<InvalidOperationException>(() => SaveAndReload(new ProvenanceLedger(), crafted)); + Assert.Contains("Lot 0 is not in the provenance ledger", thrown.Message); + + var stock = new SimpleCommodity { Data = new CultRecordRef<ItemData>(f.Scene.Cache.RefOf(f.Ore).Key), Quantity = 3, Lot = 0 }; + var savedStock = SaveAndReload(new ProvenanceLedger(), stock); + Assert.Equal(new[] { _hullLot }, savedStock.Lots.Keys); + } + [Fact] public void AMinedStackSurvivesSaveGc() { @@ -248,7 +285,7 @@ public sealed class MiningCut5bTests : IDisposable var saved = SaveAndReload(f.Scene.Items.Lots, held); - Assert.Equal(held.Select(s => s.Lot).OrderBy(i => i), saved.Lots.Keys.OrderBy(i => i)); + Assert.Equal(held.Select(s => s.Lot).Append(_hullLot).OrderBy(i => i), saved.Lots.Keys.OrderBy(i => i)); Assert.DoesNotContain(orphan, saved.Lots.Keys); var origin = Assert.IsType<Extracted>(saved[held[0].Lot].Origin); Assert.Equal(1, origin.Zone); @@ -269,10 +306,10 @@ public sealed class MiningCut5bTests : IDisposable var continued = new ItemManager(1u, f.Scene.Cache, saved, RunSaveTests.TestSettings(), _ => { }); Assert.Equal(held.Lot, continued.ExtractedLot(1, f.Scene.Belts[0], f.Ore)); - Assert.Single(saved.Lots); + Assert.Equal(2, saved.Lots.Count); // the mined lot and the hull var next = continued.ExtractedLot(1, f.Scene.Belts[1], f.Ore); Assert.NotEqual(held.Lot, next); - Assert.Equal(2, saved.Lots.Count); + Assert.Equal(3, saved.Lots.Count); // Zone and ore tell lots apart as the belt does. Assert.NotEqual(next, continued.ExtractedLot(2, f.Scene.Belts[1], f.Ore)); } @@ -303,6 +340,7 @@ public sealed class MiningCut5bTests : IDisposable var back = MessagePackSerializer.Deserialize<ItemInstance>(MessagePackSerializer.Serialize<ItemInstance>( new SimpleCommodity { Data = key, Quantity = 2, Lot = 9 }, options), options); Assert.Equal(9, back.Lot); - Assert.Empty(SaveAndReload(new ProvenanceLedger(), old).Lots); + var savedOld = SaveAndReload(new ProvenanceLedger(), old); + Assert.Equal(new[] { _hullLot }, savedOld.Lots.Keys); // the hull only } } From 149c513269164e6d55c6e1465b13ee1502985ce7 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 05:14:48 +0000 Subject: [PATCH 075/108] Mining 6 C1-C3: Zone.CargoGained, published by Extract and TryPickUp; HaulFeed words and hold fill Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/FireControl.cs | 12 ++++- Assets/Scripts/ServerShared/HaulFeed.cs | 47 ++++++++++++++++++++ Assets/Scripts/ServerShared/HaulFeed.cs.meta | 11 +++++ Assets/Scripts/ServerShared/Zone.cs | 7 +++ 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 Assets/Scripts/ServerShared/HaulFeed.cs create mode 100644 Assets/Scripts/ServerShared/HaulFeed.cs.meta diff --git a/Assets/Scripts/ServerShared/FireControl.cs b/Assets/Scripts/ServerShared/FireControl.cs index bb6d48d6c..9102b16eb 100644 --- a/Assets/Scripts/ServerShared/FireControl.cs +++ b/Assets/Scripts/ServerShared/FireControl.cs @@ -1872,14 +1872,24 @@ public static class FireControl var commodity = (SimpleCommodityData) catalog.Get(ores[i].Commodity); var maxStack = Math.Max(1, commodity.MaxStack); var lot = counts[i] > 0 ? shooter.ItemManager.ExtractedLot(zoneIndex, chunk.Field, commodity) : 0; + var adrift = 0; for (var left = counts[i]; left > 0; left -= maxStack) { var stack = new SimpleCommodity { Data = new CultRecordRef<ItemData>(key), Lot = lot, Quantity = Math.Min(left, maxStack) }; // A partial store leaves the remainder in Quantity and returns false, so the next bay is offered the rest. var stored = false; if (present) foreach (var bay in shooter.CargoBays) if (stored = bay.TryStore(stack)) break; - if (!stored) zone.Release(stack, at, velocity); + if (!stored) + { + adrift += stack.Quantity; + zone.Release(stack, at, velocity); + } } + if (counts[i] > 0) + zone.CargoGained.OnNext(new CargoGain + { + Taker = shooter, Design = new CultRecordRef<ItemData>(key), Lot = lot, Stored = counts[i] - adrift, Adrift = adrift, Kind = GainKind.Mined + }); } } diff --git a/Assets/Scripts/ServerShared/HaulFeed.cs b/Assets/Scripts/ServerShared/HaulFeed.cs new file mode 100644 index 000000000..b6f4055c8 --- /dev/null +++ b/Assets/Scripts/ServerShared/HaulFeed.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using System.Linq; +using GameCult.Caching; + +public enum GainKind { Mined, Collected } + +// One entry into a hold: what Extract stored (and let float) of one ore, or what a pickup collected. Stored plus Adrift is +// the units; a pickup has Adrift 0. Published on Zone.CargoGained by its two writers and read by presentations only. +public struct CargoGain +{ + public Entity Taker; + public CultRecordRef<ItemData> Design; + public int Lot; + public int Stored; + public int Adrift; + public GainKind Kind; +} + +// The words for a cargo gain, and the taker's hold fill. Nothing here is stored: the line and the fill are derived on +// every call. +public static class HaulFeed +{ + public static string Line(CargoGain gain, ItemManager items) + { + var name = items.ItemData.Get(gain.Design).Name; + var (used, total) = HoldFill(gain.Taker?.CargoBays ?? Enumerable.Empty<EquippedCargoBay>()); + var hold = $"(hold {used}/{total})"; + if (gain.Kind == GainKind.Collected) return $"Collected {gain.Stored} {name} {hold}"; + return gain.Adrift > 0 + ? $"+{gain.Stored} {name}, {gain.Adrift} adrift {hold}" + : $"+{gain.Stored} {name} {hold}"; + } + + // Occupied cells over the bays' interiors, a multi-cell item counted per cell. + public static (int used, int total) HoldFill(IEnumerable<EquippedCargoBay> bays) + { + int used = 0, total = 0; + foreach (var bay in bays) + foreach (var v in bay.Data.InteriorShape.AllCoordinates) + { + if (!bay.Data.InteriorShape[v]) continue; + total++; + if (bay.Occupancy[v.x, v.y] != null) used++; + } + return (used, total); + } +} diff --git a/Assets/Scripts/ServerShared/HaulFeed.cs.meta b/Assets/Scripts/ServerShared/HaulFeed.cs.meta new file mode 100644 index 000000000..b9b4b88b6 --- /dev/null +++ b/Assets/Scripts/ServerShared/HaulFeed.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4d3ef606ec5240119cbb3d7dd51123d9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/ServerShared/Zone.cs b/Assets/Scripts/ServerShared/Zone.cs index 7cbde82ef..0d729d2be 100644 --- a/Assets/Scripts/ServerShared/Zone.cs +++ b/Assets/Scripts/ServerShared/Zone.cs @@ -90,6 +90,8 @@ public class Zone public Subject<ShotOutcome> ShotResolved = new Subject<ShotOutcome>(); // Contacts.Step publishes each hull-on-hull contact it resolves; presentations are the only readers. public Subject<ContactEvent> Contacted = new Subject<ContactEvent>(); + // Published by FireControl.Extract and TryPickUp once ore or an item enters (or is offered to) a hold; read by presentations only. + public Subject<CargoGain> CargoGained = new Subject<CargoGain>(); private int _nextShotId; public int NextShotId() => ++_nextShotId; @@ -443,6 +445,11 @@ public class Zone if (floating == null || (floating.Holder != null && !ReferenceEquals(floating.Holder, taker))) return false; if (!taker.CargoBays.Any(bay => bay.TryStore(floating.Item))) return false; FloatingItems.Remove(floating); + CargoGained.OnNext(new CargoGain + { + Taker = taker, Design = floating.Item.Data, Lot = floating.Item.Lot, Kind = GainKind.Collected, + Stored = floating.Item is SimpleCommodity stack ? stack.Quantity : 1 + }); return true; } From d09850cfce116ed3c61512ab9484171293101a0d Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 05:14:48 +0000 Subject: [PATCH 076/108] Mining 6 C4: StationServices.OreValue and TrySellOre sell mined stacks through TrySell Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../Scripts/ServerShared/StationServices.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Assets/Scripts/ServerShared/StationServices.cs b/Assets/Scripts/ServerShared/StationServices.cs index be15fc74e..dace9288e 100644 --- a/Assets/Scripts/ServerShared/StationServices.cs +++ b/Assets/Scripts/ServerShared/StationServices.cs @@ -114,6 +114,30 @@ public static class StationServices return true; } + // The mined stacks of the bays: simple commodities with a lot whose origin is Extracted. Ammunition and consumables are + // simple commodities too, and a bought or staged commodity has Lot 0, which GetLot cannot resolve. + private static ItemInstance[] OreStacks(ItemManager items, IEnumerable<EquippedCargoBay> bays) => + bays.SelectMany(bay => bay.Cargo.Keys.OfType<SimpleCommodity>().Where(stack => stack.Lot != 0 && items.GetLot(stack).Origin is Extracted).Select(stack => (ItemInstance) stack)).ToArray(); + + // What the station pays for every mined stack of the bays: the sum of SellPrice over the stacks TrySellOre sells. + public static int OreValue(ItemManager items, IEnumerable<EquippedCargoBay> bays) => + (int) Math.Min(OreStacks(items, bays).Sum(stack => (long) SellPrice(items, stack)), int.MaxValue); + + // Sells every mined stack of the bays, each through TrySell, so the market's absorb rule and the price are the + // single-stack path's. Returns the units sold. + public static int TrySellOre(IEnumerable<EquippedCargoBay> bays, Entity station, ref int credits) + { + var bayList = bays.ToArray(); + var units = 0; + foreach (var stack in OreStacks(station.ItemManager, bayList)) + { + var quantity = ((SimpleCommodity) stack).Quantity; + var from = bayList.First(bay => bay.Cargo.ContainsKey(stack)); + if (TrySell(from, station, stack, ref credits)) units += quantity; + } + return units; + } + // The repair: armour and every durability go back to design and the station charges RepairCost. False, with // nothing restored, when the credits fall short. public static bool TryRepair(Entity entity, ref int credits) From 1662c53b9c0ac38f3b947a6584652d4e26f53b33 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 05:16:35 +0000 Subject: [PATCH 077/108] Mining 6 tests: CargoGained from Extract and TryPickUp, HaulFeed, TrySellOre, DemoLoop sells ore in one step Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/DemoLoopTests.cs | 16 +- tests/Aetheria.Shared.Tests/HaulFeedTests.cs | 178 ++++++++++++++++++ .../StationServicesTests.cs | 65 +++++++ 3 files changed, 256 insertions(+), 3 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/HaulFeedTests.cs diff --git a/tests/Aetheria.Shared.Tests/DemoLoopTests.cs b/tests/Aetheria.Shared.Tests/DemoLoopTests.cs index 7e765174c..a2daf444a 100644 --- a/tests/Aetheria.Shared.Tests/DemoLoopTests.cs +++ b/tests/Aetheria.Shared.Tests/DemoLoopTests.cs @@ -3,7 +3,9 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ using System.Linq; +using System.Collections.Generic; using CultMath; +using UniRx; using Xunit; // The demo loop on the shipped catalog (aetheria-release, mining 5a and the ore sheet): the player's own gun breaks a rock @@ -36,6 +38,8 @@ public sealed partial class RunStartTests arena.Update(.02f); Hold(); Assert.True(player.SetTarget(rock), "the rock is a target"); + var gains = new List<CargoGain>(); + arena.CargoGained.Subscribe(gains.Add); laser.Activate(); for (var elapsed = 0f; elapsed < 20f && arena.ChunkExists(rock); elapsed += .02f) { Hold(); arena.Update(.02f); } var info = player.ChunkInfo(rock); @@ -46,13 +50,19 @@ public sealed partial class RunStartTests .Where(h => ores.Contains(_items.GetData(h.stack).Name)).ToArray(); Assert.NotEmpty(held); Assert.Empty(arena.FloatingItems); + // The feed saw every unit that went into the hold and none float. + Assert.NotEmpty(gains); + Assert.All(gains, gain => Assert.Equal((GainKind.Mined, 0), (gain.Kind, gain.Adrift))); + Assert.Equal(held.Sum(h => h.stack.Quantity), gains.Sum(gain => gain.Stored)); var zenith = arena.Entities.Single(entity => entity.HullData.Name == "Zenith"); var credits = 0; - // Every ore stack goes: the market takes it all, whatever the full hold of Zenith has room for. - foreach (var (from, sold) in held) Assert.True(StationServices.TrySell(from, zenith, sold, ref credits), "the market takes the ore"); + // Every mined stack goes in one sale: the market takes it all, whatever the full hold of Zenith has room for. + var value = StationServices.OreValue(_items, player.CargoBays); + Assert.True(value > 0); + Assert.Equal(gains.Sum(gain => gain.Stored), StationServices.TrySellOre(player.CargoBays, zenith, ref credits)); + Assert.Equal(value, credits); Assert.DoesNotContain(player.CargoBays.SelectMany(bay => bay.Cargo.Keys.OfType<SimpleCommodity>()), c => ores.Contains(_items.GetData(c).Name)); - Assert.True(credits > 0, "the station pays for the ore"); var cell = Enumerable.Range(0, player.MaxArmor.GetLength(0)).SelectMany(x => Enumerable.Range(0, player.MaxArmor.GetLength(1)).Select(y => (x, y))) .First(c => player.MaxArmor[c.x, c.y] > 0); diff --git a/tests/Aetheria.Shared.Tests/HaulFeedTests.cs b/tests/Aetheria.Shared.Tests/HaulFeedTests.cs new file mode 100644 index 000000000..7157020b7 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/HaulFeedTests.cs @@ -0,0 +1,178 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using CultMath; +using GameCult.Caching; +using UniRx; +using Xunit; + +// Zone.CargoGained and HaulFeed (aetheria-release mining 6): Extract and TryPickUp publish what entered a hold, once; the feed +// words it and counts the hold. Fixtures are Mining Cut 5a's rig. +public sealed class HaulFeedTests : IDisposable +{ + private readonly MiningCut5aTests _five = new MiningCut5aTests(); + private readonly MiningCut4bTests _rigs = new MiningCut4bTests(); + + public void Dispose() + { + _five.Dispose(); + _rigs.Dispose(); + } + + // The 5a rig: a rock of 4 units, the shooter holding one bay of the given size; the event log records every gain. + private (MiningCut4bTests.Rig Rig, EquippedCargoBay Bay, List<CargoGain> Gains) Mining(int w, int h, params (SimpleCommodityData, float)[] ores) + { + var kind = MiningCut3Tests.Kind("Asteroid", 20f); + var rig = _rigs.Build(damage: 1000f, fuse: null, blastRadius: 0f, precision: 1000f, rockSize: .5f, velocity: 0f, kind: kind, galaxySeed: 0); + MiningCut5aTests.Stock(rig.Scene, kind, ores); + var bay = MiningCut5aTests.Bay(rig.Scene, rig.Shooter, w, h, "Hold"); + var gains = new List<CargoGain>(); + rig.Zone.CargoGained.Subscribe(gains.Add); + return (rig, bay, gains); + } + + private static CultMath.Random Dice(MiningCut4bTests.Rig rig, uint n) => SimulationDice.For(rig.Zone.DropSeed, SimulationDice.OreStream, n); + + private static void Break(MiningCut4bTests.Rig rig) + { + for (var shot = 0; shot < 40 && rig.Zone.ChunkExists(rig.Rock); shot++) + { + FireControl.Fire(rig.Gun, rig.GunItem, rig.Shooter); + MiningCut4bTests.Run(rig, .05f); + } + Assert.False(rig.Zone.ChunkExists(rig.Rock)); + } + + [Fact] + public void AnExtractionPublishesWhatWasStoredAndWhatFloated() + { + // Room for everything. + var (rig, bay, gains) = Mining(4, 4, (MiningCut5aTests.Commodity("Rock"), 1f)); + Break(rig); + var gain = Assert.Single(gains); + Assert.Equal((GainKind.Mined, 4, 0), (gain.Kind, gain.Stored, gain.Adrift)); + Assert.Same(rig.Shooter, gain.Taker); + Assert.Equal(4, MiningCut5aTests.Units(bay, "Rock", rig.Scene)); + Assert.NotEqual(0, gain.Lot); + + // A full hold: everything floats. + var (full, fullBay, fullGains) = Mining(1, 1, (MiningCut5aTests.Commodity("Grit", maxStack: 1), 1f)); + Assert.True(fullBay.TryStore(new SimpleCommodity { Data = full.Scene.Cache.RefOf<ItemData>(full.Scene.Cache.GetByName<SimpleCommodityData>("Grit")), Quantity = 1 })); + Break(full); + var overflow = Assert.Single(fullGains); + Assert.Equal((0, 4), (overflow.Stored, overflow.Adrift)); + Assert.Equal(4, MiningCut5aTests.Units(full.Zone.FloatingItems.Select(f => f.Item), "Grit", full.Scene)); + + // A partial store: the hold takes two of four. + var (part, partBay, partGains) = Mining(1, 1, (MiningCut5aTests.Commodity("Grit", maxStack: 2), 1f)); + Break(part); + var split = Assert.Single(partGains); + Assert.Equal((2, 2), (split.Stored, split.Adrift)); + Assert.Equal(2, MiningCut5aTests.Units(partBay, "Grit", part.Scene)); + Assert.Equal(2, MiningCut5aTests.Units(part.Zone.FloatingItems.Select(f => f.Item), "Grit", part.Scene)); + } + + [Fact] + public void AGoneShooterPublishesEverythingAdrift() + { + var (rig, _, gains) = Mining(4, 4, (MiningCut5aTests.Commodity("Rock"), 1f)); + rig.Shooter.HeatstrokeDeath.OnNext(UniRx.Unit.Default); + var at = rig.Zone.ChunkPose(rig.Rock.Field, rig.Rock.Index).xy; + FireControl.Extract(rig.Zone, rig.Rock, rig.Zone.Wear(rig.Rock, 1e6f), rig.Shooter, Dice(rig, 1)); + var gain = Assert.Single(gains); + Assert.Equal((0, 4), (gain.Stored, gain.Adrift)); + } + + [Fact] + public void AMineAndANullShooterPublishNothing() + { + var (rig, _, gains) = Mining(4, 4, (MiningCut5aTests.Commodity("Rock"), 1f)); + FireControl.Extract(rig.Zone, rig.Rock, rig.Zone.Wear(rig.Rock, 1e6f), null, Dice(rig, 1)); + Assert.Empty(gains); + Assert.Empty(rig.Zone.FloatingItems); + } + + [Fact] + public void AMergeIntoAnExistingStackStillPublishes() + { + var (rig, bay, gains) = Mining(4, 4, (MiningCut5aTests.Commodity("Rock"), 1f)); + var chunk = rig.Rock; + FireControl.Extract(rig.Zone, chunk, rig.Zone.Wear(chunk, 1e6f), rig.Shooter, Dice(rig, 1)); + var keys = bay.Cargo.Keys.ToArray(); + // Same rock field and index, same ore, so the same lot: the second extraction merges and writes no Cargo key. + FireControl.Extract(rig.Zone, chunk, 40f, rig.Shooter, Dice(rig, 2)); + Assert.Equal(keys, bay.Cargo.Keys.ToArray()); + Assert.Equal(2, gains.Count); + Assert.Equal(gains[0].Lot, gains[1].Lot); + Assert.True(gains[1].Stored > 0); + } + + [Fact] + public void EveryOreOfOneExtractionPublishesOnce() + { + var (rig, _, gains) = Mining(8, 8, (MiningCut5aTests.Commodity("Rock"), 1f), (MiningCut5aTests.Commodity("Gold"), 1f)); + rig.Zone.Settings.AsteroidYield = new ExponentialLerp { Minimum = 400f, Maximum = 400f, Exponent = 1f }; + FireControl.Extract(rig.Zone, rig.Rock, rig.Zone.Wear(rig.Rock, 1e6f), rig.Shooter, Dice(rig, 3)); + Assert.Equal(2, gains.Count); + Assert.Equal(2, gains.Select(g => g.Lot).Distinct().Count()); + Assert.All(gains, g => Assert.True(g.Stored + g.Adrift > 0)); + } + + [Fact] + public void APickupPublishesCollected() + { + var grit = MiningCut5aTests.Commodity("Grit", maxStack: 2); + var (rig, _, gains) = Mining(1, 1, (grit, 1f)); + Break(rig); + gains.Clear(); + var floating = rig.Zone.FloatingItems.First(); + var quantity = ((SimpleCommodity) floating.Item).Quantity; + + // A taker with no room is refused and publishes nothing. + var packed = new Ship(rig.Scene.Items, rig.Zone, MiningCut3Tests.Mint(rig.Scene, rig.Scene.Hull), new EntitySettings()); + rig.Zone.Admit(packed, piloted: false); + Assert.False(rig.Zone.TryPickUp(packed, floating.Id)); + Assert.Empty(gains); + + var taker = new Ship(rig.Scene.Items, rig.Zone, MiningCut3Tests.Mint(rig.Scene, rig.Scene.Hull), new EntitySettings()); + rig.Zone.Admit(taker, piloted: false); + MiningCut5aTests.Bay(rig.Scene, taker, 4, 4, "Taker"); + Assert.True(rig.Zone.TryPickUp(taker, floating.Id)); + var gain = Assert.Single(gains); + Assert.Equal((GainKind.Collected, quantity, 0), (gain.Kind, gain.Stored, gain.Adrift)); + Assert.Same(taker, gain.Taker); + } + + [Fact] + public void TheLineNamesWhatWasTakenAndWhatFloated() + { + var (rig, bay, _) = Mining(4, 4, (MiningCut5aTests.Commodity("Rock"), 1f)); + var items = rig.Scene.Items; + var design = rig.Scene.Cache.RefOf<ItemData>(rig.Scene.Cache.GetByName<SimpleCommodityData>("Rock")); + var fill = HaulFeed.HoldFill(rig.Shooter.CargoBays); + var hold = $"hold {fill.used}/{fill.total}"; + + var clean = HaulFeed.Line(new CargoGain { Taker = rig.Shooter, Design = design, Stored = 3, Kind = GainKind.Mined }, items); + Assert.Contains("3", clean); + Assert.Contains("Rock", clean); + Assert.Contains(hold, clean); + Assert.DoesNotContain("adrift", clean); + + var spill = HaulFeed.Line(new CargoGain { Taker = rig.Shooter, Design = design, Stored = 1, Adrift = 2, Kind = GainKind.Mined }, items); + Assert.Contains("2 adrift", spill); + Assert.Contains("Rock", spill); + Assert.DoesNotContain("adrift", HaulFeed.Line(new CargoGain { Taker = rig.Shooter, Design = design, Stored = 2, Kind = GainKind.Collected }, items)); + } + + [Fact] + public void HoldFillCountsOccupiedCellsAcrossBays() + { + var (rig, bay, _) = Mining(2, 2, (MiningCut5aTests.Commodity("Rock"), 1f)); + var second = MiningCut5aTests.Bay(rig.Scene, rig.Shooter, 3, 1, "Aft"); + Assert.Equal((0, 7), HaulFeed.HoldFill(new[] { bay, second })); + var rock = rig.Scene.Cache.GetByName<SimpleCommodityData>("Rock"); + Assert.True(bay.TryStore(new SimpleCommodity { Data = rig.Scene.Cache.RefOf<ItemData>(rock), Quantity = 1 })); + Assert.True(second.TryStore(new SimpleCommodity { Data = rig.Scene.Cache.RefOf<ItemData>(rock), Quantity = 1 })); + Assert.Equal((2, 7), HaulFeed.HoldFill(new[] { bay, second })); + } +} diff --git a/tests/Aetheria.Shared.Tests/StationServicesTests.cs b/tests/Aetheria.Shared.Tests/StationServicesTests.cs index 824ef7158..b255ad71b 100644 --- a/tests/Aetheria.Shared.Tests/StationServicesTests.cs +++ b/tests/Aetheria.Shared.Tests/StationServicesTests.cs @@ -505,4 +505,69 @@ public sealed class StationServicesTests : IDisposable Assert.Equal(BuyResult.Bought, StationServices.TryBuy(_items, ore, 10, ref credits, () => true)); Assert.Equal(0, credits); } + + private SimpleCommodity Mined(int quantity) + { + var data = _cache.GetByName<SimpleCommodityData>("Ore"); + return new SimpleCommodity { Data = _cache.RefOf<ItemData>(data), Quantity = quantity, Lot = _items.ExtractedLot(0, default, data) }; + } + + [Fact] + public void SellOreSellsOnlyMinedStacks() + { + var ship = Ship(); + var bay = ship.CargoBays.Single(); + var mined = Mined(10); + var staged = Ore(5); + var gun = Mint("Gun"); + Assert.True(bay.TryStore(mined)); + Assert.True(bay.TryStore(staged)); + Assert.True(bay.TryStore(gun)); + var station = Station(); + var value = StationServices.OreValue(_items, ship.CargoBays); + Assert.Equal(StationServices.SellPrice(_items, mined), value); + Assert.True(value > 0); + + var credits = 100; + Assert.Equal(10, StationServices.TrySellOre(ship.CargoBays, station, ref credits)); + Assert.Equal(100 + value, credits); + Assert.DoesNotContain(mined, bay.Cargo.Keys); + Assert.Contains(staged, bay.Cargo.Keys); + Assert.Contains(gun, bay.Cargo.Keys); + } + + [Fact] + public void SellOreAcrossBaysAndShips() + { + var one = Ship(); + var two = Ship(); + var bays = one.CargoBays.Concat(two.CargoBays).ToArray(); + Assert.True(one.CargoBays.Single().TryStore(Mined(30))); + Assert.True(two.CargoBays.Single().TryStore(Mined(40))); + var station = Station(); + // Fill the station's bay so nothing more fits: the market absorbs the sale at full price all the same. + for (var i = 0; i < 20; i++) station.CargoBays.Single().TryStore(Ore(100)); + var value = StationServices.OreValue(_items, bays); + Assert.Equal(StationServices.SellPrice(_items, Ore(70)), value); + + var credits = 0; + Assert.Equal(70, StationServices.TrySellOre(bays, station, ref credits)); + Assert.Equal(value, credits); + Assert.All(bays, bay => Assert.Empty(bay.Cargo.Keys.OfType<SimpleCommodity>())); + } + + [Fact] + public void SellOreWithNoOreChangesNothing() + { + var ship = Ship(); + var bay = ship.CargoBays.Single(); + Assert.True(bay.TryStore(Ore(5))); + Assert.True(bay.TryStore(Mint("Gun"))); + var held = bay.Cargo.Count; + var credits = 100; + Assert.Equal(0, StationServices.OreValue(_items, ship.CargoBays)); + Assert.Equal(0, StationServices.TrySellOre(ship.CargoBays, Station(), ref credits)); + Assert.Equal(100, credits); + Assert.Equal(held, bay.Cargo.Count); + } } From c131045e7d9c9e19668d5b0a61a93a4d3e241d7d Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 05:32:18 +0000 Subject: [PATCH 078/108] Mining 6 C5: Event Log shows each take (CargoGained), Sell Ore foldout entry; dormant log activated, placeholder text removed Option event-log of question mining-6-feedback-surface (recommended; no ruling). Unity files are not compiled here. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scenes/ARPG.unity | 23 ++------------------ Assets/Scripts/EventLog.cs | 3 ++- Assets/Scripts/Gameplay/ActionGameManager.cs | 6 +++++ Assets/Scripts/UI/Menu/TradeMenu.cs | 13 +++++++++++ 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Assets/Scenes/ARPG.unity b/Assets/Scenes/ARPG.unity index 4d5b15473..f583a38ec 100644 --- a/Assets/Scenes/ARPG.unity +++ b/Assets/Scenes/ARPG.unity @@ -21236,7 +21236,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &1396909587 RectTransform: m_ObjectHideFlags: 0 @@ -24703,26 +24703,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: "What the fuck did you just fucking type about me, you little bitch? I\u2019ll - have you know I graduated top of my class at MIT, and I\u2019ve been involved - in numerous secret raids with Anonymous, and I have over 300 confirmed DDoSes.\n\nI - am trained in online trolling and I\u2019m the top hacker in the entire world. - You are nothing to me but just another virus host. I will wipe you the fuck out - with precision the likes of which has never been seen before on the Internet, - mark my fucking words. You think you can get away with typing that shit to me - over the Internet? Think again, fucker.\n\nAs we chat over IRC I am tracing your - IP with my damn bare hands so you better prepare for the storm, maggot. The storm - that wipes out the pathetic little thing you call your computer. You\u2019re - fucking dead, kid. I can be anywhere, anytime, and I can hack into your files - in over seven hundred ways, and that\u2019s just with my bare hands.\n\nNot only - am I extensively trained in hacking, but I have access to the entire arsenal - of every piece of malware ever created and I will use it to its full extent to - wipe your miserable ass off the face of the world wide web, you little shit. - If only you could have known what unholy retribution your little \u201Cclever\u201D - comment was about to bring down upon you, maybe you would have held your fucking - fingers. But you couldn\u2019t, you didn\u2019t, and now you\u2019re paying the - price, you goddamn idiot. I will shit code all over you and you will drown in - it.\n\nYou\u2019re fucking dead, kiddo." + m_text: "" m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 53555f7a2d5e745428813f1b1118734f, type: 2} m_sharedMaterial: {fileID: -2804126062856497447, guid: 53555f7a2d5e745428813f1b1118734f, diff --git a/Assets/Scripts/EventLog.cs b/Assets/Scripts/EventLog.cs index 54db8dd57..967653b1d 100644 --- a/Assets/Scripts/EventLog.cs +++ b/Assets/Scripts/EventLog.cs @@ -13,7 +13,8 @@ public class EventLog : MonoBehaviour private SizedQueue<string> LogMessages; private StringBuilder LogText; - private void Start() + // Awake, not Start: a message can arrive in the frame the parent activates, before Start would run. + private void Awake() { LogMessages = new SizedQueue<string>(LineCount); LogText = new StringBuilder(); diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index a0cf3a4c1..8c2b38345 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -1092,6 +1092,12 @@ public class ActionGameManager : MonoBehaviour _shipSubscriptions.Add(CurrentEntity.Zone.ShotResolved .Where(outcome => outcome.Source == CurrentEntity) .Subscribe(outcome => _debugLastShots[outcome.Weapon] = outcome)); + _shipSubscriptions.Add(CurrentEntity.Zone.CargoGained + .Where(gain => gain.Taker == CurrentEntity) + .Subscribe(gain => + { + if (EventLog != null) EventLog.LogMessage(HaulFeed.Line(gain, ItemManager), gain.Adrift > 0 ? Color.yellow : Color.white); + })); FollowCamera.LookAt = ZoneRenderer.EntityInstances[CurrentEntity].LookAtPoint; FollowCamera.Follow = ZoneRenderer.EntityInstances[CurrentEntity].transform; diff --git a/Assets/Scripts/UI/Menu/TradeMenu.cs b/Assets/Scripts/UI/Menu/TradeMenu.cs index 13345f88a..5f4123ff2 100644 --- a/Assets/Scripts/UI/Menu/TradeMenu.cs +++ b/Assets/Scripts/UI/Menu/TradeMenu.cs @@ -312,6 +312,17 @@ public class TradeMenu : MonoBehaviour Dialog.MoveToCursor(); } + // Sells every mined stack of the player's ships' bays in one step; the station pays through TrySell, so nothing refuses. + private void SellOre() + { + StationServices.TrySellOre(PlayerBays(), GameManager.DockedEntity, ref GameManager.Credits); + UpdateCreditsLabel(); + Populate(); + } + + private IEnumerable<EquippedCargoBay> PlayerBays() => + GameManager.CurrentEntity.Parent.Children.Where(e => e is Ship {IsPlayerShip: true}).SelectMany(s => s.CargoBays); + private void Repair() { if (StationServices.TryRepair(GameManager.CurrentEntity, ref GameManager.Credits)) @@ -398,6 +409,8 @@ public class TradeMenu : MonoBehaviour }); var repairCost = StationServices.RepairCost(GameManager.ItemManager, GameManager.CurrentEntity); if (repairCost > 0) ContextMenu.AddOption($"Repair ({repairCost:N0})", Repair); + var oreValue = StationServices.OreValue(GameManager.ItemManager, PlayerBays()); + if (oreValue > 0) ContextMenu.AddOption($"Sell Ore ({oreValue:N0})", SellOre); ContextMenu.Show(); }); } From b5cfa3cbea7a07b12b45411ef8c3d88d65c9baca Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 05:58:28 +0000 Subject: [PATCH 079/108] Mining 6 fix: pickup reports the whole stack (read Quantity before TryStore); pin sell-ore Origin and Collected hold fill Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Zone.cs | 5 ++++- tests/Aetheria.Shared.Tests/HaulFeedTests.cs | 22 ++++++++++++++++++- .../StationServicesTests.cs | 17 ++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/ServerShared/Zone.cs b/Assets/Scripts/ServerShared/Zone.cs index 0d729d2be..74d1486c3 100644 --- a/Assets/Scripts/ServerShared/Zone.cs +++ b/Assets/Scripts/ServerShared/Zone.cs @@ -443,12 +443,15 @@ public class Zone { var floating = FloatingItems.FirstOrDefault(f => f.Id.Equals(id)); if (floating == null || (floating.Holder != null && !ReferenceEquals(floating.Holder, taker))) return false; + // The quantity is read before the store: a store that merges into a part-filled stack and spills the rest into a + // new cell rewrites the item's Quantity. + var stored = floating.Item is SimpleCommodity stack ? stack.Quantity : 1; if (!taker.CargoBays.Any(bay => bay.TryStore(floating.Item))) return false; FloatingItems.Remove(floating); CargoGained.OnNext(new CargoGain { Taker = taker, Design = floating.Item.Data, Lot = floating.Item.Lot, Kind = GainKind.Collected, - Stored = floating.Item is SimpleCommodity stack ? stack.Quantity : 1 + Stored = stored }); return true; } diff --git a/tests/Aetheria.Shared.Tests/HaulFeedTests.cs b/tests/Aetheria.Shared.Tests/HaulFeedTests.cs index 7157020b7..34eb8a3db 100644 --- a/tests/Aetheria.Shared.Tests/HaulFeedTests.cs +++ b/tests/Aetheria.Shared.Tests/HaulFeedTests.cs @@ -143,6 +143,23 @@ public sealed class HaulFeedTests : IDisposable Assert.Same(taker, gain.Taker); } + [Fact] + public void APickupThatMergesAndSpillsReportsTheWholeStack() + { + var grit = MiningCut5aTests.Commodity("Grit", maxStack: 4); + var (rig, _, gains) = Mining(1, 1, (grit, 1f)); + var taker = new Ship(rig.Scene.Items, rig.Zone, MiningCut3Tests.Mint(rig.Scene, rig.Scene.Hull), new EntitySettings()); + rig.Zone.Admit(taker, piloted: false); + var bay = MiningCut5aTests.Bay(rig.Scene, taker, 2, 1, "Taker"); + var design = rig.Scene.Cache.RefOf<ItemData>(grit); + Assert.True(bay.TryStore(new SimpleCommodity { Data = design, Lot = 7, Quantity = 3 })); + gains.Clear(); + var floating = rig.Zone.Release(new SimpleCommodity { Data = design, Lot = 7, Quantity = 4 }, new float2(0, 0), new float2(0, 0)); + Assert.True(rig.Zone.TryPickUp(taker, floating.Id)); + Assert.Equal(7, MiningCut5aTests.Units(bay, "Grit", rig.Scene)); + Assert.Equal((GainKind.Collected, 4, 0), (Assert.Single(gains).Kind, gains[0].Stored, gains[0].Adrift)); + } + [Fact] public void TheLineNamesWhatWasTakenAndWhatFloated() { @@ -161,7 +178,10 @@ public sealed class HaulFeedTests : IDisposable var spill = HaulFeed.Line(new CargoGain { Taker = rig.Shooter, Design = design, Stored = 1, Adrift = 2, Kind = GainKind.Mined }, items); Assert.Contains("2 adrift", spill); Assert.Contains("Rock", spill); - Assert.DoesNotContain("adrift", HaulFeed.Line(new CargoGain { Taker = rig.Shooter, Design = design, Stored = 2, Kind = GainKind.Collected }, items)); + var collected = HaulFeed.Line(new CargoGain { Taker = rig.Shooter, Design = design, Stored = 2, Kind = GainKind.Collected }, items); + Assert.DoesNotContain("adrift", collected); + Assert.Contains("Collected 2", collected); + Assert.Contains(hold, collected); } [Fact] diff --git a/tests/Aetheria.Shared.Tests/StationServicesTests.cs b/tests/Aetheria.Shared.Tests/StationServicesTests.cs index b255ad71b..3821a22b4 100644 --- a/tests/Aetheria.Shared.Tests/StationServicesTests.cs +++ b/tests/Aetheria.Shared.Tests/StationServicesTests.cs @@ -536,6 +536,23 @@ public sealed class StationServicesTests : IDisposable Assert.Contains(gun, bay.Cargo.Keys); } + [Fact] + public void SellOreLeavesALottedCommodityThatWasNotExtracted() + { + var ship = Ship(); + var bay = ship.CargoBays.Single(); + var data = _cache.GetByName<SimpleCommodityData>("Ore"); + var lot = _items.Lots.Add(new Lot { Design = _cache.RefOf<ItemData>(data), Origin = new Attributed(), Quality = 1 }); + Assert.NotEqual(0, lot); + var traded = new SimpleCommodity { Data = _cache.RefOf<ItemData>(data), Quantity = 6, Lot = lot }; + Assert.True(bay.TryStore(traded)); + var credits = 100; + Assert.Equal(0, StationServices.OreValue(_items, ship.CargoBays)); + Assert.Equal(0, StationServices.TrySellOre(ship.CargoBays, Station(), ref credits)); + Assert.Equal(100, credits); + Assert.Contains(traded, bay.Cargo.Keys); + } + [Fact] public void SellOreAcrossBaysAndShips() { From 7d5e14a65b1148f13b5e571744690247449378a8 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 06:08:02 +0000 Subject: [PATCH 080/108] Red test: a boot catalog must hold no hull the importer cannot build ABootCatalogHoldsNoHullTheImporterCannotBuild fails at f7fd76857: dangling, POSITION-less, skinned and primitive-less mesh nodes are all composed and included (Excluded is empty). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../ShipModCatalogTests.cs | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs index f439eecc9..476fde846 100644 --- a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs @@ -328,6 +328,49 @@ public sealed class ShipModCatalogTests : IDisposable Assert.Contains("GLB", excluded.Reason); } + // Bind is the one verdict on whether a mod hull exists: a package whose GLB names a node mesh the importer cannot build + // (dangling index, no POSITION, skinned node, no primitives) never reaches the boot catalog, so Preload has nothing left to refuse on file facts. + [Fact] + public void ABootCatalogHoldsNoHullTheImporterCannotBuild() + { + WritePackage("mod.good", hullName: "Good"); + var broken = new Dictionary<string, (string From, string To)> + { + ["mod.dangling"] = (@"{""name"":""collider"",""mesh"":0", @"{""name"":""collider"",""mesh"":7"), + ["mod.nopos"] = (@"""attributes"":{""POSITION"":0}", @"""attributes"":{}"), + ["mod.skinned"] = (@"{""name"":""map"",""mesh"":0", @"{""name"":""map"",""mesh"":0,""skin"":0"), + ["mod.noprims"] = (@"""primitives"":[{""attributes"":{""POSITION"":0}}]", @"""primitives"":[]") + }; + foreach (var (package, (from, to)) in broken) + { + WritePackage(package, hullName: package.Substring(4)); + var json = ShipFixture.GlbJson(FixtureNodes); + Assert.Contains(from, json); + File.WriteAllBytes(Path.Combine(Mods, package, "skiff.glb"), ShipFixture.Glb(json.Replace(from, to), ShipFixture.MeshBytes())); + } + + var (catalog, excluded) = ShipModCatalog.ResolveCatalog(Shipped, Derived, Mods); + + Assert.Equal(Derived, catalog); + Assert.Equal(broken.Keys.OrderBy(name => name, StringComparer.Ordinal), excluded.Select(e => e.Package).OrderBy(name => name, StringComparer.Ordinal)); + Assert.All(excluded, e => Assert.Contains("needs a mesh", e.Reason)); + using var cache = AetheriaStores.Open(catalog); + var hulls = cache.GetAll<HullData>().Where(hull => hull.Visual.IsSet()).ToArray(); + Assert.Equal(new[] { "Good" }, hulls.Select(hull => hull.Name)); + var keys = cache.AllStoredDocuments.Select(record => record.Key.Value).ToHashSet(); + foreach (var package in broken.Keys) + { + Assert.DoesNotContain(ShipModCatalog.HullKey(package).Value, keys); + Assert.DoesNotContain(ShipModCatalog.AuthoringKey(package).Value, keys); + } + // Preload's own two steps over file facts, run headlessly: neither may refuse a hull the catalog holds. + foreach (var hull in hulls) + { + var package = ShipModCatalog.PackageOf(cache, hull, Mods); + ShipModPlan.Build(package.Hull, package.Visual); + } + } + // The game's boot: a bad package is named and the rest boot; with none left, the shipped catalog boots. [Fact] public void TheBootCatalogSurvivesBadPackages() From b66d4f89abb8effc34c23815a170e6f43c063501 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 06:08:44 +0000 Subject: [PATCH 081/108] Bind decides every GLB-structure fact of a mod ship once ReadNodeIds' HasMesh is now BuildsMesh: no skin, mesh index inside meshes, at least one primitive, POSITION and triangle mode on each. Assemble's shield-radii throw is deleted (Bind's PositiveScale is the judge). The FBX thruster emitter takes Hide, with a smoke Require. Unity-only edits are not compiled in this Body. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/Editor/ShipPrefabAuthoring.cs | 1 + .../Editor/ShipPrefabAuthoringSmoke.cs | 2 ++ Assets/Scripts/Gameplay/ShipModShips.cs | 11 +++---- Assets/Scripts/ServerShared/ShipModCatalog.cs | 31 ++++++++++++++----- .../ShipModCatalogTests.cs | 5 +-- 5 files changed, 35 insertions(+), 15 deletions(-) diff --git a/Assets/Scripts/Editor/ShipPrefabAuthoring.cs b/Assets/Scripts/Editor/ShipPrefabAuthoring.cs index d2937b79d..45bbc8609 100644 --- a/Assets/Scripts/Editor/ShipPrefabAuthoring.cs +++ b/Assets/Scripts/Editor/ShipPrefabAuthoring.cs @@ -112,6 +112,7 @@ public static class ShipPrefabAuthoring case "Thruster": var emitter = DirectChild(node, "Emitter")?.GetComponent<MeshRenderer>(); if (emitter == null) throw new InvalidOperationException($"{name} needs an Emitter mesh child"); + ShipModShips.Hide(emitter, invisible); AddOrGet<ThrusterHardpoint>(node.gameObject).Emitter = emitter; thrusters.Add(node.GetComponent<ThrusterHardpoint>()); break; diff --git a/Assets/Scripts/Editor/ShipPrefabAuthoringSmoke.cs b/Assets/Scripts/Editor/ShipPrefabAuthoringSmoke.cs index 9f740f557..5342eb352 100644 --- a/Assets/Scripts/Editor/ShipPrefabAuthoringSmoke.cs +++ b/Assets/Scripts/Editor/ShipPrefabAuthoringSmoke.cs @@ -28,6 +28,8 @@ public static class ShipPrefabAuthoringSmoke ShipPrefabAuthoring.Configure(root); var ship = root.GetComponent<ShipInstance>(); Require(ship != null && ship.ThrusterHardpoints.Length == 1 && ship.ThrusterHardpoints[0].Emitter != null, "thruster emitter"); + Require(Array.TrueForAll(ship.ThrusterHardpoints[0].Emitter.sharedMaterials, material => material == ship.InvisibleMaterial), + "thruster emitter drawn with the invisible material only"); Require(ship.WeaponHardpoints.Length == 1 && ship.WeaponHardpoints[0].FiringPoint.Length == 2, "weapon muzzles"); Require(ship.WeaponHardpoints[0].FiringPoint[0].name == "Muzzle.0", "numeric muzzle order"); Require(ship.RadiatorHardpoints.Length == 1 && ship.RadiatorHardpoints[0].Mesh != null, "radiator mesh"); diff --git a/Assets/Scripts/Gameplay/ShipModShips.cs b/Assets/Scripts/Gameplay/ShipModShips.cs index 89106a6b7..33f09f590 100644 --- a/Assets/Scripts/Gameplay/ShipModShips.cs +++ b/Assets/Scripts/Gameplay/ShipModShips.cs @@ -6,9 +6,10 @@ using GameCult.Caching; using UnityEngine; using Object = UnityEngine.Object; -// Mod ships in the running game. Compose decides which mod hulls exist; Preload builds a prototype for each, keyed by the -// hull's record key, into an inactive assembled copy that Instantiate clones synchronously, so LoadEntity never loads async. -// A composed hull Preload cannot build is an import fault: Loading faults with ImportFault, naming every such hull's package. +// Mod ships in the running game. Compose (Bind) is the one verdict on whether a mod hull exists, from the package's files; +// Preload only builds a prototype for each, keyed by the hull's record key, into an inactive assembled copy that Instantiate +// clones synchronously, so LoadEntity never loads async. ImportFault reports what the Unity importer made of a composed hull: +// a composed hull Preload cannot build is an import fault: Loading faults with ImportFault, naming every such hull's package. // The prototypes are cache-only: rebuilt every boot from the catalog, the mod GLBs and the template. public static class ShipModShips { @@ -101,6 +102,7 @@ public static class ShipModShips node.name = id; return node; } + // An importer report, not a verdict: Bind has already judged the file. MeshRenderer Renderer(string id) { var found = Node(id).GetComponentInChildren<MeshRenderer>(true); @@ -130,9 +132,6 @@ public static class ShipModShips var surface = AddOrGet<HullCollider>(hullNode.gameObject); var shieldMarker = Node(plan.Shield); - var scale = shieldMarker.localScale; - if (!(scale.x > 0 && scale.y > 0 && scale.z > 0)) - throw new InvalidOperationException($"{ship.Id}: the shield anchor scale must have three positive radii."); var shield = Object.Instantiate(template.Shield.GetComponent<ShieldManager>(), shieldMarker, false); Reset(shield.transform); AddOrGet<ShieldEnvelope>(shield.gameObject); diff --git a/Assets/Scripts/ServerShared/ShipModCatalog.cs b/Assets/Scripts/ServerShared/ShipModCatalog.cs index e9ed613a2..88dc06b85 100644 --- a/Assets/Scripts/ServerShared/ShipModCatalog.cs +++ b/Assets/Scripts/ServerShared/ShipModCatalog.cs @@ -251,14 +251,15 @@ public static class ShipModCatalog foreach (var anchor in ship.Anchors) if (!modelNodes.ContainsKey(anchor.ModelNodeId)) throw new InvalidOperationException($"{ship.Id}: model has no node with aetheria.id={anchor.ModelNodeId} for anchor {anchor.Id}."); - // Assemble reads a renderer or collider mesh from these anchors' nodes and refuses without one, and reads the shield - // node's scale as three positive radii (ruling thrusters-radiators-are-meshes). These refusals stand in for Assemble's - // throws, so a package Compose includes is one the importer's assembler can build; the exhaust emission surface and - // the glowing radiator are meshes by that same ruling. A weapon mount and a tractor may be empties. + // Assemble reads a renderer or collider mesh from these anchors' nodes, and the shield node's scale as three positive + // radii (ruling thrusters-radiators-are-meshes). These refusals cover everything the package's files say about whether + // the importer can build a node (skin, dangling or empty mesh, not only "names a mesh") and are Assemble's only judge, + // so a package Compose includes is one the importer's assembler can build; the exhaust emission surface and the + // glowing radiator are meshes by that same ruling. A weapon mount and a tractor may be empties. foreach (var anchor in ship.Anchors) if ((anchor.Role == "thruster-emitter" || anchor.Role == "radiator-mesh" || anchor.Role == "map-icon" || anchor.Role == "hull-collider") && !modelNodes[anchor.ModelNodeId].HasMesh) - throw new InvalidOperationException($"{ship.Id}: {anchor.Role} anchor {anchor.Id} needs a mesh, but model node {anchor.ModelNodeId} has none."); + throw new InvalidOperationException($"{ship.Id}: {anchor.Role} anchor {anchor.Id} needs a mesh, but model node {anchor.ModelNodeId} has none the importer can build."); foreach (var anchor in ship.Anchors) if (anchor.Role == "shield" && !modelNodes[anchor.ModelNodeId].PositiveScale) throw new InvalidOperationException($"{ship.Id}: shield anchor {anchor.Id} needs three positive scale radii on model node {anchor.ModelNodeId}, with no matrix."); @@ -309,7 +310,23 @@ public static class ShipModCatalog private static bool PositiveScale(JObject node) => node["matrix"] == null && (node["scale"] == null || node["scale"].Select(component => (double)component).All(component => component > 0)); - // GLB is the xenos asset boundary. Only its node extras, whether each node names a mesh, and its nearest identified ancestor's node index + // A mesh the importer builds as a plain mesh node: no skin (glTFast makes a skinned node a SkinnedMeshRenderer, which + // Assemble's MeshRenderer/MeshFilter reads cannot see), a mesh index inside meshes, at least one primitive, and every + // primitive with POSITION and a mode absent or 4 (triangles). Geometry accessors and buffers are not read. + private static bool BuildsMesh(JObject json, JObject node) + { + if (node["skin"] != null && node["skin"].Type != JTokenType.Null) return false; + var meshes = json["meshes"] as JArray; + if (node["mesh"] == null || node["mesh"].Type != JTokenType.Integer || meshes == null) return false; + var index = (long)node["mesh"]; + if (index < 0 || index >= meshes.Count) return false; + var primitives = (meshes[(int)index] as JObject)?["primitives"] as JArray; + return primitives != null && primitives.Count > 0 && primitives.All(primitive => + primitive is JObject p && p["attributes"]?["POSITION"] != null && + (p["mode"] == null || (p["mode"].Type == JTokenType.Integer && (int)p["mode"] == 4))); + } + + // GLB is the xenos asset boundary. Only its node extras, whether each node carries a mesh the importer builds as a plain mesh node, and its nearest identified ancestor's node index // (-1 for none) are read here, plus whether the node's scale is three positive radii with no matrix; geometry belongs to the runtime importer. public static Dictionary<string, (uint Index, bool HasMesh, int Parent, bool PositiveScale)> ReadNodeIds(string path) { @@ -333,7 +350,7 @@ public static class ShipModCatalog { var id = (string)node["extras"]?["aetheria.id"]; if (string.IsNullOrEmpty(id)) { index++; continue; } - if (!ids.TryAdd(id, (index, node["mesh"] != null && node["mesh"].Type != JTokenType.Null, IdentifiedAncestor(parents, nodes, (int)index), PositiveScale(node)))) + if (!ids.TryAdd(id, (index, BuildsMesh(json, node), IdentifiedAncestor(parents, nodes, (int)index), PositiveScale(node)))) throw new InvalidOperationException($"{path}: duplicate GLB node aetheria.id={id}."); index++; } diff --git a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs index 476fde846..877430027 100644 --- a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs @@ -597,8 +597,9 @@ public sealed class ShipModCatalogTests : IDisposable public void NodeIdsMapToTheirGlbNodeIndexSkippingNodesWithoutOne() { var path = Write("nodes.glb", ShipFixture.Glb(@"{""asset"":{""version"":""2.0""},""nodes"":[ - {""name"":""plain""},{""extras"":{""aetheria.id"":""a""}},{""extras"":{}},{""extras"":{""aetheria.id"":""""}},{""mesh"":0,""extras"":{""aetheria.id"":""b""}}]}")); - Assert.Equal(new Dictionary<string, (uint, bool, int, bool)> { ["a"] = (1, false, -1, true), ["b"] = (4, true, -1, true) }, ShipModCatalog.ReadNodeIds(path)); + {""name"":""plain""},{""extras"":{""aetheria.id"":""a""}},{""extras"":{}},{""extras"":{""aetheria.id"":""""}},{""mesh"":0,""extras"":{""aetheria.id"":""b""}},{""mesh"":7,""extras"":{""aetheria.id"":""c""}}], + ""meshes"":[{""primitives"":[{""attributes"":{""POSITION"":0}}]}]}")); + Assert.Equal(new Dictionary<string, (uint, bool, int, bool)> { ["a"] = (1, false, -1, true), ["b"] = (4, true, -1, true), ["c"] = (5, false, -1, true) }, ShipModCatalog.ReadNodeIds(path)); } [Fact] From 339c617a74a7d6ec88c8242f8dc48d9c9966d09c Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 06:22:33 +0000 Subject: [PATCH 082/108] ShipRigTests fixture: the shared mesh has a POSITION primitive The fixture's empty primitives array is a mesh the importer cannot build, which Bind now refuses. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/ShipRigTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Aetheria.Shared.Tests/ShipRigTests.cs b/tests/Aetheria.Shared.Tests/ShipRigTests.cs index 34581f34a..fbad3ec05 100644 --- a/tests/Aetheria.Shared.Tests/ShipRigTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipRigTests.cs @@ -209,7 +209,7 @@ public sealed class ShipRigTests : IDisposable private static string GlbJson(Node[] nodes) { - var text = new StringBuilder(@"{""asset"":{""version"":""2.0""},""meshes"":[{""primitives"":[]}],""nodes"":["); + var text = new StringBuilder(@"{""asset"":{""version"":""2.0""},""meshes"":[{""primitives"":[{""attributes"":{""POSITION"":0}}]}],""nodes"":["); for (var index = 0; index < nodes.Length; index++) { var node = nodes[index]; From ad295acaf3bfc66be1a77d52abf65675167e397b Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 06:45:43 +0000 Subject: [PATCH 083/108] Pin BuildsMesh clauses: points mode, one bad primitive, negative and fractional mesh index, missing meshes array Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs index 877430027..175a6bd9f 100644 --- a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs @@ -329,7 +329,7 @@ public sealed class ShipModCatalogTests : IDisposable } // Bind is the one verdict on whether a mod hull exists: a package whose GLB names a node mesh the importer cannot build - // (dangling index, no POSITION, skinned node, no primitives) never reaches the boot catalog, so Preload has nothing left to refuse on file facts. + // (dangling or negative index, no meshes array, non-integer index, no POSITION on any one primitive, non-triangle mode, skinned node, no primitives) never reaches the boot catalog, so Preload has nothing left to refuse on file facts. [Fact] public void ABootCatalogHoldsNoHullTheImporterCannotBuild() { @@ -339,7 +339,12 @@ public sealed class ShipModCatalogTests : IDisposable ["mod.dangling"] = (@"{""name"":""collider"",""mesh"":0", @"{""name"":""collider"",""mesh"":7"), ["mod.nopos"] = (@"""attributes"":{""POSITION"":0}", @"""attributes"":{}"), ["mod.skinned"] = (@"{""name"":""map"",""mesh"":0", @"{""name"":""map"",""mesh"":0,""skin"":0"), - ["mod.noprims"] = (@"""primitives"":[{""attributes"":{""POSITION"":0}}]", @"""primitives"":[]") + ["mod.noprims"] = (@"""primitives"":[{""attributes"":{""POSITION"":0}}]", @"""primitives"":[]"), + ["mod.onebad"] = (@"""primitives"":[{""attributes"":{""POSITION"":0}}]", @"""primitives"":[{""attributes"":{""POSITION"":0}},{""attributes"":{}}]"), + ["mod.points"] = (@"""attributes"":{""POSITION"":0}}", @"""attributes"":{""POSITION"":0},""mode"":0}"), + ["mod.negative"] = (@"""mesh"":0", @"""mesh"":-1"), + ["mod.nomeshes"] = (@"""meshes"":", @"""other"":"), + ["mod.fractional"] = (@"""mesh"":0", @"""mesh"":0.0") }; foreach (var (package, (from, to)) in broken) { From 5c2dd76ceb4c2d7a1f379b948199ef51b8b86573 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 07:38:06 +0000 Subject: [PATCH 084/108] Test: the Substance clean break (red on base) Four headless facts: no .sbsar or .sbsar.meta remains; no surviving Assets/Packages/ ProjectSettings/GameData file names a removed Substance guid (44 tombstones: 41 sbsar metas, 2 folder metas, the importer script guid); the SUBSTANCE_PLUGIN_ENABLED define, LFS rule and manifest entries are gone; every repointed material names only textures that resolve to a .meta outside the removed tree. Fails on b2322c4ce for those reasons. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../SubstanceCleanBreakTests.cs | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs diff --git a/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs b/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs new file mode 100644 index 000000000..97e2c0b3b --- /dev/null +++ b/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs @@ -0,0 +1,174 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using Xunit; + +// Substance clean break (aetheria-release:ruling:clean-break-from-substance, cut remove-sbsar-files). The 41 .sbsar +// files, their importer and the SUBSTANCE_PLUGIN_ENABLED define are gone, and nothing that survives may point into +// them. Headless: no Unity is open, so a dangling GUID is caught here instead of rendering pink in the editor. +public sealed class SubstanceCleanBreakTests +{ + // Every guid the removed tree owned, captured from the .meta files before deletion: the 41 .sbsar.meta, the two + // folder metas (Assets/Materials/Substance.meta, Substance/Metal.meta) and the importer script guid + // (43a8bbf6..., the `script:` line of every .sbsar.meta, whose plugin was already absent). + private static readonly string[] Tombstones = + { + "06833951ebae4cc45ad88d58cb5571de", + "06d6a565d43fba5409712ce9a10bfbef", + "07f679eadba9fb14abac26b1e165f7d5", + "092bdd8d243488141aeab5bb0d72429a", + "09aee558716a08d4c9806b9b4273a209", + "0b5dfc86c0681a3459a57d197804191b", + "0be5fb1df83ac8e499a3f6a060041e49", + "130f566ffa0b2424fbb47de2194c136a", + "180b85899b4b1f848b348230339ce984", + "1c858fec5b74c7c46b1712494192b6b5", + "26a894e543f3ed44893b1620707ca62c", + "2b42584452fe0cc4fa4e8a115230b156", + "2be0f689f5b01be4aa1032bc86f15eab", + "2e9a9dbacde66a446852af882f33e9e2", + "43a8bbf65be290d44ba52b94476242b9", + "4e39297ae4fe9ee4b803c04eabb69da7", + "50192727b92e0af4cbe5c773bec3537f", + "504c7bfe0d50ff64a88b8eac2ceb46f8", + "53adf8e53222e6f4791d7bf2110fb70c", + "58e16b7dbc1c31f4585e11544cdce127", + "6b2eb94965ca27542b8627d3521f5b5b", + "7363fcc4a3c41a349b29de7ec34555be", + "7de1c11cf7591ec48bdb53e9818172f5", + "8249e9ffcbd97c84d8ce73343e156c82", + "885e680924fc12c439a842a2142d4b78", + "9458f33b8e7e51a42aa19686b9779d82", + "9aa51bbe4dd46874a906608c34a739e4", + "9d0963470d3545a4e932ed4ea95b9d62", + "9fc901afb8a434e46b9405eaec2df5a4", + "a1d39ea984432bf44b4a0686afe2bf1a", + "a74970be876d3554ea0f279f39314c9c", + "afbd691d0ea2a5a47b5a43b244593a56", + "b2bec4b400153d745b2915f1c43e5c96", + "b7e648471e9dfc44490bd41973711541", + "c00b5a4f1e4743a4ca59b8030251f900", + "c5f2177e1f35daa499f4d7e0b7f3370a", + "ca8f080ab60226e4097841eee2bfa8db", + "cbc61995a46604441ab9de4f1c68e290", + "d15fc45ed0000934d946b5f271f637ef", + "ddc6970cc883b9845bdadc91983130c2", + "deb7e15e5f95294498d18869d9f11302", + "e7758cad28ae98f478940e55222419a6", + "ea7457b9a4f0bcb43becaa33de541cbd", + "ef9a54b8dacea9f44be70da43472f701", + }; + + private static readonly string[] ScannedExtensions = + { + ".mat", ".prefab", ".unity", ".asset", ".meta", ".controller", ".anim", ".overrideController", ".mixer", + ".lighting", ".flare", ".shader", ".json", + }; + + private static readonly string[] ExcludedDirs = { ".git", "node_modules", ".voidbot" }; + + private static readonly string[] RepointedMaterials = + { + "Assets/Materials/Steel.mat", "Assets/Materials/Aluminium brushed.mat", "Assets/Materials/Silver.mat", + "Assets/Materials/Steel parkerized.mat", "Assets/Materials/Cockpit.mat", "Assets/Materials/Metal 003.mat", + "Assets/Materials/Car Paint Red.mat", "Assets/Materials/Car Paint Magenta.mat", + "Assets/Materials/Car Paint White.mat", "Assets/Materials/Car Paint White Small.mat", + "Assets/Materials/Radiators.mat", "Assets/Materials/Station Lights.mat", "Assets/Materials/Mine Glow.mat", + "Assets/Models/Discobolus/Discobolus Marble.mat", "Assets/Materials/Pickup Trim.mat", + }; + + private static IEnumerable<string> Walk(string dir) + { + foreach (var file in Directory.EnumerateFiles(dir)) yield return file; + foreach (var sub in Directory.EnumerateDirectories(dir)) + if (!ExcludedDirs.Contains(Path.GetFileName(sub))) + foreach (var file in Walk(sub)) yield return file; + } + + [Fact] + public void NoSbsarFileOrMetaRemains() + { + var root = RestoredHullsTests.FindRepoRoot(); + var stray = Walk(root).Where(f => f.EndsWith(".sbsar", StringComparison.OrdinalIgnoreCase) + || f.EndsWith(".sbsar.meta", StringComparison.OrdinalIgnoreCase)) + .Select(f => Path.GetRelativePath(root, f)).ToList(); + Assert.True(stray.Count == 0, $"{stray.Count} Substance archive files remain, first: {stray.FirstOrDefault()}"); + Assert.False(Directory.Exists(Path.Combine(root, "Assets", "Materials", "Substance"))); + } + + [Fact] + public void NoSurvivingFileNamesARemovedSubstanceGuid() + { + var root = RestoredHullsTests.FindRepoRoot(); + var files = new[] { "Assets", "Packages", "ProjectSettings" } + .Select(d => Path.Combine(root, d)).Where(Directory.Exists) + .SelectMany(Walk) + .Concat(Directory.Exists(Path.Combine(root, "GameData")) + ? Directory.EnumerateFiles(Path.Combine(root, "GameData"), "*.cc") : Enumerable.Empty<string>()) + .Where(f => f.EndsWith(".cc") || ScannedExtensions.Contains(Path.GetExtension(f), StringComparer.OrdinalIgnoreCase)); + var hits = new List<string>(); + foreach (var file in files) + { + var lines = File.ReadAllText(file, Encoding.Latin1).Split('\n'); + for (var i = 0; i < lines.Length; i++) + foreach (var guid in Tombstones) + if (lines[i].Contains(guid, StringComparison.Ordinal)) + hits.Add($"{Path.GetRelativePath(root, file)}:{i + 1} names {guid}"); + } + Assert.True(hits.Count == 0, $"{hits.Count} references to removed Substance guids:\n" + string.Join("\n", hits.Take(40))); + } + + [Fact] + public void NoSubstanceBuildSurface() + { + var root = RestoredHullsTests.FindRepoRoot(); + Assert.DoesNotContain("SUBSTANCE", File.ReadAllText(Path.Combine(root, "ProjectSettings", "ProjectSettings.asset")), StringComparison.Ordinal); + foreach (var name in new[] { "manifest.json", "packages-lock.json" }) + { + var text = File.ReadAllText(Path.Combine(root, "Packages", name)); + Assert.DoesNotContain("substance", text, StringComparison.OrdinalIgnoreCase); + Assert.DoesNotContain("allegorithmic", text, StringComparison.OrdinalIgnoreCase); + } + Assert.DoesNotContain("sbsar", File.ReadAllText(Path.Combine(root, ".gitattributes")), StringComparison.OrdinalIgnoreCase); + Assert.False(Directory.Exists(Path.Combine(root, "Assets", "Allegorithmic"))); + } + + [Fact] + public void EveryReplacementTextureResolves() + { + var root = RestoredHullsTests.FindRepoRoot(); + var guidToMeta = new Dictionary<string, string>(); + foreach (var meta in Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*.meta", SearchOption.AllDirectories)) + { + var guid = File.ReadLines(meta).FirstOrDefault(l => l.StartsWith("guid: "))?.Substring("guid: ".Length).Trim(); + if (guid != null) guidToMeta[guid] = Path.GetRelativePath(root, meta).Replace('\\', '/'); + } + + var texture = new Regex(@"m_Texture:\s*\{fileID:\s*(-?\d+),\s*guid:\s*([0-9a-f]{32})", RegexOptions.Compiled); + var problems = new List<string>(); + foreach (var rel in RepointedMaterials) + { + var path = Path.Combine(root, rel); + if (!File.Exists(path)) { problems.Add($"{rel} does not exist"); continue; } + var text = File.ReadAllText(path); + var start = text.IndexOf("m_TexEnvs:", StringComparison.Ordinal); + var end = text.IndexOf("m_Ints:", StringComparison.Ordinal); + Assert.True(start >= 0 && end > start, $"{rel} has no m_TexEnvs section"); + foreach (Match m in texture.Matches(text.Substring(start, end - start))) + { + if (m.Groups[1].Value == "0") continue; + var guid = m.Groups[2].Value; + if (!guidToMeta.TryGetValue(guid, out var meta)) problems.Add($"{rel} names {guid}, which has no .meta under Assets/"); + else if (meta.StartsWith("Assets/Materials/Substance", StringComparison.Ordinal)) problems.Add($"{rel} names {guid} inside the removed Substance tree"); + } + } + Assert.True(problems.Count == 0, string.Join("\n", problems)); + } +} From 6222b5c711849625242f958975995d574edc2056 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 07:38:28 +0000 Subject: [PATCH 085/108] Remove the 41 .sbsar files, the Substance define and five unreferenced materials Deletes Assets/Materials/Substance (41 .sbsar + metas, folder metas), the LFS rule for *.sbsar, SUBSTANCE_PLUGIN_ENABLED from the Standalone scripting defines, and five materials with zero GUID referrers (Assets/Steel, Steel brushed, Radiators 1, Thrusters, Discobolus Bronze). Surviving materials and prefabs still name the removed guids until the next commit repoints them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Materials/Radiators 1.mat | 87 ---- Assets/Materials/Radiators 1.mat.meta | 8 - Assets/Materials/Steel brushed.mat | 83 ---- Assets/Materials/Steel brushed.mat.meta | 8 - Assets/Materials/Substance.meta | 8 - Assets/Materials/Substance/Metal.meta | 8 - .../Substance/Metal/Pickup Base.sbsar | 3 - .../Substance/Metal/Pickup Base.sbsar.meta | 382 ------------------ .../Substance/Metal/Pickup Trim.sbsar | 3 - .../Substance/Metal/Pickup Trim.sbsar.meta | 381 ----------------- .../Substance/Metal/galvanized_001.sbsar | 3 - .../Substance/Metal/galvanized_001.sbsar.meta | 369 ----------------- .../Substance/Metal/iron_damaged.sbsar | 3 - .../Substance/Metal/iron_damaged.sbsar.meta | 293 -------------- .../Substance/Metal/iron_rugged.sbsar | 3 - .../Substance/Metal/iron_rugged.sbsar.meta | 293 -------------- .../Materials/Substance/Metal/metal_002.sbsar | 3 - .../Substance/Metal/metal_002.sbsar.meta | 372 ----------------- .../Materials/Substance/Metal/metal_003.sbsar | 3 - .../Substance/Metal/metal_003.sbsar.meta | 372 ----------------- .../Materials/Substance/Metal/metal_006.sbsar | 3 - .../Substance/Metal/metal_006.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_aluminium.sbsar | 3 - .../Metal/metal_aluminium.sbsar.meta | 373 ----------------- .../Metal/metal_aluminium_brushed.sbsar | 3 - .../Metal/metal_aluminium_brushed.sbsar.meta | 373 ----------------- .../Substance/Metal/metal_brass.sbsar | 3 - .../Substance/Metal/metal_brass.sbsar.meta | 375 ----------------- .../Substance/Metal/metal_car_paint 1.sbsar | 3 - .../Metal/metal_car_paint 1.sbsar.meta | 379 ----------------- .../Metal/metal_car_paint Magenta.sbsar | 3 - .../Metal/metal_car_paint Magenta.sbsar.meta | 381 ----------------- .../Substance/Metal/metal_car_paint red.sbsar | 3 - .../Metal/metal_car_paint red.sbsar.meta | 381 ----------------- .../Metal/metal_car_paint white.sbsar | 3 - .../Metal/metal_car_paint white.sbsar.meta | 382 ------------------ .../Substance/Metal/metal_copper.sbsar | 3 - .../Substance/Metal/metal_copper.sbsar.meta | 369 ----------------- .../Metal/metal_corrugated_002.sbsar | 3 - .../Metal/metal_corrugated_002.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_floor_002.sbsar | 3 - .../Metal/metal_floor_002.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_floor_004.sbsar | 3 - .../Metal/metal_floor_004.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_floor_006.sbsar | 3 - .../Metal/metal_floor_006.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_gold.sbsar | 3 - .../Substance/Metal/metal_gold.sbsar.meta | 373 ----------------- .../Substance/Metal/metal_nickel.sbsar | 3 - .../Substance/Metal/metal_nickel.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_painted_steel.sbsar | 3 - .../Metal/metal_painted_steel.sbsar.meta | 376 ----------------- .../Substance/Metal/metal_panels_001.sbsar | 3 - .../Metal/metal_panels_001.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_panels_002.sbsar | 3 - .../Metal/metal_panels_002.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_plate_001.sbsar | 3 - .../Metal/metal_plate_001.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_plate_004.sbsar | 3 - .../Metal/metal_plate_004.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_plate_011.sbsar | 3 - .../Metal/metal_plate_011.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_platinum.sbsar | 3 - .../Substance/Metal/metal_platinum.sbsar.meta | 372 ----------------- .../Substance/Metal/metal_roll_up.sbsar | 3 - .../Substance/Metal/metal_roll_up.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_silver.sbsar | 3 - .../Substance/Metal/metal_silver.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_steel.sbsar | 3 - .../Substance/Metal/metal_steel.sbsar.meta | 375 ----------------- .../Substance/Metal/metal_steel_brushed.sbsar | 3 - .../Metal/metal_steel_brushed.sbsar.meta | 370 ----------------- .../Substance/Metal/metal_steel_bumped.sbsar | 3 - .../Metal/metal_steel_bumped.sbsar.meta | 369 ----------------- .../Metal/metal_steel_parkerized.sbsar | 3 - .../Metal/metal_steel_parkerized.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_titanium.sbsar | 3 - .../Substance/Metal/metal_titanium.sbsar.meta | 369 ----------------- .../Substance/Metal/metal_used.sbsar | 3 - .../Substance/Metal/metal_used.sbsar.meta | 371 ----------------- .../Substance/Metal/metal_weapon.sbsar | 3 - .../Substance/Metal/metal_weapon.sbsar.meta | 373 ----------------- .../Substance/Metal/metal_woven.sbsar | 3 - .../Substance/Metal/metal_woven.sbsar.meta | 369 ----------------- .../Substance/Metal/snatched_metal.sbsar | 3 - .../Substance/Metal/snatched_metal.sbsar.meta | 311 -------------- Assets/Materials/Substance/marble_002.sbsar | 3 - .../Materials/Substance/marble_002.sbsar.meta | 296 -------------- Assets/Materials/Thrusters.mat | 87 ---- Assets/Materials/Thrusters.mat.meta | 8 - .../Models/Discobolus/Discobolus Bronze.mat | 80 ---- .../Discobolus/Discobolus Bronze.mat.meta | 8 - Assets/Steel.mat | 83 ---- Assets/Steel.mat.meta | 8 - 94 files changed, 15564 deletions(-) delete mode 100644 Assets/Materials/Radiators 1.mat delete mode 100644 Assets/Materials/Radiators 1.mat.meta delete mode 100644 Assets/Materials/Steel brushed.mat delete mode 100644 Assets/Materials/Steel brushed.mat.meta delete mode 100644 Assets/Materials/Substance.meta delete mode 100644 Assets/Materials/Substance/Metal.meta delete mode 100644 Assets/Materials/Substance/Metal/Pickup Base.sbsar delete mode 100644 Assets/Materials/Substance/Metal/Pickup Base.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/Pickup Trim.sbsar delete mode 100644 Assets/Materials/Substance/Metal/Pickup Trim.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/galvanized_001.sbsar delete mode 100644 Assets/Materials/Substance/Metal/galvanized_001.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/iron_damaged.sbsar delete mode 100644 Assets/Materials/Substance/Metal/iron_damaged.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/iron_rugged.sbsar delete mode 100644 Assets/Materials/Substance/Metal/iron_rugged.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_002.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_002.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_003.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_003.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_006.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_006.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_aluminium.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_aluminium.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_aluminium_brushed.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_aluminium_brushed.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_brass.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_brass.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_car_paint 1.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_car_paint 1.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_car_paint Magenta.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_car_paint Magenta.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_car_paint red.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_car_paint red.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_car_paint white.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_car_paint white.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_copper.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_copper.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_corrugated_002.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_corrugated_002.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_floor_002.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_floor_002.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_floor_004.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_floor_004.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_floor_006.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_floor_006.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_gold.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_gold.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_nickel.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_nickel.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_painted_steel.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_painted_steel.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_panels_001.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_panels_001.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_panels_002.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_panels_002.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_plate_001.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_plate_001.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_plate_004.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_plate_004.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_plate_011.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_plate_011.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_platinum.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_platinum.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_roll_up.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_roll_up.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_silver.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_silver.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_steel.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_steel.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_steel_brushed.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_steel_brushed.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_steel_bumped.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_steel_bumped.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_steel_parkerized.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_steel_parkerized.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_titanium.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_titanium.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_used.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_used.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_weapon.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_weapon.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/metal_woven.sbsar delete mode 100644 Assets/Materials/Substance/Metal/metal_woven.sbsar.meta delete mode 100644 Assets/Materials/Substance/Metal/snatched_metal.sbsar delete mode 100644 Assets/Materials/Substance/Metal/snatched_metal.sbsar.meta delete mode 100644 Assets/Materials/Substance/marble_002.sbsar delete mode 100644 Assets/Materials/Substance/marble_002.sbsar.meta delete mode 100644 Assets/Materials/Thrusters.mat delete mode 100644 Assets/Materials/Thrusters.mat.meta delete mode 100644 Assets/Models/Discobolus/Discobolus Bronze.mat delete mode 100644 Assets/Models/Discobolus/Discobolus Bronze.mat.meta delete mode 100644 Assets/Steel.mat delete mode 100644 Assets/Steel.mat.meta diff --git a/Assets/Materials/Radiators 1.mat b/Assets/Materials/Radiators 1.mat deleted file mode 100644 index a6219fe9d..000000000 --- a/Assets/Materials/Radiators 1.mat +++ /dev/null @@ -1,87 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Radiators 1 - m_Shader: {fileID: 4800000, guid: d69ef48273708ef4680762f5cdcfc860, type: 3} - m_ShaderKeywords: - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: -812895718602229137, guid: b7e648471e9dfc44490bd41973711541, - type: 3} - m_Scale: {x: 8, y: 8} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: -6057190860509678031, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} - m_Scale: {x: 8, y: 8} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: -894214952450941493, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _BumpPower: 2 - - _BumpScale: 1 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _Emission: 15 - - _EmissionFresnel: 4 - - _EmissionRoughnessFresnelPower: 0.5 - - _GlossMapScale: 1 - - _Glossiness: 1 - - _GlossyReflections: 1 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _ReverseRim: 0 - - _Rotation: 0 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _UVSec: 0 - - _ZWrite: 1 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmissionColor: {r: 1, g: 0.40135294, b: 0, a: 1} - m_BuildTextureStacks: [] diff --git a/Assets/Materials/Radiators 1.mat.meta b/Assets/Materials/Radiators 1.mat.meta deleted file mode 100644 index c562a84de..000000000 --- a/Assets/Materials/Radiators 1.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f396635dc77c59c44ac85ae278a2e909 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Materials/Steel brushed.mat b/Assets/Materials/Steel brushed.mat deleted file mode 100644 index dba1bd074..000000000 --- a/Assets/Materials/Steel brushed.mat +++ /dev/null @@ -1,83 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Steel brushed - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: _MAINTEX _METALLICGLOSSMAP _NORMALMAP _OCCLUSIONMAP _PARALLAXMAP - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: -4471413742775304797, guid: ea7457b9a4f0bcb43becaa33de541cbd, - type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 8, y: 8} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: -4638397344074346932, guid: ea7457b9a4f0bcb43becaa33de541cbd, - type: 3} - m_Scale: {x: 8, y: 8} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 5049811794194361025, guid: ea7457b9a4f0bcb43becaa33de541cbd, - type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 1753668427856518731, guid: ea7457b9a4f0bcb43becaa33de541cbd, - type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: -3498708498072814504, guid: ea7457b9a4f0bcb43becaa33de541cbd, - type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _BumpScale: 1 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _GlossMapScale: 1 - - _Glossiness: 0.5 - - _GlossyReflections: 1 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _UVSec: 0 - - _ZWrite: 1 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - m_BuildTextureStacks: [] diff --git a/Assets/Materials/Steel brushed.mat.meta b/Assets/Materials/Steel brushed.mat.meta deleted file mode 100644 index 73afa8139..000000000 --- a/Assets/Materials/Steel brushed.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: df3e704fc59794a45b8e14a78d96cca3 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Materials/Substance.meta b/Assets/Materials/Substance.meta deleted file mode 100644 index c6926c786..000000000 --- a/Assets/Materials/Substance.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 7de1c11cf7591ec48bdb53e9818172f5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Materials/Substance/Metal.meta b/Assets/Materials/Substance/Metal.meta deleted file mode 100644 index e8c0226e7..000000000 --- a/Assets/Materials/Substance/Metal.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 09aee558716a08d4c9806b9b4273a209 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Materials/Substance/Metal/Pickup Base.sbsar b/Assets/Materials/Substance/Metal/Pickup Base.sbsar deleted file mode 100644 index 963310406..000000000 --- a/Assets/Materials/Substance/Metal/Pickup Base.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dbee14b278a03ed59e1df8ecd6ba2b07ab7c2b2089e5e2bc3fad5673694a9f03 -size 14971 diff --git a/Assets/Materials/Substance/Metal/Pickup Base.sbsar.meta b/Assets/Materials/Substance/Metal/Pickup Base.sbsar.meta deleted file mode 100644 index 2966159bc..000000000 --- a/Assets/Materials/Substance/Metal/Pickup Base.sbsar.meta +++ /dev/null @@ -1,382 +0,0 @@ -fileFormatVersion: 2 -guid: 26a894e543f3ed44893b1620707ca62c -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_car_paint/metal_car_paint - - first: - 4: 400000 - second: metal_car_paint/metal_car_paint/Transform - - first: - 21: 2100000 - second: mat.Car paint - - first: - 23: 2300000 - second: metal_car_paint/metal_car_paint/MeshRenderer - - first: - 28: 2800000 - second: Car paint_baseColor - - first: - 28: 2800002 - second: Car paint_normal - - first: - 28: 2800004 - second: Car paint_metallic - - first: - 28: 2800006 - second: Car paint_ambientOcclusion - - first: - 28: 2800008 - second: Car paint_height - - first: - 33: 3300000 - second: metal_car_paint/metal_car_paint/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_car_paint/metal_car_paint/SphereCollider - - first: - 1001: 100100000 - second: metal_car_paint - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Car paint - prototypeName: Car paint - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_car_paint\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"2092133592\" type=\"8\" value=\"11,11\" />\n - <presetinput identifier=\"normal_intensity\" uid=\"2045651458\" type=\"0\" - value=\"0.25\" />\n <presetinput identifier=\"age\" uid=\"2038752334\" type=\"0\" - value=\"1\" />\n <presetinput identifier=\"flakes\" uid=\"20245147\" type=\"4\" - value=\"1\" />\n <presetinput identifier=\"flakes_scale\" uid=\"20192266\" - type=\"0\" value=\"0\" />\n <presetinput identifier=\"paint_scratches\" uid=\"22509202\" - type=\"0\" value=\"1\" />\n <presetinput identifier=\"paint_peeling\" uid=\"103560714\" - type=\"0\" value=\"0.151\" />\n <presetinput identifier=\"metal_roughness\" - uid=\"22504787\" type=\"0\" value=\"0.33\" />\n <presetinput identifier=\"paint_color\" - uid=\"105341618\" type=\"2\" value=\"1,0.891509,0.946396\" />\n <presetinput - identifier=\"paint_roughness\" uid=\"22504606\" type=\"0\" value=\"0\" />\n - <presetinput identifier=\"paint_metallic\" uid=\"22503567\" type=\"0\" value=\"0\" - />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 3068890721646206586, guid: 26a894e543f3ed44893b1620707ca62c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 0.5, y: 0.5} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 5917659159057834157, guid: 26a894e543f3ed44893b1620707ca62c, - type: 3} - scale: {x: 0.5, y: 0.5} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -3552914696322007609, guid: 26a894e543f3ed44893b1620707ca62c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -1242281561028671816, guid: 26a894e543f3ed44893b1620707ca62c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -1652887728991447519, guid: 26a894e543f3ed44893b1620707ca62c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 1 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 1 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Car paint_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 2048 - textureHeight: 2048 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 3720744386649352057, guid: 26a894e543f3ed44893b1620707ca62c, - type: 3} - generatedTextures: - - {fileID: 5917659159057834157, guid: 26a894e543f3ed44893b1620707ca62c, type: 3} - - {fileID: 3068890721646206586, guid: 26a894e543f3ed44893b1620707ca62c, type: 3} - - {fileID: -3552914696322007609, guid: 26a894e543f3ed44893b1620707ca62c, type: 3} - - {fileID: -1242281561028671816, guid: 26a894e543f3ed44893b1620707ca62c, type: 3} - - {fileID: -1652887728991447519, guid: 26a894e543f3ed44893b1620707ca62c, type: 3} diff --git a/Assets/Materials/Substance/Metal/Pickup Trim.sbsar b/Assets/Materials/Substance/Metal/Pickup Trim.sbsar deleted file mode 100644 index 963310406..000000000 --- a/Assets/Materials/Substance/Metal/Pickup Trim.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dbee14b278a03ed59e1df8ecd6ba2b07ab7c2b2089e5e2bc3fad5673694a9f03 -size 14971 diff --git a/Assets/Materials/Substance/Metal/Pickup Trim.sbsar.meta b/Assets/Materials/Substance/Metal/Pickup Trim.sbsar.meta deleted file mode 100644 index 302e453b5..000000000 --- a/Assets/Materials/Substance/Metal/Pickup Trim.sbsar.meta +++ /dev/null @@ -1,381 +0,0 @@ -fileFormatVersion: 2 -guid: c00b5a4f1e4743a4ca59b8030251f900 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_car_paint/metal_car_paint - - first: - 4: 400000 - second: metal_car_paint/metal_car_paint/Transform - - first: - 21: 2100000 - second: mat.Car paint - - first: - 23: 2300000 - second: metal_car_paint/metal_car_paint/MeshRenderer - - first: - 28: 2800000 - second: Car paint_baseColor - - first: - 28: 2800002 - second: Car paint_normal - - first: - 28: 2800004 - second: Car paint_metallic - - first: - 28: 2800006 - second: Car paint_ambientOcclusion - - first: - 28: 2800008 - second: Car paint_height - - first: - 33: 3300000 - second: metal_car_paint/metal_car_paint/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_car_paint/metal_car_paint/SphereCollider - - first: - 1001: 100100000 - second: metal_car_paint - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Car paint - prototypeName: Car paint - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_car_paint\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"2092133592\" type=\"8\" value=\"11,11\" />\n - <presetinput identifier=\"normal_intensity\" uid=\"2045651458\" type=\"0\" - value=\"0.25\" />\n <presetinput identifier=\"age\" uid=\"2038752334\" type=\"0\" - value=\"1\" />\n <presetinput identifier=\"flakes\" uid=\"20245147\" type=\"4\" - value=\"1\" />\n <presetinput identifier=\"flakes_scale\" uid=\"20192266\" - type=\"0\" value=\"0.425\" />\n <presetinput identifier=\"paint_scratches\" - uid=\"22509202\" type=\"0\" value=\"1\" />\n <presetinput identifier=\"paint_peeling\" - uid=\"103560714\" type=\"0\" value=\"0.405\" />\n <presetinput identifier=\"metal_roughness\" - uid=\"22504787\" type=\"0\" value=\"0.425\" />\n <presetinput identifier=\"paint_color\" - uid=\"105341618\" type=\"2\" value=\"0,0.605881,1\" />\n <presetinput identifier=\"paint_roughness\" - uid=\"22504606\" type=\"0\" value=\"0\" />\n <presetinput identifier=\"paint_metallic\" - uid=\"22503567\" type=\"0\" value=\"1\" />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 3068890721646206586, guid: c00b5a4f1e4743a4ca59b8030251f900, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 0.5, y: 0.5} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 5917659159057834157, guid: c00b5a4f1e4743a4ca59b8030251f900, - type: 3} - scale: {x: 0.5, y: 0.5} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -3552914696322007609, guid: c00b5a4f1e4743a4ca59b8030251f900, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -1242281561028671816, guid: c00b5a4f1e4743a4ca59b8030251f900, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -1652887728991447519, guid: c00b5a4f1e4743a4ca59b8030251f900, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.005 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Car paint_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 2048 - textureHeight: 2048 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 3720744386649352057, guid: c00b5a4f1e4743a4ca59b8030251f900, - type: 3} - generatedTextures: - - {fileID: 5917659159057834157, guid: c00b5a4f1e4743a4ca59b8030251f900, type: 3} - - {fileID: 3068890721646206586, guid: c00b5a4f1e4743a4ca59b8030251f900, type: 3} - - {fileID: -3552914696322007609, guid: c00b5a4f1e4743a4ca59b8030251f900, type: 3} - - {fileID: -1242281561028671816, guid: c00b5a4f1e4743a4ca59b8030251f900, type: 3} - - {fileID: -1652887728991447519, guid: c00b5a4f1e4743a4ca59b8030251f900, type: 3} diff --git a/Assets/Materials/Substance/Metal/galvanized_001.sbsar b/Assets/Materials/Substance/Metal/galvanized_001.sbsar deleted file mode 100644 index 5d6237210..000000000 --- a/Assets/Materials/Substance/Metal/galvanized_001.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:274db26d631b6cd53024c1366c01322d99b6194b5e211d04c5430bb8174ae8f6 -size 8207 diff --git a/Assets/Materials/Substance/Metal/galvanized_001.sbsar.meta b/Assets/Materials/Substance/Metal/galvanized_001.sbsar.meta deleted file mode 100644 index 9815351c0..000000000 --- a/Assets/Materials/Substance/Metal/galvanized_001.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 2be0f689f5b01be4aa1032bc86f15eab -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: galvanized_001/galvanized_001 - - first: - 4: 400000 - second: galvanized_001/galvanized_001/Transform - - first: - 21: 2100000 - second: mat.Galvanized_001 - - first: - 23: 2300000 - second: galvanized_001/galvanized_001/MeshRenderer - - first: - 28: 2800000 - second: Galvanized_001_baseColor - - first: - 28: 2800002 - second: Galvanized_001_normal - - first: - 28: 2800004 - second: Galvanized_001_metallic - - first: - 28: 2800006 - second: Galvanized_001_ambientOcclusion - - first: - 28: 2800008 - second: Galvanized_001_height - - first: - 33: 3300000 - second: galvanized_001/galvanized_001/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: galvanized_001/galvanized_001/SphereCollider - - first: - 1001: 100100000 - second: galvanized_001 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Galvanized_001 - prototypeName: Galvanized_001 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://galvanized_001\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -2787997366030867252, guid: 2be0f689f5b01be4aa1032bc86f15eab, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 7907137595978400316, guid: 2be0f689f5b01be4aa1032bc86f15eab, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 1034366337303036879, guid: 2be0f689f5b01be4aa1032bc86f15eab, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 4470803051826786927, guid: 2be0f689f5b01be4aa1032bc86f15eab, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -3422293810953865746, guid: 2be0f689f5b01be4aa1032bc86f15eab, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Galvanized_001_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Galvanized_001 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -231086597109407277, guid: 2be0f689f5b01be4aa1032bc86f15eab, - type: 3} - generatedTextures: - - {fileID: 7907137595978400316, guid: 2be0f689f5b01be4aa1032bc86f15eab, type: 3} - - {fileID: -2787997366030867252, guid: 2be0f689f5b01be4aa1032bc86f15eab, type: 3} - - {fileID: 1034366337303036879, guid: 2be0f689f5b01be4aa1032bc86f15eab, type: 3} - - {fileID: 4470803051826786927, guid: 2be0f689f5b01be4aa1032bc86f15eab, type: 3} - - {fileID: -3422293810953865746, guid: 2be0f689f5b01be4aa1032bc86f15eab, type: 3} diff --git a/Assets/Materials/Substance/Metal/iron_damaged.sbsar b/Assets/Materials/Substance/Metal/iron_damaged.sbsar deleted file mode 100644 index cb09572e5..000000000 --- a/Assets/Materials/Substance/Metal/iron_damaged.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4a12de208077d6dfd8e70dfa8a8976bb9e5b2ca2d258bb34aa50c81a58a6451c -size 30808 diff --git a/Assets/Materials/Substance/Metal/iron_damaged.sbsar.meta b/Assets/Materials/Substance/Metal/iron_damaged.sbsar.meta deleted file mode 100644 index d7a4d07d7..000000000 --- a/Assets/Materials/Substance/Metal/iron_damaged.sbsar.meta +++ /dev/null @@ -1,293 +0,0 @@ -fileFormatVersion: 2 -guid: d15fc45ed0000934d946b5f271f637ef -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Iron Damaged - prototypeName: Iron Damaged - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://iron_damaged\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"1484747668\" type=\"8\" value=\"9,9\" />\n - </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -1855041196637152199, guid: d15fc45ed0000934d946b5f271f637ef, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -2789335455068261637, guid: d15fc45ed0000934d946b5f271f637ef, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 7922211451800446260, guid: d15fc45ed0000934d946b5f271f637ef, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -4424499752615739725, guid: d15fc45ed0000934d946b5f271f637ef, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 7474978398744299577, guid: d15fc45ed0000934d946b5f271f637ef, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambientocclusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - textureParameters: - - textureName: Iron Damaged - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Damaged - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Damaged - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Damaged - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Damaged - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Damaged - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Damaged - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Damaged - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Damaged - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 512 - textureHeight: 512 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 1736733470071950104, guid: d15fc45ed0000934d946b5f271f637ef, - type: 3} - generatedTextures: - - {fileID: -2789335455068261637, guid: d15fc45ed0000934d946b5f271f637ef, type: 3} - - {fileID: -1855041196637152199, guid: d15fc45ed0000934d946b5f271f637ef, type: 3} - - {fileID: 7922211451800446260, guid: d15fc45ed0000934d946b5f271f637ef, type: 3} - - {fileID: 7474978398744299577, guid: d15fc45ed0000934d946b5f271f637ef, type: 3} - - {fileID: -4424499752615739725, guid: d15fc45ed0000934d946b5f271f637ef, type: 3} diff --git a/Assets/Materials/Substance/Metal/iron_rugged.sbsar b/Assets/Materials/Substance/Metal/iron_rugged.sbsar deleted file mode 100644 index d211f88ad..000000000 --- a/Assets/Materials/Substance/Metal/iron_rugged.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5f2bc787cbb3f6511050a4faddaa07077bf54814131752687ed3717914d77de5 -size 28930 diff --git a/Assets/Materials/Substance/Metal/iron_rugged.sbsar.meta b/Assets/Materials/Substance/Metal/iron_rugged.sbsar.meta deleted file mode 100644 index 4d3540662..000000000 --- a/Assets/Materials/Substance/Metal/iron_rugged.sbsar.meta +++ /dev/null @@ -1,293 +0,0 @@ -fileFormatVersion: 2 -guid: afbd691d0ea2a5a47b5a43b244593a56 -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Iron Rugged - prototypeName: Iron Rugged - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://iron_rugged\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"780426713\" type=\"8\" value=\"9,9\" />\n - </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -2323688274092838296, guid: afbd691d0ea2a5a47b5a43b244593a56, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -3909611376798458227, guid: afbd691d0ea2a5a47b5a43b244593a56, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -1417795912608492100, guid: afbd691d0ea2a5a47b5a43b244593a56, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -7795300588429949130, guid: afbd691d0ea2a5a47b5a43b244593a56, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 3868076301887189615, guid: afbd691d0ea2a5a47b5a43b244593a56, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambientocclusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - textureParameters: - - textureName: Iron Rugged - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Rugged - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Rugged - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Rugged - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Rugged - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Rugged - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Rugged - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Rugged - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Iron Rugged - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 512 - textureHeight: 512 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -7894845242109240131, guid: afbd691d0ea2a5a47b5a43b244593a56, - type: 3} - generatedTextures: - - {fileID: -3909611376798458227, guid: afbd691d0ea2a5a47b5a43b244593a56, type: 3} - - {fileID: -2323688274092838296, guid: afbd691d0ea2a5a47b5a43b244593a56, type: 3} - - {fileID: -1417795912608492100, guid: afbd691d0ea2a5a47b5a43b244593a56, type: 3} - - {fileID: 3868076301887189615, guid: afbd691d0ea2a5a47b5a43b244593a56, type: 3} - - {fileID: -7795300588429949130, guid: afbd691d0ea2a5a47b5a43b244593a56, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_002.sbsar b/Assets/Materials/Substance/Metal/metal_002.sbsar deleted file mode 100644 index 97dcc5ffe..000000000 --- a/Assets/Materials/Substance/Metal/metal_002.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9282e9326add2015fd2748e98c38062e438b085036eae00825551986e30d002f -size 11670 diff --git a/Assets/Materials/Substance/Metal/metal_002.sbsar.meta b/Assets/Materials/Substance/Metal/metal_002.sbsar.meta deleted file mode 100644 index 725363c0a..000000000 --- a/Assets/Materials/Substance/Metal/metal_002.sbsar.meta +++ /dev/null @@ -1,372 +0,0 @@ -fileFormatVersion: 2 -guid: 2b42584452fe0cc4fa4e8a115230b156 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_002/metal_002 - - first: - 4: 400000 - second: metal_002/metal_002/Transform - - first: - 21: 2100000 - second: mat.Metal 002 - - first: - 23: 2300000 - second: metal_002/metal_002/MeshRenderer - - first: - 28: 2800000 - second: Metal 002_baseColor - - first: - 28: 2800002 - second: Metal 002_normal - - first: - 28: 2800004 - second: Metal 002_metallic - - first: - 28: 2800006 - second: Metal 002_ambientOcclusion - - first: - 28: 2800008 - second: Metal 002_height - - first: - 33: 3300000 - second: metal_002/metal_002/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_002/metal_002/SphereCollider - - first: - 1001: 100100000 - second: metal_002 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal 002 - prototypeName: Metal 002 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_002\" label=\"\" >\n <presetinput - identifier=\"deep_rust\" uid=\"428347714\" type=\"0\" value=\"0.49\" />\n - <presetinput identifier=\"rust\" uid=\"428349112\" type=\"0\" value=\"0.83\" - />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 1550000119726971649, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -6057190860509678031, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -894214952450941493, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -6882973941229436791, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 6347190432477724635, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal 002_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 002 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 3766318789785789000, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} - generatedTextures: - - {fileID: -6057190860509678031, guid: 2b42584452fe0cc4fa4e8a115230b156, type: 3} - - {fileID: 1550000119726971649, guid: 2b42584452fe0cc4fa4e8a115230b156, type: 3} - - {fileID: -894214952450941493, guid: 2b42584452fe0cc4fa4e8a115230b156, type: 3} - - {fileID: -6882973941229436791, guid: 2b42584452fe0cc4fa4e8a115230b156, type: 3} - - {fileID: 6347190432477724635, guid: 2b42584452fe0cc4fa4e8a115230b156, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_003.sbsar b/Assets/Materials/Substance/Metal/metal_003.sbsar deleted file mode 100644 index bbc118a2d..000000000 --- a/Assets/Materials/Substance/Metal/metal_003.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4ef8ee0ce61d17b7c84433ea0f780f32609c81f580f2c7d3a9c78303b9051a47 -size 7739 diff --git a/Assets/Materials/Substance/Metal/metal_003.sbsar.meta b/Assets/Materials/Substance/Metal/metal_003.sbsar.meta deleted file mode 100644 index f3ab67932..000000000 --- a/Assets/Materials/Substance/Metal/metal_003.sbsar.meta +++ /dev/null @@ -1,372 +0,0 @@ -fileFormatVersion: 2 -guid: 885e680924fc12c439a842a2142d4b78 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_003/metal_003 - - first: - 4: 400000 - second: metal_003/metal_003/Transform - - first: - 21: 2100000 - second: mat.Metal 003 - - first: - 23: 2300000 - second: metal_003/metal_003/MeshRenderer - - first: - 28: 2800000 - second: Metal 003_baseColor - - first: - 28: 2800002 - second: Metal 003_normal - - first: - 28: 2800004 - second: Metal 003_metallic - - first: - 28: 2800006 - second: Metal 003_height - - first: - 28: 2800008 - second: Metal 003_ambientOcclusion - - first: - 33: 3300000 - second: metal_003/metal_003/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_003/metal_003/SphereCollider - - first: - 1001: 100100000 - second: metal_003 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal 003 - prototypeName: Metal 003 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_003\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"1810375239\" type=\"8\" value=\"10,10\" />\n - <presetinput identifier=\"age\" uid=\"288263018\" type=\"0\" value=\"0.592\" - />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -2508943184622041221, guid: 885e680924fc12c439a842a2142d4b78, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 8, y: 8} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -1236254257114565538, guid: 885e680924fc12c439a842a2142d4b78, - type: 3} - scale: {x: 8, y: 8} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 4019402794555593307, guid: 885e680924fc12c439a842a2142d4b78, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -1475328947160444094, guid: 885e680924fc12c439a842a2142d4b78, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 7523010977671448217, guid: 885e680924fc12c439a842a2142d4b78, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - textureParameters: - - textureName: Metal 003_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 003 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 1024 - textureHeight: 1024 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -741235592913766832, guid: 885e680924fc12c439a842a2142d4b78, - type: 3} - generatedTextures: - - {fileID: -1236254257114565538, guid: 885e680924fc12c439a842a2142d4b78, type: 3} - - {fileID: -2508943184622041221, guid: 885e680924fc12c439a842a2142d4b78, type: 3} - - {fileID: 4019402794555593307, guid: 885e680924fc12c439a842a2142d4b78, type: 3} - - {fileID: 7523010977671448217, guid: 885e680924fc12c439a842a2142d4b78, type: 3} - - {fileID: -1475328947160444094, guid: 885e680924fc12c439a842a2142d4b78, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_006.sbsar b/Assets/Materials/Substance/Metal/metal_006.sbsar deleted file mode 100644 index ac614998f..000000000 --- a/Assets/Materials/Substance/Metal/metal_006.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c7cdd662d4c7ee3124366ac316fe6aa5dd247c279bba053a9084916e0510d8df -size 12109 diff --git a/Assets/Materials/Substance/Metal/metal_006.sbsar.meta b/Assets/Materials/Substance/Metal/metal_006.sbsar.meta deleted file mode 100644 index f304dd2c0..000000000 --- a/Assets/Materials/Substance/Metal/metal_006.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 53adf8e53222e6f4791d7bf2110fb70c -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_006/metal_006 - - first: - 4: 400000 - second: metal_006/metal_006/Transform - - first: - 21: 2100000 - second: mat.Metal 006 - - first: - 23: 2300000 - second: metal_006/metal_006/MeshRenderer - - first: - 28: 2800000 - second: Metal 006_baseColor - - first: - 28: 2800002 - second: Metal 006_normal - - first: - 28: 2800004 - second: Metal 006_metallic - - first: - 28: 2800006 - second: Metal 006_height - - first: - 28: 2800008 - second: Metal 006_ambientOcclusion - - first: - 33: 3300000 - second: metal_006/metal_006/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_006/metal_006/SphereCollider - - first: - 1001: 100100000 - second: metal_006 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal 006 - prototypeName: Metal 006 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_006\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -9145106948908842110, guid: 53adf8e53222e6f4791d7bf2110fb70c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 8714526317094329886, guid: 53adf8e53222e6f4791d7bf2110fb70c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 8283496261199770474, guid: 53adf8e53222e6f4791d7bf2110fb70c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -247870979206812949, guid: 53adf8e53222e6f4791d7bf2110fb70c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 4895182546727821380, guid: 53adf8e53222e6f4791d7bf2110fb70c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - textureParameters: - - textureName: Metal 006_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal 006 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 3954565982357225544, guid: 53adf8e53222e6f4791d7bf2110fb70c, - type: 3} - generatedTextures: - - {fileID: 8714526317094329886, guid: 53adf8e53222e6f4791d7bf2110fb70c, type: 3} - - {fileID: -9145106948908842110, guid: 53adf8e53222e6f4791d7bf2110fb70c, type: 3} - - {fileID: 8283496261199770474, guid: 53adf8e53222e6f4791d7bf2110fb70c, type: 3} - - {fileID: 4895182546727821380, guid: 53adf8e53222e6f4791d7bf2110fb70c, type: 3} - - {fileID: -247870979206812949, guid: 53adf8e53222e6f4791d7bf2110fb70c, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_aluminium.sbsar b/Assets/Materials/Substance/Metal/metal_aluminium.sbsar deleted file mode 100644 index 088b73bee..000000000 --- a/Assets/Materials/Substance/Metal/metal_aluminium.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b19246651deb85c3c0a8d424507e0711ccce8c9eae241da396a36cd210f38f20 -size 10491 diff --git a/Assets/Materials/Substance/Metal/metal_aluminium.sbsar.meta b/Assets/Materials/Substance/Metal/metal_aluminium.sbsar.meta deleted file mode 100644 index 95addd8d7..000000000 --- a/Assets/Materials/Substance/Metal/metal_aluminium.sbsar.meta +++ /dev/null @@ -1,373 +0,0 @@ -fileFormatVersion: 2 -guid: 6b2eb94965ca27542b8627d3521f5b5b -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_aluminium/metal_aluminium - - first: - 4: 400000 - second: metal_aluminium/metal_aluminium/Transform - - first: - 21: 2100000 - second: mat.Aluminium - - first: - 23: 2300000 - second: metal_aluminium/metal_aluminium/MeshRenderer - - first: - 28: 2800000 - second: Aluminium_baseColor - - first: - 28: 2800002 - second: Aluminium_normal - - first: - 28: 2800004 - second: Aluminium_metallic - - first: - 28: 2800006 - second: Aluminium_ambientOcclusion - - first: - 28: 2800008 - second: Aluminium_height - - first: - 33: 3300000 - second: metal_aluminium/metal_aluminium/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_aluminium/metal_aluminium/SphereCollider - - first: - 1001: 100100000 - second: metal_aluminium - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Aluminium - prototypeName: Aluminium - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_aluminium\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"3181072216\" type=\"8\" value=\"9,9\" />\n - <presetinput identifier=\"dirt\" uid=\"3098331086\" type=\"0\" value=\"0.47\" - />\n <presetinput identifier=\"scratches\" uid=\"3338933642\" type=\"0\" value=\"1\" - />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -7227111979962756822, guid: 6b2eb94965ca27542b8627d3521f5b5b, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 5122202571912407749, guid: 6b2eb94965ca27542b8627d3521f5b5b, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -5067940305606501900, guid: 6b2eb94965ca27542b8627d3521f5b5b, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 9049458111962441826, guid: 6b2eb94965ca27542b8627d3521f5b5b, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -7751791800289965735, guid: 6b2eb94965ca27542b8627d3521f5b5b, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Aluminium_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 512 - textureHeight: 512 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 2717629391965333470, guid: 6b2eb94965ca27542b8627d3521f5b5b, - type: 3} - generatedTextures: - - {fileID: 5122202571912407749, guid: 6b2eb94965ca27542b8627d3521f5b5b, type: 3} - - {fileID: -7227111979962756822, guid: 6b2eb94965ca27542b8627d3521f5b5b, type: 3} - - {fileID: -5067940305606501900, guid: 6b2eb94965ca27542b8627d3521f5b5b, type: 3} - - {fileID: 9049458111962441826, guid: 6b2eb94965ca27542b8627d3521f5b5b, type: 3} - - {fileID: -7751791800289965735, guid: 6b2eb94965ca27542b8627d3521f5b5b, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_aluminium_brushed.sbsar b/Assets/Materials/Substance/Metal/metal_aluminium_brushed.sbsar deleted file mode 100644 index 7f2ec6e98..000000000 --- a/Assets/Materials/Substance/Metal/metal_aluminium_brushed.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:41bfd12f87e8255f00383022aa8a1d0c83273a8a23e21233db9f8f08eb89738f -size 12223 diff --git a/Assets/Materials/Substance/Metal/metal_aluminium_brushed.sbsar.meta b/Assets/Materials/Substance/Metal/metal_aluminium_brushed.sbsar.meta deleted file mode 100644 index cafdf3d25..000000000 --- a/Assets/Materials/Substance/Metal/metal_aluminium_brushed.sbsar.meta +++ /dev/null @@ -1,373 +0,0 @@ -fileFormatVersion: 2 -guid: 06d6a565d43fba5409712ce9a10bfbef -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_aluminium_brushed/metal_aluminium_brushed - - first: - 4: 400000 - second: metal_aluminium_brushed/metal_aluminium_brushed/Transform - - first: - 21: 2100000 - second: mat.Aluminium brushed - - first: - 23: 2300000 - second: metal_aluminium_brushed/metal_aluminium_brushed/MeshRenderer - - first: - 28: 2800000 - second: Aluminium brushed_baseColor - - first: - 28: 2800002 - second: Aluminium brushed_normal - - first: - 28: 2800004 - second: Aluminium brushed_metallic - - first: - 28: 2800006 - second: Aluminium brushed_ambientOcclusion - - first: - 28: 2800008 - second: Aluminium brushed_height - - first: - 33: 3300000 - second: metal_aluminium_brushed/metal_aluminium_brushed/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_aluminium_brushed/metal_aluminium_brushed/SphereCollider - - first: - 1001: 100100000 - second: metal_aluminium_brushed - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Aluminium brushed - prototypeName: Aluminium brushed - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_aluminium_brushed\" label=\"\" >\n - <presetinput identifier=\"$outputsize\" uid=\"2569318558\" type=\"8\" value=\"9,9\" - />\n <presetinput identifier=\"scratches\" uid=\"3820743244\" type=\"0\" value=\"1\" - />\n <presetinput identifier=\"aluminium_color\" uid=\"3822108404\" type=\"2\" - value=\"0.951,0.951,0.951\" />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 4730978449518085612, guid: 06d6a565d43fba5409712ce9a10bfbef, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 7556082237344091230, guid: 06d6a565d43fba5409712ce9a10bfbef, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 6373266012617290493, guid: 06d6a565d43fba5409712ce9a10bfbef, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 342959783478273704, guid: 06d6a565d43fba5409712ce9a10bfbef, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -9132138291289375396, guid: 06d6a565d43fba5409712ce9a10bfbef, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Aluminium brushed_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Aluminium brushed - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 512 - textureHeight: 512 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -5899741495057040748, guid: 06d6a565d43fba5409712ce9a10bfbef, - type: 3} - generatedTextures: - - {fileID: 7556082237344091230, guid: 06d6a565d43fba5409712ce9a10bfbef, type: 3} - - {fileID: 4730978449518085612, guid: 06d6a565d43fba5409712ce9a10bfbef, type: 3} - - {fileID: 6373266012617290493, guid: 06d6a565d43fba5409712ce9a10bfbef, type: 3} - - {fileID: 342959783478273704, guid: 06d6a565d43fba5409712ce9a10bfbef, type: 3} - - {fileID: -9132138291289375396, guid: 06d6a565d43fba5409712ce9a10bfbef, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_brass.sbsar b/Assets/Materials/Substance/Metal/metal_brass.sbsar deleted file mode 100644 index 8db7e53b4..000000000 --- a/Assets/Materials/Substance/Metal/metal_brass.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:26e440c8cc91202789c408e82dfa3caca98938014aaf63baade897fade94f212 -size 12658 diff --git a/Assets/Materials/Substance/Metal/metal_brass.sbsar.meta b/Assets/Materials/Substance/Metal/metal_brass.sbsar.meta deleted file mode 100644 index dad220291..000000000 --- a/Assets/Materials/Substance/Metal/metal_brass.sbsar.meta +++ /dev/null @@ -1,375 +0,0 @@ -fileFormatVersion: 2 -guid: 9fc901afb8a434e46b9405eaec2df5a4 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_brass/metal_brass - - first: - 4: 400000 - second: metal_brass/metal_brass/Transform - - first: - 21: 2100000 - second: mat.Brass - - first: - 23: 2300000 - second: metal_brass/metal_brass/MeshRenderer - - first: - 28: 2800000 - second: Brass_baseColor - - first: - 28: 2800002 - second: Brass_normal - - first: - 28: 2800004 - second: Brass_metallic - - first: - 28: 2800006 - second: Brass_ambientOcclusion - - first: - 28: 2800008 - second: Brass_height - - first: - 33: 3300000 - second: metal_brass/metal_brass/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_brass/metal_brass/SphereCollider - - first: - 1001: 100100000 - second: metal_brass - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Brass - prototypeName: Brass - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_brass\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"2699195248\" type=\"8\" value=\"10,10\" />\n - <presetinput identifier=\"dirt\" uid=\"3700793424\" type=\"0\" value=\"1\" - />\n <presetinput identifier=\"scratches\" uid=\"2782264294\" type=\"0\" value=\"1\" - />\n <presetinput identifier=\"oxidation\" uid=\"3665635746\" type=\"0\" value=\"0.226\" - />\n <presetinput identifier=\"brass_roughness\" uid=\"3708655714\" type=\"0\" - value=\"0.092\" />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -3419035557588562233, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -1863473678134789185, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 6214616473909614744, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -3436886866959827803, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 7009887839391554354, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Brass_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Brass - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 1024 - textureHeight: 1024 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -4907982557009795279, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} - generatedTextures: - - {fileID: -1863473678134789185, guid: 9fc901afb8a434e46b9405eaec2df5a4, type: 3} - - {fileID: -3419035557588562233, guid: 9fc901afb8a434e46b9405eaec2df5a4, type: 3} - - {fileID: 6214616473909614744, guid: 9fc901afb8a434e46b9405eaec2df5a4, type: 3} - - {fileID: -3436886866959827803, guid: 9fc901afb8a434e46b9405eaec2df5a4, type: 3} - - {fileID: 7009887839391554354, guid: 9fc901afb8a434e46b9405eaec2df5a4, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_car_paint 1.sbsar b/Assets/Materials/Substance/Metal/metal_car_paint 1.sbsar deleted file mode 100644 index 963310406..000000000 --- a/Assets/Materials/Substance/Metal/metal_car_paint 1.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dbee14b278a03ed59e1df8ecd6ba2b07ab7c2b2089e5e2bc3fad5673694a9f03 -size 14971 diff --git a/Assets/Materials/Substance/Metal/metal_car_paint 1.sbsar.meta b/Assets/Materials/Substance/Metal/metal_car_paint 1.sbsar.meta deleted file mode 100644 index d6786ba5e..000000000 --- a/Assets/Materials/Substance/Metal/metal_car_paint 1.sbsar.meta +++ /dev/null @@ -1,379 +0,0 @@ -fileFormatVersion: 2 -guid: 1c858fec5b74c7c46b1712494192b6b5 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_car_paint/metal_car_paint - - first: - 4: 400000 - second: metal_car_paint/metal_car_paint/Transform - - first: - 21: 2100000 - second: mat.Car paint - - first: - 23: 2300000 - second: metal_car_paint/metal_car_paint/MeshRenderer - - first: - 28: 2800000 - second: Car paint_baseColor - - first: - 28: 2800002 - second: Car paint_normal - - first: - 28: 2800004 - second: Car paint_metallic - - first: - 28: 2800006 - second: Car paint_ambientOcclusion - - first: - 28: 2800008 - second: Car paint_height - - first: - 33: 3300000 - second: metal_car_paint/metal_car_paint/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_car_paint/metal_car_paint/SphereCollider - - first: - 1001: 100100000 - second: metal_car_paint - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Car paint - prototypeName: Car paint - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_car_paint\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"2092133592\" type=\"8\" value=\"10,10\" />\n - <presetinput identifier=\"age\" uid=\"2038752334\" type=\"0\" value=\"0.66\" - />\n <presetinput identifier=\"flakes\" uid=\"20245147\" type=\"4\" value=\"1\" - />\n <presetinput identifier=\"flakes_scale\" uid=\"20192266\" type=\"0\" - value=\"0.225\" />\n <presetinput identifier=\"paint_scratches\" uid=\"22509202\" - type=\"0\" value=\"1\" />\n <presetinput identifier=\"paint_peeling\" uid=\"103560714\" - type=\"0\" value=\"0.14\" />\n <presetinput identifier=\"paint_color\" uid=\"105341618\" - type=\"2\" value=\"1,0.891509,0.946396\" />\n <presetinput identifier=\"paint_roughness\" - uid=\"22504606\" type=\"0\" value=\"0.15\" />\n <presetinput identifier=\"paint_metallic\" - uid=\"22503567\" type=\"0\" value=\"0\" />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 3068890721646206586, guid: 1c858fec5b74c7c46b1712494192b6b5, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 16, y: 16} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 5917659159057834157, guid: 1c858fec5b74c7c46b1712494192b6b5, - type: 3} - scale: {x: 16, y: 16} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -3552914696322007609, guid: 1c858fec5b74c7c46b1712494192b6b5, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -1242281561028671816, guid: 1c858fec5b74c7c46b1712494192b6b5, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -1652887728991447519, guid: 1c858fec5b74c7c46b1712494192b6b5, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.005 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Car paint_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 1024 - textureHeight: 1024 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 3720744386649352057, guid: 1c858fec5b74c7c46b1712494192b6b5, - type: 3} - generatedTextures: - - {fileID: 5917659159057834157, guid: 1c858fec5b74c7c46b1712494192b6b5, type: 3} - - {fileID: 3068890721646206586, guid: 1c858fec5b74c7c46b1712494192b6b5, type: 3} - - {fileID: -3552914696322007609, guid: 1c858fec5b74c7c46b1712494192b6b5, type: 3} - - {fileID: -1242281561028671816, guid: 1c858fec5b74c7c46b1712494192b6b5, type: 3} - - {fileID: -1652887728991447519, guid: 1c858fec5b74c7c46b1712494192b6b5, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_car_paint Magenta.sbsar b/Assets/Materials/Substance/Metal/metal_car_paint Magenta.sbsar deleted file mode 100644 index 963310406..000000000 --- a/Assets/Materials/Substance/Metal/metal_car_paint Magenta.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dbee14b278a03ed59e1df8ecd6ba2b07ab7c2b2089e5e2bc3fad5673694a9f03 -size 14971 diff --git a/Assets/Materials/Substance/Metal/metal_car_paint Magenta.sbsar.meta b/Assets/Materials/Substance/Metal/metal_car_paint Magenta.sbsar.meta deleted file mode 100644 index c839a27b8..000000000 --- a/Assets/Materials/Substance/Metal/metal_car_paint Magenta.sbsar.meta +++ /dev/null @@ -1,381 +0,0 @@ -fileFormatVersion: 2 -guid: a1d39ea984432bf44b4a0686afe2bf1a -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_car_paint/metal_car_paint - - first: - 4: 400000 - second: metal_car_paint/metal_car_paint/Transform - - first: - 21: 2100000 - second: mat.Car paint - - first: - 23: 2300000 - second: metal_car_paint/metal_car_paint/MeshRenderer - - first: - 28: 2800000 - second: Car paint_baseColor - - first: - 28: 2800002 - second: Car paint_normal - - first: - 28: 2800004 - second: Car paint_metallic - - first: - 28: 2800006 - second: Car paint_ambientOcclusion - - first: - 28: 2800008 - second: Car paint_height - - first: - 33: 3300000 - second: metal_car_paint/metal_car_paint/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_car_paint/metal_car_paint/SphereCollider - - first: - 1001: 100100000 - second: metal_car_paint - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Car paint - prototypeName: Car paint - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_car_paint\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"2092133592\" type=\"8\" value=\"11,11\" />\n - <presetinput identifier=\"normal_intensity\" uid=\"2045651458\" type=\"0\" - value=\"0.25\" />\n <presetinput identifier=\"age\" uid=\"2038752334\" type=\"0\" - value=\"1\" />\n <presetinput identifier=\"flakes\" uid=\"20245147\" type=\"4\" - value=\"1\" />\n <presetinput identifier=\"flakes_scale\" uid=\"20192266\" - type=\"0\" value=\"1\" />\n <presetinput identifier=\"paint_scratches\" uid=\"22509202\" - type=\"0\" value=\"1\" />\n <presetinput identifier=\"paint_peeling\" uid=\"103560714\" - type=\"0\" value=\"0.246\" />\n <presetinput identifier=\"metal_roughness\" - uid=\"22504787\" type=\"0\" value=\"0.39\" />\n <presetinput identifier=\"paint_color\" - uid=\"105341618\" type=\"2\" value=\"0.5,0,0.228113\" />\n <presetinput identifier=\"paint_roughness\" - uid=\"22504606\" type=\"0\" value=\"0\" />\n <presetinput identifier=\"paint_metallic\" - uid=\"22503567\" type=\"0\" value=\"1\" />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 3068890721646206586, guid: a1d39ea984432bf44b4a0686afe2bf1a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 5917659159057834157, guid: a1d39ea984432bf44b4a0686afe2bf1a, - type: 3} - scale: {x: 2, y: 2} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -3552914696322007609, guid: a1d39ea984432bf44b4a0686afe2bf1a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -1242281561028671816, guid: a1d39ea984432bf44b4a0686afe2bf1a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -1652887728991447519, guid: a1d39ea984432bf44b4a0686afe2bf1a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 1 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 1 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Car paint_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 2048 - textureHeight: 2048 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 3720744386649352057, guid: a1d39ea984432bf44b4a0686afe2bf1a, - type: 3} - generatedTextures: - - {fileID: 5917659159057834157, guid: a1d39ea984432bf44b4a0686afe2bf1a, type: 3} - - {fileID: 3068890721646206586, guid: a1d39ea984432bf44b4a0686afe2bf1a, type: 3} - - {fileID: -3552914696322007609, guid: a1d39ea984432bf44b4a0686afe2bf1a, type: 3} - - {fileID: -1242281561028671816, guid: a1d39ea984432bf44b4a0686afe2bf1a, type: 3} - - {fileID: -1652887728991447519, guid: a1d39ea984432bf44b4a0686afe2bf1a, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_car_paint red.sbsar b/Assets/Materials/Substance/Metal/metal_car_paint red.sbsar deleted file mode 100644 index 963310406..000000000 --- a/Assets/Materials/Substance/Metal/metal_car_paint red.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dbee14b278a03ed59e1df8ecd6ba2b07ab7c2b2089e5e2bc3fad5673694a9f03 -size 14971 diff --git a/Assets/Materials/Substance/Metal/metal_car_paint red.sbsar.meta b/Assets/Materials/Substance/Metal/metal_car_paint red.sbsar.meta deleted file mode 100644 index ded098ca6..000000000 --- a/Assets/Materials/Substance/Metal/metal_car_paint red.sbsar.meta +++ /dev/null @@ -1,381 +0,0 @@ -fileFormatVersion: 2 -guid: 504c7bfe0d50ff64a88b8eac2ceb46f8 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_car_paint/metal_car_paint - - first: - 4: 400000 - second: metal_car_paint/metal_car_paint/Transform - - first: - 21: 2100000 - second: mat.Car paint - - first: - 23: 2300000 - second: metal_car_paint/metal_car_paint/MeshRenderer - - first: - 28: 2800000 - second: Car paint_baseColor - - first: - 28: 2800002 - second: Car paint_normal - - first: - 28: 2800004 - second: Car paint_metallic - - first: - 28: 2800006 - second: Car paint_ambientOcclusion - - first: - 28: 2800008 - second: Car paint_height - - first: - 33: 3300000 - second: metal_car_paint/metal_car_paint/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_car_paint/metal_car_paint/SphereCollider - - first: - 1001: 100100000 - second: metal_car_paint - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Car paint - prototypeName: Car paint - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_car_paint\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"2092133592\" type=\"8\" value=\"11,11\" />\n - <presetinput identifier=\"normal_intensity\" uid=\"2045651458\" type=\"0\" - value=\"0.25\" />\n <presetinput identifier=\"age\" uid=\"2038752334\" type=\"0\" - value=\"1\" />\n <presetinput identifier=\"flakes\" uid=\"20245147\" type=\"4\" - value=\"1\" />\n <presetinput identifier=\"flakes_scale\" uid=\"20192266\" - type=\"0\" value=\"1\" />\n <presetinput identifier=\"paint_scratches\" uid=\"22509202\" - type=\"0\" value=\"1\" />\n <presetinput identifier=\"paint_peeling\" uid=\"103560714\" - type=\"0\" value=\"0.246\" />\n <presetinput identifier=\"metal_roughness\" - uid=\"22504787\" type=\"0\" value=\"0.39\" />\n <presetinput identifier=\"paint_color\" - uid=\"105341618\" type=\"2\" value=\"1,0.15685,0\" />\n <presetinput identifier=\"paint_roughness\" - uid=\"22504606\" type=\"0\" value=\"0\" />\n <presetinput identifier=\"paint_metallic\" - uid=\"22503567\" type=\"0\" value=\"1\" />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 3068890721646206586, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 5917659159057834157, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -3552914696322007609, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -1242281561028671816, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -1652887728991447519, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.005 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Car paint_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 2048 - textureHeight: 2048 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 3720744386649352057, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, - type: 3} - generatedTextures: - - {fileID: 5917659159057834157, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, type: 3} - - {fileID: 3068890721646206586, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, type: 3} - - {fileID: -3552914696322007609, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, type: 3} - - {fileID: -1242281561028671816, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, type: 3} - - {fileID: -1652887728991447519, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_car_paint white.sbsar b/Assets/Materials/Substance/Metal/metal_car_paint white.sbsar deleted file mode 100644 index 963310406..000000000 --- a/Assets/Materials/Substance/Metal/metal_car_paint white.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dbee14b278a03ed59e1df8ecd6ba2b07ab7c2b2089e5e2bc3fad5673694a9f03 -size 14971 diff --git a/Assets/Materials/Substance/Metal/metal_car_paint white.sbsar.meta b/Assets/Materials/Substance/Metal/metal_car_paint white.sbsar.meta deleted file mode 100644 index 98f20f5ea..000000000 --- a/Assets/Materials/Substance/Metal/metal_car_paint white.sbsar.meta +++ /dev/null @@ -1,382 +0,0 @@ -fileFormatVersion: 2 -guid: b2bec4b400153d745b2915f1c43e5c96 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_car_paint/metal_car_paint - - first: - 4: 400000 - second: metal_car_paint/metal_car_paint/Transform - - first: - 21: 2100000 - second: mat.Car paint - - first: - 23: 2300000 - second: metal_car_paint/metal_car_paint/MeshRenderer - - first: - 28: 2800000 - second: Car paint_baseColor - - first: - 28: 2800002 - second: Car paint_normal - - first: - 28: 2800004 - second: Car paint_metallic - - first: - 28: 2800006 - second: Car paint_ambientOcclusion - - first: - 28: 2800008 - second: Car paint_height - - first: - 33: 3300000 - second: metal_car_paint/metal_car_paint/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_car_paint/metal_car_paint/SphereCollider - - first: - 1001: 100100000 - second: metal_car_paint - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Car paint - prototypeName: Car paint - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_car_paint\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"2092133592\" type=\"8\" value=\"11,11\" />\n - <presetinput identifier=\"normal_intensity\" uid=\"2045651458\" type=\"0\" - value=\"0.25\" />\n <presetinput identifier=\"age\" uid=\"2038752334\" type=\"0\" - value=\"1\" />\n <presetinput identifier=\"flakes\" uid=\"20245147\" type=\"4\" - value=\"1\" />\n <presetinput identifier=\"flakes_scale\" uid=\"20192266\" - type=\"0\" value=\"0\" />\n <presetinput identifier=\"paint_scratches\" uid=\"22509202\" - type=\"0\" value=\"1\" />\n <presetinput identifier=\"paint_peeling\" uid=\"103560714\" - type=\"0\" value=\"0.095\" />\n <presetinput identifier=\"metal_roughness\" - uid=\"22504787\" type=\"0\" value=\"0.33\" />\n <presetinput identifier=\"paint_color\" - uid=\"105341618\" type=\"2\" value=\"1,0.891509,0.946396\" />\n <presetinput - identifier=\"paint_roughness\" uid=\"22504606\" type=\"0\" value=\"0\" />\n - <presetinput identifier=\"paint_metallic\" uid=\"22503567\" type=\"0\" value=\"0\" - />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 3068890721646206586, guid: b2bec4b400153d745b2915f1c43e5c96, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 0.5, y: 0.5} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 5917659159057834157, guid: b2bec4b400153d745b2915f1c43e5c96, - type: 3} - scale: {x: 0.5, y: 0.5} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -3552914696322007609, guid: b2bec4b400153d745b2915f1c43e5c96, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -1242281561028671816, guid: b2bec4b400153d745b2915f1c43e5c96, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -1652887728991447519, guid: b2bec4b400153d745b2915f1c43e5c96, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 1 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 1 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Car paint_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Car paint - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 2048 - textureHeight: 2048 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 3720744386649352057, guid: b2bec4b400153d745b2915f1c43e5c96, - type: 3} - generatedTextures: - - {fileID: 5917659159057834157, guid: b2bec4b400153d745b2915f1c43e5c96, type: 3} - - {fileID: 3068890721646206586, guid: b2bec4b400153d745b2915f1c43e5c96, type: 3} - - {fileID: -3552914696322007609, guid: b2bec4b400153d745b2915f1c43e5c96, type: 3} - - {fileID: -1242281561028671816, guid: b2bec4b400153d745b2915f1c43e5c96, type: 3} - - {fileID: -1652887728991447519, guid: b2bec4b400153d745b2915f1c43e5c96, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_copper.sbsar b/Assets/Materials/Substance/Metal/metal_copper.sbsar deleted file mode 100644 index b9eaa9f10..000000000 --- a/Assets/Materials/Substance/Metal/metal_copper.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7e0b38479a336f09f0f273488c666a1eb025ddd9a65366da00c80179ca0a64ee -size 7413 diff --git a/Assets/Materials/Substance/Metal/metal_copper.sbsar.meta b/Assets/Materials/Substance/Metal/metal_copper.sbsar.meta deleted file mode 100644 index d1afb9abd..000000000 --- a/Assets/Materials/Substance/Metal/metal_copper.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 8249e9ffcbd97c84d8ce73343e156c82 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_copper/metal_copper - - first: - 4: 400000 - second: metal_copper/metal_copper/Transform - - first: - 21: 2100000 - second: mat.Copper - - first: - 23: 2300000 - second: metal_copper/metal_copper/MeshRenderer - - first: - 28: 2800000 - second: Copper_baseColor - - first: - 28: 2800002 - second: Copper_normal - - first: - 28: 2800004 - second: Copper_metallic - - first: - 28: 2800006 - second: Copper_ambientOcclusion - - first: - 28: 2800008 - second: Copper_height - - first: - 33: 3300000 - second: metal_copper/metal_copper/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_copper/metal_copper/SphereCollider - - first: - 1001: 100100000 - second: metal_copper - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Copper - prototypeName: Copper - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_copper\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -3792452219542522299, guid: 8249e9ffcbd97c84d8ce73343e156c82, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -595311359069952391, guid: 8249e9ffcbd97c84d8ce73343e156c82, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -1397886531756242709, guid: 8249e9ffcbd97c84d8ce73343e156c82, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 2236529815293478155, guid: 8249e9ffcbd97c84d8ce73343e156c82, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -1739956823984805281, guid: 8249e9ffcbd97c84d8ce73343e156c82, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Copper_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Copper - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 9219180724257492359, guid: 8249e9ffcbd97c84d8ce73343e156c82, - type: 3} - generatedTextures: - - {fileID: -595311359069952391, guid: 8249e9ffcbd97c84d8ce73343e156c82, type: 3} - - {fileID: -3792452219542522299, guid: 8249e9ffcbd97c84d8ce73343e156c82, type: 3} - - {fileID: -1397886531756242709, guid: 8249e9ffcbd97c84d8ce73343e156c82, type: 3} - - {fileID: 2236529815293478155, guid: 8249e9ffcbd97c84d8ce73343e156c82, type: 3} - - {fileID: -1739956823984805281, guid: 8249e9ffcbd97c84d8ce73343e156c82, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_corrugated_002.sbsar b/Assets/Materials/Substance/Metal/metal_corrugated_002.sbsar deleted file mode 100644 index 24237719c..000000000 --- a/Assets/Materials/Substance/Metal/metal_corrugated_002.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5b798bdf0e774a7d826b7080b18c91ac8000cf6ac617dc395d8cf105aba8d7da -size 12826 diff --git a/Assets/Materials/Substance/Metal/metal_corrugated_002.sbsar.meta b/Assets/Materials/Substance/Metal/metal_corrugated_002.sbsar.meta deleted file mode 100644 index 3de9c9e1e..000000000 --- a/Assets/Materials/Substance/Metal/metal_corrugated_002.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 9d0963470d3545a4e932ed4ea95b9d62 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_corrugated_002/metal_corrugated_002 - - first: - 4: 400000 - second: metal_corrugated_002/metal_corrugated_002/Transform - - first: - 21: 2100000 - second: mat.Metal Corrugated 002 - - first: - 23: 2300000 - second: metal_corrugated_002/metal_corrugated_002/MeshRenderer - - first: - 28: 2800000 - second: Metal Corrugated 002_baseColor - - first: - 28: 2800002 - second: Metal Corrugated 002_normal - - first: - 28: 2800004 - second: Metal Corrugated 002_metallic - - first: - 28: 2800006 - second: Metal Corrugated 002_ambientOcclusion - - first: - 28: 2800008 - second: Metal Corrugated 002_height - - first: - 33: 3300000 - second: metal_corrugated_002/metal_corrugated_002/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_corrugated_002/metal_corrugated_002/SphereCollider - - first: - 1001: 100100000 - second: metal_corrugated_002 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal Corrugated 002 - prototypeName: Metal Corrugated 002 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_corrugated_002\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -3654691528969531916, guid: 9d0963470d3545a4e932ed4ea95b9d62, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 4818317370781631303, guid: 9d0963470d3545a4e932ed4ea95b9d62, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 5859956115695178477, guid: 9d0963470d3545a4e932ed4ea95b9d62, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -8111981235355854162, guid: 9d0963470d3545a4e932ed4ea95b9d62, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -5667621616349238808, guid: 9d0963470d3545a4e932ed4ea95b9d62, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal Corrugated 002_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Corrugated 002 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -1355354389579744761, guid: 9d0963470d3545a4e932ed4ea95b9d62, - type: 3} - generatedTextures: - - {fileID: 4818317370781631303, guid: 9d0963470d3545a4e932ed4ea95b9d62, type: 3} - - {fileID: -3654691528969531916, guid: 9d0963470d3545a4e932ed4ea95b9d62, type: 3} - - {fileID: 5859956115695178477, guid: 9d0963470d3545a4e932ed4ea95b9d62, type: 3} - - {fileID: -8111981235355854162, guid: 9d0963470d3545a4e932ed4ea95b9d62, type: 3} - - {fileID: -5667621616349238808, guid: 9d0963470d3545a4e932ed4ea95b9d62, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_floor_002.sbsar b/Assets/Materials/Substance/Metal/metal_floor_002.sbsar deleted file mode 100644 index af4adc50c..000000000 --- a/Assets/Materials/Substance/Metal/metal_floor_002.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5815e5257550f8315dd80831c4cab398a3ae7b234b25e716ecca18c9facbd9be -size 11140 diff --git a/Assets/Materials/Substance/Metal/metal_floor_002.sbsar.meta b/Assets/Materials/Substance/Metal/metal_floor_002.sbsar.meta deleted file mode 100644 index c100570af..000000000 --- a/Assets/Materials/Substance/Metal/metal_floor_002.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: ddc6970cc883b9845bdadc91983130c2 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_floor_002/metal_floor_002 - - first: - 4: 400000 - second: metal_floor_002/metal_floor_002/Transform - - first: - 21: 2100000 - second: mat.Metal Floor 002 - - first: - 23: 2300000 - second: metal_floor_002/metal_floor_002/MeshRenderer - - first: - 28: 2800000 - second: Metal Floor 002_baseColor - - first: - 28: 2800002 - second: Metal Floor 002_normal - - first: - 28: 2800004 - second: Metal Floor 002_metallic - - first: - 28: 2800006 - second: Metal Floor 002_ambientOcclusion - - first: - 28: 2800008 - second: Metal Floor 002_height - - first: - 33: 3300000 - second: metal_floor_002/metal_floor_002/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_floor_002/metal_floor_002/SphereCollider - - first: - 1001: 100100000 - second: metal_floor_002 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal Floor 002 - prototypeName: Metal Floor 002 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_floor_002\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 351554284034007472, guid: ddc6970cc883b9845bdadc91983130c2, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -7508666898770042810, guid: ddc6970cc883b9845bdadc91983130c2, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -4403901252400104909, guid: ddc6970cc883b9845bdadc91983130c2, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -4356325417559842052, guid: ddc6970cc883b9845bdadc91983130c2, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -3247329771169464856, guid: ddc6970cc883b9845bdadc91983130c2, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal Floor 002_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 002 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 3616699503892477274, guid: ddc6970cc883b9845bdadc91983130c2, - type: 3} - generatedTextures: - - {fileID: -7508666898770042810, guid: ddc6970cc883b9845bdadc91983130c2, type: 3} - - {fileID: 351554284034007472, guid: ddc6970cc883b9845bdadc91983130c2, type: 3} - - {fileID: -4403901252400104909, guid: ddc6970cc883b9845bdadc91983130c2, type: 3} - - {fileID: -4356325417559842052, guid: ddc6970cc883b9845bdadc91983130c2, type: 3} - - {fileID: -3247329771169464856, guid: ddc6970cc883b9845bdadc91983130c2, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_floor_004.sbsar b/Assets/Materials/Substance/Metal/metal_floor_004.sbsar deleted file mode 100644 index f7136c15b..000000000 --- a/Assets/Materials/Substance/Metal/metal_floor_004.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d30688944fced2d854f8375ebecd8ad7a6a8021cee07e89710b44ad8272addd -size 8634 diff --git a/Assets/Materials/Substance/Metal/metal_floor_004.sbsar.meta b/Assets/Materials/Substance/Metal/metal_floor_004.sbsar.meta deleted file mode 100644 index 031cbe6c4..000000000 --- a/Assets/Materials/Substance/Metal/metal_floor_004.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 50192727b92e0af4cbe5c773bec3537f -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_floor_004/metal_floor_004 - - first: - 4: 400000 - second: metal_floor_004/metal_floor_004/Transform - - first: - 21: 2100000 - second: mat.Metal Floor 004 - - first: - 23: 2300000 - second: metal_floor_004/metal_floor_004/MeshRenderer - - first: - 28: 2800000 - second: Metal Floor 004_baseColor - - first: - 28: 2800002 - second: Metal Floor 004_normal - - first: - 28: 2800004 - second: Metal Floor 004_metallic - - first: - 28: 2800006 - second: Metal Floor 004_ambientOcclusion - - first: - 28: 2800008 - second: Metal Floor 004_height - - first: - 33: 3300000 - second: metal_floor_004/metal_floor_004/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_floor_004/metal_floor_004/SphereCollider - - first: - 1001: 100100000 - second: metal_floor_004 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal Floor 004 - prototypeName: Metal Floor 004 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_floor_004\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 5886398526092406922, guid: 50192727b92e0af4cbe5c773bec3537f, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 1550179426837470591, guid: 50192727b92e0af4cbe5c773bec3537f, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 4385304290797446058, guid: 50192727b92e0af4cbe5c773bec3537f, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -3130265262045919237, guid: 50192727b92e0af4cbe5c773bec3537f, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 4866469902769357514, guid: 50192727b92e0af4cbe5c773bec3537f, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal Floor 004_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 004 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -1891697860355797410, guid: 50192727b92e0af4cbe5c773bec3537f, - type: 3} - generatedTextures: - - {fileID: 1550179426837470591, guid: 50192727b92e0af4cbe5c773bec3537f, type: 3} - - {fileID: 5886398526092406922, guid: 50192727b92e0af4cbe5c773bec3537f, type: 3} - - {fileID: 4385304290797446058, guid: 50192727b92e0af4cbe5c773bec3537f, type: 3} - - {fileID: -3130265262045919237, guid: 50192727b92e0af4cbe5c773bec3537f, type: 3} - - {fileID: 4866469902769357514, guid: 50192727b92e0af4cbe5c773bec3537f, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_floor_006.sbsar b/Assets/Materials/Substance/Metal/metal_floor_006.sbsar deleted file mode 100644 index 81ce60800..000000000 --- a/Assets/Materials/Substance/Metal/metal_floor_006.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9604a8c7814d09f90d8bc64061cdc39c733d9f96de43143717f9a951b1f08a0e -size 10884 diff --git a/Assets/Materials/Substance/Metal/metal_floor_006.sbsar.meta b/Assets/Materials/Substance/Metal/metal_floor_006.sbsar.meta deleted file mode 100644 index 91f291c9d..000000000 --- a/Assets/Materials/Substance/Metal/metal_floor_006.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 06833951ebae4cc45ad88d58cb5571de -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_floor_006/metal_floor_006 - - first: - 4: 400000 - second: metal_floor_006/metal_floor_006/Transform - - first: - 21: 2100000 - second: mat.Metal Floor 006 - - first: - 23: 2300000 - second: metal_floor_006/metal_floor_006/MeshRenderer - - first: - 28: 2800000 - second: Metal Floor 006_baseColor - - first: - 28: 2800002 - second: Metal Floor 006_normal - - first: - 28: 2800004 - second: Metal Floor 006_metallic - - first: - 28: 2800006 - second: Metal Floor 006_ambientOcclusion - - first: - 28: 2800008 - second: Metal Floor 006_height - - first: - 33: 3300000 - second: metal_floor_006/metal_floor_006/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_floor_006/metal_floor_006/SphereCollider - - first: - 1001: 100100000 - second: metal_floor_006 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal Floor 006 - prototypeName: Metal Floor 006 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_floor_006\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -2252411089510067877, guid: 06833951ebae4cc45ad88d58cb5571de, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -446378320346000722, guid: 06833951ebae4cc45ad88d58cb5571de, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 877764506763962143, guid: 06833951ebae4cc45ad88d58cb5571de, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -4232129871321120126, guid: 06833951ebae4cc45ad88d58cb5571de, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 3318615130639472310, guid: 06833951ebae4cc45ad88d58cb5571de, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal Floor 006_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Floor 006 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -6975397259061671394, guid: 06833951ebae4cc45ad88d58cb5571de, - type: 3} - generatedTextures: - - {fileID: -446378320346000722, guid: 06833951ebae4cc45ad88d58cb5571de, type: 3} - - {fileID: -2252411089510067877, guid: 06833951ebae4cc45ad88d58cb5571de, type: 3} - - {fileID: 877764506763962143, guid: 06833951ebae4cc45ad88d58cb5571de, type: 3} - - {fileID: -4232129871321120126, guid: 06833951ebae4cc45ad88d58cb5571de, type: 3} - - {fileID: 3318615130639472310, guid: 06833951ebae4cc45ad88d58cb5571de, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_gold.sbsar b/Assets/Materials/Substance/Metal/metal_gold.sbsar deleted file mode 100644 index 5aa377680..000000000 --- a/Assets/Materials/Substance/Metal/metal_gold.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:29ef1a459ab7d090b32ee563d729038527c4d031595abef2a49398543d11343c -size 7428 diff --git a/Assets/Materials/Substance/Metal/metal_gold.sbsar.meta b/Assets/Materials/Substance/Metal/metal_gold.sbsar.meta deleted file mode 100644 index c4e7f4644..000000000 --- a/Assets/Materials/Substance/Metal/metal_gold.sbsar.meta +++ /dev/null @@ -1,373 +0,0 @@ -fileFormatVersion: 2 -guid: a74970be876d3554ea0f279f39314c9c -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_gold/metal_gold - - first: - 4: 400000 - second: metal_gold/metal_gold/Transform - - first: - 21: 2100000 - second: mat.Gold - - first: - 23: 2300000 - second: metal_gold/metal_gold/MeshRenderer - - first: - 28: 2800000 - second: Gold_baseColor - - first: - 28: 2800002 - second: Gold_normal - - first: - 28: 2800004 - second: Gold_metallic - - first: - 28: 2800006 - second: Gold_ambientOcclusion - - first: - 28: 2800008 - second: Gold_height - - first: - 33: 3300000 - second: metal_gold/metal_gold/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_gold/metal_gold/SphereCollider - - first: - 1001: 100100000 - second: metal_gold - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Gold - prototypeName: Gold - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_gold\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"2862216590\" type=\"8\" value=\"9,9\" />\n - <presetinput identifier=\"dirt\" uid=\"2947448088\" type=\"0\" value=\"0.766\" - />\n <presetinput identifier=\"scratches\" uid=\"3615194042\" type=\"0\" value=\"1\" - />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -6248678595456566848, guid: a74970be876d3554ea0f279f39314c9c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 4, y: 4} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 2039085267362074300, guid: a74970be876d3554ea0f279f39314c9c, - type: 3} - scale: {x: 4, y: 4} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -8783136193678078058, guid: a74970be876d3554ea0f279f39314c9c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 7384525862955468029, guid: a74970be876d3554ea0f279f39314c9c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -8934633548313413119, guid: a74970be876d3554ea0f279f39314c9c, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Gold_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Gold - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 512 - textureHeight: 512 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -905690159841262435, guid: a74970be876d3554ea0f279f39314c9c, - type: 3} - generatedTextures: - - {fileID: 2039085267362074300, guid: a74970be876d3554ea0f279f39314c9c, type: 3} - - {fileID: -6248678595456566848, guid: a74970be876d3554ea0f279f39314c9c, type: 3} - - {fileID: -8783136193678078058, guid: a74970be876d3554ea0f279f39314c9c, type: 3} - - {fileID: 7384525862955468029, guid: a74970be876d3554ea0f279f39314c9c, type: 3} - - {fileID: -8934633548313413119, guid: a74970be876d3554ea0f279f39314c9c, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_nickel.sbsar b/Assets/Materials/Substance/Metal/metal_nickel.sbsar deleted file mode 100644 index e7cf69c6b..000000000 --- a/Assets/Materials/Substance/Metal/metal_nickel.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a0395691305bc49406088b12b65ea186d65d5101bc230a2e91b4ddbf2c7b65ea -size 8935 diff --git a/Assets/Materials/Substance/Metal/metal_nickel.sbsar.meta b/Assets/Materials/Substance/Metal/metal_nickel.sbsar.meta deleted file mode 100644 index 65531754c..000000000 --- a/Assets/Materials/Substance/Metal/metal_nickel.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: c5f2177e1f35daa499f4d7e0b7f3370a -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_nickel/metal_nickel - - first: - 4: 400000 - second: metal_nickel/metal_nickel/Transform - - first: - 21: 2100000 - second: mat.Nickel - - first: - 23: 2300000 - second: metal_nickel/metal_nickel/MeshRenderer - - first: - 28: 2800000 - second: Nickel_baseColor - - first: - 28: 2800002 - second: Nickel_normal - - first: - 28: 2800004 - second: Nickel_metallic - - first: - 28: 2800006 - second: Nickel_ambientOcclusion - - first: - 28: 2800008 - second: Nickel_height - - first: - 33: 3300000 - second: metal_nickel/metal_nickel/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_nickel/metal_nickel/SphereCollider - - first: - 1001: 100100000 - second: metal_nickel - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Nickel - prototypeName: Nickel - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_nickel\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 1040180909335529060, guid: c5f2177e1f35daa499f4d7e0b7f3370a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -3896990606402278735, guid: c5f2177e1f35daa499f4d7e0b7f3370a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -8156577797594723071, guid: c5f2177e1f35daa499f4d7e0b7f3370a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -7935365347593253955, guid: c5f2177e1f35daa499f4d7e0b7f3370a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -4922792887777872198, guid: c5f2177e1f35daa499f4d7e0b7f3370a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Nickel_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Nickel - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -443055228576417237, guid: c5f2177e1f35daa499f4d7e0b7f3370a, - type: 3} - generatedTextures: - - {fileID: -3896990606402278735, guid: c5f2177e1f35daa499f4d7e0b7f3370a, type: 3} - - {fileID: 1040180909335529060, guid: c5f2177e1f35daa499f4d7e0b7f3370a, type: 3} - - {fileID: -8156577797594723071, guid: c5f2177e1f35daa499f4d7e0b7f3370a, type: 3} - - {fileID: -7935365347593253955, guid: c5f2177e1f35daa499f4d7e0b7f3370a, type: 3} - - {fileID: -4922792887777872198, guid: c5f2177e1f35daa499f4d7e0b7f3370a, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_painted_steel.sbsar b/Assets/Materials/Substance/Metal/metal_painted_steel.sbsar deleted file mode 100644 index d764cd35f..000000000 --- a/Assets/Materials/Substance/Metal/metal_painted_steel.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bc8dcd55f0619c028037c7225720acb4eea87b28cc7c120125fa2b38d02f775a -size 13628 diff --git a/Assets/Materials/Substance/Metal/metal_painted_steel.sbsar.meta b/Assets/Materials/Substance/Metal/metal_painted_steel.sbsar.meta deleted file mode 100644 index 467fa07bd..000000000 --- a/Assets/Materials/Substance/Metal/metal_painted_steel.sbsar.meta +++ /dev/null @@ -1,376 +0,0 @@ -fileFormatVersion: 2 -guid: b7e648471e9dfc44490bd41973711541 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_painted_steel/metal_painted_steel - - first: - 4: 400000 - second: metal_painted_steel/metal_painted_steel/Transform - - first: - 21: 2100000 - second: mat.Painted steel - - first: - 23: 2300000 - second: metal_painted_steel/metal_painted_steel/MeshRenderer - - first: - 28: 2800000 - second: Painted steel_baseColor - - first: - 28: 2800002 - second: Painted steel_normal - - first: - 28: 2800004 - second: Painted steel_metallic - - first: - 28: 2800006 - second: Painted steel_ambientOcclusion - - first: - 28: 2800008 - second: Painted steel_height - - first: - 33: 3300000 - second: metal_painted_steel/metal_painted_steel/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_painted_steel/metal_painted_steel/SphereCollider - - first: - 1001: 100100000 - second: metal_painted_steel - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Painted steel - prototypeName: Painted steel - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_painted_steel\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"326965559\" type=\"8\" value=\"10,10\" />\n - <presetinput identifier=\"$randomseed\" uid=\"1141837669\" type=\"4\" value=\"6025\" - />\n <presetinput identifier=\"scratches\" uid=\"1855038369\" type=\"0\" value=\"1\" - />\n <presetinput identifier=\"rust\" uid=\"1776436197\" type=\"0\" value=\"0.29\" - />\n <presetinput identifier=\"paint_color\" uid=\"1770592093\" type=\"2\" - value=\"1,0.583333,0\" />\n <presetinput identifier=\"paint_roughness\" uid=\"1855031964\" - type=\"0\" value=\"0.18\" />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -812895718602229137, guid: b7e648471e9dfc44490bd41973711541, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 4387638379454744182, guid: b7e648471e9dfc44490bd41973711541, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 5280895355680202213, guid: b7e648471e9dfc44490bd41973711541, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 1053975553097811288, guid: b7e648471e9dfc44490bd41973711541, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -5932748352949090903, guid: b7e648471e9dfc44490bd41973711541, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Painted steel_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Painted steel - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 1024 - textureHeight: 1024 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -4658142721435264040, guid: b7e648471e9dfc44490bd41973711541, - type: 3} - generatedTextures: - - {fileID: 4387638379454744182, guid: b7e648471e9dfc44490bd41973711541, type: 3} - - {fileID: -812895718602229137, guid: b7e648471e9dfc44490bd41973711541, type: 3} - - {fileID: 5280895355680202213, guid: b7e648471e9dfc44490bd41973711541, type: 3} - - {fileID: 1053975553097811288, guid: b7e648471e9dfc44490bd41973711541, type: 3} - - {fileID: -5932748352949090903, guid: b7e648471e9dfc44490bd41973711541, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_panels_001.sbsar b/Assets/Materials/Substance/Metal/metal_panels_001.sbsar deleted file mode 100644 index 2ee3b87ea..000000000 --- a/Assets/Materials/Substance/Metal/metal_panels_001.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e868f72fde8e3c55a2d8c097ebb39c05157670897d14eeb86932021feec16158 -size 11295 diff --git a/Assets/Materials/Substance/Metal/metal_panels_001.sbsar.meta b/Assets/Materials/Substance/Metal/metal_panels_001.sbsar.meta deleted file mode 100644 index a423b3b51..000000000 --- a/Assets/Materials/Substance/Metal/metal_panels_001.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 7363fcc4a3c41a349b29de7ec34555be -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_panels_001/metal_panels_001 - - first: - 4: 400000 - second: metal_panels_001/metal_panels_001/Transform - - first: - 21: 2100000 - second: mat.Metal Panels 001 - - first: - 23: 2300000 - second: metal_panels_001/metal_panels_001/MeshRenderer - - first: - 28: 2800000 - second: Metal Panels 001_baseColor - - first: - 28: 2800002 - second: Metal Panels 001_normal - - first: - 28: 2800004 - second: Metal Panels 001_metallic - - first: - 28: 2800006 - second: Metal Panels 001_ambientOcclusion - - first: - 28: 2800008 - second: Metal Panels 001_height - - first: - 33: 3300000 - second: metal_panels_001/metal_panels_001/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_panels_001/metal_panels_001/SphereCollider - - first: - 1001: 100100000 - second: metal_panels_001 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal Panels 001 - prototypeName: Metal Panels 001 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_panels_001\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 2945532018097518028, guid: 7363fcc4a3c41a349b29de7ec34555be, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 6344665451385196243, guid: 7363fcc4a3c41a349b29de7ec34555be, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -103584793617860315, guid: 7363fcc4a3c41a349b29de7ec34555be, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -2941359408041138506, guid: 7363fcc4a3c41a349b29de7ec34555be, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 1361220934952870948, guid: 7363fcc4a3c41a349b29de7ec34555be, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal Panels 001_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 001 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 1523472303362493764, guid: 7363fcc4a3c41a349b29de7ec34555be, - type: 3} - generatedTextures: - - {fileID: 6344665451385196243, guid: 7363fcc4a3c41a349b29de7ec34555be, type: 3} - - {fileID: 2945532018097518028, guid: 7363fcc4a3c41a349b29de7ec34555be, type: 3} - - {fileID: -103584793617860315, guid: 7363fcc4a3c41a349b29de7ec34555be, type: 3} - - {fileID: -2941359408041138506, guid: 7363fcc4a3c41a349b29de7ec34555be, type: 3} - - {fileID: 1361220934952870948, guid: 7363fcc4a3c41a349b29de7ec34555be, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_panels_002.sbsar b/Assets/Materials/Substance/Metal/metal_panels_002.sbsar deleted file mode 100644 index 2cf3cd0b5..000000000 --- a/Assets/Materials/Substance/Metal/metal_panels_002.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b16e09a1b06ae6b857d9f9478af0838a31ba554a2455b9e65e9db43a125ce633 -size 7592 diff --git a/Assets/Materials/Substance/Metal/metal_panels_002.sbsar.meta b/Assets/Materials/Substance/Metal/metal_panels_002.sbsar.meta deleted file mode 100644 index fe8ecd2b6..000000000 --- a/Assets/Materials/Substance/Metal/metal_panels_002.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 2e9a9dbacde66a446852af882f33e9e2 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_panels_002/metal_panels_002 - - first: - 4: 400000 - second: metal_panels_002/metal_panels_002/Transform - - first: - 21: 2100000 - second: mat.Metal Panels 002 - - first: - 23: 2300000 - second: metal_panels_002/metal_panels_002/MeshRenderer - - first: - 28: 2800000 - second: Metal Panels 002_baseColor - - first: - 28: 2800002 - second: Metal Panels 002_normal - - first: - 28: 2800004 - second: Metal Panels 002_metallic - - first: - 28: 2800006 - second: Metal Panels 002_ambientOcclusion - - first: - 28: 2800008 - second: Metal Panels 002_height - - first: - 33: 3300000 - second: metal_panels_002/metal_panels_002/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_panels_002/metal_panels_002/SphereCollider - - first: - 1001: 100100000 - second: metal_panels_002 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal Panels 002 - prototypeName: Metal Panels 002 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_panels_002\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -7157783387845257801, guid: 2e9a9dbacde66a446852af882f33e9e2, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 6030008930922367719, guid: 2e9a9dbacde66a446852af882f33e9e2, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -5177487458041023939, guid: 2e9a9dbacde66a446852af882f33e9e2, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -6221273311826804186, guid: 2e9a9dbacde66a446852af882f33e9e2, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -2755774738339798629, guid: 2e9a9dbacde66a446852af882f33e9e2, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal Panels 002_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Panels 002 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 3282252981698000714, guid: 2e9a9dbacde66a446852af882f33e9e2, - type: 3} - generatedTextures: - - {fileID: 6030008930922367719, guid: 2e9a9dbacde66a446852af882f33e9e2, type: 3} - - {fileID: -7157783387845257801, guid: 2e9a9dbacde66a446852af882f33e9e2, type: 3} - - {fileID: -5177487458041023939, guid: 2e9a9dbacde66a446852af882f33e9e2, type: 3} - - {fileID: -6221273311826804186, guid: 2e9a9dbacde66a446852af882f33e9e2, type: 3} - - {fileID: -2755774738339798629, guid: 2e9a9dbacde66a446852af882f33e9e2, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_plate_001.sbsar b/Assets/Materials/Substance/Metal/metal_plate_001.sbsar deleted file mode 100644 index 3d06effb9..000000000 --- a/Assets/Materials/Substance/Metal/metal_plate_001.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7c9aea022bbc0138be51bb7b89314a569ad359390a0b8d1b6b2c717d317acd8b -size 10171 diff --git a/Assets/Materials/Substance/Metal/metal_plate_001.sbsar.meta b/Assets/Materials/Substance/Metal/metal_plate_001.sbsar.meta deleted file mode 100644 index 9a0327632..000000000 --- a/Assets/Materials/Substance/Metal/metal_plate_001.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 180b85899b4b1f848b348230339ce984 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_plate_001/metal_plate_001 - - first: - 4: 400000 - second: metal_plate_001/metal_plate_001/Transform - - first: - 21: 2100000 - second: mat.Metal plate 001 - - first: - 23: 2300000 - second: metal_plate_001/metal_plate_001/MeshRenderer - - first: - 28: 2800000 - second: Metal plate 001_baseColor - - first: - 28: 2800002 - second: Metal plate 001_normal - - first: - 28: 2800004 - second: Metal plate 001_metallic - - first: - 28: 2800006 - second: Metal plate 001_ambientOcclusion - - first: - 28: 2800008 - second: Metal plate 001_height - - first: - 33: 3300000 - second: metal_plate_001/metal_plate_001/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_plate_001/metal_plate_001/SphereCollider - - first: - 1001: 100100000 - second: metal_plate_001 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal plate 001 - prototypeName: Metal plate 001 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_plate_001\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 6805374924820727666, guid: 180b85899b4b1f848b348230339ce984, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 443512894100413061, guid: 180b85899b4b1f848b348230339ce984, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -3656363544911682969, guid: 180b85899b4b1f848b348230339ce984, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 6012193567810889268, guid: 180b85899b4b1f848b348230339ce984, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 1247009903862830065, guid: 180b85899b4b1f848b348230339ce984, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal plate 001_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 001 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -1468868417959000437, guid: 180b85899b4b1f848b348230339ce984, - type: 3} - generatedTextures: - - {fileID: 443512894100413061, guid: 180b85899b4b1f848b348230339ce984, type: 3} - - {fileID: 6805374924820727666, guid: 180b85899b4b1f848b348230339ce984, type: 3} - - {fileID: -3656363544911682969, guid: 180b85899b4b1f848b348230339ce984, type: 3} - - {fileID: 6012193567810889268, guid: 180b85899b4b1f848b348230339ce984, type: 3} - - {fileID: 1247009903862830065, guid: 180b85899b4b1f848b348230339ce984, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_plate_004.sbsar b/Assets/Materials/Substance/Metal/metal_plate_004.sbsar deleted file mode 100644 index dc0474e13..000000000 --- a/Assets/Materials/Substance/Metal/metal_plate_004.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:65295627150c30fc70fe138aee16c2266bffdd0a5b1fbcbe7fe040a3d0309d39 -size 14216 diff --git a/Assets/Materials/Substance/Metal/metal_plate_004.sbsar.meta b/Assets/Materials/Substance/Metal/metal_plate_004.sbsar.meta deleted file mode 100644 index fd4373932..000000000 --- a/Assets/Materials/Substance/Metal/metal_plate_004.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 0b5dfc86c0681a3459a57d197804191b -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_plate_004/metal_plate_004 - - first: - 4: 400000 - second: metal_plate_004/metal_plate_004/Transform - - first: - 21: 2100000 - second: mat.Metal plate 004 - - first: - 23: 2300000 - second: metal_plate_004/metal_plate_004/MeshRenderer - - first: - 28: 2800000 - second: Metal plate 004_baseColor - - first: - 28: 2800002 - second: Metal plate 004_normal - - first: - 28: 2800004 - second: Metal plate 004_metallic - - first: - 28: 2800006 - second: Metal plate 004_ambientOcclusion - - first: - 28: 2800008 - second: Metal plate 004_height - - first: - 33: 3300000 - second: metal_plate_004/metal_plate_004/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_plate_004/metal_plate_004/SphereCollider - - first: - 1001: 100100000 - second: metal_plate_004 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal plate 004 - prototypeName: Metal plate 004 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_plate_004\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -7484568915117973449, guid: 0b5dfc86c0681a3459a57d197804191b, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 1309396409266656355, guid: 0b5dfc86c0681a3459a57d197804191b, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -5781884682247363129, guid: 0b5dfc86c0681a3459a57d197804191b, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 5620992320681838871, guid: 0b5dfc86c0681a3459a57d197804191b, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 6570316561944570698, guid: 0b5dfc86c0681a3459a57d197804191b, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal plate 004_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 004 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -5894754650268316995, guid: 0b5dfc86c0681a3459a57d197804191b, - type: 3} - generatedTextures: - - {fileID: 1309396409266656355, guid: 0b5dfc86c0681a3459a57d197804191b, type: 3} - - {fileID: -7484568915117973449, guid: 0b5dfc86c0681a3459a57d197804191b, type: 3} - - {fileID: -5781884682247363129, guid: 0b5dfc86c0681a3459a57d197804191b, type: 3} - - {fileID: 5620992320681838871, guid: 0b5dfc86c0681a3459a57d197804191b, type: 3} - - {fileID: 6570316561944570698, guid: 0b5dfc86c0681a3459a57d197804191b, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_plate_011.sbsar b/Assets/Materials/Substance/Metal/metal_plate_011.sbsar deleted file mode 100644 index c1e0a3922..000000000 --- a/Assets/Materials/Substance/Metal/metal_plate_011.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:829bc422cbe5b984103972cd7cf36d207fe0a6b561a2619301dec3e684009784 -size 9674 diff --git a/Assets/Materials/Substance/Metal/metal_plate_011.sbsar.meta b/Assets/Materials/Substance/Metal/metal_plate_011.sbsar.meta deleted file mode 100644 index 55c1cd50c..000000000 --- a/Assets/Materials/Substance/Metal/metal_plate_011.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: ca8f080ab60226e4097841eee2bfa8db -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_plate_011/metal_plate_011 - - first: - 4: 400000 - second: metal_plate_011/metal_plate_011/Transform - - first: - 21: 2100000 - second: mat.Metal plate 011 - - first: - 23: 2300000 - second: metal_plate_011/metal_plate_011/MeshRenderer - - first: - 28: 2800000 - second: Metal plate 011_baseColor - - first: - 28: 2800002 - second: Metal plate 011_normal - - first: - 28: 2800004 - second: Metal plate 011_metallic - - first: - 28: 2800006 - second: Metal plate 011_ambientOcclusion - - first: - 28: 2800008 - second: Metal plate 011_height - - first: - 33: 3300000 - second: metal_plate_011/metal_plate_011/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_plate_011/metal_plate_011/SphereCollider - - first: - 1001: 100100000 - second: metal_plate_011 - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal plate 011 - prototypeName: Metal plate 011 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_plate_011\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 1206901763152500494, guid: ca8f080ab60226e4097841eee2bfa8db, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -562402163750398719, guid: ca8f080ab60226e4097841eee2bfa8db, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -8211546087015286653, guid: ca8f080ab60226e4097841eee2bfa8db, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 7355910353852850503, guid: ca8f080ab60226e4097841eee2bfa8db, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -2794334530799708578, guid: ca8f080ab60226e4097841eee2bfa8db, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal plate 011_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal plate 011 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 5028268363422298589, guid: ca8f080ab60226e4097841eee2bfa8db, - type: 3} - generatedTextures: - - {fileID: -562402163750398719, guid: ca8f080ab60226e4097841eee2bfa8db, type: 3} - - {fileID: 1206901763152500494, guid: ca8f080ab60226e4097841eee2bfa8db, type: 3} - - {fileID: -8211546087015286653, guid: ca8f080ab60226e4097841eee2bfa8db, type: 3} - - {fileID: 7355910353852850503, guid: ca8f080ab60226e4097841eee2bfa8db, type: 3} - - {fileID: -2794334530799708578, guid: ca8f080ab60226e4097841eee2bfa8db, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_platinum.sbsar b/Assets/Materials/Substance/Metal/metal_platinum.sbsar deleted file mode 100644 index ffaec19de..000000000 --- a/Assets/Materials/Substance/Metal/metal_platinum.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b880030baaf5ccc272c780265fc4b1570a55a63a8b804223ccbdc54a576b9be7 -size 5196 diff --git a/Assets/Materials/Substance/Metal/metal_platinum.sbsar.meta b/Assets/Materials/Substance/Metal/metal_platinum.sbsar.meta deleted file mode 100644 index f39efaf0d..000000000 --- a/Assets/Materials/Substance/Metal/metal_platinum.sbsar.meta +++ /dev/null @@ -1,372 +0,0 @@ -fileFormatVersion: 2 -guid: 9458f33b8e7e51a42aa19686b9779d82 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_platinum/metal_platinum - - first: - 4: 400000 - second: metal_platinum/metal_platinum/Transform - - first: - 21: 2100000 - second: mat.Platinum - - first: - 23: 2300000 - second: metal_platinum/metal_platinum/MeshRenderer - - first: - 28: 2800000 - second: Platinum_baseColor - - first: - 28: 2800002 - second: Platinum_normal - - first: - 28: 2800004 - second: Platinum_metallic - - first: - 28: 2800006 - second: Platinum_ambientOcclusion - - first: - 28: 2800008 - second: Platinum_height - - first: - 33: 3300000 - second: metal_platinum/metal_platinum/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_platinum/metal_platinum/SphereCollider - - first: - 1001: 100100000 - second: metal_platinum - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Platinum - prototypeName: Platinum - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_platinum\" label=\"\" >\n <presetinput - identifier=\"dirt\" uid=\"3294776141\" type=\"0\" value=\"0.43\" />\n <presetinput - identifier=\"surface_imperfections\" uid=\"3166060376\" type=\"0\" value=\"1\" - />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 3498638986299907941, guid: 9458f33b8e7e51a42aa19686b9779d82, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -8172963137857357993, guid: 9458f33b8e7e51a42aa19686b9779d82, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -8040379993892829019, guid: 9458f33b8e7e51a42aa19686b9779d82, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 225164955126363719, guid: 9458f33b8e7e51a42aa19686b9779d82, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -130007606447889175, guid: 9458f33b8e7e51a42aa19686b9779d82, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Platinum_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Platinum - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 8636029498071112704, guid: 9458f33b8e7e51a42aa19686b9779d82, - type: 3} - generatedTextures: - - {fileID: -8172963137857357993, guid: 9458f33b8e7e51a42aa19686b9779d82, type: 3} - - {fileID: 3498638986299907941, guid: 9458f33b8e7e51a42aa19686b9779d82, type: 3} - - {fileID: -8040379993892829019, guid: 9458f33b8e7e51a42aa19686b9779d82, type: 3} - - {fileID: 225164955126363719, guid: 9458f33b8e7e51a42aa19686b9779d82, type: 3} - - {fileID: -130007606447889175, guid: 9458f33b8e7e51a42aa19686b9779d82, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_roll_up.sbsar b/Assets/Materials/Substance/Metal/metal_roll_up.sbsar deleted file mode 100644 index db99f183e..000000000 --- a/Assets/Materials/Substance/Metal/metal_roll_up.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1a2036e21cdd2d392fdcb755d2faf982335fc4deaa8c7b913110db234fa04f3a -size 11017 diff --git a/Assets/Materials/Substance/Metal/metal_roll_up.sbsar.meta b/Assets/Materials/Substance/Metal/metal_roll_up.sbsar.meta deleted file mode 100644 index 3d93351e8..000000000 --- a/Assets/Materials/Substance/Metal/metal_roll_up.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 4e39297ae4fe9ee4b803c04eabb69da7 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_roll_up/metal_roll_up - - first: - 4: 400000 - second: metal_roll_up/metal_roll_up/Transform - - first: - 21: 2100000 - second: mat.Metal roll up - - first: - 23: 2300000 - second: metal_roll_up/metal_roll_up/MeshRenderer - - first: - 28: 2800000 - second: Metal roll up_baseColor - - first: - 28: 2800002 - second: Metal roll up_normal - - first: - 28: 2800004 - second: Metal roll up_metallic - - first: - 28: 2800006 - second: Metal roll up_ambientOcclusion - - first: - 28: 2800008 - second: Metal roll up_height - - first: - 33: 3300000 - second: metal_roll_up/metal_roll_up/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_roll_up/metal_roll_up/SphereCollider - - first: - 1001: 100100000 - second: metal_roll_up - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal roll up - prototypeName: Metal roll up - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_roll_up\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 1258325809611119299, guid: 4e39297ae4fe9ee4b803c04eabb69da7, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -5250987364813910665, guid: 4e39297ae4fe9ee4b803c04eabb69da7, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -1897870436205287166, guid: 4e39297ae4fe9ee4b803c04eabb69da7, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 7199963334284863655, guid: 4e39297ae4fe9ee4b803c04eabb69da7, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 1153539711168243343, guid: 4e39297ae4fe9ee4b803c04eabb69da7, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal roll up_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal roll up - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 7440086527666654772, guid: 4e39297ae4fe9ee4b803c04eabb69da7, - type: 3} - generatedTextures: - - {fileID: -5250987364813910665, guid: 4e39297ae4fe9ee4b803c04eabb69da7, type: 3} - - {fileID: 1258325809611119299, guid: 4e39297ae4fe9ee4b803c04eabb69da7, type: 3} - - {fileID: -1897870436205287166, guid: 4e39297ae4fe9ee4b803c04eabb69da7, type: 3} - - {fileID: 7199963334284863655, guid: 4e39297ae4fe9ee4b803c04eabb69da7, type: 3} - - {fileID: 1153539711168243343, guid: 4e39297ae4fe9ee4b803c04eabb69da7, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_silver.sbsar b/Assets/Materials/Substance/Metal/metal_silver.sbsar deleted file mode 100644 index 08b0ac146..000000000 --- a/Assets/Materials/Substance/Metal/metal_silver.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4b18ce39a69d5e25641d53fcbe04f281c92ca7e01936e6a9b279476be8ff3255 -size 6898 diff --git a/Assets/Materials/Substance/Metal/metal_silver.sbsar.meta b/Assets/Materials/Substance/Metal/metal_silver.sbsar.meta deleted file mode 100644 index 326559316..000000000 --- a/Assets/Materials/Substance/Metal/metal_silver.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 0be5fb1df83ac8e499a3f6a060041e49 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_silver/metal_silver - - first: - 4: 400000 - second: metal_silver/metal_silver/Transform - - first: - 21: 2100000 - second: mat.Silver - - first: - 23: 2300000 - second: metal_silver/metal_silver/MeshRenderer - - first: - 28: 2800000 - second: Silver_baseColor - - first: - 28: 2800002 - second: Silver_normal - - first: - 28: 2800004 - second: Silver_metallic - - first: - 28: 2800006 - second: Silver_ambientOcclusion - - first: - 28: 2800008 - second: Silver_height - - first: - 33: 3300000 - second: metal_silver/metal_silver/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_silver/metal_silver/SphereCollider - - first: - 1001: 100100000 - second: metal_silver - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Silver - prototypeName: Silver - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_silver\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 8947980237086559854, guid: 0be5fb1df83ac8e499a3f6a060041e49, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -1383037052668628532, guid: 0be5fb1df83ac8e499a3f6a060041e49, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 6429125567479694453, guid: 0be5fb1df83ac8e499a3f6a060041e49, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -9097439929179392311, guid: 0be5fb1df83ac8e499a3f6a060041e49, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 425190381137097012, guid: 0be5fb1df83ac8e499a3f6a060041e49, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Silver_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Silver - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 7490952440742008943, guid: 0be5fb1df83ac8e499a3f6a060041e49, - type: 3} - generatedTextures: - - {fileID: -1383037052668628532, guid: 0be5fb1df83ac8e499a3f6a060041e49, type: 3} - - {fileID: 8947980237086559854, guid: 0be5fb1df83ac8e499a3f6a060041e49, type: 3} - - {fileID: 6429125567479694453, guid: 0be5fb1df83ac8e499a3f6a060041e49, type: 3} - - {fileID: -9097439929179392311, guid: 0be5fb1df83ac8e499a3f6a060041e49, type: 3} - - {fileID: 425190381137097012, guid: 0be5fb1df83ac8e499a3f6a060041e49, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_steel.sbsar b/Assets/Materials/Substance/Metal/metal_steel.sbsar deleted file mode 100644 index 31ec34fd3..000000000 --- a/Assets/Materials/Substance/Metal/metal_steel.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d559edac51ad4c529c197d7c9a813fe8c2fa1bcb0963cd0f8bad8ab1403b3821 -size 10697 diff --git a/Assets/Materials/Substance/Metal/metal_steel.sbsar.meta b/Assets/Materials/Substance/Metal/metal_steel.sbsar.meta deleted file mode 100644 index 172d4668b..000000000 --- a/Assets/Materials/Substance/Metal/metal_steel.sbsar.meta +++ /dev/null @@ -1,375 +0,0 @@ -fileFormatVersion: 2 -guid: cbc61995a46604441ab9de4f1c68e290 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_steel/metal_steel - - first: - 4: 400000 - second: metal_steel/metal_steel/Transform - - first: - 21: 2100000 - second: mat.Steel - - first: - 23: 2300000 - second: metal_steel/metal_steel/MeshRenderer - - first: - 28: 2800000 - second: Steel_baseColor - - first: - 28: 2800002 - second: Steel_normal - - first: - 28: 2800004 - second: Steel_metallic - - first: - 28: 2800006 - second: Steel_ambientOcclusion - - first: - 28: 2800008 - second: Steel_height - - first: - 33: 3300000 - second: metal_steel/metal_steel/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_steel/metal_steel/SphereCollider - - first: - 1001: 100100000 - second: metal_steel - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Steel - prototypeName: Steel - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_steel\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"1318093408\" type=\"8\" value=\"9,9\" />\n - <presetinput identifier=\"dirt\" uid=\"854373931\" type=\"0\" value=\"0.903\" - />\n <presetinput identifier=\"rust\" uid=\"854346221\" type=\"0\" value=\"0\" - />\n <presetinput identifier=\"surface_imperfections\" uid=\"863227179\" type=\"0\" - value=\"0.413\" />\n <presetinput identifier=\"steel_roughness\" uid=\"863268384\" - type=\"0\" value=\"0.292\" />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -3888315358723833787, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 4, y: 4} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 108215966750249586, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} - scale: {x: 4, y: 4} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 4793252353645218242, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -4384182597330533215, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 4600200897981803784, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Steel_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 512 - textureHeight: 512 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -3155047780354543793, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} - generatedTextures: - - {fileID: 108215966750249586, guid: cbc61995a46604441ab9de4f1c68e290, type: 3} - - {fileID: -3888315358723833787, guid: cbc61995a46604441ab9de4f1c68e290, type: 3} - - {fileID: 4793252353645218242, guid: cbc61995a46604441ab9de4f1c68e290, type: 3} - - {fileID: -4384182597330533215, guid: cbc61995a46604441ab9de4f1c68e290, type: 3} - - {fileID: 4600200897981803784, guid: cbc61995a46604441ab9de4f1c68e290, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_steel_brushed.sbsar b/Assets/Materials/Substance/Metal/metal_steel_brushed.sbsar deleted file mode 100644 index 45c0b10b3..000000000 --- a/Assets/Materials/Substance/Metal/metal_steel_brushed.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bf6b40453b42e050b2ce05478f1c1964d9489cdf02413f12b40f4ce1e49b4432 -size 12832 diff --git a/Assets/Materials/Substance/Metal/metal_steel_brushed.sbsar.meta b/Assets/Materials/Substance/Metal/metal_steel_brushed.sbsar.meta deleted file mode 100644 index d08c0d290..000000000 --- a/Assets/Materials/Substance/Metal/metal_steel_brushed.sbsar.meta +++ /dev/null @@ -1,370 +0,0 @@ -fileFormatVersion: 2 -guid: ea7457b9a4f0bcb43becaa33de541cbd -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_steel_brushed/metal_steel_brushed - - first: - 4: 400000 - second: metal_steel_brushed/metal_steel_brushed/Transform - - first: - 21: 2100000 - second: mat.Steel brushed - - first: - 23: 2300000 - second: metal_steel_brushed/metal_steel_brushed/MeshRenderer - - first: - 28: 2800000 - second: Steel brushed_baseColor - - first: - 28: 2800002 - second: Steel brushed_normal - - first: - 28: 2800004 - second: Steel brushed_metallic - - first: - 28: 2800006 - second: Steel brushed_ambientOcclusion - - first: - 28: 2800008 - second: Steel brushed_height - - first: - 33: 3300000 - second: metal_steel_brushed/metal_steel_brushed/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_steel_brushed/metal_steel_brushed/SphereCollider - - first: - 1001: 100100000 - second: metal_steel_brushed - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Steel brushed - prototypeName: Steel brushed - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_steel_brushed\" label=\"\" >\n <presetinput - identifier=\"oxidation\" uid=\"44192965\" type=\"0\" value=\"0.8\" />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -4471413742775304797, guid: ea7457b9a4f0bcb43becaa33de541cbd, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -4638397344074346932, guid: ea7457b9a4f0bcb43becaa33de541cbd, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 5049811794194361025, guid: ea7457b9a4f0bcb43becaa33de541cbd, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 1753668427856518731, guid: ea7457b9a4f0bcb43becaa33de541cbd, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -3498708498072814504, guid: ea7457b9a4f0bcb43becaa33de541cbd, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Steel brushed_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel brushed - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 7852708265981260911, guid: ea7457b9a4f0bcb43becaa33de541cbd, - type: 3} - generatedTextures: - - {fileID: -4638397344074346932, guid: ea7457b9a4f0bcb43becaa33de541cbd, type: 3} - - {fileID: -4471413742775304797, guid: ea7457b9a4f0bcb43becaa33de541cbd, type: 3} - - {fileID: 5049811794194361025, guid: ea7457b9a4f0bcb43becaa33de541cbd, type: 3} - - {fileID: 1753668427856518731, guid: ea7457b9a4f0bcb43becaa33de541cbd, type: 3} - - {fileID: -3498708498072814504, guid: ea7457b9a4f0bcb43becaa33de541cbd, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_steel_bumped.sbsar b/Assets/Materials/Substance/Metal/metal_steel_bumped.sbsar deleted file mode 100644 index 6580295bb..000000000 --- a/Assets/Materials/Substance/Metal/metal_steel_bumped.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a9ae449451a55abd8466e8af67685a45d86fd39ea2070294dde7f2a07776bea5 -size 17275 diff --git a/Assets/Materials/Substance/Metal/metal_steel_bumped.sbsar.meta b/Assets/Materials/Substance/Metal/metal_steel_bumped.sbsar.meta deleted file mode 100644 index 1dd652796..000000000 --- a/Assets/Materials/Substance/Metal/metal_steel_bumped.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 092bdd8d243488141aeab5bb0d72429a -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_steel_bumped/metal_steel_bumped - - first: - 4: 400000 - second: metal_steel_bumped/metal_steel_bumped/Transform - - first: - 21: 2100000 - second: mat.Steel bumped - - first: - 23: 2300000 - second: metal_steel_bumped/metal_steel_bumped/MeshRenderer - - first: - 28: 2800000 - second: Steel bumped_baseColor - - first: - 28: 2800002 - second: Steel bumped_normal - - first: - 28: 2800004 - second: Steel bumped_metallic - - first: - 28: 2800006 - second: Steel bumped_ambientOcclusion - - first: - 28: 2800008 - second: Steel bumped_height - - first: - 33: 3300000 - second: metal_steel_bumped/metal_steel_bumped/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_steel_bumped/metal_steel_bumped/SphereCollider - - first: - 1001: 100100000 - second: metal_steel_bumped - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Steel bumped - prototypeName: Steel bumped - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_steel_bumped\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 3586080781697202320, guid: 092bdd8d243488141aeab5bb0d72429a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 86365302875955127, guid: 092bdd8d243488141aeab5bb0d72429a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 9208498935135840223, guid: 092bdd8d243488141aeab5bb0d72429a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 7740971908710523460, guid: 092bdd8d243488141aeab5bb0d72429a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 6493472383464308858, guid: 092bdd8d243488141aeab5bb0d72429a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Steel bumped_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel bumped - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -864409875390858066, guid: 092bdd8d243488141aeab5bb0d72429a, - type: 3} - generatedTextures: - - {fileID: 86365302875955127, guid: 092bdd8d243488141aeab5bb0d72429a, type: 3} - - {fileID: 3586080781697202320, guid: 092bdd8d243488141aeab5bb0d72429a, type: 3} - - {fileID: 9208498935135840223, guid: 092bdd8d243488141aeab5bb0d72429a, type: 3} - - {fileID: 7740971908710523460, guid: 092bdd8d243488141aeab5bb0d72429a, type: 3} - - {fileID: 6493472383464308858, guid: 092bdd8d243488141aeab5bb0d72429a, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_steel_parkerized.sbsar b/Assets/Materials/Substance/Metal/metal_steel_parkerized.sbsar deleted file mode 100644 index 92bee293c..000000000 --- a/Assets/Materials/Substance/Metal/metal_steel_parkerized.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:54993a1aae47acf7e1aba24812f215e1787969016dd1f420899ab363342a7b6d -size 9206 diff --git a/Assets/Materials/Substance/Metal/metal_steel_parkerized.sbsar.meta b/Assets/Materials/Substance/Metal/metal_steel_parkerized.sbsar.meta deleted file mode 100644 index a7cabf9ff..000000000 --- a/Assets/Materials/Substance/Metal/metal_steel_parkerized.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: e7758cad28ae98f478940e55222419a6 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_steel_parkerized/metal_steel_parkerized - - first: - 4: 400000 - second: metal_steel_parkerized/metal_steel_parkerized/Transform - - first: - 21: 2100000 - second: mat.Steel parkerized - - first: - 23: 2300000 - second: metal_steel_parkerized/metal_steel_parkerized/MeshRenderer - - first: - 28: 2800000 - second: Steel parkerized_baseColor - - first: - 28: 2800002 - second: Steel parkerized_normal - - first: - 28: 2800004 - second: Steel parkerized_metallic - - first: - 28: 2800006 - second: Steel parkerized_ambientOcclusion - - first: - 28: 2800008 - second: Steel parkerized_height - - first: - 33: 3300000 - second: metal_steel_parkerized/metal_steel_parkerized/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_steel_parkerized/metal_steel_parkerized/SphereCollider - - first: - 1001: 100100000 - second: metal_steel_parkerized - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Steel parkerized - prototypeName: Steel parkerized - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_steel_parkerized\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 885599758852769373, guid: e7758cad28ae98f478940e55222419a6, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -4474525002722929857, guid: e7758cad28ae98f478940e55222419a6, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -2334804936223627746, guid: e7758cad28ae98f478940e55222419a6, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: -8380876848358870972, guid: e7758cad28ae98f478940e55222419a6, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 172713863077875830, guid: e7758cad28ae98f478940e55222419a6, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Steel parkerized_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Steel parkerized - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -6026401407715332296, guid: e7758cad28ae98f478940e55222419a6, - type: 3} - generatedTextures: - - {fileID: -4474525002722929857, guid: e7758cad28ae98f478940e55222419a6, type: 3} - - {fileID: 885599758852769373, guid: e7758cad28ae98f478940e55222419a6, type: 3} - - {fileID: -2334804936223627746, guid: e7758cad28ae98f478940e55222419a6, type: 3} - - {fileID: -8380876848358870972, guid: e7758cad28ae98f478940e55222419a6, type: 3} - - {fileID: 172713863077875830, guid: e7758cad28ae98f478940e55222419a6, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_titanium.sbsar b/Assets/Materials/Substance/Metal/metal_titanium.sbsar deleted file mode 100644 index ede9cde4d..000000000 --- a/Assets/Materials/Substance/Metal/metal_titanium.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e3aabfbcb813fef9ef20793d54c93bf5c37255573bb8ad043620f60041acd6d1 -size 5206 diff --git a/Assets/Materials/Substance/Metal/metal_titanium.sbsar.meta b/Assets/Materials/Substance/Metal/metal_titanium.sbsar.meta deleted file mode 100644 index e4ece6915..000000000 --- a/Assets/Materials/Substance/Metal/metal_titanium.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: 58e16b7dbc1c31f4585e11544cdce127 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_titanium/metal_titanium - - first: - 4: 400000 - second: metal_titanium/metal_titanium/Transform - - first: - 21: 2100000 - second: mat.Titanium - - first: - 23: 2300000 - second: metal_titanium/metal_titanium/MeshRenderer - - first: - 28: 2800000 - second: Titanium_baseColor - - first: - 28: 2800002 - second: Titanium_normal - - first: - 28: 2800004 - second: Titanium_metallic - - first: - 28: 2800006 - second: Titanium_ambientOcclusion - - first: - 28: 2800008 - second: Titanium_height - - first: - 33: 3300000 - second: metal_titanium/metal_titanium/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_titanium/metal_titanium/SphereCollider - - first: - 1001: 100100000 - second: metal_titanium - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Titanium - prototypeName: Titanium - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_titanium\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -5074057273227030627, guid: 58e16b7dbc1c31f4585e11544cdce127, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 3009319823116150993, guid: 58e16b7dbc1c31f4585e11544cdce127, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 3613456606582262254, guid: 58e16b7dbc1c31f4585e11544cdce127, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 7558371940554398246, guid: 58e16b7dbc1c31f4585e11544cdce127, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -3774795931012705877, guid: 58e16b7dbc1c31f4585e11544cdce127, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Titanium_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Titanium - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: 9178725544925813344, guid: 58e16b7dbc1c31f4585e11544cdce127, - type: 3} - generatedTextures: - - {fileID: 3009319823116150993, guid: 58e16b7dbc1c31f4585e11544cdce127, type: 3} - - {fileID: -5074057273227030627, guid: 58e16b7dbc1c31f4585e11544cdce127, type: 3} - - {fileID: 3613456606582262254, guid: 58e16b7dbc1c31f4585e11544cdce127, type: 3} - - {fileID: 7558371940554398246, guid: 58e16b7dbc1c31f4585e11544cdce127, type: 3} - - {fileID: -3774795931012705877, guid: 58e16b7dbc1c31f4585e11544cdce127, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_used.sbsar b/Assets/Materials/Substance/Metal/metal_used.sbsar deleted file mode 100644 index 5a8b87d9c..000000000 --- a/Assets/Materials/Substance/Metal/metal_used.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:03b72a9708206dd2c10aba185b507def52bbbcb713666711ed5d67926fbedd68 -size 14332 diff --git a/Assets/Materials/Substance/Metal/metal_used.sbsar.meta b/Assets/Materials/Substance/Metal/metal_used.sbsar.meta deleted file mode 100644 index 37fcc6a20..000000000 --- a/Assets/Materials/Substance/Metal/metal_used.sbsar.meta +++ /dev/null @@ -1,371 +0,0 @@ -fileFormatVersion: 2 -guid: 130f566ffa0b2424fbb47de2194c136a -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_used/metal_used - - first: - 4: 400000 - second: metal_used/metal_used/Transform - - first: - 21: 2100000 - second: mat.Metal used - - first: - 23: 2300000 - second: metal_used/metal_used/MeshRenderer - - first: - 28: 2800000 - second: Metal used_baseColor - - first: - 28: 2800002 - second: Metal used_normal - - first: - 28: 2800004 - second: Metal used_metallic - - first: - 28: 2800006 - second: Metal used_ambientOcclusion - - first: - 28: 2800008 - second: Metal used_height - - first: - 33: 3300000 - second: metal_used/metal_used/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_used/metal_used/SphereCollider - - first: - 1001: 100100000 - second: metal_used - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal used - prototypeName: Metal used - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_used\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"2490862535\" type=\"8\" value=\"9,9\" />\n - </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 8398852885706109728, guid: 130f566ffa0b2424fbb47de2194c136a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 8357651109123355072, guid: 130f566ffa0b2424fbb47de2194c136a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -435054815742279573, guid: 130f566ffa0b2424fbb47de2194c136a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 6248133906606842143, guid: 130f566ffa0b2424fbb47de2194c136a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 2780512161145013460, guid: 130f566ffa0b2424fbb47de2194c136a, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal used_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal used - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 512 - textureHeight: 512 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -890370705972978167, guid: 130f566ffa0b2424fbb47de2194c136a, - type: 3} - generatedTextures: - - {fileID: 8357651109123355072, guid: 130f566ffa0b2424fbb47de2194c136a, type: 3} - - {fileID: 8398852885706109728, guid: 130f566ffa0b2424fbb47de2194c136a, type: 3} - - {fileID: -435054815742279573, guid: 130f566ffa0b2424fbb47de2194c136a, type: 3} - - {fileID: 6248133906606842143, guid: 130f566ffa0b2424fbb47de2194c136a, type: 3} - - {fileID: 2780512161145013460, guid: 130f566ffa0b2424fbb47de2194c136a, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_weapon.sbsar b/Assets/Materials/Substance/Metal/metal_weapon.sbsar deleted file mode 100644 index d96236940..000000000 --- a/Assets/Materials/Substance/Metal/metal_weapon.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8e9033843201f75f1b86df82b69fd89ee6b9aa317df18f9105d0f8904d56be8f -size 10547 diff --git a/Assets/Materials/Substance/Metal/metal_weapon.sbsar.meta b/Assets/Materials/Substance/Metal/metal_weapon.sbsar.meta deleted file mode 100644 index 05d1fcf4b..000000000 --- a/Assets/Materials/Substance/Metal/metal_weapon.sbsar.meta +++ /dev/null @@ -1,373 +0,0 @@ -fileFormatVersion: 2 -guid: 07f679eadba9fb14abac26b1e165f7d5 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_weapon/metal_weapon - - first: - 4: 400000 - second: metal_weapon/metal_weapon/Transform - - first: - 21: 2100000 - second: mat.Metal Weapon - - first: - 23: 2300000 - second: metal_weapon/metal_weapon/MeshRenderer - - first: - 28: 2800000 - second: Metal Weapon_baseColor - - first: - 28: 2800002 - second: Metal Weapon_normal - - first: - 28: 2800004 - second: Metal Weapon_metallic - - first: - 28: 2800006 - second: Metal Weapon_ambientOcclusion - - first: - 28: 2800008 - second: Metal Weapon_height - - first: - 33: 3300000 - second: metal_weapon/metal_weapon/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_weapon/metal_weapon/SphereCollider - - first: - 1001: 100100000 - second: metal_weapon - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal Weapon - prototypeName: Metal Weapon - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_weapon\" label=\"\" >\n <presetinput - identifier=\"dirt\" uid=\"2667454443\" type=\"0\" value=\"0.46\" />\n <presetinput - identifier=\"scratches\" uid=\"3780562351\" type=\"0\" value=\"1\" />\n <presetinput - identifier=\"metal_roughness\" uid=\"3861636079\" type=\"0\" value=\"0.4\" - />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: -6635831357954291190, guid: 07f679eadba9fb14abac26b1e165f7d5, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -6402586014670071135, guid: 07f679eadba9fb14abac26b1e165f7d5, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: 854616604008364032, guid: 07f679eadba9fb14abac26b1e165f7d5, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 4606406952830974004, guid: 07f679eadba9fb14abac26b1e165f7d5, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -5822151887330517421, guid: 07f679eadba9fb14abac26b1e165f7d5, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal Weapon_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal Weapon - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -6659110875122461561, guid: 07f679eadba9fb14abac26b1e165f7d5, - type: 3} - generatedTextures: - - {fileID: -6402586014670071135, guid: 07f679eadba9fb14abac26b1e165f7d5, type: 3} - - {fileID: -6635831357954291190, guid: 07f679eadba9fb14abac26b1e165f7d5, type: 3} - - {fileID: 854616604008364032, guid: 07f679eadba9fb14abac26b1e165f7d5, type: 3} - - {fileID: 4606406952830974004, guid: 07f679eadba9fb14abac26b1e165f7d5, type: 3} - - {fileID: -5822151887330517421, guid: 07f679eadba9fb14abac26b1e165f7d5, type: 3} diff --git a/Assets/Materials/Substance/Metal/metal_woven.sbsar b/Assets/Materials/Substance/Metal/metal_woven.sbsar deleted file mode 100644 index 576f8c4a5..000000000 --- a/Assets/Materials/Substance/Metal/metal_woven.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6c50e25516df1c3d2cb879d4e3e78491462296d92f05ac5774b6aa1290a777ee -size 9445 diff --git a/Assets/Materials/Substance/Metal/metal_woven.sbsar.meta b/Assets/Materials/Substance/Metal/metal_woven.sbsar.meta deleted file mode 100644 index 27d8bfafe..000000000 --- a/Assets/Materials/Substance/Metal/metal_woven.sbsar.meta +++ /dev/null @@ -1,369 +0,0 @@ -fileFormatVersion: 2 -guid: deb7e15e5f95294498d18869d9f11302 -ScriptedImporter: - internalIDToNameTable: - - first: - 1: 100000 - second: metal_woven/metal_woven - - first: - 4: 400000 - second: metal_woven/metal_woven/Transform - - first: - 21: 2100000 - second: mat.Metal woven - - first: - 23: 2300000 - second: metal_woven/metal_woven/MeshRenderer - - first: - 28: 2800000 - second: Metal woven_baseColor - - first: - 28: 2800002 - second: Metal woven_normal - - first: - 28: 2800004 - second: Metal woven_metallic - - first: - 28: 2800006 - second: Metal woven_ambientOcclusion - - first: - 28: 2800008 - second: Metal woven_height - - first: - 33: 3300000 - second: metal_woven/metal_woven/MeshFilter - - first: - 114: 11400000 - second: sbsar - - first: - 114: 11400002 - second: graph0 - - first: - 135: 13500000 - second: metal_woven/metal_woven/SphereCollider - - first: - 1001: 100100000 - second: metal_woven - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Metal woven - prototypeName: Metal woven - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://metal_woven\" label=\"\" >\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 549858149917880910, guid: deb7e15e5f95294498d18869d9f11302, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -5021036940690714266, guid: deb7e15e5f95294498d18869d9f11302, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -4741193760961545063, guid: deb7e15e5f95294498d18869d9f11302, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 4441773978818050154, guid: deb7e15e5f95294498d18869d9f11302, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: -8782013540898460330, guid: deb7e15e5f95294498d18869d9f11302, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Metal woven_glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven_diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven_baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven_normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven_specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven_roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven_metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven_ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven_height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Metal woven - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 256 - textureHeight: 256 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -1778075352807424672, guid: deb7e15e5f95294498d18869d9f11302, - type: 3} - generatedTextures: - - {fileID: -5021036940690714266, guid: deb7e15e5f95294498d18869d9f11302, type: 3} - - {fileID: 549858149917880910, guid: deb7e15e5f95294498d18869d9f11302, type: 3} - - {fileID: -4741193760961545063, guid: deb7e15e5f95294498d18869d9f11302, type: 3} - - {fileID: 4441773978818050154, guid: deb7e15e5f95294498d18869d9f11302, type: 3} - - {fileID: -8782013540898460330, guid: deb7e15e5f95294498d18869d9f11302, type: 3} diff --git a/Assets/Materials/Substance/Metal/snatched_metal.sbsar b/Assets/Materials/Substance/Metal/snatched_metal.sbsar deleted file mode 100644 index 35980ce5c..000000000 --- a/Assets/Materials/Substance/Metal/snatched_metal.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:556e67022b660530d0afc8296e37706b09e9ef08db46b5421edbd80f0c8993f2 -size 28573 diff --git a/Assets/Materials/Substance/Metal/snatched_metal.sbsar.meta b/Assets/Materials/Substance/Metal/snatched_metal.sbsar.meta deleted file mode 100644 index 3da7ab6e7..000000000 --- a/Assets/Materials/Substance/Metal/snatched_metal.sbsar.meta +++ /dev/null @@ -1,311 +0,0 @@ -fileFormatVersion: 2 -guid: 9aa51bbe4dd46874a906608c34a739e4 -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Snatched Metal - prototypeName: Snatched Metal - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://snatched_metal\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"755928508\" type=\"8\" value=\"9,9\" />\n - </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 8651868829797956950, guid: 9aa51bbe4dd46874a906608c34a739e4, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: 3043754869544600785, guid: 9aa51bbe4dd46874a906608c34a739e4, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -8730703347107057792, guid: 9aa51bbe4dd46874a906608c34a739e4, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 8639218750153593357, guid: 9aa51bbe4dd46874a906608c34a739e4, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 8363912540366899318, guid: 9aa51bbe4dd46874a906608c34a739e4, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambientocclusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: opacity - identifier: opacity - usageName: opacity - channelStr: opacity - label: Opacity - usage: 2 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: opacity - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: opacity - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: opacity - components: - - sourceName: opacity - from: 0 - to: 3 - textureParameters: - - textureName: Snatched Metal - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Snatched Metal - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Snatched Metal - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Snatched Metal - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Snatched Metal - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Snatched Metal - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Snatched Metal - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Snatched Metal - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Snatched Metal - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Snatched Metal - opacity - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 512 - textureHeight: 512 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -2363654054484809406, guid: 9aa51bbe4dd46874a906608c34a739e4, - type: 3} - generatedTextures: - - {fileID: 3043754869544600785, guid: 9aa51bbe4dd46874a906608c34a739e4, type: 3} - - {fileID: 8651868829797956950, guid: 9aa51bbe4dd46874a906608c34a739e4, type: 3} - - {fileID: -8730703347107057792, guid: 9aa51bbe4dd46874a906608c34a739e4, type: 3} - - {fileID: 8363912540366899318, guid: 9aa51bbe4dd46874a906608c34a739e4, type: 3} - - {fileID: 8639218750153593357, guid: 9aa51bbe4dd46874a906608c34a739e4, type: 3} diff --git a/Assets/Materials/Substance/marble_002.sbsar b/Assets/Materials/Substance/marble_002.sbsar deleted file mode 100644 index 728270967..000000000 --- a/Assets/Materials/Substance/marble_002.sbsar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2859e24557bccbe309d8946052849b828cabd34b8e45b933faee212eeffd462e -size 8113 diff --git a/Assets/Materials/Substance/marble_002.sbsar.meta b/Assets/Materials/Substance/marble_002.sbsar.meta deleted file mode 100644 index 624e0d1a6..000000000 --- a/Assets/Materials/Substance/marble_002.sbsar.meta +++ /dev/null @@ -1,296 +0,0 @@ -fileFormatVersion: 2 -guid: ef9a54b8dacea9f44be70da43472f701 -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 232528478, guid: 43a8bbf65be290d44ba52b94476242b9, type: 3} - version: 29 - projectContext: 0 - mGraphInstanceData: - - graphLabel: Marble 002 - prototypeName: Marble 002 - graphDescIndex: 0 - generateAllOutputs: 0 - generateMipMaps: 1 - preset: " <sbspreset pkgurl=\"pkg://marble_002\" label=\"\" >\n <presetinput - identifier=\"$outputsize\" uid=\"756697317\" type=\"8\" value=\"12,12\" />\n - <presetinput identifier=\"cracks_scale\" uid=\"1472628123\" type=\"4\" value=\"13\" - />\n <presetinput identifier=\"cracks_disorder\" uid=\"1472534721\" type=\"0\" - value=\"1\" />\n <presetinput identifier=\"marble_color\" uid=\"1472505596\" - type=\"2\" value=\"0.7,0.654348,0.525\" />\n </sbspreset>\n" - shaderName: Standard - materialProperties: - shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - shaderKeywords: - lightmapFlags: 4 - enableInstancingVariants: 0 - doubleSidedGI: 0 - customRenderQueue: -1 - texEnvs: - - name: _BumpMap - texture: {fileID: 5777664804669422655, guid: ef9a54b8dacea9f44be70da43472f701, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailAlbedoMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailMask - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _DetailNormalMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _EmissionMap - texture: {instanceID: 0} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MainTex - texture: {fileID: -5564000130503291907, guid: ef9a54b8dacea9f44be70da43472f701, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _MetallicGlossMap - texture: {fileID: -3258750942226492355, guid: ef9a54b8dacea9f44be70da43472f701, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _OcclusionMap - texture: {fileID: 4985089394248351555, guid: ef9a54b8dacea9f44be70da43472f701, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - - name: _ParallaxMap - texture: {fileID: 7116303992264550, guid: ef9a54b8dacea9f44be70da43472f701, - type: 3} - scale: {x: 1, y: 1} - offset: {x: 0, y: 0} - floats: - - name: _BumpScale - float: 1 - - name: _Cutoff - float: 0.5 - - name: _DetailNormalMapScale - float: 1 - - name: _DstBlend - float: 0 - - name: _GlossMapScale - float: 1 - - name: _Glossiness - float: 0.5 - - name: _GlossyReflections - float: 1 - - name: _Metallic - float: 0 - - name: _Mode - float: 0 - - name: _OcclusionStrength - float: 1 - - name: _Parallax - float: 0.02 - - name: _SmoothnessTextureChannel - float: 0 - - name: _SpecularHighlights - float: 1 - - name: _SrcBlend - float: 1 - - name: _UVSec - float: 0 - - name: _ZWrite - float: 1 - colors: - - name: _Color - color: {r: 1, g: 1, b: 1, a: 1} - - name: _EmissionColor - color: {r: 0, g: 0, b: 0, a: 1} - outputDescList: - - outputName: diffuse - identifier: diffuse - usageName: diffuse - channelStr: diffuse - label: Diffuse - usage: 0 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: baseColor - identifier: basecolor - usageName: baseColor - channelStr: baseColor - label: Base Color - usage: 1 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: normal - identifier: normal - usageName: normal - channelStr: normal - label: Normal - usage: 7 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: specular - identifier: specular - usageName: specular - channelStr: specular - label: Specular - usage: 11 - bImage: 1 - bNumerical: 0 - bLinear: 0 - - outputName: glossiness - identifier: glossiness - usageName: glossiness - channelStr: glossiness - label: Glossiness - usage: 14 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: roughness - identifier: roughness - usageName: roughness - channelStr: roughness - label: Roughness - usage: 15 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: metallic - identifier: metallic - usageName: metallic - channelStr: metallic - label: Metallic - usage: 34 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: ambientOcclusion - identifier: ambient_occlusion - usageName: ambientOcclusion - channelStr: ambientOcclusion - label: Ambient Occlusion - usage: 5 - bImage: 1 - bNumerical: 0 - bLinear: 1 - - outputName: height - identifier: height - usageName: height - channelStr: height - label: Height - usage: 9 - bImage: 1 - bNumerical: 0 - bLinear: 1 - texturePackingList: - - targetName: diffuse - components: - - sourceName: diffuse - from: 0 - to: 3 - - targetName: baseColor - components: - - sourceName: baseColor - from: 0 - to: 3 - - targetName: normal - components: - - sourceName: normal - from: 0 - to: 3 - - targetName: specular - components: - - sourceName: specular - from: 0 - to: 3 - - targetName: glossiness - components: - - sourceName: glossiness - from: 0 - to: 3 - - targetName: roughness - components: - - sourceName: roughness - from: 0 - to: 3 - - targetName: metallic - components: - - sourceName: smoothness - from: 0 - to: 3 - - targetName: ambientOcclusion - components: - - sourceName: ambientOcclusion - from: 0 - to: 3 - - targetName: height - components: - - sourceName: height - from: 0 - to: 3 - textureParameters: - - textureName: Marble 002 - diffuse - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Marble 002 - baseColor - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Marble 002 - normal - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Marble 002 - specular - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Marble 002 - glossiness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Marble 002 - roughness - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Marble 002 - metallic - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Marble 002 - ambientOcclusion - wrapMode: 0 - filterMode: 1 - aniso: 1 - - textureName: Marble 002 - height - wrapMode: 0 - filterMode: 1 - aniso: 1 - colorSpaceList: [] - inputTextureMap: [] - targetSettingList: - - label: Default - bOverride: 0 - bLockRatio: 1 - textureWidth: 4096 - textureHeight: 4096 - textureFormatMode: 0 - normalCompressed: 0 - bGenerateOnLoad: 1 - material: {fileID: -4681939019719023292, guid: ef9a54b8dacea9f44be70da43472f701, - type: 3} - generatedTextures: - - {fileID: -5564000130503291907, guid: ef9a54b8dacea9f44be70da43472f701, type: 3} - - {fileID: 5777664804669422655, guid: ef9a54b8dacea9f44be70da43472f701, type: 3} - - {fileID: -3258750942226492355, guid: ef9a54b8dacea9f44be70da43472f701, type: 3} - - {fileID: 4985089394248351555, guid: ef9a54b8dacea9f44be70da43472f701, type: 3} - - {fileID: 7116303992264550, guid: ef9a54b8dacea9f44be70da43472f701, type: 3} diff --git a/Assets/Materials/Thrusters.mat b/Assets/Materials/Thrusters.mat deleted file mode 100644 index f9b21ae83..000000000 --- a/Assets/Materials/Thrusters.mat +++ /dev/null @@ -1,87 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Thrusters - m_Shader: {fileID: 4800000, guid: d69ef48273708ef4680762f5cdcfc860, type: 3} - m_ShaderKeywords: - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: -812895718602229137, guid: b7e648471e9dfc44490bd41973711541, - type: 3} - m_Scale: {x: 8, y: 8} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: -6057190860509678031, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} - m_Scale: {x: 8, y: 8} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: -894214952450941493, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _BumpPower: 2 - - _BumpScale: 1 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _Emission: 0 - - _EmissionFresnel: 1 - - _EmissionRoughnessFresnelPower: 0.5 - - _GlossMapScale: 1 - - _Glossiness: 1 - - _GlossyReflections: 1 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _ReverseRim: 0 - - _Rotation: 0 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _UVSec: 0 - - _ZWrite: 1 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmissionColor: {r: 0.7112653, g: 0.4292453, b: 1, a: 1} - m_BuildTextureStacks: [] diff --git a/Assets/Materials/Thrusters.mat.meta b/Assets/Materials/Thrusters.mat.meta deleted file mode 100644 index 5fd79a1be..000000000 --- a/Assets/Materials/Thrusters.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 616adaf59c64a444f8249cc7cf13c527 -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Models/Discobolus/Discobolus Bronze.mat b/Assets/Models/Discobolus/Discobolus Bronze.mat deleted file mode 100644 index 30697d42a..000000000 --- a/Assets/Models/Discobolus/Discobolus Bronze.mat +++ /dev/null @@ -1,80 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Discobolus Bronze - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: _METALLICGLOSSMAP _NORMALMAP - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: 2800000, guid: 9863db663524d9a4eab030a666b1f2da, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: -1863473678134789185, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 6214616473909614744, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: 2800000, guid: d60207b632e464d4b884dded41db5b9b, type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _BumpScale: 1 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _GlossMapScale: 1 - - _Glossiness: 0.5 - - _GlossyReflections: 1 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.005 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _UVSec: 0 - - _ZWrite: 1 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - m_BuildTextureStacks: [] diff --git a/Assets/Models/Discobolus/Discobolus Bronze.mat.meta b/Assets/Models/Discobolus/Discobolus Bronze.mat.meta deleted file mode 100644 index 4ca3a3b46..000000000 --- a/Assets/Models/Discobolus/Discobolus Bronze.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 45f1ac126982c314a8471da3d264210b -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 2100000 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Steel.mat b/Assets/Steel.mat deleted file mode 100644 index fc4d8d0ca..000000000 --- a/Assets/Steel.mat +++ /dev/null @@ -1,83 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!21 &2100000 -Material: - serializedVersion: 6 - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: Steel - m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: _MAINTEX _METALLICGLOSSMAP _NORMALMAP _OCCLUSIONMAP _PARALLAXMAP - m_LightmapFlags: 4 - m_EnableInstancingVariants: 0 - m_DoubleSidedGI: 0 - m_CustomRenderQueue: -1 - stringTagMap: {} - disabledShaderPasses: [] - m_SavedProperties: - serializedVersion: 3 - m_TexEnvs: - - _BumpMap: - m_Texture: {fileID: -3888315358723833787, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailAlbedoMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailMask: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _DetailNormalMap: - m_Texture: {fileID: 0} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _EmissionMap: - m_Texture: {fileID: 0} - m_Scale: {x: 4, y: 4} - m_Offset: {x: 0, y: 0} - - _MainTex: - m_Texture: {fileID: 108215966750249586, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} - m_Scale: {x: 4, y: 4} - m_Offset: {x: 0, y: 0} - - _MetallicGlossMap: - m_Texture: {fileID: 4793252353645218242, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _OcclusionMap: - m_Texture: {fileID: -4384182597330533215, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - - _ParallaxMap: - m_Texture: {fileID: 4600200897981803784, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} - m_Scale: {x: 1, y: 1} - m_Offset: {x: 0, y: 0} - m_Floats: - - _BumpScale: 1 - - _Cutoff: 0.5 - - _DetailNormalMapScale: 1 - - _DstBlend: 0 - - _GlossMapScale: 1 - - _Glossiness: 0.5 - - _GlossyReflections: 1 - - _Metallic: 0 - - _Mode: 0 - - _OcclusionStrength: 1 - - _Parallax: 0.02 - - _SmoothnessTextureChannel: 0 - - _SpecularHighlights: 1 - - _SrcBlend: 1 - - _UVSec: 0 - - _ZWrite: 1 - m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} - - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - m_BuildTextureStacks: [] diff --git a/Assets/Steel.mat.meta b/Assets/Steel.mat.meta deleted file mode 100644 index d645ba6a4..000000000 --- a/Assets/Steel.mat.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4c998decce894b4458e1bc667975aeea -NativeFormatImporter: - externalObjects: {} - mainObjectFileID: 2100000 - userData: - assetBundleName: - assetBundleVariant: From 3f2f637e6386dfee27c093569bddffcbad01d714 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 07:39:07 +0000 Subject: [PATCH 086/108] Drop the *.sbsar LFS rule and SUBSTANCE_PLUGIN_ENABLED define Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .gitattributes | 1 - ProjectSettings/ProjectSettings.asset | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index d530ed421..9d4b872b4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -51,7 +51,6 @@ *.dylib filter=lfs diff=lfs merge=lfs -text *.bundle filter=lfs diff=lfs merge=lfs -text *.engine filter=lfs diff=lfs merge=lfs -text -*.sbsar filter=lfs diff=lfs merge=lfs -text *.msgpack filter=lfs diff=lfs merge=lfs -text GameData/*.cc filter=lfs diff=lfs merge=lfs -text GameData/Mods/**/*.cc filter=lfs diff=lfs merge=lfs -text diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 1b000cd89..76b6938ad 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1f95917a4ca95a4f6977be90d80185648b012099467fa2275b31b868aca88b6f -size 24058 +oid sha256:900f257853e7bf436c28cb323c323f2ef43e8d0659253ca7545cd23255d8ea57 +size 24033 From d144a2ccc203deda3d6d4a46c74683796dc41eab Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 07:39:47 +0000 Subject: [PATCH 087/108] Repoint the Substance materials to the owned ambientCG PBR sets Rewrites 14 materials from the removed sbsar sub-assets to Assets/Materials/PBR textures (Steel_Brushed, Gunmetal_Dark, Metal_Scratched, Paint_Worn_Light, Plates_Panels), keeping each sbsar preset colour as _Color where it differed; flat colour for Discobolus Marble (no marble set ships). Adds Pickup Trim.mat (copy of Car Paint White Small, flat trim colour). Turret, the five pickup prefabs and the Zenith_Blender externalObjects now name file materials instead of the ProceduralMaterial sub-asset. Own commit so it reverts alone (question sbsar-fallback-fidelity, built on its recommended option; no ruling yet). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Content/Prefabs/Turrets/Turret.prefab | 4 +- Assets/Materials/Aluminium brushed.mat | 17 ++-- Assets/Materials/Car Paint Magenta.mat | 14 +-- Assets/Materials/Car Paint Red.mat | 17 ++-- Assets/Materials/Car Paint White Small.mat | 17 ++-- Assets/Materials/Car Paint White.mat | 14 +-- Assets/Materials/Cockpit.mat | 17 ++-- Assets/Materials/Metal 003.mat | 15 +-- Assets/Materials/Mine Glow.mat | 9 +- Assets/Materials/Pickup Trim.mat | 97 +++++++++++++++++++ Assets/Materials/Pickup Trim.mat.meta | 8 ++ Assets/Materials/Radiators.mat | 9 +- Assets/Materials/Silver.mat | 15 +-- Assets/Materials/Station Lights.mat | 9 +- Assets/Materials/Steel parkerized.mat | 15 +-- Assets/Materials/Steel.mat | 15 +-- .../Models/Discobolus/Discobolus Marble.mat | 10 +- Assets/Models/Zenith_Blender.fbx.meta | 6 +- .../Prefabs/RPG/Pickups/Dodecahedron.prefab | 4 +- Assets/Prefabs/RPG/Pickups/Hexahedron.prefab | 4 +- Assets/Prefabs/RPG/Pickups/Icosahedron.prefab | 4 +- Assets/Prefabs/RPG/Pickups/Octahedron.prefab | 4 +- Assets/Prefabs/RPG/Pickups/Tetrahedron.prefab | 4 +- 23 files changed, 186 insertions(+), 142 deletions(-) create mode 100644 Assets/Materials/Pickup Trim.mat create mode 100644 Assets/Materials/Pickup Trim.mat.meta diff --git a/Assets/Content/Prefabs/Turrets/Turret.prefab b/Assets/Content/Prefabs/Turrets/Turret.prefab index 748ca8a29..2df968941 100644 --- a/Assets/Content/Prefabs/Turrets/Turret.prefab +++ b/Assets/Content/Prefabs/Turrets/Turret.prefab @@ -998,8 +998,8 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 3720744386649352057, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, type: 3} - - {fileID: 3720744386649352057, guid: b2bec4b400153d745b2915f1c43e5c96, type: 3} + - {fileID: 2100000, guid: 38f8ba6b169127249b6532be2b3926ee, type: 2} + - {fileID: 2100000, guid: 5e43f48908cce2949a41677ec48affe5, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Materials/Aluminium brushed.mat b/Assets/Materials/Aluminium brushed.mat index b8ade999f..a624f95e1 100644 --- a/Assets/Materials/Aluminium brushed.mat +++ b/Assets/Materials/Aluminium brushed.mat @@ -20,8 +20,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: 4730978449518085612, guid: 06d6a565d43fba5409712ce9a10bfbef, - type: 3} + m_Texture: {fileID: 2800000, guid: c3ef09438e3e46d18a4c267810aeb285, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: @@ -45,23 +44,19 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: 7556082237344091230, guid: 06d6a565d43fba5409712ce9a10bfbef, - type: 3} + m_Texture: {fileID: 2800000, guid: f70b6df0395b4752b4ec80cb7bfd8f42, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: 6373266012617290493, guid: 06d6a565d43fba5409712ce9a10bfbef, - type: 3} + m_Texture: {fileID: 2800000, guid: 40f5e915d2734d43bc01f984772e9d29, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: - m_Texture: {fileID: 342959783478273704, guid: 06d6a565d43fba5409712ce9a10bfbef, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _ParallaxMap: - m_Texture: {fileID: -9132138291289375396, guid: 06d6a565d43fba5409712ce9a10bfbef, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: @@ -85,7 +80,7 @@ Material: - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 0.951, g: 0.951, b: 0.951, a: 1} - _EdgeColor: {r: 3.0117648, g: 3.0117648, b: 11.984314, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Materials/Car Paint Magenta.mat b/Assets/Materials/Car Paint Magenta.mat index dbe95bd62..bff25331a 100644 --- a/Assets/Materials/Car Paint Magenta.mat +++ b/Assets/Materials/Car Paint Magenta.mat @@ -26,8 +26,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: 3068890721646206586, guid: a1d39ea984432bf44b4a0686afe2bf1a, - type: 3} + m_Texture: {fileID: 2800000, guid: 4ce3c2cc69304068b4a2ddc833b748b9, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _FadeTex: @@ -35,18 +34,15 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: 5917659159057834157, guid: a1d39ea984432bf44b4a0686afe2bf1a, - type: 3} + m_Texture: {fileID: 2800000, guid: 73568a0c02bd4184bcb398c9e3dd7ab6, type: 3} m_Scale: {x: 2, y: 2} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: -3552914696322007609, guid: a1d39ea984432bf44b4a0686afe2bf1a, - type: 3} + m_Texture: {fileID: 2800000, guid: d9cd336372c244e398532512e3f8f3be, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: - m_Texture: {fileID: -1242281561028671816, guid: a1d39ea984432bf44b4a0686afe2bf1a, - type: 3} + m_Texture: {fileID: 2800000, guid: 73e117729c3447e5aa0eb1a30fad7c75, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Ints: [] @@ -59,6 +55,6 @@ Material: - _Metallic: 1 - _OcclusionStrength: 1 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 0.5, g: 0, b: 0.228113, a: 1} - _EdgeColor: {r: 3.0117648, g: 3.0117648, b: 11.984314, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Materials/Car Paint Red.mat b/Assets/Materials/Car Paint Red.mat index 8a7ffa46f..063e9367c 100644 --- a/Assets/Materials/Car Paint Red.mat +++ b/Assets/Materials/Car Paint Red.mat @@ -20,8 +20,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: 3068890721646206586, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, - type: 3} + m_Texture: {fileID: 2800000, guid: 4ce3c2cc69304068b4a2ddc833b748b9, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: @@ -45,23 +44,19 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: 5917659159057834157, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, - type: 3} + m_Texture: {fileID: 2800000, guid: 73568a0c02bd4184bcb398c9e3dd7ab6, type: 3} m_Scale: {x: 2, y: 2} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: -3552914696322007609, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, - type: 3} + m_Texture: {fileID: 2800000, guid: d9cd336372c244e398532512e3f8f3be, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: - m_Texture: {fileID: -1242281561028671816, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, - type: 3} + m_Texture: {fileID: 2800000, guid: 73e117729c3447e5aa0eb1a30fad7c75, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _ParallaxMap: - m_Texture: {fileID: -1652887728991447519, guid: 504c7bfe0d50ff64a88b8eac2ceb46f8, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: @@ -85,7 +80,7 @@ Material: - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 0.15685, b: 0, a: 1} - _EdgeColor: {r: 6.0235295, g: 6.0235295, b: 24.094118, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Materials/Car Paint White Small.mat b/Assets/Materials/Car Paint White Small.mat index aab8a3663..cca6010f3 100644 --- a/Assets/Materials/Car Paint White Small.mat +++ b/Assets/Materials/Car Paint White Small.mat @@ -29,8 +29,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: 3068890721646206586, guid: 1c858fec5b74c7c46b1712494192b6b5, - type: 3} + m_Texture: {fileID: 2800000, guid: 4ce3c2cc69304068b4a2ddc833b748b9, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: @@ -54,23 +53,19 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: 5917659159057834157, guid: 1c858fec5b74c7c46b1712494192b6b5, - type: 3} + m_Texture: {fileID: 2800000, guid: 73568a0c02bd4184bcb398c9e3dd7ab6, type: 3} m_Scale: {x: 16, y: 16} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: -3552914696322007609, guid: 1c858fec5b74c7c46b1712494192b6b5, - type: 3} + m_Texture: {fileID: 2800000, guid: d9cd336372c244e398532512e3f8f3be, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: - m_Texture: {fileID: -1242281561028671816, guid: 1c858fec5b74c7c46b1712494192b6b5, - type: 3} + m_Texture: {fileID: 2800000, guid: 73e117729c3447e5aa0eb1a30fad7c75, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _ParallaxMap: - m_Texture: {fileID: -1652887728991447519, guid: 1c858fec5b74c7c46b1712494192b6b5, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Ints: [] @@ -95,7 +90,7 @@ Material: - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 0.891509, b: 0.946396, a: 1} - _EdgeColor: {r: 6.0235295, g: 6.0235295, b: 24.094118, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Materials/Car Paint White.mat b/Assets/Materials/Car Paint White.mat index ba32280af..ad0af17d2 100644 --- a/Assets/Materials/Car Paint White.mat +++ b/Assets/Materials/Car Paint White.mat @@ -26,8 +26,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: 3068890721646206586, guid: b2bec4b400153d745b2915f1c43e5c96, - type: 3} + m_Texture: {fileID: 2800000, guid: 4ce3c2cc69304068b4a2ddc833b748b9, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _FadeTex: @@ -35,18 +34,15 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: 5917659159057834157, guid: b2bec4b400153d745b2915f1c43e5c96, - type: 3} + m_Texture: {fileID: 2800000, guid: 73568a0c02bd4184bcb398c9e3dd7ab6, type: 3} m_Scale: {x: 2, y: 2} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: -3552914696322007609, guid: b2bec4b400153d745b2915f1c43e5c96, - type: 3} + m_Texture: {fileID: 2800000, guid: d9cd336372c244e398532512e3f8f3be, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: - m_Texture: {fileID: -1242281561028671816, guid: b2bec4b400153d745b2915f1c43e5c96, - type: 3} + m_Texture: {fileID: 2800000, guid: 73e117729c3447e5aa0eb1a30fad7c75, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Ints: [] @@ -59,6 +55,6 @@ Material: - _Metallic: 1 - _OcclusionStrength: 1 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 0.891509, b: 0.946396, a: 1} - _EdgeColor: {r: 3.0117648, g: 3.0117648, b: 11.984314, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Materials/Cockpit.mat b/Assets/Materials/Cockpit.mat index 543d0d608..fb19e541a 100644 --- a/Assets/Materials/Cockpit.mat +++ b/Assets/Materials/Cockpit.mat @@ -26,8 +26,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: -3419035557588562233, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} + m_Texture: {fileID: 2800000, guid: 3a10044baac4438f9fc0930783eccdf7, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: @@ -51,23 +50,19 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: -1863473678134789185, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} + m_Texture: {fileID: 2800000, guid: 5a9cee903a2d48718aaf6b224126f279, type: 3} m_Scale: {x: 2, y: 2} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: 6214616473909614744, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} + m_Texture: {fileID: 2800000, guid: 8b24d7ea11c341408a146fa39f59b7b0, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: - m_Texture: {fileID: -3436886866959827803, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _ParallaxMap: - m_Texture: {fileID: 7009887839391554354, guid: 9fc901afb8a434e46b9405eaec2df5a4, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Ints: [] @@ -92,7 +87,7 @@ Material: - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 0.85, g: 0.65, b: 0.30, a: 1} - _EdgeColor: {r: 3.0117648, g: 3.0117648, b: 11.984314, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Materials/Metal 003.mat b/Assets/Materials/Metal 003.mat index 4d07d4c1a..09330e338 100644 --- a/Assets/Materials/Metal 003.mat +++ b/Assets/Materials/Metal 003.mat @@ -20,8 +20,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: -2508943184622041221, guid: 885e680924fc12c439a842a2142d4b78, - type: 3} + m_Texture: {fileID: 2800000, guid: 3a10044baac4438f9fc0930783eccdf7, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: @@ -41,23 +40,19 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: -1236254257114565538, guid: 885e680924fc12c439a842a2142d4b78, - type: 3} + m_Texture: {fileID: 2800000, guid: 5a9cee903a2d48718aaf6b224126f279, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: 4019402794555593307, guid: 885e680924fc12c439a842a2142d4b78, - type: 3} + m_Texture: {fileID: 2800000, guid: 8b24d7ea11c341408a146fa39f59b7b0, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: - m_Texture: {fileID: -1475328947160444094, guid: 885e680924fc12c439a842a2142d4b78, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _ParallaxMap: - m_Texture: {fileID: 7523010977671448217, guid: 885e680924fc12c439a842a2142d4b78, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: diff --git a/Assets/Materials/Mine Glow.mat b/Assets/Materials/Mine Glow.mat index e1627f2d9..7d6d630e7 100644 --- a/Assets/Materials/Mine Glow.mat +++ b/Assets/Materials/Mine Glow.mat @@ -20,8 +20,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: -812895718602229137, guid: b7e648471e9dfc44490bd41973711541, - type: 3} + m_Texture: {fileID: 2800000, guid: 8bc10cfce8a64defaf9f67d156003f09, type: 3} m_Scale: {x: 2, y: 2} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: @@ -41,13 +40,11 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: -6057190860509678031, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} + m_Texture: {fileID: 2800000, guid: 2195885db9e846999fd10aa7f5c629b1, type: 3} m_Scale: {x: 2, y: 2} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: -894214952450941493, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} + m_Texture: {fileID: 2800000, guid: d91bff887b764847a484d0a9bedce9e9, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: diff --git a/Assets/Materials/Pickup Trim.mat b/Assets/Materials/Pickup Trim.mat new file mode 100644 index 000000000..0cea43f4f --- /dev/null +++ b/Assets/Materials/Pickup Trim.mat @@ -0,0 +1,97 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Pickup Trim + m_Shader: {fileID: 4800000, guid: ddff0b48b92c991499817d2a0f5d5059, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _MAINTEX + - _METALLICGLOSSMAP + - _NORMALMAP + - _OCCLUSIONMAP + - _PARALLAXMAP + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 16, y: 16} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: df0632a08c5f1a1498fa325c755dc459, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 16, y: 16} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _Fade: 1 + - _FadeEdge: 0.1 + - _FadeSharpness: 16 + - _GlossMapScale: 1 + - _Glossiness: 0.7 + - _GlossyReflections: 1 + - _Metallic: 0.6 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0, g: 0.605881, b: 1, a: 1} + - _EdgeColor: {r: 6.0235295, g: 6.0235295, b: 24.094118, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Materials/Pickup Trim.mat.meta b/Assets/Materials/Pickup Trim.mat.meta new file mode 100644 index 000000000..d57d829c2 --- /dev/null +++ b/Assets/Materials/Pickup Trim.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bebc82079e5d4e578a73c3ab48d2c2da +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Materials/Radiators.mat b/Assets/Materials/Radiators.mat index aa7eaf0fb..1e5c52a54 100644 --- a/Assets/Materials/Radiators.mat +++ b/Assets/Materials/Radiators.mat @@ -21,8 +21,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: -812895718602229137, guid: b7e648471e9dfc44490bd41973711541, - type: 3} + m_Texture: {fileID: 2800000, guid: 8bc10cfce8a64defaf9f67d156003f09, type: 3} m_Scale: {x: 2, y: 2} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: @@ -46,13 +45,11 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: -6057190860509678031, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} + m_Texture: {fileID: 2800000, guid: 2195885db9e846999fd10aa7f5c629b1, type: 3} m_Scale: {x: 2, y: 2} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: -894214952450941493, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} + m_Texture: {fileID: 2800000, guid: d91bff887b764847a484d0a9bedce9e9, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: diff --git a/Assets/Materials/Silver.mat b/Assets/Materials/Silver.mat index e02d24f97..0bb79d6a1 100644 --- a/Assets/Materials/Silver.mat +++ b/Assets/Materials/Silver.mat @@ -26,8 +26,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: 8947980237086559854, guid: 0be5fb1df83ac8e499a3f6a060041e49, - type: 3} + m_Texture: {fileID: 2800000, guid: c3ef09438e3e46d18a4c267810aeb285, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: @@ -51,23 +50,19 @@ Material: m_Scale: {x: 2, y: 2} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: -1383037052668628532, guid: 0be5fb1df83ac8e499a3f6a060041e49, - type: 3} + m_Texture: {fileID: 2800000, guid: f70b6df0395b4752b4ec80cb7bfd8f42, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: 6429125567479694453, guid: 0be5fb1df83ac8e499a3f6a060041e49, - type: 3} + m_Texture: {fileID: 2800000, guid: 40f5e915d2734d43bc01f984772e9d29, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: - m_Texture: {fileID: -9097439929179392311, guid: 0be5fb1df83ac8e499a3f6a060041e49, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _ParallaxMap: - m_Texture: {fileID: 425190381137097012, guid: 0be5fb1df83ac8e499a3f6a060041e49, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Ints: [] diff --git a/Assets/Materials/Station Lights.mat b/Assets/Materials/Station Lights.mat index f863306a1..2aac54ac7 100644 --- a/Assets/Materials/Station Lights.mat +++ b/Assets/Materials/Station Lights.mat @@ -24,8 +24,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: -812895718602229137, guid: b7e648471e9dfc44490bd41973711541, - type: 3} + m_Texture: {fileID: 2800000, guid: 8bc10cfce8a64defaf9f67d156003f09, type: 3} m_Scale: {x: 8, y: 8} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: @@ -49,13 +48,11 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: -6057190860509678031, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} + m_Texture: {fileID: 2800000, guid: 2195885db9e846999fd10aa7f5c629b1, type: 3} m_Scale: {x: 16, y: 16} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: -894214952450941493, guid: 2b42584452fe0cc4fa4e8a115230b156, - type: 3} + m_Texture: {fileID: 2800000, guid: d91bff887b764847a484d0a9bedce9e9, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: diff --git a/Assets/Materials/Steel parkerized.mat b/Assets/Materials/Steel parkerized.mat index b4194ab66..ba47afb87 100644 --- a/Assets/Materials/Steel parkerized.mat +++ b/Assets/Materials/Steel parkerized.mat @@ -29,8 +29,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: 885599758852769373, guid: e7758cad28ae98f478940e55222419a6, - type: 3} + m_Texture: {fileID: 2800000, guid: dc71e34b4a1f4de7aa826d18b67b5852, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: @@ -54,23 +53,19 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: -4474525002722929857, guid: e7758cad28ae98f478940e55222419a6, - type: 3} + m_Texture: {fileID: 2800000, guid: 1ed06708491744fe944217d19e450157, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: -2334804936223627746, guid: e7758cad28ae98f478940e55222419a6, - type: 3} + m_Texture: {fileID: 2800000, guid: 31e7d642ff8a49a28390c82626c4b6b9, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: - m_Texture: {fileID: -8380876848358870972, guid: e7758cad28ae98f478940e55222419a6, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _ParallaxMap: - m_Texture: {fileID: 172713863077875830, guid: e7758cad28ae98f478940e55222419a6, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Ints: [] diff --git a/Assets/Materials/Steel.mat b/Assets/Materials/Steel.mat index 37420bfd4..6eeb29385 100644 --- a/Assets/Materials/Steel.mat +++ b/Assets/Materials/Steel.mat @@ -26,8 +26,7 @@ Material: serializedVersion: 3 m_TexEnvs: - _BumpMap: - m_Texture: {fileID: -3888315358723833787, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} + m_Texture: {fileID: 2800000, guid: c3ef09438e3e46d18a4c267810aeb285, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _DetailAlbedoMap: @@ -51,23 +50,19 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: 108215966750249586, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} + m_Texture: {fileID: 2800000, guid: f70b6df0395b4752b4ec80cb7bfd8f42, type: 3} m_Scale: {x: 4, y: 4} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: 4793252353645218242, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} + m_Texture: {fileID: 2800000, guid: 40f5e915d2734d43bc01f984772e9d29, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: - m_Texture: {fileID: -4384182597330533215, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _ParallaxMap: - m_Texture: {fileID: 4600200897981803784, guid: cbc61995a46604441ab9de4f1c68e290, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Ints: [] diff --git a/Assets/Models/Discobolus/Discobolus Marble.mat b/Assets/Models/Discobolus/Discobolus Marble.mat index 3c862a22c..f4331ed09 100644 --- a/Assets/Models/Discobolus/Discobolus Marble.mat +++ b/Assets/Models/Discobolus/Discobolus Marble.mat @@ -40,13 +40,11 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MainTex: - m_Texture: {fileID: -5564000130503291907, guid: ef9a54b8dacea9f44be70da43472f701, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _MetallicGlossMap: - m_Texture: {fileID: -3258750942226492355, guid: ef9a54b8dacea9f44be70da43472f701, - type: 3} + m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _OcclusionMap: @@ -63,7 +61,7 @@ Material: - _DetailNormalMapScale: 1 - _DstBlend: 0 - _GlossMapScale: 1 - - _Glossiness: 0.5 + - _Glossiness: 0.45 - _GlossyReflections: 1 - _Metallic: 0 - _Mode: 0 @@ -75,6 +73,6 @@ Material: - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 0.7, g: 0.654348, b: 0.525, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Models/Zenith_Blender.fbx.meta b/Assets/Models/Zenith_Blender.fbx.meta index 2094752dc..6f719ce83 100644 --- a/Assets/Models/Zenith_Blender.fbx.meta +++ b/Assets/Models/Zenith_Blender.fbx.meta @@ -8,8 +8,7 @@ ModelImporter: type: UnityEngine:Material assembly: UnityEngine.CoreModule name: Black - second: {fileID: 3720744386649352057, guid: 1c858fec5b74c7c46b1712494192b6b5, - type: 3} + second: {fileID: 2100000, guid: b9f65861b71050b4a84fe0007bedbba9, type: 2} - first: type: UnityEngine:Material assembly: UnityEngine.CoreModule @@ -19,8 +18,7 @@ ModelImporter: type: UnityEngine:Material assembly: UnityEngine.CoreModule name: White - second: {fileID: -741235592913766832, guid: 885e680924fc12c439a842a2142d4b78, - type: 3} + second: {fileID: 2100000, guid: 39af4e3978df92f40a55e2a114aa242a, type: 2} materials: materialImportMode: 1 materialName: 0 diff --git a/Assets/Prefabs/RPG/Pickups/Dodecahedron.prefab b/Assets/Prefabs/RPG/Pickups/Dodecahedron.prefab index 7a65a0864..7be70840f 100644 --- a/Assets/Prefabs/RPG/Pickups/Dodecahedron.prefab +++ b/Assets/Prefabs/RPG/Pickups/Dodecahedron.prefab @@ -103,8 +103,8 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 3720744386649352057, guid: c00b5a4f1e4743a4ca59b8030251f900, type: 3} - - {fileID: 3720744386649352057, guid: 26a894e543f3ed44893b1620707ca62c, type: 3} + - {fileID: 2100000, guid: bebc82079e5d4e578a73c3ab48d2c2da, type: 2} + - {fileID: 2100000, guid: b9f65861b71050b4a84fe0007bedbba9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Prefabs/RPG/Pickups/Hexahedron.prefab b/Assets/Prefabs/RPG/Pickups/Hexahedron.prefab index f9a477cda..4a8609c7c 100644 --- a/Assets/Prefabs/RPG/Pickups/Hexahedron.prefab +++ b/Assets/Prefabs/RPG/Pickups/Hexahedron.prefab @@ -103,8 +103,8 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 3720744386649352057, guid: c00b5a4f1e4743a4ca59b8030251f900, type: 3} - - {fileID: 3720744386649352057, guid: 26a894e543f3ed44893b1620707ca62c, type: 3} + - {fileID: 2100000, guid: bebc82079e5d4e578a73c3ab48d2c2da, type: 2} + - {fileID: 2100000, guid: b9f65861b71050b4a84fe0007bedbba9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Prefabs/RPG/Pickups/Icosahedron.prefab b/Assets/Prefabs/RPG/Pickups/Icosahedron.prefab index 4252e74cc..b80967c41 100644 --- a/Assets/Prefabs/RPG/Pickups/Icosahedron.prefab +++ b/Assets/Prefabs/RPG/Pickups/Icosahedron.prefab @@ -103,8 +103,8 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 3720744386649352057, guid: c00b5a4f1e4743a4ca59b8030251f900, type: 3} - - {fileID: 3720744386649352057, guid: 26a894e543f3ed44893b1620707ca62c, type: 3} + - {fileID: 2100000, guid: bebc82079e5d4e578a73c3ab48d2c2da, type: 2} + - {fileID: 2100000, guid: b9f65861b71050b4a84fe0007bedbba9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Prefabs/RPG/Pickups/Octahedron.prefab b/Assets/Prefabs/RPG/Pickups/Octahedron.prefab index 099083195..9cabd7b79 100644 --- a/Assets/Prefabs/RPG/Pickups/Octahedron.prefab +++ b/Assets/Prefabs/RPG/Pickups/Octahedron.prefab @@ -103,8 +103,8 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 3720744386649352057, guid: c00b5a4f1e4743a4ca59b8030251f900, type: 3} - - {fileID: 3720744386649352057, guid: 26a894e543f3ed44893b1620707ca62c, type: 3} + - {fileID: 2100000, guid: bebc82079e5d4e578a73c3ab48d2c2da, type: 2} + - {fileID: 2100000, guid: b9f65861b71050b4a84fe0007bedbba9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/Assets/Prefabs/RPG/Pickups/Tetrahedron.prefab b/Assets/Prefabs/RPG/Pickups/Tetrahedron.prefab index 6dad19967..20f8073a7 100644 --- a/Assets/Prefabs/RPG/Pickups/Tetrahedron.prefab +++ b/Assets/Prefabs/RPG/Pickups/Tetrahedron.prefab @@ -103,8 +103,8 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 3720744386649352057, guid: c00b5a4f1e4743a4ca59b8030251f900, type: 3} - - {fileID: 3720744386649352057, guid: 26a894e543f3ed44893b1620707ca62c, type: 3} + - {fileID: 2100000, guid: bebc82079e5d4e578a73c3ab48d2c2da, type: 2} + - {fileID: 2100000, guid: b9f65861b71050b4a84fe0007bedbba9, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 From 0bcf8f818793323f1e6d84cc33e79a1351ff9087 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 07:39:54 +0000 Subject: [PATCH 088/108] Docs: record the sbsar removal Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- docs/aetheria-release-map.md | 3 +-- docs/cultcache-migration-cut.md | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/aetheria-release-map.md b/docs/aetheria-release-map.md index 72e96f22e..c270c297c 100644 --- a/docs/aetheria-release-map.md +++ b/docs/aetheria-release-map.md @@ -502,7 +502,6 @@ record. | follow-up | `hull-damage-wear` | demo | Damage visible on the hull (line 6). | | follow-up | `mod-ship-single-existence-gate` | demo | A skipped package throws on spawn; demo hulls are packages. | | follow-up | `ambiguous-hardpoint-origin` | demo | Save correctness for package hulls. | -| follow-up | `remove-sbsar-files` | demo | Clean break from Substance before a public build. | | follow-up | `delaunay-exact-predicates` | demo | Galaxy links; a silently unlinked zone could strand a demo run. | | follow-up | `failed-start-scene-halts` | demo | The New Game failure path the demo's missing-cast refusal uses. | | follow-up | `stale-docs-after-scenarios-menu` | demo | Docs that describe the old New Game path. | @@ -2188,7 +2187,7 @@ wear comes from baked maps. Grunge is baked into `ship.maps.png` A. - r2's region tint (`_PaintStrength`, `RegionLuminance`, a tiling `_WearNoise`) and its `Livery` of three colours are never built. - Revision 1's vertex mask is gone. - - The 41 `.sbsar` files go with follow-up `remove-sbsar-files`. + - The 41 `.sbsar` files are removed (follow-up `remove-sbsar-files`). #### Parity diff --git a/docs/cultcache-migration-cut.md b/docs/cultcache-migration-cut.md index 16e885490..967f4b6b7 100644 --- a/docs/cultcache-migration-cut.md +++ b/docs/cultcache-migration-cut.md @@ -151,7 +151,7 @@ death clearing the run across relaunch, stance toggle, `FieldShieldTest`. It fou migration defect: CultMath types are not Unity-serializable, so Unity-serialized CultMath fields load as zero. Mouse sensitivity (lost look control) moved to `PlayerSettings` in `00ebe46a`; the rest, including the black rarity colours, is `docs/settings-globals-cut.md`. -Scene materials are broken by the dead Substance plugin, not by this migration. +The Substance maps are removed and the materials repointed to Assets/Materials/PBR. History, before the smoke: - nothing else from agents. The preset rework's Soul findings were fixed in From b2a272d1abab8947fa17c13d09c723ce4f85c732 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 07:41:17 +0000 Subject: [PATCH 089/108] Test: scan m_TexEnvs up to m_Floats (some materials have no m_Ints) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs b/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs index 97e2c0b3b..db3606ecd 100644 --- a/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs +++ b/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs @@ -159,7 +159,7 @@ public sealed class SubstanceCleanBreakTests if (!File.Exists(path)) { problems.Add($"{rel} does not exist"); continue; } var text = File.ReadAllText(path); var start = text.IndexOf("m_TexEnvs:", StringComparison.Ordinal); - var end = text.IndexOf("m_Ints:", StringComparison.Ordinal); + var end = text.IndexOf("m_Floats:", StringComparison.Ordinal); Assert.True(start >= 0 && end > start, $"{rel} has no m_TexEnvs section"); foreach (Match m in texture.Matches(text.Substring(start, end - start))) { From 6905726ba35c752004f263cdac0f6711c5255fcd Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 08:21:54 +0000 Subject: [PATCH 090/108] Test: guard repointed prefab/fbx.meta material guids, LFS pointers, all text assets, texture importer type Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../SubstanceCleanBreakTests.cs | 99 ++++++++++++++++--- 1 file changed, 87 insertions(+), 12 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs b/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs index db3606ecd..ae3e0bddf 100644 --- a/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs +++ b/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs @@ -66,12 +66,18 @@ public sealed class SubstanceCleanBreakTests "ef9a54b8dacea9f44be70da43472f701", }; - private static readonly string[] ScannedExtensions = + private static readonly string[] PrefabsAndMetasEditedByTheCut = { - ".mat", ".prefab", ".unity", ".asset", ".meta", ".controller", ".anim", ".overrideController", ".mixer", - ".lighting", ".flare", ".shader", ".json", + "Assets/Content/Prefabs/Turrets/Turret.prefab", "Assets/Prefabs/RPG/Pickups/Dodecahedron.prefab", + "Assets/Prefabs/RPG/Pickups/Hexahedron.prefab", "Assets/Prefabs/RPG/Pickups/Icosahedron.prefab", + "Assets/Prefabs/RPG/Pickups/Octahedron.prefab", "Assets/Prefabs/RPG/Pickups/Tetrahedron.prefab", + "Assets/Models/Zenith_Blender.fbx.meta", }; + // A material reference (main object fileID 2100000). Script guids in the same files resolve to Unity packages, + // which have no .meta under Assets/, so only material slots are checked. + private static readonly Regex MaterialRef = new(@"fileID:\s*2100000,\s*guid:\s*([0-9a-f]{32})", RegexOptions.Compiled); + private static readonly string[] ExcludedDirs = { ".git", "node_modules", ".voidbot" }; private static readonly string[] RepointedMaterials = @@ -92,6 +98,51 @@ public sealed class SubstanceCleanBreakTests foreach (var file in Walk(sub)) yield return file; } + // A checkout that holds Git LFS pointers instead of content cannot be scanned. The guards that read LFS-tracked + // files fail loudly here: skipping would pass vacuously, and a failure says "smudge the LFS objects first". + private static bool IsLfsPointer(string path) + { + using var stream = File.OpenRead(path); + var head = new byte[48]; + var n = stream.Read(head, 0, head.Length); + return Encoding.ASCII.GetString(head, 0, n).StartsWith("version https://git-lfs", StringComparison.Ordinal); + } + + private static string ReadTextOrFailOnPointer(string path) + { + Assert.False(IsLfsPointer(path), $"{path} is an LFS pointer, not content: this guard cannot see inside it. Run `git lfs pull`."); + return File.ReadAllText(path, Encoding.Latin1); + } + + // Everything is scanned except known binary media (a denylist, so an unlisted serialized type is still read) and, + // for unlisted extensions, files with a NUL byte in the first 8 KiB. The extension check comes first because an + // LFS pointer for a texture is itself text and says nothing about what the object holds. + private static readonly string[] BinaryExtensions = + { + ".png", ".jpg", ".jpeg", ".tga", ".tif", ".tiff", ".psd", ".bmp", ".gif", ".exr", ".hdr", ".dds", ".wav", ".mp3", + ".ogg", ".mp4", ".fbx", ".glb", ".blend", ".ttf", ".otf", ".dll", ".so", ".pdb", ".msgpack", ".zip", ".bank", + }; + + private static bool LooksBinary(string path) + { + if (BinaryExtensions.Contains(Path.GetExtension(path), StringComparer.OrdinalIgnoreCase)) return true; + using var stream = File.OpenRead(path); + var buf = new byte[8192]; + var n = stream.Read(buf, 0, buf.Length); + return Array.IndexOf(buf, (byte)0, 0, n) >= 0; + } + + private static Dictionary<string, string> GuidToMeta(string root) + { + var map = new Dictionary<string, string>(); + foreach (var meta in Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*.meta", SearchOption.AllDirectories)) + { + var guid = File.ReadLines(meta).FirstOrDefault(l => l.StartsWith("guid: "))?.Substring("guid: ".Length).Trim(); + if (guid != null) map[guid] = Path.GetRelativePath(root, meta).Replace('\\', '/'); + } + return map; + } + [Fact] public void NoSbsarFileOrMetaRemains() { @@ -112,7 +163,11 @@ public sealed class SubstanceCleanBreakTests .SelectMany(Walk) .Concat(Directory.Exists(Path.Combine(root, "GameData")) ? Directory.EnumerateFiles(Path.Combine(root, "GameData"), "*.cc") : Enumerable.Empty<string>()) - .Where(f => f.EndsWith(".cc") || ScannedExtensions.Contains(Path.GetExtension(f), StringComparer.OrdinalIgnoreCase)); + .Where(f => f.EndsWith(".cc") || !LooksBinary(f)) + .ToList(); + var pointers = files.Where(IsLfsPointer).Select(f => Path.GetRelativePath(root, f)).ToList(); + Assert.True(pointers.Count == 0, + $"{pointers.Count} scanned files are LFS pointers, not content (first: {pointers.FirstOrDefault()}); run `git lfs pull`."); var hits = new List<string>(); foreach (var file in files) { @@ -129,7 +184,7 @@ public sealed class SubstanceCleanBreakTests public void NoSubstanceBuildSurface() { var root = RestoredHullsTests.FindRepoRoot(); - Assert.DoesNotContain("SUBSTANCE", File.ReadAllText(Path.Combine(root, "ProjectSettings", "ProjectSettings.asset")), StringComparison.Ordinal); + Assert.DoesNotContain("SUBSTANCE", ReadTextOrFailOnPointer(Path.Combine(root, "ProjectSettings", "ProjectSettings.asset")), StringComparison.Ordinal); foreach (var name in new[] { "manifest.json", "packages-lock.json" }) { var text = File.ReadAllText(Path.Combine(root, "Packages", name)); @@ -144,14 +199,9 @@ public sealed class SubstanceCleanBreakTests public void EveryReplacementTextureResolves() { var root = RestoredHullsTests.FindRepoRoot(); - var guidToMeta = new Dictionary<string, string>(); - foreach (var meta in Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*.meta", SearchOption.AllDirectories)) - { - var guid = File.ReadLines(meta).FirstOrDefault(l => l.StartsWith("guid: "))?.Substring("guid: ".Length).Trim(); - if (guid != null) guidToMeta[guid] = Path.GetRelativePath(root, meta).Replace('\\', '/'); - } + var guidToMeta = GuidToMeta(root); - var texture = new Regex(@"m_Texture:\s*\{fileID:\s*(-?\d+),\s*guid:\s*([0-9a-f]{32})", RegexOptions.Compiled); + var texture = new Regex(@"m_Texture:\s*\{fileID:\s*(-?\d+)(?:,\s*guid:\s*([0-9a-f]{32}))?", RegexOptions.Compiled); var problems = new List<string>(); foreach (var rel in RepointedMaterials) { @@ -164,11 +214,36 @@ public sealed class SubstanceCleanBreakTests foreach (Match m in texture.Matches(text.Substring(start, end - start))) { if (m.Groups[1].Value == "0") continue; + if (!m.Groups[2].Success) { problems.Add($"{rel} has a nonzero texture fileID with no guid: {m.Value}"); continue; } var guid = m.Groups[2].Value; if (!guidToMeta.TryGetValue(guid, out var meta)) problems.Add($"{rel} names {guid}, which has no .meta under Assets/"); else if (meta.StartsWith("Assets/Materials/Substance", StringComparison.Ordinal)) problems.Add($"{rel} names {guid} inside the removed Substance tree"); + else if (!File.ReadLines(Path.Combine(root, meta)).Any(l => l.StartsWith("TextureImporter:", StringComparison.Ordinal))) + problems.Add($"{rel} texture slot names {guid} ({meta}), which is not a TextureImporter asset"); } } Assert.True(problems.Count == 0, string.Join("\n", problems)); } + + [Fact] + public void EveryRepointedPrefabAndFbxSlotResolves() + { + var root = RestoredHullsTests.FindRepoRoot(); + var guidToMeta = GuidToMeta(root); + var problems = new List<string>(); + foreach (var rel in PrefabsAndMetasEditedByTheCut) + { + var path = Path.Combine(root, rel); + if (!File.Exists(path)) { problems.Add($"{rel} does not exist"); continue; } + var lines = ReadTextOrFailOnPointer(path).Split('\n'); + for (var i = 0; i < lines.Length; i++) + foreach (Match m in MaterialRef.Matches(lines[i])) + { + var guid = m.Groups[1].Value; + if (!guidToMeta.TryGetValue(guid, out var meta)) problems.Add($"{rel}:{i + 1} names {guid}, which has no .meta under Assets/"); + else if (!meta.EndsWith(".mat.meta", StringComparison.Ordinal)) problems.Add($"{rel}:{i + 1} material slot names {guid} ({meta}), which is not a .mat"); + } + } + Assert.True(problems.Count == 0, string.Join("\n", problems.Take(40))); + } } From e326f5a8fab71f02d109916e11a07c88b747a8b4 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 08:41:38 +0000 Subject: [PATCH 091/108] Docs: ygg-verify recipe stages every LFS file the sbsar guards read Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- docs/mining-cut-refresh.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/mining-cut-refresh.md b/docs/mining-cut-refresh.md index a96d10b40..b14a5c942 100644 --- a/docs/mining-cut-refresh.md +++ b/docs/mining-cut-refresh.md @@ -63,8 +63,9 @@ rows are kept for the combined test count. The three file sets are disjoint. I checked with `git diff --name-only` over each branch's own range, and none of the three pairs shares a file. So each anchored line is byte-identical in the merged tree. - **Tests ran on Yggdrasil, against synthetic merges** (section 0). CultLib `45c2f40` and CultMath `6d5e209` are - the pins in `Directory.Build.props`. The two LFS files the tests read (`GameData/Aetheria.cc`, - `Assets/Resources/Settings.asset`) were staged beside the job, because the verify mirror carries no LFS. + the pins in `Directory.Build.props`. The LFS files the tests read were staged beside the job, because the verify mirror carries no LFS. The Mining + cut tests needed `GameData/Aetheria.cc` and `Assets/Resources/Settings.asset`; `SubstanceCleanBreakTests` needs 99 + (see the LFS staging set under Verification). - **Catalog facts** come from a probe that opens the merged tree's `GameData/Aetheria.cc` through `AetheriaStores.Open` (section 0). @@ -289,7 +290,7 @@ Every mining question is ruled. - Mark the `:396-412` table as history, anchored at `8bd25f6f`. - **Verification:** - Yggdrasil, the same job that section 0 ran: - `ygg-verify.sh <aetheria clone> <merge sha> dotnet '<clone CultLib 45c2f40 to /CultLib and 6d5e209 to /CultMath; restore the two LFS files; dotnet test tests/Aetheria.Shared.Tests -p:CultLibRoot=/CultLib -p:CultMathRoot=/CultMath>'`. + `ygg-verify.sh <aetheria clone> <merge sha> dotnet '<clone CultLib 45c2f40 to /CultLib and 6d5e209 to /CultMath; restore the LFS staging set below; dotnet test tests/Aetheria.Shared.Tests -p:CultLibRoot=/CultLib -p:CultMathRoot=/CultMath>'`. Both roots are mandatory (shared precondition). - The job mounts the Yggdrasil mirrors read-only with `DOCKER_ARGS="-v /home/gamecultadmin/eureka-verify/repos:/repos:ro -v /home/gamecultadmin/eureka-verify/lfs-aetheria:/lfs:ro"`. @@ -298,8 +299,16 @@ Every mining question is ruled. Rule pinned: fire control and mining compose without a behaviour change on either side. Every pre-existing test passes unchanged. - The verify mirror has no LFS (the push from `F:\Projects\Aetheria` fails in the LFS pre-push hook on an - `ssh:` remote). Push from a `--shared --no-checkout` clone, and mount the two LFS blobs. This is recorded + `ssh:` remote). Push from a `--shared --no-checkout` clone, and mount the LFS blobs. This is recorded so the next Hands does not rediscover it. + - LFS staging set. `SubstanceCleanBreakTests` fails loudly on any LFS pointer it scans, so the job must restore + every LFS-tracked file under `Assets/`, `Packages/`, `ProjectSettings/` and `GameData/*.cc` that is not a + binary-media extension (the test's `BinaryExtensions` denylist): 99 files at `6905726ba`, 96 `*.asset` and 3 + `*.cc` (`GameData/Aetheria.cc`, `GameData/Mods/aetheria.nakovalnya/ship.cc`, `GameData/Mods/aetheria.wren/ship.cc`), + which includes `ProjectSettings/ProjectSettings.asset` and `Assets/Resources/Settings.asset`. Derive the list from + the merged tree instead of hand-copying it: + `git ls-files Assets Packages ProjectSettings 'GameData/*.cc' | git check-attr --stdin filter | grep 'lfs$' | sed 's/: filter: lfs//' | grep -viE '\.(png|jpg|jpeg|tga|tif|tiff|psd|bmp|gif|exr|hdr|dds|wav|mp3|ogg|mp4|fbx|glb|blend|ttf|otf|dll|so|pdb|msgpack|zip|bank)$'`, + then copy each path from the `/lfs` mount over the checkout. Staging only two files turns the suite red. - Unity batchmode compile of the merged tree (Self, in a worktree, never with the operator's editor open on the main tree). This is the Cut 1 renderer compile the map still owes. - Operator: fly through a belt (the Cut 1 check the map still owes). Rocks orbit smoothly, and the minimap From 83e6957de07b4da8e9035d8f40aadb013aed09c3 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 08:41:38 +0000 Subject: [PATCH 092/108] Test: guid resolution requires the asset beside the .meta Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs b/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs index ae3e0bddf..39842e4f0 100644 --- a/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs +++ b/tests/Aetheria.Shared.Tests/SubstanceCleanBreakTests.cs @@ -138,7 +138,11 @@ public sealed class SubstanceCleanBreakTests foreach (var meta in Directory.EnumerateFiles(Path.Combine(root, "Assets"), "*.meta", SearchOption.AllDirectories)) { var guid = File.ReadLines(meta).FirstOrDefault(l => l.StartsWith("guid: "))?.Substring("guid: ".Length).Trim(); - if (guid != null) map[guid] = Path.GetRelativePath(root, meta).Replace('\\', '/'); + if (guid == null) continue; + // A .meta whose asset is gone still carries the guid, so resolution must look beside it: the asset is the + // .meta path minus ".meta". Directory metas resolve to a folder. + var asset = meta.Substring(0, meta.Length - ".meta".Length); + if (File.Exists(asset) || Directory.Exists(asset)) map[guid] = Path.GetRelativePath(root, meta).Replace('\\', '/'); } return map; } @@ -216,7 +220,7 @@ public sealed class SubstanceCleanBreakTests if (m.Groups[1].Value == "0") continue; if (!m.Groups[2].Success) { problems.Add($"{rel} has a nonzero texture fileID with no guid: {m.Value}"); continue; } var guid = m.Groups[2].Value; - if (!guidToMeta.TryGetValue(guid, out var meta)) problems.Add($"{rel} names {guid}, which has no .meta under Assets/"); + if (!guidToMeta.TryGetValue(guid, out var meta)) problems.Add($"{rel} names {guid}, which has no .meta and asset under Assets/"); else if (meta.StartsWith("Assets/Materials/Substance", StringComparison.Ordinal)) problems.Add($"{rel} names {guid} inside the removed Substance tree"); else if (!File.ReadLines(Path.Combine(root, meta)).Any(l => l.StartsWith("TextureImporter:", StringComparison.Ordinal))) problems.Add($"{rel} texture slot names {guid} ({meta}), which is not a TextureImporter asset"); @@ -240,7 +244,7 @@ public sealed class SubstanceCleanBreakTests foreach (Match m in MaterialRef.Matches(lines[i])) { var guid = m.Groups[1].Value; - if (!guidToMeta.TryGetValue(guid, out var meta)) problems.Add($"{rel}:{i + 1} names {guid}, which has no .meta under Assets/"); + if (!guidToMeta.TryGetValue(guid, out var meta)) problems.Add($"{rel}:{i + 1} names {guid}, which has no .meta and asset under Assets/"); else if (!meta.EndsWith(".mat.meta", StringComparison.Ordinal)) problems.Add($"{rel}:{i + 1} material slot names {guid} ({meta}), which is not a .mat"); } } From ea6b5115b4bf105f637a187a37e10b94ef9942b8 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 09:19:27 +0000 Subject: [PATCH 093/108] Docs: the LFS staging set greens the sbsar guards only; name what else a green suite needs Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- docs/mining-cut-refresh.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/mining-cut-refresh.md b/docs/mining-cut-refresh.md index b14a5c942..7adb1e951 100644 --- a/docs/mining-cut-refresh.md +++ b/docs/mining-cut-refresh.md @@ -64,7 +64,7 @@ rows are kept for the combined test count. of the three pairs shares a file. So each anchored line is byte-identical in the merged tree. - **Tests ran on Yggdrasil, against synthetic merges** (section 0). CultLib `45c2f40` and CultMath `6d5e209` are the pins in `Directory.Build.props`. The LFS files the tests read were staged beside the job, because the verify mirror carries no LFS. The Mining - cut tests needed `GameData/Aetheria.cc` and `Assets/Resources/Settings.asset`; `SubstanceCleanBreakTests` needs 99 + cut tests needed `GameData/Aetheria.cc` and `Assets/Resources/Settings.asset`; `SubstanceCleanBreakTests` needs 97 and the whole suite needs more (see the LFS staging set under Verification). - **Catalog facts** come from a probe that opens the merged tree's `GameData/Aetheria.cc` through `AetheriaStores.Open` (section 0). @@ -303,12 +303,12 @@ Every mining question is ruled. so the next Hands does not rediscover it. - LFS staging set. `SubstanceCleanBreakTests` fails loudly on any LFS pointer it scans, so the job must restore every LFS-tracked file under `Assets/`, `Packages/`, `ProjectSettings/` and `GameData/*.cc` that is not a - binary-media extension (the test's `BinaryExtensions` denylist): 99 files at `6905726ba`, 96 `*.asset` and 3 + binary-media extension (the test's `BinaryExtensions` denylist): 99 files at `83e6957de`, 96 `*.asset` and 3 `*.cc` (`GameData/Aetheria.cc`, `GameData/Mods/aetheria.nakovalnya/ship.cc`, `GameData/Mods/aetheria.wren/ship.cc`), which includes `ProjectSettings/ProjectSettings.asset` and `Assets/Resources/Settings.asset`. Derive the list from the merged tree instead of hand-copying it: `git ls-files Assets Packages ProjectSettings 'GameData/*.cc' | git check-attr --stdin filter | grep 'lfs$' | sed 's/: filter: lfs//' | grep -viE '\.(png|jpg|jpeg|tga|tif|tiff|psd|bmp|gif|exr|hdr|dds|wav|mp3|ogg|mp4|fbx|glb|blend|ttf|otf|dll|so|pdb|msgpack|zip|bank)$'`, - then copy each path from the `/lfs` mount over the checkout. Staging only two files turns the suite red. + then copy each path from the `/lfs` mount over the checkout. That set (99: the 97 the sbsar guards read plus the two mod `ship.cc` files the Nakovalnya and Wren tests open) makes `SubstanceCleanBreakTests` green and nothing more: staging only two files turns it red. For a fully green suite also stage `GameData/Mods/*/ship.glb` (the catalog excludes a package with an invalid GLB header, failing about 520 tests) and the LFS `.ttf`/`.otf` fonts `CreditsTests.FontCreditsShowWhatTheFontsThemselvesEmbed` reads. - Unity batchmode compile of the merged tree (Self, in a worktree, never with the operator's editor open on the main tree). This is the Cut 1 renderer compile the map still owes. - Operator: fly through a belt (the Cut 1 check the map still owes). Rocks orbit smoothly, and the minimap From f38862aabc55744d9736511c48aa780a2e78f2a8 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 09:33:16 +0000 Subject: [PATCH 094/108] Test: reload keeps the hardpoint an origin two hardpoints accept (fails at base) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../HardpointOriginTests.cs | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 tests/Aetheria.Shared.Tests/HardpointOriginTests.cs diff --git a/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs b/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs new file mode 100644 index 000000000..7087f3090 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs @@ -0,0 +1,67 @@ +using System.Linq; +using CultMath; +using Xunit; +using static CultMath.math; + +// Hardpoint gear holds the hardpoint it was seated in across save and reload: an origin two hardpoints accept is +// resolved by the item's saved Rotation (HardpointData.Rotation), not by hardpoint declaration order. +public sealed partial class RunStartTests +{ + // Two disjoint ballistic hardpoints, A (None, cell (6,5)) and B (Reversed, cell (5,5)). The edge gun's single cell is + // (1,0): origin (5,5) puts it at (6,5) unturned and at (5,5) turned 180 degrees, so both hardpoints take it there. + private (HullData hull, HardpointData a, HardpointData b) TwinMountHull(string name) + { + var a = Mount(HardpointType.Ballistic, 6, 5, rotation: ItemRotation.None); + var b = Mount(HardpointType.Ballistic, 5, 5, rotation: ItemRotation.Reversed); + return (ScratchHull(name, 12, a, b), a, b); + } + + [Fact] + public void AnOriginTwoHardpointsAcceptReloadsIntoTheHardpointItHeld() + { + var (hull, _, b) = TwinMountHull("Origin Twin Mounts"); + var filler = ScratchGear("Origin Filler", HardpointType.Ballistic, 1, 1); + var edge = ScratchGear("Origin Edge Gun", HardpointType.Ballistic, EdgeShape()); + var entity = BareHull(hull); + Assert.True(entity.TryEquip(Instance(filler), int2(6, 5))); + Assert.True(entity.TryEquip(Instance(edge), int2(5, 5))); + var held = entity.Equipment.Single(i => i.Data == edge); + Assert.Same(b, held.Hardpoint); + Assert.Equal(ItemRotation.Reversed, held.EquippableItem.Rotation); + // Un-equip the filler as a player would, then save and reload. + entity.TryUnequip(entity.Equipment.Single(i => i.Data == filler)); + + var reloaded = EntitySerializer.Unpack(_items, null, EntitySerializer.Pack(entity)); + var after = reloaded.Equipment.Single(i => i.Data == edge); + Assert.Equal(1, reloaded.HullData.Hardpoints.IndexOf(after.Hardpoint)); + } + + [Fact] + public void ReloadKeepsTheFirstHardpointToo() + { + var (hull, _, _) = TwinMountHull("Origin Twin Mounts First"); + var edge = ScratchGear("Origin Edge Gun First", HardpointType.Ballistic, EdgeShape()); + var entity = BareHull(hull); + Assert.True(entity.TryEquip(Instance(edge), int2(5, 5))); + Assert.Equal(ItemRotation.None, entity.Equipment.Single(i => i.Data == edge).EquippableItem.Rotation); + + var reloaded = EntitySerializer.Unpack(_items, null, EntitySerializer.Pack(entity)); + var after = reloaded.Equipment.Single(i => i.Data == edge); + Assert.Equal(0, reloaded.HullData.Hardpoints.IndexOf(after.Hardpoint)); + } + + [Fact] + public void AnItemWhoseRotationNamesNoAcceptingHardpointStillSeats() + { + var (hull, a, _) = TwinMountHull("Origin Twin Mounts Stray"); + var edge = ScratchGear("Origin Edge Gun Stray", HardpointType.Ballistic, EdgeShape()); + var entity = BareHull(hull); + var item = Instance(edge); + item.Rotation = ItemRotation.Clockwise; + Assert.True(entity.ItemFits(item, int2(5, 5))); + Assert.True(entity.TryEquip(item, int2(5, 5))); + var held = entity.Equipment.Single(i => i.Data == edge); + Assert.Same(a, held.Hardpoint); + Assert.Equal(ItemRotation.None, held.EquippableItem.Rotation); + } +} From eea98d44140b2484923727063f30d44632dc31a3 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 09:33:23 +0000 Subject: [PATCH 095/108] HardpointAt prefers the hardpoint matching the item's Rotation Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Entity.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/ServerShared/Entity.cs b/Assets/Scripts/ServerShared/Entity.cs index b520db17d..6f7683822 100644 --- a/Assets/Scripts/ServerShared/Entity.cs +++ b/Assets/Scripts/ServerShared/Entity.cs @@ -1545,7 +1545,7 @@ public abstract class Entity } else { - hardpoint = HardpointAt(itemData, hullData, hullCoord, moving); + hardpoint = HardpointAt(itemData, hullData, hullCoord, item.Rotation, moving); if (hardpoint == null) return false; item.Rotation = hardpoint.Rotation; } @@ -1560,10 +1560,12 @@ public abstract class Entity // The one placement rule for hardpoint gear. At this origin the item lies within a hardpoint of its type, turned to // that hardpoint's rotation (HardpointData.TakesAt, the fit rule); its own cells are free, since a hardpoint's // leftover cells may hold general gear (operator, 2026-09-30: "saving slots in a hardpoint can be a valid tradeoff - // for crowded ships"); and that hardpoint holds no other hardpoint item, since it holds one at most. - private HardpointData HardpointAt(EquippableItemData itemData, HullData hullData, int2 hullCoord, EquippedItem moving) + // for crowded ships"); and that hardpoint holds no other hardpoint item, since it holds one at most. Where several hardpoints accept the origin, the + // one whose rotation equals the item's own (saved) rotation is preferred, so reload seats gear where it was; an item whose + // rotation names none of them takes the first (stable order). + private HardpointData HardpointAt(EquippableItemData itemData, HullData hullData, int2 hullCoord, ItemRotation seated, EquippedItem moving) { - foreach (var hardpoint in hullData.Hardpoints) + foreach (var hardpoint in hullData.Hardpoints.OrderBy(h => h.Rotation == seated ? 0 : 1)) { if (!hardpoint.TakesAt(itemData, hullCoord - hardpoint.Position)) continue; var ownCellsFree = itemData.Shape.Coordinates From 2d91a5b13b82f23e13300630d5d5e574c6a472cb Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 11:19:09 +0000 Subject: [PATCH 096/108] Probes never write item.Rotation: TryEquip seats the hardpoint's rotation; ItemFits reports it via out Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/ServerShared/Entity.cs | 17 +++++++++++++---- Assets/Scripts/UI/Menu/InventoryPanel.cs | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/ServerShared/Entity.cs b/Assets/Scripts/ServerShared/Entity.cs index 6f7683822..2f3062ff2 100644 --- a/Assets/Scripts/ServerShared/Entity.cs +++ b/Assets/Scripts/ServerShared/Entity.cs @@ -1547,7 +1547,6 @@ public abstract class Entity { hardpoint = HardpointAt(itemData, hullData, hullCoord, item.Rotation, moving); if (hardpoint == null) return false; - item.Rotation = hardpoint.Rotation; } return true; @@ -1582,14 +1581,22 @@ public abstract class Entity // Check whether the given item will fit when its origin is placed at the given coordinate on the hull. An item that // is already equipped here is judged without its own cells, so a gun can be moved within its own hardpoint; // TryEquip stays strict (it never sees an item as its own occupant), so equipping an equipped item twice is refused. - public bool ItemFits(EquippableItem item, int2 hullCoord) + public bool ItemFits(EquippableItem item, int2 hullCoord) => ItemFits(item, hullCoord, out _); + + // As above, and reports the rotation TryEquip would seat the item at: its hardpoint's for hardpoint gear, otherwise + // its own. A probe never writes item.Rotation; TryEquip is the only seat. + public bool ItemFits(EquippableItem item, int2 hullCoord, out ItemRotation seated) { + seated = item.Rotation; // Don't allow equipping while deployed if (_active) return false; var itemData = ItemManager.GetData(item); var hullData = ItemManager.GetData(Hull) as HullData; - return ItemFits(itemData, hullData, item, hullCoord, out _, Equipment.FirstOrDefault(e => e.EquippableItem == item)); + if (!ItemFits(itemData, hullData, item, hullCoord, out var hardpoint, Equipment.FirstOrDefault(e => e.EquippableItem == item))) + return false; + seated = hardpoint?.Rotation ?? item.Rotation; + return true; } public bool TryFindSpace(EquippableItem item, out int2 hullCoord) @@ -1662,7 +1669,9 @@ public abstract class Entity var hullData = ItemManager.GetData(Hull) as HullData; if (!ItemFits(itemData, hullData, item, hullCoord, out var hardpoint)) return false; - + // The one seat of hardpoint gear's rotation, before EquippedItem's ctor reads it. + if (hardpoint != null) item.Rotation = hardpoint.Rotation; + EquippedItem equippedItem; if (itemData.HardpointType == HardpointType.Tool) { diff --git a/Assets/Scripts/UI/Menu/InventoryPanel.cs b/Assets/Scripts/UI/Menu/InventoryPanel.cs index 2087a3870..eaa6212ac 100644 --- a/Assets/Scripts/UI/Menu/InventoryPanel.cs +++ b/Assets/Scripts/UI/Menu/InventoryPanel.cs @@ -386,11 +386,11 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler var itemData = GameManager.ItemManager.GetData(item); if (!(item is EquippableItem equippableItem)) return; var placementPosition = v + itemDragObject.OriginCellOffset; - if (entity.ItemFits(equippableItem, placementPosition)) + if (entity.ItemFits(equippableItem, placementPosition, out var seated)) { //foreach (var cell in _dragCells) cell.gameObject.SetActive(false); FakeItem = item; - FakeOccupancy = hullData.Shape.Inset(itemData.Shape, placementPosition, item.Rotation); + FakeOccupancy = hullData.Shape.Inset(itemData.Shape, placementPosition, seated); RefreshCells(); GameManager.RegisterDragTarget(drag => { From d9ccac62963e56fb39c37b78099610ceca21c647 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 11:19:26 +0000 Subject: [PATCH 097/108] Pin probe purity and the shipped catalog's hardpoint origins Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../HardpointOriginTests.cs | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs b/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs index 7087f3090..e675e3646 100644 --- a/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs +++ b/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Linq; using CultMath; using Xunit; @@ -64,4 +65,74 @@ public sealed partial class RunStartTests Assert.Same(a, held.Hardpoint); Assert.Equal(ItemRotation.None, held.EquippableItem.Rotation); } + + // A probe reports; only TryEquip seats. The probe used to turn the item to the hardpoint it found, so the same item + // probed twice could resolve differently, and a failed or merely previewed placement left it turned. + [Fact] + public void AProbeLeavesTheItemsRotationAlone() + { + var (hull, a, b) = TwinMountHull("Origin Twin Mounts Probe"); + var edge = ScratchGear("Origin Edge Gun Probe", HardpointType.Ballistic, EdgeShape()); + var entity = BareHull(hull); + var item = Instance(edge); + item.Rotation = ItemRotation.Clockwise; + + Assert.True(entity.ItemFits(item, int2(5, 5))); + Assert.Equal(ItemRotation.Clockwise, item.Rotation); + Assert.True(entity.ItemFits(item, int2(5, 5), out var seated)); + Assert.Equal(ItemRotation.None, seated); + Assert.Equal(ItemRotation.Clockwise, item.Rotation); + Assert.True(entity.TryFindSpace(item, out _)); + Assert.Equal(ItemRotation.Clockwise, item.Rotation); + Assert.False(entity.ItemFits(item, int2(0, 0), out var unseated)); + Assert.Equal(ItemRotation.Clockwise, unseated); + Assert.Equal(ItemRotation.Clockwise, item.Rotation); + + Assert.True(entity.TryEquip(item, int2(5, 5))); + var held = entity.Equipment.Single(i => i.Data == edge); + Assert.Same(a, held.Hardpoint); + Assert.Equal(ItemRotation.None, held.EquippableItem.Rotation); + + var reversed = Instance(edge); + reversed.Rotation = ItemRotation.Reversed; + var fresh = BareHull(hull); + Assert.True(fresh.ItemFits(reversed, int2(5, 5), out var first)); + Assert.True(fresh.ItemFits(reversed, int2(5, 5), out var second)); + Assert.Equal(ItemRotation.Reversed, first); + Assert.Equal(first, second); + Assert.Equal(b.Rotation, first); + } +} + +// The shipped catalog authors no origin that two differently turned hardpoints of one type both take. The fit rule alone +// over-approximates what Entity.HardpointAt sees (occupancy only removes candidates), so zero here is stricter than needed. +public sealed class ShippedHardpointOriginTests +{ + [Fact] + public void TheShippedCatalogHasNoAmbiguousOrigin() + { + using var cache = RestoredHullsTests.OpenCatalog(); + var designs = cache.GetAll<EquippableItemData>().Where(d => !(d is HullData) && d.HardpointType != HardpointType.Tool).ToArray(); + var ambiguous = new List<string>(); + var pairs = 0; + foreach (var hull in cache.GetAll<HullData>()) + for (var i = 0; i < hull.Hardpoints.Count; i++) + for (var j = i + 1; j < hull.Hardpoints.Count; j++) + { + var a = hull.Hardpoints[i]; + var b = hull.Hardpoints[j]; + if (a.Type != b.Type || a.Rotation == b.Rotation) continue; + pairs++; + foreach (var design in designs.Where(d => d.HardpointType == a.Type)) + for (var x = -20; x < hull.Shape.Width; x++) + for (var y = -20; y < hull.Shape.Height; y++) + { + var origin = int2(x, y); + if (a.TakesAt(design, origin - a.Position) && b.TakesAt(design, origin - b.Position)) + ambiguous.Add($"{hull.Name} {design.Name} at ({x},{y}): hardpoints {i} and {j}"); + } + } + System.Console.WriteLine($"ShippedHardpointOriginTests visited {pairs} same-type different-rotation pairs"); + Assert.True(ambiguous.Count == 0, $"{ambiguous.Count} ambiguous origins: " + string.Join("; ", ambiguous.Take(10))); + } } From cc20ce93ac8b7073003aae00bc641351a459ab0d Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 13:28:37 +0000 Subject: [PATCH 098/108] Catalog origin pin fails if its scan visits nothing Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/HardpointOriginTests.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs b/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs index e675e3646..7c635bb58 100644 --- a/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs +++ b/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs @@ -115,6 +115,7 @@ public sealed class ShippedHardpointOriginTests var designs = cache.GetAll<EquippableItemData>().Where(d => !(d is HullData) && d.HardpointType != HardpointType.Tool).ToArray(); var ambiguous = new List<string>(); var pairs = 0; + var probes = 0; foreach (var hull in cache.GetAll<HullData>()) for (var i = 0; i < hull.Hardpoints.Count; i++) for (var j = i + 1; j < hull.Hardpoints.Count; j++) @@ -128,11 +129,14 @@ public sealed class ShippedHardpointOriginTests for (var y = -20; y < hull.Shape.Height; y++) { var origin = int2(x, y); + probes++; if (a.TakesAt(design, origin - a.Position) && b.TakesAt(design, origin - b.Position)) ambiguous.Add($"{hull.Name} {design.Name} at ({x},{y}): hardpoints {i} and {j}"); } } System.Console.WriteLine($"ShippedHardpointOriginTests visited {pairs} same-type different-rotation pairs"); + // A scan that visits nothing would pass; the catalog has such pairs today, so losing them must fail loudly. + Assert.True(pairs > 0 && probes > 0, $"the scan visited {pairs} pairs and {probes} origins"); Assert.True(ambiguous.Count == 0, $"{ambiguous.Count} ambiguous origins: " + string.Join("; ", ambiguous.Take(10))); } } From f7d5a7d2a81e2ee8ac1381e6340f2fbf87e1379d Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 13:32:34 +0000 Subject: [PATCH 099/108] A failed start is decided in RunStart.Launch; the scene steps nothing without a live run Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/Gameplay/ActionGameManager.cs | 21 +++------ Assets/Scripts/ServerShared/RunStart.cs | 15 ++++++ tests/Aetheria.Shared.Tests/RunLaunchTests.cs | 46 +++++++++++++++++++ 3 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 tests/Aetheria.Shared.Tests/RunLaunchTests.cs diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 8c2b38345..74f495afb 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -854,21 +854,12 @@ public class ActionGameManager : MonoBehaviour var scenario = PendingScenario; PendingScenario = null; var failures = new List<string>(); - RunStart.Staged staged = null; - try + var staged = RunStart.Launch(() => RunSave.Replace(CultCache, () => { - staged = RunSave.Replace(CultCache, () => - { - RunStart.GenerateArena(ItemManager, Settings.ZoneSettings, Settings.PlanetSettings, CurrentGalaxy, scenario); - PopulateLevel(CurrentGalaxy.Entrance); - return RunStart.Stage(ItemManager, Zone, scenario, Settings.StartingHullName, Settings.TutorialGenerationSettings, failures); - }); - } - catch (Exception exception) - { - Debug.LogException(exception); - failures.Add(exception.Message); - } + RunStart.GenerateArena(ItemManager, Settings.ZoneSettings, Settings.PlanetSettings, CurrentGalaxy, scenario); + PopulateLevel(CurrentGalaxy.Entrance); + return RunStart.Stage(ItemManager, Zone, scenario, Settings.StartingHullName, Settings.TutorialGenerationSettings, failures); + }), failures, Debug.LogException); if (staged == null) { @@ -1348,6 +1339,8 @@ public class ActionGameManager : MonoBehaviour void Update() { + // No live run (a start that failed, a run that ended): the main menu is up, and nothing steps a zone or reads a player. + if (CurrentGalaxy == null) return; if(!_paused) { _time += Time.deltaTime; diff --git a/Assets/Scripts/ServerShared/RunStart.cs b/Assets/Scripts/ServerShared/RunStart.cs index cadd66bcc..4e6808859 100644 --- a/Assets/Scripts/ServerShared/RunStart.cs +++ b/Assets/Scripts/ServerShared/RunStart.cs @@ -30,6 +30,21 @@ public static class RunStart itemManager, zoneSettings, planetSettings, galaxy, galaxy.Entrance, galaxy.IsPrelude, scenario.Ambient); } + // Runs a start and answers whether it produced a run: null, with the reason in `failures`, when `start` throws or + // returns nothing. The caller shows the failure and clears its run; nothing past a null may run the game. + public static Staged Launch(Func<Staged> start, List<string> failures, Action<Exception> log = null) + { + Staged staged = null; + try { staged = start(); } + catch (Exception exception) + { + log?.Invoke(exception); + failures.Add(exception.Message); + } + if (staged == null && failures.Count == 0) failures.Add("the start produced no run"); + return staged; + } + // Runs the scenario's Stage, then admits its player and everything it placed: each entity's stance set both ways // with the player, a pilot for each piloted one. Returns null, with every failure listed and the arena unchanged, // unless the whole scenario staged. diff --git a/tests/Aetheria.Shared.Tests/RunLaunchTests.cs b/tests/Aetheria.Shared.Tests/RunLaunchTests.cs new file mode 100644 index 000000000..1c8b0e380 --- /dev/null +++ b/tests/Aetheria.Shared.Tests/RunLaunchTests.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using Xunit; + +// RunStart.Launch decides whether a start produced a run; the game scene halts on its answer (a failed start clears the +// galaxy, and a scene with no galaxy steps nothing). Kills: a start that throws or returns nothing reading as a run, a +// failure with no reason to show on the menu, a thrown exception that is neither logged nor listed, and a start that +// worked being reported failed. +public sealed class RunLaunchTests +{ + [Fact] + public void AStartThatThrowsIsNoRunAndSaysWhy() + { + var failures = new List<string>(); + var logged = new List<Exception>(); + var staged = RunStart.Launch(() => throw new InvalidOperationException("the arena would not generate"), failures, logged.Add); + Assert.Null(staged); + Assert.Equal(new[] { "the arena would not generate" }, failures); + Assert.Single(logged); + } + + [Fact] + public void AStartThatReturnsNothingIsNoRunAndKeepsItsOwnReasons() + { + var failures = new List<string>(); + Assert.Null(RunStart.Launch(() => { failures.Add("player: the scenario places no player"); return null; }, failures)); + Assert.Equal(new[] { "player: the scenario places no player" }, failures); + } + + [Fact] + public void AStartThatReturnsNothingAndSaysNothingStillGivesAReason() + { + var failures = new List<string>(); + Assert.Null(RunStart.Launch(() => null, failures)); + Assert.Single(failures); + } + + [Fact] + public void AStartThatStagedIsARunWithNoFailures() + { + var failures = new List<string>(); + var made = new RunStart.Staged(); + Assert.Same(made, RunStart.Launch(() => made, failures)); + Assert.Empty(failures); + } +} From 95568140e2c78d21e440272d956dafc339eae5b2 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 13:35:15 +0000 Subject: [PATCH 100/108] Pin the deployed guard of the out ItemFits overload Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../HardpointOriginTests.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs b/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs index 7c635bb58..6d5341ae9 100644 --- a/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs +++ b/tests/Aetheria.Shared.Tests/HardpointOriginTests.cs @@ -102,6 +102,27 @@ public sealed partial class RunStartTests Assert.Equal(first, second); Assert.Equal(b.Rotation, first); } + + // A deployed entity takes no gear, so no probe reports a fit or a seat on one (the out overload's own guard). + // Kills: a probe that ignores the deployed state and offers a placement TryEquip would then refuse. + [Fact] + public void ADeployedEntityTakesNoProbe() + { + var (hull, _, _) = TwinMountHull("Origin Twin Mounts Deployed"); + var edge = ScratchGear("Origin Edge Gun Deployed", HardpointType.Ballistic, EdgeShape()); + var entity = BareHull(hull); + var item = Instance(edge); + item.Rotation = ItemRotation.Clockwise; + Assert.True(entity.ItemFits(item, int2(5, 5), out _)); + + var zone = Arena(false); + entity.Zone = zone; + zone.Admit(entity, piloted: false); + Assert.False(entity.ItemFits(item, int2(5, 5), out var seated)); + Assert.Equal(ItemRotation.Clockwise, seated); + Assert.False(entity.ItemFits(item, int2(5, 5))); + Assert.False(entity.TryEquip(item, int2(5, 5))); + } } // The shipped catalog authors no origin that two differently turned hardpoints of one type both take. The fit rule alone From 796a7af9efc605cca831731b57f30603bf95d77a Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 13:56:16 +0000 Subject: [PATCH 101/108] ActionGameManager.RunLive gates the renderer's Update paths too Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- Assets/Scripts/Gameplay/ActionGameManager.cs | 6 ++++-- Assets/Scripts/Zone Display/ZoneRenderer.cs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 74f495afb..a47577d38 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -106,6 +106,9 @@ public class ActionGameManager : MonoBehaviour } public static Galaxy CurrentGalaxy; + // Whether a run is live: a failed start and a finished run both clear the galaxy, and the scene's update paths (this + // manager's, the renderer's) step and draw nothing without one. + public static bool RunLive => CurrentGalaxy != null; // The scenario a new run starts from: MainMenu.Launch sets it, and StartGame's new-run branch consumes it once. public static Scenario PendingScenario; @@ -1339,8 +1342,7 @@ public class ActionGameManager : MonoBehaviour void Update() { - // No live run (a start that failed, a run that ended): the main menu is up, and nothing steps a zone or reads a player. - if (CurrentGalaxy == null) return; + if (!RunLive) return; if(!_paused) { _time += Time.deltaTime; diff --git a/Assets/Scripts/Zone Display/ZoneRenderer.cs b/Assets/Scripts/Zone Display/ZoneRenderer.cs index f63f746bd..24ce8a494 100644 --- a/Assets/Scripts/Zone Display/ZoneRenderer.cs +++ b/Assets/Scripts/Zone Display/ZoneRenderer.cs @@ -508,6 +508,7 @@ public class ZoneRenderer : MonoBehaviour void LateUpdate() { + if (!ActionGameManager.RunLive) return; Map.Draw(Zone, ActionGameManager.Clock.Lead); } @@ -550,6 +551,7 @@ public class ZoneRenderer : MonoBehaviour void Update() { + if (!ActionGameManager.RunLive) return; var lead = ActionGameManager.Clock.Lead; GravityLowering.Lower(Zone, lead, ref _gravityWells); foreach (var loot in _floatingItems.Values) From 6a5ee8ee1c6e363ed5f0f8860c92520bb1f21547 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 14:00:37 +0000 Subject: [PATCH 102/108] Pin the boss gate's exit-zone check and the refused-boss path Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- tests/Aetheria.Shared.Tests/RunGoalTests.cs | 48 +++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/RunGoalTests.cs b/tests/Aetheria.Shared.Tests/RunGoalTests.cs index cfdbdb158..c01927ecb 100644 --- a/tests/Aetheria.Shared.Tests/RunGoalTests.cs +++ b/tests/Aetheria.Shared.Tests/RunGoalTests.cs @@ -414,6 +414,54 @@ public sealed partial class RunStartTests Assert.False(RunGoal.ExitOpen(ZoneOf(galaxy, zone))); } + // The gate belongs to the exit zone alone. A boss zone that is not the exit spawns its boss and loses it, and that zone's gate + // stays sealed: the exit check, not the boss mark, decides where a gate can open (a MainGalaxy choke-point boss zone is such a zone). + [Fact] + public void Exit_stays_sealed_in_a_non_exit_zone_whose_boss_died() + { + var galaxy = DemoGalaxy(1); + GiveAntagonistABoss(galaxy); + var other = galaxy.Zones.First(zone => zone != galaxy.Exit); + galaxy.BossZones[Zhestokost(galaxy)] = other; + + var zone = ZoneOf(galaxy, other); + Assert.True(zone.Pack.BossSpawned, "the fixture must spawn a boss outside the exit"); + var boss = Assert.Single(zone.Entities, entity => entity.IsBoss); + Assert.False(RunGoal.ExitOpen(zone)); + boss.HeatstrokeDeath.OnNext(Unit.Default); + Assert.False(RunGoal.BossAlive(zone)); + Assert.False(RunGoal.ExitOpen(zone), "a dead boss outside the exit zone opens no gate"); + } + + // The null-boss path through the real spawn loop: the boss zone is the exit, the faction's Loadout resolves, and + // Materialize cannot build it, so no boss is produced and the gate must not read as open. + // Both refusals (no Loadout, unbuildable Loadout) leave BossSpawned false. + [Fact] + public void A_refused_boss_leaves_the_exit_sealed_through_the_spawn_loop() + { + var galaxy = DemoGalaxy(1); + var loadout = GiveAntagonistABoss(galaxy); + var antagonist = Zhestokost(galaxy); + var exitZone = galaxy.Exit; + Assert.Equal(exitZone, galaxy.BossZones[antagonist]); + + // Unbuildable: the Loadout resolves and the entity is null. + loadout.Slots[0].Position = new int2(999, 999); + loadout.Slots[1].Position = new int2(998, 998); + StoreLoadout(loadout); + var unbuildable = ZoneOf(galaxy, exitZone); + Assert.False(unbuildable.Pack.BossSpawned); + Assert.DoesNotContain(unbuildable.Entities, entity => entity.IsBoss); + Assert.False(RunGoal.ExitOpen(unbuildable)); + + // Unresolved: the faction's Loadout is gone, so BossOf returns null. + antagonist.BossLoadout = new CultRecordRef<Loadout>(Loadouts.KeyOf("No Such Loadout")); + var unresolved = ZoneOf(galaxy, exitZone); + Assert.False(unresolved.Pack.BossSpawned); + Assert.DoesNotContain(unresolved.Entities, entity => entity.IsBoss); + Assert.False(RunGoal.ExitOpen(unresolved)); + } + // Continue: the mark is saved with the zone and restored, so a boss alive when the run was saved is alive after. [Fact] public void Boss_mark_survives_continue() From 1411629983ac1bf6bc3ccde629880744faefa5ea Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 14:02:19 +0000 Subject: [PATCH 103/108] Pin ship order past 1000 units and undetected ships at every distance Two sweep fixtures close mining-target-pin-gaps: ships on both sides of 1000 and out to 4000 ordered both ways, and undetected ships from 2 to 8000 units on every bearing never picked by any press. Tests only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../MiningTargetQueriesTests.cs | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/MiningTargetQueriesTests.cs b/tests/Aetheria.Shared.Tests/MiningTargetQueriesTests.cs index 374f9292e..9cd8ec025 100644 --- a/tests/Aetheria.Shared.Tests/MiningTargetQueriesTests.cs +++ b/tests/Aetheria.Shared.Tests/MiningTargetQueriesTests.cs @@ -546,4 +546,82 @@ public sealed partial class MiningCut3Tests Assert.Equal(order[i % order.Count], observer.Target.Value); } } + + private static float2 Polar(float2 at, float distance, float angle) => at + distance * float2(cos(angle), sin(angle)); + + // Both presses, from nothing and from every target, visit `order` and wrap. + private static void AssertPressesWalk(Ship observer, List<TargetRef> order) + { + observer.SetTarget(TargetRef.None); + for (var i = 0; i <= order.Count; i++) + { + Assert.True(observer.TargetNext()); + Assert.Equal(order[i % order.Count], observer.Target.Value); + } + observer.SetTarget(TargetRef.None); + for (var i = 0; i <= order.Count; i++) + { + Assert.True(observer.TargetPrevious()); + Assert.Equal(order[order.Count - 1 - i % order.Count], observer.Target.Value); + } + for (var i = 0; i < order.Count; i++) + { + observer.SetTarget(order[i]); + Assert.True(observer.TargetNext()); + Assert.Equal(order[(i + 1) % order.Count], observer.Target.Value); + observer.SetTarget(order[i]); + Assert.True(observer.TargetPrevious()); + Assert.Equal(order[(i + order.Count - 1) % order.Count], observer.Target.Value); + } + } + + // Ships keep their distance order for both presses at every range: the key is the distance itself past 1000 too, + // not a function that clamps or bends there. Ships stand on both sides of 1000, many thousand units out, each a + // distinct distance and admitted in an order unlike the distance order, so a key that ties or inverts any two + // falls back on zone order and shows. + [Fact] + public void ShipsPastAThousandUnitsAreOrderedByDistanceBothWays() + { + var at = float2(500, 0); + var (s, observer) = TargetScene(7, at); + var distances = new[] { 1800f, 700f, 2400f, 1200f, 400f, 4000f, 999f, 1500f, 1001f, 150f, 3100f, 1100f }; + for (var i = 0; i < distances.Length; i++) Sight(s, observer, Polar(at, distances[i], i * 1.9f)); + var order = ByDistance(s, observer, 120f); + Assert.True(order.Count(t => t.Chunk.HasValue) >= 8 && order.Count(t => t.Entity != null) == distances.Length, $"degenerate: {order.Count} candidates"); + var ships = order.Where(t => t.Entity != null).Select(t => length(t.Entity.Position.xz - at)).ToList(); + Assert.Equal(ships.OrderBy(d => d).ToList(), ships); + Assert.Equal(ships.Distinct().Count(), ships.Count); + AssertPressesWalk(observer, order); + } + + // The pilot's instruments bound the pick at every range: undetected ships stand from a few units out to well + // past the farthest seen one, on every bearing, among the seen ships, so a press that offers undetected ships + // within any window of distance (or only once the zone is crowded) offers one here. Every press walks the + // detected order, and the reticle aimed straight at each hidden ship still takes a detected target. + [Fact] + public void ShipsTheObserverHasNotDetectedAreNeverPickedAtAnyDistance() + { + var at = float2(500, 0); + var (s, observer) = TargetScene(7, at); + foreach (var (distance, i) in new[] { 60f, 300f, 800f, 1300f, 2000f }.Select((d, i) => (d, i))) Sight(s, observer, Polar(at, distance, i * 1.3f + .4f)); + var hidden = new List<TargetRef>(); + for (var i = 0; i < 48; i++) + hidden.Add(Unseen(s, Polar(at, 2f * MathF.Pow(1.18f, i), i * 2.4f))); + var order = ByDistance(s, observer, 120f); + Assert.True(order.Count > 5 && order.Count(t => t.Entity != null) == 5, $"degenerate: {order.Count} candidates"); + Assert.All(hidden, h => Assert.DoesNotContain(h, order)); + var farthest = hidden.Max(h => length(h.Entity.Position.xz - at)); + Assert.True(farthest > 4000f && hidden.Count(h => length(h.Entity.Position.xz - at) is > 100f and < 2500f) > 10, "the hidden ships do not sweep the window"); + + AssertPressesWalk(observer, order); + foreach (var h in hidden) + { + var to = h.Entity.Position.xz - at; + observer.Aim = float3(to.x, 0, to.y); + observer.SetTarget(TargetRef.None); + Assert.True(observer.TargetUnderReticle()); + Assert.DoesNotContain(observer.Target.Value, hidden); + Assert.Contains(observer.Target.Value, order); + } + } } From 6c13605adba0f608d939455cdb8e9a1e42b6fa42 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 14:52:07 +0000 Subject: [PATCH 104/108] Docs: bring the new-run passages true to the scenarios menu New Game opens the scenario picker; RunSave.Replace swaps the saved run after staging; Galaxy.IsPrelude is the one tutorial owner; MIConvexHull and the IsTutorial static are gone; item streams are seeded from the galaxy seed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- docs/cultcache-migration-cut.md | 58 ++++++++++++++++--------------- docs/headless-playground-cut.md | 56 +++++++++++++++-------------- docs/item-provenance-cut.md | 16 +++++---- docs/item-provenance-substrate.md | 23 ++++++------ docs/merge-to-master-checklist.md | 2 +- docs/tutorial-script-sketch.md | 2 +- 6 files changed, 84 insertions(+), 73 deletions(-) diff --git a/docs/cultcache-migration-cut.md b/docs/cultcache-migration-cut.md index 967f4b6b7..f27bde97d 100644 --- a/docs/cultcache-migration-cut.md +++ b/docs/cultcache-migration-cut.md @@ -95,7 +95,7 @@ recorded, none blocking: `WeaponData.AmmoType` refs. - One cache holds all three stores for the process. - `RunSave` commits a save atomically with stable zone keys and clears the run - on New Game or death. + on death or victory (`RunSave.Replace` drops the old run once a new one has staged). - `SavedRun`, the msgpack settings and layout I/O, `.loadout`, `SaveState`, `SaveZone` and the importer are deleted. - **Loadouts are authored ship presets in the catalog.** This was reworked @@ -138,9 +138,6 @@ The first Soul pass found untested all-or-nothing, availability and price rules, weapon-group corruption, dictionary-ordered product choice, and a premature "done". All are fixed. -Recorded, not fixed: New Game clears the previous run before generation, as the -spec says, so a generation fault loses that run. - `GameData/PlayerSettings.msgpack` entered history through `5c5c3d5e`. It holds defaults and the username, and about 65 earlier versions are already in LFS history, so history is left alone. @@ -651,7 +648,9 @@ After Cut 10, every runtime write is a single-store `Commit` on one cache that holds catalog, run and player stores from first access: - `RunSave.Commit` saves the run at wormhole arrival and quit, with stable `SavedZone` keys. -- `RunSave.Clear` deletes every run record at New Game and at death. +- `RunSave.Clear` deletes every run record at death and victory (`ActionGameManager.EndRun`). +- `RunSave.Replace` swaps the saved run for a new one only after the new run has + staged; a start that fails leaves the saved run in place. - The settings getter creates `PlayerSettings` on first launch, and `SavePlayerSettings` commits it. - `Loadouts.Save` writes loadouts to the player store, and @@ -849,7 +848,7 @@ reads a global back (Q4). | Global | Store | Read by | Existence owned by | Missing at main menu | Missing at resume | Missing at new game | |---|---|---|---|---|---|---| | `PlayerSettings` | Player | `MainMenu` (name, tutorial flag), `ActionGameManager` (credits) | boot: `ActionGameManager.Awake` after `AetheriaStores.Open`, when `GetGlobal<PlayerSettings>()` is null, upserts one and flushes (Cut 10) | cannot happen after boot | same | same | -| `SavedGame` | Run | `MainMenu` (resume), `Galaxy(CultCache, SavedGame, ...)` | new game: `ActionGameManager.BeginRun()` creates the run store and writes it; `Die()` deletes the run store (Cut 10) | no run file: Resume hidden; run file without `SavedGame`: refuse to resume, log the key, New Game only | as main menu | new game deletes any run store first | +| `SavedGame` | Run | `MainMenu` (resume), `Galaxy(CultCache, SavedGame, ...)` | new run: `RunSave.Replace` writes the new run's records and removes the old run's once the scenario has staged; `EndRun` calls `RunSave.Clear` at death and victory | no run file: Continue disabled; run file without `SavedGame`: Continue disabled, log the key | as main menu | a new run keeps the saved run until it has staged | | catalog globals | Catalog | none exist | authored data; catalog is read-only | `AetheriaStores.Open` throws naming every `[CultGlobal]` type routed to the catalog with no record | same | same | **CultLib's role.** `[CultGlobal]` means exactly: at most one record of the @@ -1772,8 +1771,8 @@ Probes behind 8a (scratch copies; nothing committed): Math audit: - **Not used:** `float4x4`, `transpose`, `determinant`, `_11` names. The - `determinant` hits (`AetheriaMath.cs:98-112`, `NIH\MIConvexHull`) are locals - and comments; the `half` hits are locals. `float2x2`/`float3x3`, `int3`/`int4`, + `determinant` hits were locals and comments (in `AetheriaMath.cs` and the + vendored `NIH\MIConvexHull`, both since deleted); the `half` hits are locals. `float2x2`/`float3x3`, `int3`/`int4`, `double2`/`double3`, `quaternion.LookRotation`, `Random` and `snoise` all compile against CultMath. - **Accepted by Cut 6b:** `hash`, `normalize`, `Random`, `snoise` and NaN @@ -2596,28 +2595,31 @@ AetherDb and test edits made by Cut 9 (landed `70fbaca1`, recorded `e3af23fa`). - `SavedGame` global and `savedzone-{i}` records in `run.cc`. - `PlayerSettings` global in `player.cc`. - Orbit and body records in `run.cc`, written by zone generation and landed by the next save. - - **Run begins:** New Game calls `RunSave.Clear(CultCache)` as its first - statement (the `MainMenu.cs:110` handler), before the `Task.Run` at `:127` - or `:154`. - - Galaxy generation writes nothing. - - Zone generation (`PopulateLevel` `:615`, then `ZoneGenerator.cs:99, 108, - 200-201, 239, 253`) upserts orbits and bodies into the attached run store. - They stay staged until the next `RunSave.Commit`. + - **Run begins:** a scenario launch (`MainMenu.Launch`) generates the galaxy on a + background task and writes nothing to the run store. `StartGame` then calls + `StartScenario`, which runs arena generation, `PopulateLevel` and staging + inside `RunSave.Replace(CultCache, ...)`. The saved run's records are removed + only when staging succeeds; on failure the records the start wrote are removed + and the saved run stays. + - Zone generation (`PopulateLevel`, then `ZoneGenerator`) upserts orbits and + bodies into the attached run store. They stay staged until the next + `RunSave.Commit`, or are removed by `Replace` on a failed start. - **Run saves:** `ActionGameManager.SaveRun()`: - - It is `if (CurrentGalaxy != null) { var (game, zones) = RunSave.Capture(CultCache, CurrentGalaxy, Zone, DockedEntity ?? CurrentEntity, IsTutorial, _actionBarSlots.Select(s => s.Save()).ToArray()); RunSave.Commit(CultCache, game, zones); }`. + - It captures the live run (`RunSave.Capture`, which writes `SavedGame.IsTutorial` from `galaxy.IsPrelude`) and commits it with `RunSave.Commit` (`ActionGameManager.SaveRun`, `:284`). - Callers: wormhole arrival (`:605`) and `OnApplicationQuit() { SaveRun(); SavePlayerSettings(); }`. - - **Run ends:** `Die` replaces `SavePlayerSettings()` at `:1059` with - `RunSave.Clear(CultCache); SavePlayerSettings();`. - - `CurrentGalaxy` is already null (`:1058`), so a quit afterwards does not save a run. + - **Run ends:** `EndRun` (death and victory) nulls `CurrentGalaxy`, then calls + `RunSave.Clear(CultCache); SavePlayerSettings();` (`ActionGameManager.cs:1224-1232`). + - `CurrentGalaxy` is already null, so a quit afterwards does not save a run. - **Run exists:** derived only as `CultCache.GetGlobal<SavedGame>() != null`. - `MainMenu.ShowMain` enables Continue from it. Continue sets - `IsTutorial = saved.IsTutorial` and - `CurrentGalaxy = new Galaxy(CultCache, saved, Debug.Log)`. - - `StartGame` (`:695-741`) reads it once at the top: `null` takes the - new-run branch; otherwise it resumes from `CurrentZone`, - `CurrentZoneEntity` and `ActionBarBindings` (`:722, 723, 737`). + `CurrentGalaxy = new Galaxy(CultCache, saved, Debug.Log)`, whose `IsPrelude` + comes from `saved.IsTutorial`. + - `StartGame` (`ActionGameManager.cs:820`) branches on `PendingScenario`: set + means a new run (`StartScenario`); otherwise it resumes from `CurrentZone`, + `CurrentZoneEntity` and `ActionBarBindings` of the saved run. - A run store that holds records but no `SavedGame` logs - `run store has no SavedGame; Continue disabled`. New Game clears it. + `run store has no SavedGame; Continue disabled`. The next scenario launch + replaces those records once it has staged. - **Player settings:** - The `ActionGameManager.PlayerSettings` getter returns `CultCache.GetGlobal<PlayerSettings>()`. - When that is absent (first launch), the getter commits @@ -2651,7 +2653,7 @@ AetherDb and test edits made by Cut 9 (landed `70fbaca1`, recorded `e3af23fa`). - The cache never creates either. `AetheriaStores.Open` keeps its missing-global check catalog-only (`AetheriaStores.cs:24-29`). - **Derived state:** - "Run exists" is derived from the `SavedGame` global. - - `IsTutorial` is set from it on Continue and written back by `Capture`. + - `Galaxy.IsPrelude` is set from `SavedGame.IsTutorial` on Continue; `Capture` writes it back from `galaxy.IsPrelude`. No static copy exists. - `PlayerSettings.SavedRun` is deleted, not demoted. - **Forbidden writers:** - `File.*` I/O for game state anywhere in `Assets\Scripts`. @@ -2660,10 +2662,10 @@ AetherDb and test edits made by Cut 9 (landed `70fbaca1`, recorded `e3af23fa`). - A second `AetheriaStores.Open` in `Assets\Scripts`. - Any upsert of `SavedGame` or `SavedZone` outside `RunSave.Commit`. - **Shared paths:** - - Normal and tutorial New Game both call `Clear`. + - Every scenario launch goes through `RunSave.Replace`. - Continue and a new run's `StartGame` read the same global. - Wormhole and quit call `SaveRun`. - - Death calls `Clear`. + - Death and victory call `Clear` through `EndRun`. - **Deletion line:** `SavedRun`, `SaveState`, the msgpack settings and layout I/O, `SaveLoadout`, `SaveZone` and the `SavedGame` constructor go before `RunSave` lands. diff --git a/docs/headless-playground-cut.md b/docs/headless-playground-cut.md index bea30aa46..51c3f1bb5 100644 --- a/docs/headless-playground-cut.md +++ b/docs/headless-playground-cut.md @@ -10,6 +10,13 @@ probe was built with `--artifacts-path` in scratch, so this tree got no `bin`/`o writes. CultLib was a temporary detached worktree at `a0813c6`, since removed. The probe source is not kept; §2.8 records what it did. +Since this map, the new-run path moved: `MainMenu.Launch` starts a `Scenario` and +`ActionGameManager.StartScenario` replaces the saved run through `RunSave.Replace` +after `RunStart` stages it (`docs/scenarios-cut.md` R.9); the `IsTutorial` static is +gone (`Galaxy.IsPrelude` is the one owner) and `ItemManager` takes its seed in its +constructor. Passages below that name the old `MainMenu` new-game anchors or those +statics are rewritten to that path; the `Run` owner itself is still unbuilt. + ## 0. Target Operator, 2026-09-17: player inputs "map directly to the same entity inputs the AI @@ -107,11 +114,11 @@ All of this is Unity code: | Concern | Anchor | Unity dependencies | |---|---|---| | Store composition | `ActionGameManager.cs:43-63` (static, `Application.dataPath`) | path only | -| Handoff across scene load | statics `CurrentGalaxy`, `IsTutorial` (`:96-97`), written by `MainMenu.cs:104-105,126,138,152,166`, read by `SectorMap.cs:114-310` | `SceneManager.LoadScene` (`MainMenu.cs:106,139,167`) | -| New game: clear | `MainMenu.cs:112` | none | -| New game: galaxy | `MainMenu.cs:125,148` (`UnityEngine.Random.value` background noise), `:127-141,153-169` (`Task.Run`, then `Observable.NextFrame`) | Random, UniRx main-thread scheduler | -| ItemManager | `ActionGameManager.cs:264`; RNG clock-seeded at `ItemManager.cs:20` | `Debug.Log` | -| Start / Continue | `StartGame` `:725-770`: spawn player ship `:733-744`; Continue resolves the docked child `:751-762`; action bar restore `:764-767` | renderer binding, `SectorMap` reveal | +| Handoff across scene load | statics `CurrentGalaxy` and `PendingScenario` (`ActionGameManager.cs:108,113`), written by `MainMenu.Launch` and Continue, read by `SectorMap` | `SceneManager.LoadScene` (`MainMenu.EnterGame`, `MainMenu.cs:287`) | +| New game: replace | `ActionGameManager.StartScenario` (`:855-876`): `RunSave.Replace` drops the saved run only after the scenario stages; `MainMenu` clears nothing | none | +| New game: galaxy | `MainMenu.Launch` builds a `GalaxyStage` and runs `Task.Run(() => RunStart.Generate(scenario, stage))`, then `Observable.NextFrame`; background noise and galaxy draw from `GalaxyStage.Seed`, not `UnityEngine.Random` | UniRx main-thread scheduler | +| ItemManager | `ActionGameManager.cs:309`; seed is a constructor argument, `RunStart.ItemSeed(galaxy, step)` (`RunStart.cs:99`), reseeded by `RunStart.SeedItems` | `Debug.Log` | +| Start / Continue | `StartGame` (`:820`): `PendingScenario` set runs `StartScenario` (new run, player staged by `RunStart.Stage`); otherwise Continue resolves the saved zone and docked child and restores the action bar | renderer binding, `SectorMap` reveal | | Zone entry | `PopulateLevel` `:639-675`: generate/unpack `:643-654`; move pilot `:659-666` | `ZoneRenderer.LoadZone`, `Debug.Log` | | Wormhole placement (a game rule) | `ZoneRenderer.cs:222-231` (`dir * Pack.Radius * GameSettings.WormholeDistanceRatio`) | lives in a MonoBehaviour | | Warp | detect `ActionGameManager.cs:312-316`; `EnterWormhole` `:615-637`, which saves on arrival (`:635`) | `ZoneRenderer.WormholeInstances` as the wormhole list | @@ -146,7 +153,7 @@ All of this is Unity code: (`GameSettings.cs:17`, authored `LonginusX`) and `WormholeDistanceRatio` (`:23`, authored 0.75). - Randomness: - - `ItemManager.Random` is clock-seeded (`ItemManager.cs:20`). + - `ItemManager.Random` is seeded by the constructor argument (`ItemManager.cs:35`); a new run's seed is `RunStart.ItemSeed(galaxy, step)`, from `Galaxy.Seed`. - `Galaxy` is clock-seeded only when `seed == 0` (`Galaxy.cs:108,158`). - `Zone` seeds from the zone name (`Zone.cs:54`). - `Zone.Update` runs belt updates on `Task.Run` (`Zone.cs:144`). It is still @@ -243,7 +250,7 @@ Continue and death. There is one instance per run. It holds no Unity type. - `GameplaySettings`, `ZoneGenerationSettings`, `PlanetSettings`; - a `uint seed` for `ItemManager`; - `Action<string> log`; - - for a new run, a caller-built `Galaxy` and `isTutorial`; + - for a new run, a caller-built `Galaxy` (`Galaxy.IsPrelude` says whether it is the prelude) and the staged start (`RunStart.Stage`); - `dt` per step; - commands from either lowering; - `SavedActionBarBinding[]` at save, owned by the Unity action bar (the playground @@ -305,10 +312,8 @@ Continue and death. There is one instance per run. It holds no Unity type. - `ActionGameManager`: bodies of `SaveRun`, `EnterWormhole`, `PopulateLevel`'s simulation half, `StartGame`, `Dock`, `DoDock`'s state half, `Undock`'s checks, `TowShip`, `Die`'s clear, and `IntroCutscene` (entirely); - - statics `CurrentGalaxy` and `IsTutorial`; - - `MainMenu.cs:104-105,112`; - - `ZoneRenderer.cs:222-231`'s wormhole construction; - - `ItemManager.cs:20`'s clock seed. + - statics `CurrentGalaxy` and `PendingScenario`; + - `ZoneRenderer.cs:222-231`'s wormhole construction. All of these go in the same cut that adds `Run`. None survives as a fallback. @@ -318,12 +323,12 @@ Unity dependencies, each injected or cut: |---|---|---| | `Time.deltaTime` | `:1218` | injected: `Run.Step(float dt)` | | `Time.time` | `IntroCutscene`, `Die` post-fx | cutscene deleted; post-fx stays in Unity, on `Died` | -| `UnityEngine.Random` | `MainMenu.cs:125,148` (background noise), `EntityInstance.cs:413-428` (loot) | noise stays in the menu as a galaxy-generation input; loot roll moves to `Zone` on `ItemManager.Random` (Cut 2); effect spread jitter (`ProjectileManager.cs:20-26`) stays visual | -| Clock RNG | `ItemManager.cs:20` | cut; the seed is a constructor argument, and Unity passes a clock-derived one | +| `UnityEngine.Random` | `EntityInstance.cs:413-428` (loot) | galaxy noise already draws from `GalaxyStage.Seed`; loot roll moves to `Zone` on `ItemManager.Random` (Cut 2); effect spread jitter (`ProjectileManager.cs:20-26`) stays visual | +| Clock RNG | `Scenario.Seed` of 0 (`GalaxyStage.SeedFrom`) | the clock seeds only the galaxy seed; every item stream derives from it through `RunStart.ItemSeed` | | Coroutines | `IntroCutscene` | deleted (dead) | | UniRx | `Observable.NextFrame` in the menu, `EveryUpdate` in `Die` | stay in Unity; `Run` uses C# events, and `Entity.Death` (UniRx, headless-compiled) is what `Run` subscribes to | | `Debug.Log` | `:264`, `:657`, `MainMenu` | injected `Action<string>` | -| Scene load | `MainMenu` | stays; the handoff static becomes `ActionGameManager.NewRun : (Galaxy, bool)?`, command-only, consumed once in `Start`; null means Continue | +| Scene load | `MainMenu` | stays; the handoff static is `ActionGameManager.PendingScenario`, command-only, consumed once by `StartGame`; null means Continue | | MonoBehaviour state | `_currentEntity`, `DockedEntity`, `DockingBay`, `TowingStation`, `Zone`, `ItemManager` | projections of `Run` | | Barrel transforms | `EntityInstance.cs:516` -> `HardpointTransforms` | `HardpointTransforms` deleted (Cut 2); the arc is item rotation plus `FiringArc` (fork A); barrels and `ArticulationPoint` are presentation only, `GetBarrel` | | `Physics.*` hit queries | `Projectile`, `GuidedProjectile`, `Laser`, `Lightning`, `HullCollider` subjects | deleted from damage paths; `FireControl` rolls (Cut 2) | @@ -374,7 +379,7 @@ This is subtraction first, then one new file. - Deletes and moves: - `ActionGameManager.cs`: - `IntroCutscene` `:772-799` (dead). - - Statics `CurrentGalaxy` and `IsTutorial` (`:96-97`). + - Statics `CurrentGalaxy` and `PendingScenario` (`:108,113`). - `SaveRun` body `:243-248` becomes `Run?.Save(actionBar)`. Quit (`:236`) calls it. - `EnterWormhole` `:615-637` and the detect loop `:312-316` become `Run.TryEnterWormhole()`. `WarpArrived` drives `SectorMap.QueueZoneReveal`. @@ -393,14 +398,13 @@ This is subtraction first, then one new file. `Run.Died`. - `:264` constructs no `ItemManager`. - `Update` `:1218` becomes `Run.Step(Time.deltaTime)`. - - `MainMenu.cs`: - - Continue (`:102-107`) sets `ActionGameManager.NewRun = null` and loads the scene. - - New Game drops `:112` and sets `NewRun = (sector, tutorial)` at `:138,166`. + - `MainMenu`: already built. Continue (`ShowMain`) loads the scene with no + `PendingScenario`; `MainMenu.Launch` sets `PendingScenario` and clears nothing. - `SectorMap.cs:114-310` reads `ActionGameManager.Instance.Run.Galaxy`. - `InventoryPanel.cs:117-118` becomes `GameManager.Run.Board(ship)`. - `ZoneRenderer.cs:222-231` iterates `zone.Wormholes`. - - `ItemManager.cs:20`: the seed becomes a constructor argument. Call sites: 11 in - tests, 1 in `AetherDb`, and `Run`. + - `ItemManager`: the seed is already a constructor argument (`ItemManager.cs:35`); + `Run` supplies `RunStart.ItemSeed(galaxy, step)`. - Settings (fork S (a)): - `StartingHullName` and `WormholeDistanceRatio` move from `GameSettings.cs:17,23` to `GameplaySettings` (`Settings.cs:155`). @@ -412,8 +416,8 @@ This is subtraction first, then one new file. `GalaxyZone.AdjacentZones` with the rule from `ZoneRenderer.cs:226-230`. Null galaxy zone gives an empty array. - New `Run.cs`: types and rules, no bodies here. - - `static Run New(CultCache, GameplaySettings, ZoneGenerationSettings, PlanetSettings, Galaxy, bool isTutorial, uint seed, Action<string> log)` - 1. `RunSave.Clear`. + - `static Run New(CultCache, GameplaySettings, ZoneGenerationSettings, PlanetSettings, Galaxy, Scenario, Action<string> log)` + 1. `RunSave.Replace` around steps 2-5 (the saved run goes only once the scenario has staged). 2. `ItemManager` over `RunSave.Lots`, seeded. 3. `EnterZone(Entrance)`. 4. Spawn the player ship per `:734-743`. @@ -446,7 +450,7 @@ This is subtraction first, then one new file. child; updates `Bay.DockedShip`. - `void Tow()`: the rule from `:891-911`. - `void Save(SavedActionBarBinding[] actionBar)` - - `RunSave.Capture(cache, Galaxy, Zone, Station ?? Pilot, isTutorial, actionBar)`, + - `RunSave.Capture(cache, Galaxy, Zone, Station ?? Pilot, actionBar, credits)`, then `Commit(…, ItemManager.Lots)`. - No-op when `Ended`. - Remembers `actionBar` for warp saves. @@ -461,7 +465,7 @@ This is subtraction first, then one new file. | Test | Asserts | Mutation that must kill it | |---|---|---| -| `NewRunSpawnsPilotInEntrance` | pilot is a `Ship` with `IsPlayerShip`, in `Zone.Entities`, `Zone.GalaxyZone == Galaxy.Entrance`; the run store is cleared of a prior `SavedGame` | `New` skips `RunSave.Clear`; spawn omits `Zones.Entities.Add` | +| `NewRunSpawnsPilotInEntrance` | pilot is a `Ship` with `IsPlayerShip`, in `Zone.Entities`, `Zone.GalaxyZone == Galaxy.Entrance`; the run store holds no prior `SavedGame` once the run has staged | `New` skips `RunSave.Replace`; spawn omits `Zones.Entities.Add` | | `WarpMovesPilotAndSaves` | stepping after `TryEnterWormhole` lands the pilot in the target zone, out of the old zone's entities, with `SavedGame.CurrentZone` equal to the target index after reopen | arrival skips `Save`; `EnterZone` leaves the pilot in the old zone | | `ContinueLandsDocked` | save while docked, reopen, `Continue`: `Station` is the saved orbital, `Pilot` is its player child | `Land` binds to the orbital itself | | `DeathEndsAndClears` | hull death clears every run record; `Step` throws; `Save` writes nothing | `Died` handler omits `Clear`; `Ended` not set | @@ -473,7 +477,7 @@ This is subtraction first, then one new file. - Unity batchmode has no `error CS`. - Negative greps: - `rg -n "RunSave\.(Clear|Commit|Capture)" Assets/Scripts --glob '!ServerShared/**'` is empty. - - `rg -n "CurrentGalaxy|IsTutorial\s*=" Assets/Scripts` is empty. + - `rg -n "CurrentGalaxy|PendingScenario" Assets/Scripts` matches only the `Run` lowering in `ActionGameManager` and `MainMenu`. - `rg -n "new Wormhole" Assets/Scripts` matches only `Zone.cs`. - `rg -n "new ItemManager\(" Assets/Scripts` matches only `Run.cs`. - `rg -n "ZoneGenerator\.GenerateZone|new Zone\(" Assets/Scripts --glob '!ServerShared/**'` is empty. @@ -1161,7 +1165,7 @@ Options as mapped before the ruling: - **Recommend (a).** **N. Is the scene handoff static acceptable?** Low-blocking. -- (a) `ActionGameManager.NewRun : (Galaxy, bool)?`, consumed once by `Start`. +- (a) `ActionGameManager.PendingScenario : Scenario`, consumed once by `StartGame` (built this way). - (b) `MainMenu` builds the whole `Run` on its generation thread. That moves zone generation's run-store upserts off the main thread, and the `CultCache` threading contract is not checked here. diff --git a/docs/item-provenance-cut.md b/docs/item-provenance-cut.md index 473ec76c2..a0ccd947f 100644 --- a/docs/item-provenance-cut.md +++ b/docs/item-provenance-cut.md @@ -166,9 +166,9 @@ Contradictions and corrections found in the Body: `LoadoutTests` fixture is not: `FirstAvailableProductInKeyOrderBuildsTheSlot` (`LoadoutTests.cs:289-312`) adds two same-maker Lamp products and reads `.Product`. 6. **`ItemManager` lives one scene load, and every run starts with a scene load.** It is - constructed in `ActionGameManager.Start` (`:264`). There is one scene, `ARPG`. New Game - and Continue both end in `SceneManager.LoadScene("ARPG")` (`MainMenu.cs:106,139,167`), and - no `DontDestroyOnLoad` exists. So a ledger held by `ItemManager` spans exactly one run. + constructed in `ActionGameManager.Start` (`:309`). There is one scene, `ARPG`. A scenario + launch and Continue both end in `SceneManager.LoadScene("ARPG")` (`MainMenu.EnterGame`, + `:287`), and no `DontDestroyOnLoad` guards the `ItemManager`. So a ledger held by `ItemManager` spans exactly one run. 7. **Aside, not this cut:** `CreateInstance(CraftedItemData, float)` mints a `CompoundCommodity` for a `ConsumableItemData` design (`ItemManager.cs:136-141`), while `TryActivateConsumable` casts to `ConsumableItem` (`Entity.cs:336`). This map keeps @@ -252,9 +252,11 @@ Not probed: CultCache Studio's rendering of the ledger (operator check); Unity c `ZoneGenerator`'s staged-upsert pattern (`ZoneGenerator.cs:99-108`) is not used for lots: the ledger is live simulation state, captured at commit like entities. - Lifecycle: the run begins with a scene load (§1.6), whose `Start` reads - `RunSave.Lots(CultCache)`. New Game has already cleared the run store (`MainMenu.cs:112`), - so it gets an empty ledger. Continue gets the stored one. Death clears the run store - (`ActionGameManager.cs:1090`); the next run reloads the scene. + `RunSave.Lots(CultCache)`. A scenario launch has `PendingScenario` set, so `Start` builds an + empty `ProvenanceLedger` instead (`ActionGameManager.cs:312`); the saved run's records stay + in the store until `RunSave.Replace` drops them once the new run has staged + (`SavedGame.cs:247`). Continue reads the stored ledger. Death and victory end in `EndRun`, + which calls `RunSave.Clear` (`ActionGameManager.cs:1224-1231`); the next run reloads the scene. **Branding.** - Owner: `ItemManager.Brand(CraftedItemInstance)` -> `(Faction Maker, FactionProductData Product)`. @@ -526,7 +528,7 @@ Subtraction, plus a data rewrite. worktrees. Operator-only checks after Cut C: -- New Game and fly through one zone. The starting ship's items show tier colour, and the +- New Game, pick a scenario, and fly through one zone. The starting ship's items show tier colour, and the properties panel shows Manufacturer, product name and flavour text for branded gear. - Dock and buy an item: its brand still shows in your cargo. - Kill an NPC and pick up loot: brand shown. diff --git a/docs/item-provenance-substrate.md b/docs/item-provenance-substrate.md index 0bc310942..956d79138 100644 --- a/docs/item-provenance-substrate.md +++ b/docs/item-provenance-substrate.md @@ -68,8 +68,7 @@ catalog, built a 196-zone sector galaxy from the authored `Settings.asset`, and `47189c8a`). The commented `HaulingControllerData` union (`Behaviors.cs:179`) is the same kind of residue. - **No recipe, blueprint or ingredient model exists.** "Factory", "fabricat", - "assembler", "blueprint", "recipe" and "refiner" appear in no live C# outside - `NIH/MIConvexHull`. + "assembler", "blueprint", "recipe" and "refiner" appear in no live C#. `ItemData.Manufacturer` readers: `PropertiesPanel.cs:371-372` (shows "Manufacturer", falling back to "GameCult"), `tools/AetherDb/Program.cs:54` (census), and the @@ -83,7 +82,7 @@ All crafted instances come from three `ItemManager` overloads: - `CreateInstance(CraftedItemData, float quality)` (`ItemManager.cs:126-142`) sets Quality and Durability, with no product and no ingredients. - `CreateInstance(CraftedItemData)` (`:144-160`) rolls a rarity tier with the - **time-seeded** `ItemManager.Random` (`:20`) and stores the tier's *discrete* + `ItemManager.Random` (`:22`; seeded per run from the galaxy seed by `RunStart.ItemSeed`) and stores the tier's *discrete* Quality. - `CreateInstance(FactionProductData)` (`:164-187`) calls the previous overload, sets `Product`, and draws a gaussian `RoleFill` per design role. Since no role is @@ -130,9 +129,12 @@ unexecuted stubs. `TradeMenu.Inventory = entity.CargoBays.First()` (`ActionGameManager.cs:827-829`). - **Zones generate lazily on first entry** (`ActionGameManager.cs:643-652`, `PackedContents ??=`) from a deterministic zone seed - (`ZoneGenerator.cs:47`: name hash xor position hash). Item *selection* follows that - seed, but item *quality* comes from the time-seeded `ItemManager.Random`. A zone is - never regenerated within a run. New Game clears the run store (`MainMenu.cs:111`). + (`ZoneGenerator.cs:52`: name hash xor position hash). Item *selection* follows that + seed, but item *quality* comes from `ItemManager.Random`, a stream seeded per run from + the galaxy seed (`RunStart.SeedItems`, steps `ArenaStep`, `StageStep`, `ContinueStep`) + and drawn in the order zones are entered. A zone is never regenerated within a run. A + new run does not clear the run store up front: `RunSave.Replace` drops the old run's + records once the new run has staged (`SavedGame.cs:247`). - Each station carries hull, hardpoint gear, one docking bay, cargo bay, capacitor and stock, all embedded by value. No station equips a factory; none can, because factory designs have no product (§1). @@ -150,8 +152,9 @@ unexecuted stubs. `FactionProductData`, `PersonalityAttribute`, `NameFile`, `InputLayout`, `Loadout`. - Run (`:10`): `OrbitData`, `BodyData`, `SavedZone`, `SavedGame`. Written only by `RunSave.Commit`, which does one commit, keys zones `savedzone-{i}` and removes stale - zones (`SavedGame.cs:96-111`). `RunSave.Clear` removes every run-typed record - (`:114-124`). The single-file store writes its whole view on commit. + zones (`SavedGame.cs:216`). `RunSave.Clear` removes every run-typed + record (`:242`); `RunSave.Replace` (`:247`) does the same for a new run, but only once + the new run has staged. The single-file store writes its whole view on commit. - Player (`:11`): `PlayerSettings`. - **Every item instance is a value** embedded in `EntityPack` (hull, equipment, bays, cargo contents; `EntitySerializer.cs:179-196`), inside `SavedZone.Contents`. No @@ -237,7 +240,7 @@ Every stat and wear reader goes through the instance: "F" marks a fork (§9). "D" marks a recorded default. -| Kind | Named by | Mint | Transfer / loot / sell | Consume | Zone unload / save | New Game / death | Decides | +| Kind | Named by | Mint | Transfer / loot / sell | Consume | Zone unload / save | New run / death | Decides | |---|---|---|---|---|---|---|---| | **Lot** (provenance node) | run-scoped `LotId` (F1) | synthesis, at the mint site's call (F3) | never moves; instances point at it (D) | synthesized inputs are consumed at synthesis and have no instance (D) | kept while reachable from any instance, route or station; GC on `RunSave.Commit` (D, from the orphan-SavedZone scar) | cleared with the run store (D) | the synthesizer, one function in `ServerShared` | | **Lot properties** (mocked quality per role) | on the lot (F4) | rolled once at synthesis from factory quality and input qualities, seeded by lot id (F4) | immutable | n/a | with the lot | with the lot | synthesizer; stat readers only read | @@ -301,7 +304,7 @@ synthesized?** Blocks station identity, routes, stock and loot provenance. pirated freighter's cargo should come from a station the player can fly to. The skeleton is about 200 stations, small next to 16k instances. It demotes `ZoneGenerator`'s station count and faction choice to reading the roster. It also - moves item quality from the time-seeded `ItemManager.Random` to seeded synthesis, + moves item quality from the per-run `ItemManager.Random` stream, which depends on the order zones are entered, to lot-seeded synthesis, which makes the chain regenerable. - Sub-default: stations keep no identity outside a run. Zones never regenerate within one. diff --git a/docs/merge-to-master-checklist.md b/docs/merge-to-master-checklist.md index d5d70e17b..270b5625b 100644 --- a/docs/merge-to-master-checklist.md +++ b/docs/merge-to-master-checklist.md @@ -33,7 +33,7 @@ Compiled 2026-09-29 by Eyes from the maps on the branch. Pointers are `doc:line` ### 2b. Fresh launch (no `run.cc`, no `player.cc`) 3. **Launch to main menu.** Expect no Addressables errors, and the Groups window shows `Assets/Content` under `Default Local Group` (`addressables-cut.md:301`). `player.cc` appears and Continue is disabled (`cultcache-migration-cut.md:2746`). Proves: Addressables Cut 1, CultCache cutover. The 09-17 smoke covered the last two on the old tree; this is a cheap recheck on the new schema. -4. **New Game (tutorial).** Expect the galaxy generates and the start ship is the Longinus (`settings-globals-cut.md:498`, an expectation, not a recorded check for this stack). Expect a Zenith station with a docking bay in the entrance zone every time (`locomotion-cut.md:375`). Proves: locomotion Cut 1 station rule. +4. **New Game, then a scenario.** New Game opens the scenario picker (`MainMenu.ShowScenarios`); a development build lists modes (Terminus (Demo)), development (Tutorial Galaxy, Main Galaxy) and test arenas, a release build lists only the modes. Pick Tutorial Galaxy or Terminus (Demo). Expect the galaxy generates and the start ship is the Longinus (`settings-globals-cut.md:498`, an expectation, not a recorded check for this stack). Expect a Zenith station with a docking bay in the entrance zone every time (`locomotion-cut.md:375`). Proves: locomotion Cut 1 station rule. 5. **Addressables, "Use Asset Database".** Ships, turret and Zenith spawn; thruster and aether-drive particles show; fire an instant weapon (Autocannon) and a charged one (ChargeBlast SG); action bar icons show (`addressables-cut.md:362-366`). Proves: Addressables Cut 2. ### 2c. Flight, power and economy diff --git a/docs/tutorial-script-sketch.md b/docs/tutorial-script-sketch.md index 7e9233988..3fcbbebb6 100644 --- a/docs/tutorial-script-sketch.md +++ b/docs/tutorial-script-sketch.md @@ -16,7 +16,7 @@ Status: sketch for the operator to react to. Nothing here is built or canon. ## Shape -One contained tutorial run in a small prelude galaxy (`IsTutorial`, +One contained tutorial run in a small prelude galaxy (`Galaxy.IsPrelude`, `TutorialGenerationSettings`). The player is a newly incorporated subsidiary of the protagonist faction. Threefra, a debt-born assessor with opinions, walks them through a "qualification module" whose checklist is theatre. The real test is how the player From 4a3e5394ebf846686595424525143bfd9920103e Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 14:59:48 +0000 Subject: [PATCH 105/108] Pin mining ship order out to 8000 units and the hidden-ship pick in a crowded zone Closes the far-window edges the 141162998 pins left: ships out to 7990 units admitted farthest first, and a zone of 100+ entities with undetected ships out to 8000. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../MiningTargetQueriesTests.cs | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/Aetheria.Shared.Tests/MiningTargetQueriesTests.cs b/tests/Aetheria.Shared.Tests/MiningTargetQueriesTests.cs index 9cd8ec025..e492b5835 100644 --- a/tests/Aetheria.Shared.Tests/MiningTargetQueriesTests.cs +++ b/tests/Aetheria.Shared.Tests/MiningTargetQueriesTests.cs @@ -624,4 +624,52 @@ public sealed partial class MiningCut3Tests Assert.Contains(observer.Target.Value, order); } } + + // The distance key stays the distance far beyond the clamps a fixture reaching 4000 can see: ships stand out to + // 8000 units, several within any one quantum or round-number cap (4600 and 4900, 5200 and 5300, 7960, 7975 and 7990), + // and are admitted farthest first, so zone order is the exact reverse of distance order and any tie (a clamp, a + // coarse bucket, a cap on either key) shows as a swapped pair. + [Fact] + public void ShipsOutToEightThousandUnitsAreOrderedByDistanceBothWaysWhenAdmittedFarthestFirst() + { + var at = float2(500, 0); + var (s, observer) = TargetScene(7, at); + var distances = new[] { 7990f, 7975f, 7960f, 7900f, 7000f, 6100f, 5300f, 5200f, 4900f, 4600f, 4000f, 3600f, 3100f, 2900f, 1500f, 700f }; + for (var i = 0; i < distances.Length; i++) Sight(s, observer, Polar(at, distances[i], i * 1.9f)); + var order = ByDistance(s, observer, 120f); + Assert.True(order.Count(t => t.Chunk.HasValue) >= 8 && order.Count(t => t.Entity != null) == distances.Length, $"degenerate: {order.Count} candidates"); + var ships = order.Where(t => t.Entity != null).Select(t => length(t.Entity.Position.xz - at)).ToList(); + Assert.Equal(ships.OrderBy(d => d).ToList(), ships); + Assert.Equal(ships.Distinct().Count(), ships.Count); + Assert.True(ships.Last() > 7900f); + AssertPressesWalk(observer, order); + } + + // The same pins in a crowded zone: far more than 60 entities stand in it, ships the observer has not detected + // among them out to 8000 units, so a leak or a bent key gated on the zone's size shows here. + [Fact] + public void ShipsTheObserverHasNotDetectedAreNeverPickedInACrowdedZone() + { + var at = float2(500, 0); + var (s, observer) = TargetScene(7, at); + var seen = new[] { 6200f, 4700f, 2500f, 900f, 120f, 5400f }; + for (var i = 0; i < seen.Length; i++) Sight(s, observer, Polar(at, seen[i], i * 1.3f + .4f)); + var hidden = new List<TargetRef>(); + for (var i = 0; i < 110; i++) + hidden.Add(Unseen(s, Polar(at, 3f * MathF.Pow(1.0885f, i), i * 2.4f))); + var order = ByDistance(s, observer, 120f); + Assert.True(s.Zone.Entities.Count > 100, $"zone holds {s.Zone.Entities.Count}"); + Assert.True(order.Count > seen.Length && order.Count(t => t.Entity != null) == seen.Length, $"degenerate: {order.Count} candidates"); + Assert.All(hidden, h => Assert.DoesNotContain(h, order)); + Assert.True(hidden.Max(h => length(h.Entity.Position.xz - at)) > 7500f, "the hidden ships do not reach the far window"); + AssertPressesWalk(observer, order); + foreach (var h in hidden.Where((_, i) => i % 3 == 0)) + { + var to = h.Entity.Position.xz - at; + observer.Aim = float3(to.x, 0, to.y); + observer.SetTarget(TargetRef.None); + Assert.True(observer.TargetUnderReticle()); + Assert.DoesNotContain(observer.Target.Value, hidden); + } + } } From 255af22ac871ba021f4e299ac167f188e15f7214 Mon Sep 17 00:00:00 2001 From: Nibu <nibu@minds.nibu.gamecult.org> Date: Fri, 13 Nov 2026 15:30:04 +0000 Subject: [PATCH 106/108] Docs: close the stale new-game leftovers Bring settings-globals, mining, prior-art, headless probe record and the release map true to the scenarios menu and current seeding. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- docs/aetheria-release-map.md | 1 - docs/headless-playground-cut.md | 19 ++++++++++--------- docs/mining-cut.md | 2 +- ...rategic-ai-arena-living-world-prior-art.md | 3 ++- docs/settings-globals-cut.md | 5 +++-- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/docs/aetheria-release-map.md b/docs/aetheria-release-map.md index c270c297c..83892fc69 100644 --- a/docs/aetheria-release-map.md +++ b/docs/aetheria-release-map.md @@ -504,7 +504,6 @@ record. | follow-up | `ambiguous-hardpoint-origin` | demo | Save correctness for package hulls. | | follow-up | `delaunay-exact-predicates` | demo | Galaxy links; a silently unlinked zone could strand a demo run. | | follow-up | `failed-start-scene-halts` | demo | The New Game failure path the demo's missing-cast refusal uses. | -| follow-up | `stale-docs-after-scenarios-menu` | demo | Docs that describe the old New Game path. | | follow-up | `scratch-carry-drafts` | demo | The ship `.cc` draft bears on `demo-ship-cc-timing`. | | follow-up | `faction-lore-notes-r3` | full game | Vault setting notes; no demo cut reads them. | | follow-up | `mining-impacts-through-contract` | full game | Mining Cut 4 is parked. | diff --git a/docs/headless-playground-cut.md b/docs/headless-playground-cut.md index 51c3f1bb5..d6ca6104a 100644 --- a/docs/headless-playground-cut.md +++ b/docs/headless-playground-cut.md @@ -127,10 +127,11 @@ All of this is Unity code: | Save | `SaveRun` `:241-249`, called at quit `:236` and warp `:635` | action-bar slots (`:246`) | | Death | `BindToEntity` subscribes `Death` -> `Die` (`:1053`); `Die` `:1080-1115` clears the run (`:1088`) | `Time.time`, `Observable.EveryUpdate` post-fx | | Tick | `Update` `:1151-1220`: input `:1189-1216`, then `Zone.Update(Time.deltaTime)` `:1218` | `Time.deltaTime`, pause flag | -| Dead code | `IntroCutscene` `:772-799`; its only call is commented out (`:760`) | coroutine, `Time.time` | ### 2.2 Already headless +- Past probe: the measurements below were taken at an earlier commit and their line anchors + are not maintained; re-run the probe before relying on a number or an anchor. - `Aetheria.Shared/Aetheria.Shared.csproj` compiles `Assets/Scripts/ServerShared/**` plus UniRx (`UniRxLibrary`) and Ink with no Unity defines. It is the Unity-independence check. @@ -141,23 +142,23 @@ All of this is Unity code: - a player `LonginusX` spawned through `LoadoutGenerator`; - thrust by hand-set `MovementDirection` reached 142 m/s in 5 s; - a `Minion` patrol moved the player ship 642 units in 10 s; - - `TryDock` and `TryUndock` succeeded (`Entity.cs:721-755`); - - `Ship.EnterWormhole` followed by stepping fired `OnEnteredWormhole` (`Ship.cs:82-90,372`); - - `Death` fired on hull damage (`Entity.cs:277-280`); + - `TryDock` and `TryUndock` succeeded; + - `Ship.EnterWormhole` followed by stepping fired `OnEnteredWormhole`; + - `Death` fired on hull damage; - `RunSave.Capture` and `RunSave.Commit` wrote a 489 KB `run.cc`. - Settings: `GameSettings` is a ScriptableObject (`GameSettings.cs:11`) holding ServerShared classes. - `tools/AetherDb/AuthoredSettings.cs` reads them from the asset YAML. The probe placed every field (0 unplaced). - Two lifecycle inputs are Unity-only `GameSettings` fields: `StartingHullName` - (`GameSettings.cs:17`, authored `LonginusX`) and `WormholeDistanceRatio` (`:23`, + (`GameSettings.cs:13`, authored `Longinus`) and `WormholeDistanceRatio` (`:16`, authored 0.75). - Randomness: - `ItemManager.Random` is seeded by the constructor argument (`ItemManager.cs:35`); a new run's seed is `RunStart.ItemSeed(galaxy, step)`, from `Galaxy.Seed`. - - `Galaxy` is clock-seeded only when `seed == 0` (`Galaxy.cs:108,158`). - - `Zone` seeds from the zone name (`Zone.cs:54`). - - `Zone.Update` runs belt updates on `Task.Run` (`Zone.cs:144`). It is still - deterministic (probe: identical traces). + - `Galaxy` takes its seed from the run (`Galaxy.cs:119`); a zero seed throws. + - `Zone` seeds from the zone name: `CombatSeed` (`Zone.cs:162`), with `DropSeed` mixing in the run's seed (`:163`). + - Probe: `Zone.Update` was deterministic (identical traces) when belt updates ran on `Task.Run`; + no `Task.Run` remains in `Zone.cs`. ### 2.3 Agents diff --git a/docs/mining-cut.md b/docs/mining-cut.md index 7c5be8297..ce23094dc 100644 --- a/docs/mining-cut.md +++ b/docs/mining-cut.md @@ -301,7 +301,7 @@ resources **(probe: 8 belts, 0 authored)**. - A: Composition is derived: `Comp_c(o) = Abundance_o × exp(Variance × g(hash(belt key, index, o)))`, normalized, with `g ∈ [-1, 1]`. Nothing is stored. Existing saves work, and key 4 is retired. - B: `ZoneGenerator` writes `BodyData.Resources` per belt at generation, and the chunk jitter is derived. Belts in - runs started before Cut 5 have empty compositions until New Game. + runs started before Cut 5 have empty compositions until a new run. - C: Per-belt only, with no per-chunk variation. - **Recommended: A.** It has one owner (the catalog) and nothing to migrate. It follows the same "derived, never stored" spirit as branding. The operator's wording ("the chunk's composition") argues against C. If B is chosen, diff --git a/docs/research/2026-10-21-strategic-ai-arena-living-world-prior-art.md b/docs/research/2026-10-21-strategic-ai-arena-living-world-prior-art.md index 42f0ee20c..87a1bb7c9 100644 --- a/docs/research/2026-10-21-strategic-ai-arena-living-world-prior-art.md +++ b/docs/research/2026-10-21-strategic-ai-arena-living-world-prior-art.md @@ -390,7 +390,8 @@ Battlecode, Halite, CodinGame, BWAPI/SSCAIT/AIIDE/CIG, SC2 AI Arena, Lux, CodeCl - **The Colosseum follow-up.** `aetheria-release:follow_up:colosseum-npc-lab` (in force; owner "Aetheria Agents and the headless simulation") names its foundations: - an observation and action seam (agents hold live `Ship`, `Zone` and `ItemManager` references); - - seeding `ItemManager.Random` and the MIConvexHull randoms; + - seeding for tournament reproducibility: `ItemManager.Random` already takes the run's seed + (`RunStart.ItemSeed`), and no MIConvexHull source remains in the repo; - a replay recorder; - a headless tournament runner on Yggdrasil with ratings; - a primitive vocabulary; diff --git a/docs/settings-globals-cut.md b/docs/settings-globals-cut.md index b031ba4bf..f1b2e0582 100644 --- a/docs/settings-globals-cut.md +++ b/docs/settings-globals-cut.md @@ -495,8 +495,9 @@ landed type differs from it by the one attribute. (the helper) [2 now]. - `rg -n "ScriptableObject" Assets/Scripts/ServerShared` must stay 0. - operator: - - Play smoke: main menu, then New Game (tutorial). The tutorial galaxy generates, - and the starting ship is LonginusX. + - Play smoke: main menu, then New Game, then the Tutorial Galaxy scenario (listed under + development, in editor and development builds). The prelude galaxy generates, and the + starting ship is `Settings.StartingHullName` (`Longinus`). - In a station trade menu and the properties panel, item names show tier colours: Legendary orange, Uncommon green. None is black. - The inventory shows armour and durability gradients, and hit flashes use the From ce5d0125408df4eb44f9a214cd2b9aa3d5bf48de Mon Sep 17 00:00:00 2001 From: soul <s@x> Date: Tue, 17 Nov 2026 18:53:45 +0100 Subject: [PATCH 107/108] Wren becomes a test fixture; compose and validate refuse an offered hull with no schematic Move the starter-box aetheria.wren package from GameData/Mods to tests/fixtures/mods (LFS rule added) so it no longer ships; the Wren tests compose it through TestCatalog.RepoWithFixtures. ShipModCatalog.SchematicFault, built on LoadoutGenerator.IsOffered, excludes an offered hull with no schematic lines at compose and is reported by ship-authoring validate. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .gitattributes | 2 + Assets/Scripts/ServerShared/ShipModCatalog.cs | 13 +++++ docs/element-ids.md | 2 +- docs/mining-cut-refresh.md | 4 +- .../ElementIdUpgradeTests.cs | 2 +- .../RestoredHullsTests.cs | 1 + .../ShipModCatalogTests.cs | 47 +++++++++++++++++++ .../Aetheria.Shared.Tests/ShipProductTests.cs | 24 ++++++++++ tests/Aetheria.Shared.Tests/TestCatalog.cs | 21 +++++++++ .../Aetheria.Shared.Tests/WrenPackageTests.cs | 10 ++-- .../fixtures/mods}/aetheria.wren/ship.cc | 0 .../fixtures/mods}/aetheria.wren/ship.glb | 0 tools/AetherDb/ShipAuthoringCommands.cs | 4 ++ 13 files changed, 121 insertions(+), 9 deletions(-) rename {GameData/Mods => tests/fixtures/mods}/aetheria.wren/ship.cc (100%) rename {GameData/Mods => tests/fixtures/mods}/aetheria.wren/ship.glb (100%) diff --git a/.gitattributes b/.gitattributes index 9d4b872b4..87c9db929 100644 --- a/.gitattributes +++ b/.gitattributes @@ -55,6 +55,8 @@ GameData/*.cc filter=lfs diff=lfs merge=lfs -text GameData/Mods/**/*.cc filter=lfs diff=lfs merge=lfs -text GameData/Mods/**/*.glb filter=lfs diff=lfs merge=lfs -text +tests/fixtures/mods/**/*.cc filter=lfs diff=lfs merge=lfs -text +tests/fixtures/mods/**/*.glb filter=lfs diff=lfs merge=lfs -text tools/blender/tests/fixtures/*.glb filter=lfs diff=lfs merge=lfs -text *.a filter=lfs diff=lfs merge=lfs -text *AkSoundEngine filter=lfs diff=lfs merge=lfs -text diff --git a/Assets/Scripts/ServerShared/ShipModCatalog.cs b/Assets/Scripts/ServerShared/ShipModCatalog.cs index 88dc06b85..d085974b4 100644 --- a/Assets/Scripts/ServerShared/ShipModCatalog.cs +++ b/Assets/Scripts/ServerShared/ShipModCatalog.cs @@ -110,6 +110,7 @@ public static class ShipModCatalog if (shipIds.Contains(ship.Id)) Exclude(directory, $"ship ID collides with an existing catalog ship authoring record."); if (StationKinds.HullKindFault(cache, hull) is { } kindFault) Exclude(directory, kindFault); + if (SchematicFault(cache, ship, package.Products) is { } schematicFault) Exclude(directory, schematicFault); foreach (var product in package.Products) { if (!factionKeys.Contains(product.Manufacturer.Key)) @@ -157,6 +158,18 @@ public static class ShipModCatalog } } + // Why a package's hull cannot go on the market, or null: a hull offered through any of its products is drawn on the map and + // the schematic by its lines (ShipModVisual.BuildLineMesh builds nothing from none), so an offered hull without any is + // excluded. An unoffered stand-in is left alone. Offered is LoadoutGenerator.IsOffered, the one reader of NotOffered + // (ruling off-market-is-unoffered-product); `items` is the catalog the products' bins resolve in. A product whose bin + // line the catalog does not hold is not judged here: the catalog read refuses it. + public static string SchematicFault(CultCache items, ShipAuthoring ship, FactionProductData[] products) + { + if (ship.SchematicLines != null && ship.SchematicLines.Any(line => line?.Points != null && line.Points.Length > 0)) return null; + var offered = products.Any(product => (product.Bin == null || items.Get(product.Bin.Line) != null) && LoadoutGenerator.IsOffered(items, product)); + return offered ? $"{ship.Id}: the hull is offered on the market but has no schematic lines." : null; + } + public static Package ReadPackage(string shipPath) { var path = Path.GetFullPath(shipPath); diff --git a/docs/element-ids.md b/docs/element-ids.md index b4ae9584a..32ccdafc8 100644 --- a/docs/element-ids.md +++ b/docs/element-ids.md @@ -26,7 +26,7 @@ that some intermediate pins read a single-file v3 store silently and drop the id writers, keep a pre-upgrade copy of any real store (`GameData/Aetheria.cc` and the mod packages are tracked in git; player saves and run stores are not), and do not roll the pin back after a store has been written under the new one. -The shipped mod packages (`GameData/Mods/aetheria.wren/ship.cc`, `aetheria.nakovalnya/ship.cc`) held only default +The shipped mod package (`GameData/Mods/aetheria.nakovalnya/ship.cc`) and the test fixture package (`tests/fixtures/mods/aetheria.wren/ship.cc`) held only default placeholders (`0` and `[]`) in the retired `HullData` slots 21 and 22, which the new CultLib refuses to write over (`CultSchemaConflictException`). They were regenerated with `AetherDb ship-authoring regenerate <ship.cc> apply`, which loads the records, writes them into a fresh file under the current schema, requires them to read back identical and replaces the file. Both diff --git a/docs/mining-cut-refresh.md b/docs/mining-cut-refresh.md index 7adb1e951..b0bf89420 100644 --- a/docs/mining-cut-refresh.md +++ b/docs/mining-cut-refresh.md @@ -304,11 +304,11 @@ Every mining question is ruled. - LFS staging set. `SubstanceCleanBreakTests` fails loudly on any LFS pointer it scans, so the job must restore every LFS-tracked file under `Assets/`, `Packages/`, `ProjectSettings/` and `GameData/*.cc` that is not a binary-media extension (the test's `BinaryExtensions` denylist): 99 files at `83e6957de`, 96 `*.asset` and 3 - `*.cc` (`GameData/Aetheria.cc`, `GameData/Mods/aetheria.nakovalnya/ship.cc`, `GameData/Mods/aetheria.wren/ship.cc`), + `*.cc` (`GameData/Aetheria.cc`, `GameData/Mods/aetheria.nakovalnya/ship.cc`, `tests/fixtures/mods/aetheria.wren/ship.cc`), which includes `ProjectSettings/ProjectSettings.asset` and `Assets/Resources/Settings.asset`. Derive the list from the merged tree instead of hand-copying it: `git ls-files Assets Packages ProjectSettings 'GameData/*.cc' | git check-attr --stdin filter | grep 'lfs$' | sed 's/: filter: lfs//' | grep -viE '\.(png|jpg|jpeg|tga|tif|tiff|psd|bmp|gif|exr|hdr|dds|wav|mp3|ogg|mp4|fbx|glb|blend|ttf|otf|dll|so|pdb|msgpack|zip|bank)$'`, - then copy each path from the `/lfs` mount over the checkout. That set (99: the 97 the sbsar guards read plus the two mod `ship.cc` files the Nakovalnya and Wren tests open) makes `SubstanceCleanBreakTests` green and nothing more: staging only two files turns it red. For a fully green suite also stage `GameData/Mods/*/ship.glb` (the catalog excludes a package with an invalid GLB header, failing about 520 tests) and the LFS `.ttf`/`.otf` fonts `CreditsTests.FontCreditsShowWhatTheFontsThemselvesEmbed` reads. + then copy each path from the `/lfs` mount over the checkout. That set (99: the 97 the sbsar guards read plus the two mod `ship.cc` files the Nakovalnya and Wren tests open) makes `SubstanceCleanBreakTests` green and nothing more: staging only two files turns it red. For a fully green suite also stage `GameData/Mods/*/ship.glb` and `tests/fixtures/mods/*/ship.glb` (the catalog excludes a package with an invalid GLB header, failing about 520 tests) and the LFS `.ttf`/`.otf` fonts `CreditsTests.FontCreditsShowWhatTheFontsThemselvesEmbed` reads. - Unity batchmode compile of the merged tree (Self, in a worktree, never with the operator's editor open on the main tree). This is the Cut 1 renderer compile the map still owes. - Operator: fly through a belt (the Cut 1 check the map still owes). Rocks orbit smoothly, and the minimap diff --git a/tests/Aetheria.Shared.Tests/ElementIdUpgradeTests.cs b/tests/Aetheria.Shared.Tests/ElementIdUpgradeTests.cs index d94222635..682b20409 100644 --- a/tests/Aetheria.Shared.Tests/ElementIdUpgradeTests.cs +++ b/tests/Aetheria.Shared.Tests/ElementIdUpgradeTests.cs @@ -107,7 +107,7 @@ public class ElementIdUpgradeTests { using var directory = new TempDirectory(); var copy = Path.Combine(directory.Path, "ship.cc"); - File.Copy(Path.Combine(RunStartTests.FindRepoRoot(), "GameData", "Mods", "aetheria.wren", "ship.cc"), copy); + File.Copy(Path.Combine(RunStartTests.FindRepoRoot(), "tests", "fixtures", "mods", "aetheria.wren", "ship.cc"), copy); var bytes = File.ReadAllBytes(copy); var (hull, visual, products) = ShipAuthoringStore.Load(copy); diff --git a/tests/Aetheria.Shared.Tests/RestoredHullsTests.cs b/tests/Aetheria.Shared.Tests/RestoredHullsTests.cs index 121d468b3..f5d3e8498 100644 --- a/tests/Aetheria.Shared.Tests/RestoredHullsTests.cs +++ b/tests/Aetheria.Shared.Tests/RestoredHullsTests.cs @@ -61,6 +61,7 @@ public sealed class RestoredHullsTests } internal static CultCache OpenCatalog() => OpenReadOnlyRealCatalog(TestCatalog.Repo); + internal static CultCache OpenCatalogWithFixtures() => OpenReadOnlyRealCatalog(TestCatalog.RepoWithFixtures); // Shared tutorial-galaxy construction settings (Assets/Resources/Settings.asset's own values), factored out // so every test that needs a real tutorial Galaxy -- not just EntranceZoneAlwaysGetsADockedStationAcrossSeeds diff --git a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs index 175a6bd9f..b4003954c 100644 --- a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs @@ -49,6 +49,53 @@ public sealed class ShipModCatalogTests : IDisposable AssertOnlyTheDerivedFile(); } + // A package selling one product through the one product writer, with or without schematic lines and offered or not. + private void PricedPackage(string id, bool lines, bool offered) + { + var factionKey = AddFaction(); + WritePackage(id, id, tweak: ship => + { + ship.Hull.Price = 100; + if (!lines) ship.Visual.SchematicLines = new List<ShipPolyline>(); + }); + using var cache = ShipAuthoringStore.Open(Path.Combine(Mods, id, "ship.cc"), writable: true); + ShipAuthoringStore.WriteProduct(cache, id, new FactionProductData + { + Name = id + " product", + Design = new CultRecordRef<CraftedItemData>(ShipModCatalog.HullKey(id)), + Manufacturer = new CultRecordRef<Faction>(factionKey), + NotOffered = !offered + }); + cache.FlushAsync().Wait(); + } + + private CultRecordKey AddFaction() + { + using var cache = AetheriaStores.Open(Shipped, catalogWritable: true); + var existing = cache.GetAll<Faction>().FirstOrDefault(); + var key = existing != null ? cache.RefOf(existing).Key : cache.Upsert(new Faction { Name = "Acme", ShortName = "ACM" }).Key; + cache.FlushAsync().Wait(); + return key; + } + + // An offered hull is drawn by its schematic lines (ShipModVisual.BuildLineMesh builds nothing from none), so one without any + // is left out of the catalog with its reason; an offered hull with lines and an unoffered stand-in without them both compose. + [Fact] + public void ComposeExcludesAnOfferedHullWithoutSchematicLinesAndKeepsTheRest() + { + PricedPackage("mod.offeredbare", lines: false, offered: true); + PricedPackage("mod.offeredlined", lines: true, offered: true); + PricedPackage("mod.standin", lines: false, offered: false); + + var composition = ShipModCatalog.Compose(Shipped, Derived, Mods); + + Assert.Equal(new[] { "mod.offeredlined", "mod.standin" }, composition.Included.OrderBy(id => id, StringComparer.Ordinal)); + var excluded = Assert.Single(composition.Excluded); + Assert.Equal("mod.offeredbare", excluded.Package); + Assert.Contains("mod.offeredbare", excluded.Reason); + Assert.Contains("no schematic", excluded.Reason); + } + // A package's station kind is checked per package: a bad one is left out, named with its reason, and the derived catalog // still opens. The shipped catalog's own check is unchanged. [Fact] diff --git a/tests/Aetheria.Shared.Tests/ShipProductTests.cs b/tests/Aetheria.Shared.Tests/ShipProductTests.cs index 82f094e88..0ee2db012 100644 --- a/tests/Aetheria.Shared.Tests/ShipProductTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipProductTests.cs @@ -99,6 +99,30 @@ public sealed class ShipProductTests : IDisposable } } + // validate gives the verdict compose gives: an offered hull with no schematic lines is refused, an unoffered one is not. + [Fact] + public void ValidateRefusesAnOfferedHullWithoutSchematicLinesAsComposeDoes() + { + Environment.CurrentDirectory = _root.Path; + string Bare(string id, bool offered) + { + var directory = ShipFixture.WritePackage(Mods, id, id, tweak: ship => { ship.Hull.Price = 100; ship.Visual.SchematicLines = new List<ShipPolyline>(); }); + var path = Path.Combine(directory, "ship.cc"); + using var cache = ShipAuthoringStore.Open(path, writable: true); + var product = Product(id + " product", _acme, id); + product.NotOffered = !offered; + ShipAuthoringStore.WriteProduct(cache, id, product); + cache.FlushAsync().Wait(); + return path; + } + + var (code, _, error) = Run("validate", Bare("mod.offered", offered: true)); + Assert.Equal(1, code); + Assert.Contains("no schematic", error); + Assert.Equal(0, Run("validate", Bare("mod.standin", offered: false)).Item1); + Assert.Equal(new[] { "mod.standin" }, ShipModCatalog.Compose(Shipped, Derived, Mods).Included); + } + [Fact] public void APackageWithAnUnknownMakerIsExcluded() { diff --git a/tests/Aetheria.Shared.Tests/TestCatalog.cs b/tests/Aetheria.Shared.Tests/TestCatalog.cs index 60d41c996..2561406f2 100644 --- a/tests/Aetheria.Shared.Tests/TestCatalog.cs +++ b/tests/Aetheria.Shared.Tests/TestCatalog.cs @@ -18,6 +18,12 @@ internal static class TestCatalog // The repo's catalog with its first-party packages composed in, resolved once per test process. public static string Repo => Shared.Value; + private static readonly Lazy<string> SharedWithFixtures = new Lazy<string>(() => ForRepoWithFixtures(RunStartTests.FindRepoRoot())); + + // The repo's catalog with its first-party packages and the test fixture packages (tests/fixtures/mods) composed in. For a + // test whose subject is a fixture package; Repo is the catalog the game ships. + public static string RepoWithFixtures => SharedWithFixtures.Value; + // The shipped assembly's own [CultDocument] types and nothing the test assembly registers (CultDocumentRegistry.ForTypes // does not re-scan the AppDomain), so this assembly's fixture documents never become catalog globals the real catalog // must hold. The one registry every test that opens a real catalog, and the composition behind Repo, uses. @@ -34,6 +40,21 @@ internal static class TestCatalog return Resolve(Path.Combine(repoRoot, "GameData", "Aetheria.cc"), Path.Combine(repoRoot, "GameData", "Mods"), work); } + // ForRepo over a mods root assembled from GameData/Mods and tests/fixtures/mods, copied into the per-call temp directory. + public static string ForRepoWithFixtures(string repoRoot) + { + var work = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "aetheria-testcatalog-" + Guid.NewGuid().ToString("N"))).FullName; + AppDomain.CurrentDomain.ProcessExit += (_, _) => { try { Directory.Delete(work, true); } catch (IOException) { } }; + var mods = Path.Combine(work, "Mods"); + foreach (var root in new[] { Path.Combine(repoRoot, "GameData", "Mods"), Path.Combine(repoRoot, "tests", "fixtures", "mods") }) + foreach (var package in Directory.GetDirectories(root)) + { + var target = Directory.CreateDirectory(Path.Combine(mods, Path.GetFileName(package))).FullName; + foreach (var file in Directory.GetFiles(package)) File.Copy(file, Path.Combine(target, Path.GetFileName(file))); + } + return Resolve(Path.Combine(repoRoot, "GameData", "Aetheria.cc"), mods, work); + } + public static string Resolve(string shippedCatalog, string modsRoot, string workDir) { // Every directory under the first-party tree is a package. The game treats a directory without a ship.cc as not a diff --git a/tests/Aetheria.Shared.Tests/WrenPackageTests.cs b/tests/Aetheria.Shared.Tests/WrenPackageTests.cs index bb95cbb55..3395d7f32 100644 --- a/tests/Aetheria.Shared.Tests/WrenPackageTests.cs +++ b/tests/Aetheria.Shared.Tests/WrenPackageTests.cs @@ -5,7 +5,7 @@ using Xunit; using static CultMath.math; using Random = CultMath.Random; -// GameData/Mods/aetheria.wren: a first-party package written by `ship-authoring starter --like Djinni`, then priced and given +// tests/fixtures/mods/aetheria.wren: a test fixture package, not shipped with the game, written by `ship-authoring starter --like Djinni`, then priced and given // an unoffered Aeronautics Unlimited product by `ship-authoring price` and `product`; its model is the starter's boxed // stand-in. It is the pipeline's proof from a hull package on disk to a ship that flies in the headless simulation: the // package composes into the catalog, its mounts take catalog gear, and the fitted ship moves under thrust. `fly` cannot @@ -19,7 +19,7 @@ public sealed class WrenPackageTests [Fact] public void TheStarterPackageIsInTheComposedCatalogWithTheStatsOfItsLike() { - using var cache = RestoredHullsTests.OpenCatalog(); + using var cache = RestoredHullsTests.OpenCatalogWithFixtures(); var hull = Wren(cache); var like = cache.GetByName<HullData>("Djinni"); Assert.NotNull(hull); @@ -34,7 +34,7 @@ public sealed class WrenPackageTests [Fact] public void TheStarterIsMadeButNeverOffered() { - using var cache = RestoredHullsTests.OpenCatalog(); + using var cache = RestoredHullsTests.OpenCatalogWithFixtures(); var hull = Wren(cache); var product = Assert.Single(cache.GetAll<FactionProductData>(), p => p.Design.Key.Equals(ShipModCatalog.HullKey(Id))); Assert.Equal("Aeronautics Unlimited", cache.Get(product.Manufacturer).Name); @@ -47,7 +47,7 @@ public sealed class WrenPackageTests [Fact] public void EveryMountTakesACatalogDesign() { - using var cache = RestoredHullsTests.OpenCatalog(); + using var cache = RestoredHullsTests.OpenCatalogWithFixtures(); var designs = cache.GetAll<EquippableItemData>().ToArray(); var bare = Wren(cache).Hardpoints.Where(hardpoint => !designs.Any(hardpoint.Takes)).Select(hardpoint => $"{hardpoint.Transform} ({hardpoint.Type})").ToArray(); // No shield design fits a 1x1 yet (hardpoint-fit lists Djinni's 4-cell shield with none either); every other mount does. @@ -57,7 +57,7 @@ public sealed class WrenPackageTests [Fact] public void TheStarterFliesUnderThrust() { - using var cache = RestoredHullsTests.OpenCatalog(); + using var cache = RestoredHullsTests.OpenCatalogWithFixtures(); var ship = RestoredHullsTests.BuildThrustedShip(cache, "Wren"); var start = ship.Velocity; ship.MovementDirection = float2(0, 1); diff --git a/GameData/Mods/aetheria.wren/ship.cc b/tests/fixtures/mods/aetheria.wren/ship.cc similarity index 100% rename from GameData/Mods/aetheria.wren/ship.cc rename to tests/fixtures/mods/aetheria.wren/ship.cc diff --git a/GameData/Mods/aetheria.wren/ship.glb b/tests/fixtures/mods/aetheria.wren/ship.glb similarity index 100% rename from GameData/Mods/aetheria.wren/ship.glb rename to tests/fixtures/mods/aetheria.wren/ship.glb diff --git a/tools/AetherDb/ShipAuthoringCommands.cs b/tools/AetherDb/ShipAuthoringCommands.cs index 458ae4038..4298bc198 100644 --- a/tools/AetherDb/ShipAuthoringCommands.cs +++ b/tools/AetherDb/ShipAuthoringCommands.cs @@ -53,6 +53,10 @@ public static class ShipAuthoringCommands var judged = model != null && File.Exists(model) ? "records and model" : "records only, no model yet"; if (judged == "records and model") ShipModCatalog.ReadPackage(args[1]); else ShipAuthoringStore.ValidateLoaded(hull, ship, products); + // Compose refuses an offered hull with no schematic; the author sees that verdict here, before compose. + // A package with no products is never offered, so the shipped catalog (which only resolves a product's bin) is opened for none. + using var catalog = products.Length > 0 ? AetherDb.Open().Cache : null; + if (ShipModCatalog.SchematicFault(catalog, ship, products) is { } fault) throw new InvalidOperationException(fault); Console.WriteLine($"{ship.Id}: {hull.Name}, {hull.Hardpoints.Count} hardpoints, {ship.Anchors.Count} anchors, {ship.SchematicLines.Count} lines ({judged})"); return 0; } From 8b2d1f5442df2090943f28b36db7e1f41cc1527c Mon Sep 17 00:00:00 2001 From: soul <s@x> Date: Tue, 17 Nov 2026 19:12:07 +0100 Subject: [PATCH 108/108] Compose and validate judge a package's bins; the schematic gate reads offered-ness through them MarketFault (renamed from SchematicFault) refuses a product bin whose line is neither an unbinned shipped product nor an unbinned product of the same package, which the catalog read would crash boot on, and which let an offered hull with no lines pass through a cross-package bin. The carve-out guard is gone: IsOffered now has an overload taking a line resolver, so it judges package-own lines too. Tests pin bin-derived offeredness, any-vs-all products, null SchematicLines and the exclusion of bad bins with the derived catalog still opening. The LFS staging derivation includes tests/fixtures/mods. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --- .../Scripts/ServerShared/LoadoutGenerator.cs | 7 +- Assets/Scripts/ServerShared/ShipModCatalog.cs | 26 ++-- docs/mining-cut-refresh.md | 4 +- .../ShipModCatalogTests.cs | 136 ++++++++++++++---- .../Aetheria.Shared.Tests/ShipProductTests.cs | 13 +- tools/AetherDb/ShipAuthoringCommands.cs | 6 +- 6 files changed, 148 insertions(+), 44 deletions(-) diff --git a/Assets/Scripts/ServerShared/LoadoutGenerator.cs b/Assets/Scripts/ServerShared/LoadoutGenerator.cs index fcd554efd..62e8632a1 100644 --- a/Assets/Scripts/ServerShared/LoadoutGenerator.cs +++ b/Assets/Scripts/ServerShared/LoadoutGenerator.cs @@ -257,8 +257,11 @@ public class LoadoutGenerator // Whether a product is on the market at all (ruling off-market-is-unoffered-product). The one reader of NotOffered. A bin is // offered only if both it and its line are (ruling bin-inherits-line-offered); the catalog read guarantees a bin's line exists. - public static bool IsOffered(CultCache items, FactionProductData product) => - !product.NotOffered && (product.Bin == null || !items.Get(product.Bin.Line).NotOffered); + public static bool IsOffered(CultCache items, FactionProductData product) => IsOffered(product, line => items.Get(line)); + + // The same reader for a caller whose bin lines are not all in one catalog yet (ShipModCatalog.MarketFault, over a package's own products). + public static bool IsOffered(FactionProductData product, Func<CultRecordRef<FactionProductData>, FactionProductData> lineOf) => + !product.NotOffered && (product.Bin == null || !lineOf(product.Bin.Line).NotOffered); // How much this outfitter favors a product: its maker's preference times the product's share of it. The one weight of // generation and of ChooseProduct. A bin takes the share of its maker's stock that would pass its floor and its line takes diff --git a/Assets/Scripts/ServerShared/ShipModCatalog.cs b/Assets/Scripts/ServerShared/ShipModCatalog.cs index d085974b4..0e5bd801c 100644 --- a/Assets/Scripts/ServerShared/ShipModCatalog.cs +++ b/Assets/Scripts/ServerShared/ShipModCatalog.cs @@ -110,7 +110,7 @@ public static class ShipModCatalog if (shipIds.Contains(ship.Id)) Exclude(directory, $"ship ID collides with an existing catalog ship authoring record."); if (StationKinds.HullKindFault(cache, hull) is { } kindFault) Exclude(directory, kindFault); - if (SchematicFault(cache, ship, package.Products) is { } schematicFault) Exclude(directory, schematicFault); + if (MarketFault(cache, ship, package.Products) is { } marketFault) Exclude(directory, marketFault); foreach (var product in package.Products) { if (!factionKeys.Contains(product.Manufacturer.Key)) @@ -158,16 +158,24 @@ public static class ShipModCatalog } } - // Why a package's hull cannot go on the market, or null: a hull offered through any of its products is drawn on the map and - // the schematic by its lines (ShipModVisual.BuildLineMesh builds nothing from none), so an offered hull without any is - // excluded. An unoffered stand-in is left alone. Offered is LoadoutGenerator.IsOffered, the one reader of NotOffered - // (ruling off-market-is-unoffered-product); `items` is the catalog the products' bins resolve in. A product whose bin - // line the catalog does not hold is not judged here: the catalog read refuses it. - public static string SchematicFault(CultCache items, ShipAuthoring ship, FactionProductData[] products) + // Why a package's products cannot join the catalog, or null; the one judgement Compose and `ship-authoring validate` share. + // `items` is the shipped catalog. A product's bin may name only a product line the shipped catalog holds or one of the + // package's own products (and that line must not be a bin itself): the catalog read refuses any other bin, and a line in + // another package is no promise, since packages compose independently. With every bin resolved, a hull offered through any of its + // products is drawn on the map and the schematic by its lines (ShipModVisual.BuildLineMesh builds nothing from none), so an + // offered hull without any is refused; an unoffered stand-in is left alone. Offered is LoadoutGenerator.IsOffered, the one + // reader of NotOffered (ruling off-market-is-unoffered-product), resolving a line among the package's own products too. + public static string MarketFault(CultCache items, ShipAuthoring ship, FactionProductData[] products) { + var own = new Dictionary<CultRecordKey, FactionProductData>(); + foreach (var product in products) own[ProductKey(ship.Id, product.Manufacturer.Key)] = product; + FactionProductData LineOf(CultRecordRef<FactionProductData> line) => items.Get(line) ?? (own.TryGetValue(line.Key, out var found) ? found : null); + foreach (var product in products.Where(product => product.Bin != null)) + if (LineOf(product.Bin.Line) is not { } line || line.Bin != null) + return $"{ship.Id}: product '{product.Name}' bins a line that is neither an unbinned shipped product nor an unbinned product of this package."; if (ship.SchematicLines != null && ship.SchematicLines.Any(line => line?.Points != null && line.Points.Length > 0)) return null; - var offered = products.Any(product => (product.Bin == null || items.Get(product.Bin.Line) != null) && LoadoutGenerator.IsOffered(items, product)); - return offered ? $"{ship.Id}: the hull is offered on the market but has no schematic lines." : null; + return products.Any(product => LoadoutGenerator.IsOffered(product, LineOf)) + ? $"{ship.Id}: the hull is offered on the market but has no schematic lines." : null; } public static Package ReadPackage(string shipPath) diff --git a/docs/mining-cut-refresh.md b/docs/mining-cut-refresh.md index b0bf89420..8a5fdcd9e 100644 --- a/docs/mining-cut-refresh.md +++ b/docs/mining-cut-refresh.md @@ -302,12 +302,12 @@ Every mining question is ruled. `ssh:` remote). Push from a `--shared --no-checkout` clone, and mount the LFS blobs. This is recorded so the next Hands does not rediscover it. - LFS staging set. `SubstanceCleanBreakTests` fails loudly on any LFS pointer it scans, so the job must restore - every LFS-tracked file under `Assets/`, `Packages/`, `ProjectSettings/` and `GameData/*.cc` that is not a + every LFS-tracked file under `Assets/`, `Packages/`, `ProjectSettings/`, `GameData/*.cc` and `tests/fixtures/mods/*.cc` that is not a binary-media extension (the test's `BinaryExtensions` denylist): 99 files at `83e6957de`, 96 `*.asset` and 3 `*.cc` (`GameData/Aetheria.cc`, `GameData/Mods/aetheria.nakovalnya/ship.cc`, `tests/fixtures/mods/aetheria.wren/ship.cc`), which includes `ProjectSettings/ProjectSettings.asset` and `Assets/Resources/Settings.asset`. Derive the list from the merged tree instead of hand-copying it: - `git ls-files Assets Packages ProjectSettings 'GameData/*.cc' | git check-attr --stdin filter | grep 'lfs$' | sed 's/: filter: lfs//' | grep -viE '\.(png|jpg|jpeg|tga|tif|tiff|psd|bmp|gif|exr|hdr|dds|wav|mp3|ogg|mp4|fbx|glb|blend|ttf|otf|dll|so|pdb|msgpack|zip|bank)$'`, + `git ls-files Assets Packages ProjectSettings 'GameData/*.cc' 'tests/fixtures/mods/*.cc' | git check-attr --stdin filter | grep 'lfs$' | sed 's/: filter: lfs//' | grep -viE '\.(png|jpg|jpeg|tga|tif|tiff|psd|bmp|gif|exr|hdr|dds|wav|mp3|ogg|mp4|fbx|glb|blend|ttf|otf|dll|so|pdb|msgpack|zip|bank)$'`, then copy each path from the `/lfs` mount over the checkout. That set (99: the 97 the sbsar guards read plus the two mod `ship.cc` files the Nakovalnya and Wren tests open) makes `SubstanceCleanBreakTests` green and nothing more: staging only two files turns it red. For a fully green suite also stage `GameData/Mods/*/ship.glb` and `tests/fixtures/mods/*/ship.glb` (the catalog excludes a package with an invalid GLB header, failing about 520 tests) and the LFS `.ttf`/`.otf` fonts `CreditsTests.FontCreditsShowWhatTheFontsThemselvesEmbed` reads. - Unity batchmode compile of the merged tree (Self, in a worktree, never with the operator's editor open on the main tree). This is the Cut 1 renderer compile the map still owes. diff --git a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs index b4003954c..5a4f38093 100644 --- a/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipModCatalogTests.cs @@ -49,43 +49,71 @@ public sealed class ShipModCatalogTests : IDisposable AssertOnlyTheDerivedFile(); } - // A package selling one product through the one product writer, with or without schematic lines and offered or not. - private void PricedPackage(string id, bool lines, bool offered) - { - var factionKey = AddFaction(); - WritePackage(id, id, tweak: ship => - { - ship.Hull.Price = 100; - if (!lines) ship.Visual.SchematicLines = new List<ShipPolyline>(); - }); - using var cache = ShipAuthoringStore.Open(Path.Combine(Mods, id, "ship.cc"), writable: true); - ShipAuthoringStore.WriteProduct(cache, id, new FactionProductData - { - Name = id + " product", - Design = new CultRecordRef<CraftedItemData>(ShipModCatalog.HullKey(id)), - Manufacturer = new CultRecordRef<Faction>(factionKey), - NotOffered = !offered - }); - cache.FlushAsync().Wait(); - } - - private CultRecordKey AddFaction() + // A maker (by name) the shipped catalog holds, made on first use. + private CultRecordKey Maker(string name) { using var cache = AetheriaStores.Open(Shipped, catalogWritable: true); - var existing = cache.GetAll<Faction>().FirstOrDefault(); - var key = existing != null ? cache.RefOf(existing).Key : cache.Upsert(new Faction { Name = "Acme", ShortName = "ACM" }).Key; + var existing = cache.GetAll<Faction>().FirstOrDefault(faction => faction.Name == name); + var key = existing != null ? cache.RefOf(existing).Key : cache.Upsert(new Faction { Name = name, ShortName = name.Substring(0, 3).ToUpperInvariant() }).Key; cache.FlushAsync().Wait(); return key; } + // A shipped product line a package's product can bin. + private CultRecordKey ShippedLine(string name, bool notOffered) + { + var maker = Maker("Acme"); + using var cache = AetheriaStores.Open(Shipped, catalogWritable: true); + var hull = cache.Upsert(new HullData { Name = name + " hull", Shape = ShipAuthoringTests.Fixture().Hull.Shape, Price = 10 }); + var line = cache.Upsert(new FactionProductData + { + Name = name, + Design = new CultRecordRef<CraftedItemData>(hull.Key), + Manufacturer = new CultRecordRef<Faction>(maker), + NotOffered = notOffered + }); + cache.FlushAsync().Wait(); + return line.Key; + } + + // One product of a package: its maker, whether it is itself off the market, and the line it bins, if any. + private sealed record Sale(string Maker, bool NotOffered = false, CultRecordKey? Bin = null); + + // A priced package selling the given products through the one product writer, with or without schematic lines + // (`lines` null leaves the record's SchematicLines null). + private void PricedPackage(string id, bool? lines, params Sale[] sales) + { + var makers = sales.Select(sale => Maker(sale.Maker)).ToArray(); + WritePackage(id, id, tweak: ship => + { + ship.Hull.Price = 100; + if (lines == false) ship.Visual.SchematicLines = new List<ShipPolyline>(); + if (lines == null) ship.Visual.SchematicLines = null; + }); + using var cache = ShipAuthoringStore.Open(Path.Combine(Mods, id, "ship.cc"), writable: true); + for (var n = 0; n < sales.Length; n++) + ShipAuthoringStore.WriteProduct(cache, id, new FactionProductData + { + Name = $"{id} product {n}", + Design = new CultRecordRef<CraftedItemData>(ShipModCatalog.HullKey(id)), + Manufacturer = new CultRecordRef<Faction>(makers[n]), + NotOffered = sales[n].NotOffered, + Bin = sales[n].Bin is { } line ? new ProductBin { Line = new CultRecordRef<FactionProductData>(line), Floor = 1f } : null + }); + cache.FlushAsync().Wait(); + } + + private static string Excluded(ShipModCatalog.Composition composition, string package) => + composition.Excluded.SingleOrDefault(entry => entry.Package == package)?.Reason; + // An offered hull is drawn by its schematic lines (ShipModVisual.BuildLineMesh builds nothing from none), so one without any // is left out of the catalog with its reason; an offered hull with lines and an unoffered stand-in without them both compose. [Fact] public void ComposeExcludesAnOfferedHullWithoutSchematicLinesAndKeepsTheRest() { - PricedPackage("mod.offeredbare", lines: false, offered: true); - PricedPackage("mod.offeredlined", lines: true, offered: true); - PricedPackage("mod.standin", lines: false, offered: false); + PricedPackage("mod.offeredbare", lines: false, new Sale("Acme")); + PricedPackage("mod.offeredlined", lines: true, new Sale("Acme")); + PricedPackage("mod.standin", lines: false, new Sale("Acme", NotOffered: true)); var composition = ShipModCatalog.Compose(Shipped, Derived, Mods); @@ -96,6 +124,62 @@ public sealed class ShipModCatalogTests : IDisposable Assert.Contains("no schematic", excluded.Reason); } + // A hull is offered when any product of it is, and a binned product is offered only if its line is (ruling bin-inherits-line-offered): + // the verdict is IsOffered's, not a read of the product's own NotOffered. + [Fact] + public void OfferedNessComesFromAnyProductAndFromTheBinsLine() + { + var offeredLine = ShippedLine("Offered Line", notOffered: false); + var closedLine = ShippedLine("Closed Line", notOffered: true); + PricedPackage("mod.binoffered", lines: false, new Sale("Acme", Bin: offeredLine)); + PricedPackage("mod.binclosed", lines: false, new Sale("Acme", Bin: closedLine)); + PricedPackage("mod.oneoftwo", lines: false, new Sale("Acme", NotOffered: true), new Sale("Rival")); + + var composition = ShipModCatalog.Compose(Shipped, Derived, Mods); + + Assert.Contains("no schematic", Excluded(composition, "mod.binoffered")); + Assert.Null(Excluded(composition, "mod.binclosed")); + Assert.Contains("no schematic", Excluded(composition, "mod.oneoftwo")); + Assert.Equal(new[] { "mod.binclosed" }, composition.Included); + } + + [Fact] + public void ANullSchematicIsNoSchematicWhenOffered() + { + PricedPackage("mod.nulled", lines: null, new Sale("Acme")); + PricedPackage("mod.nulledstandin", lines: null, new Sale("Acme", NotOffered: true)); + + var composition = ShipModCatalog.Compose(Shipped, Derived, Mods); + + Assert.Contains("no schematic", Excluded(composition, "mod.nulled")); + Assert.Equal(new[] { "mod.nulledstandin" }, composition.Included); + } + + // A bin's line is a shipped product or one of the package's own, never another package's and never nothing: the catalog read + // refuses such a bin at boot, so compose leaves the package out and the derived catalog opens. + [Fact] + public void ComposeExcludesAPackageWhoseBinNamesNoShippedOrOwnLine() + { + var shipped = ShippedLine("Shipped Line", notOffered: false); + var maker = Maker("Acme"); + PricedPackage("mod.lined", lines: true, new Sale("Acme")); + PricedPackage("mod.cross", lines: false, new Sale("Rival", Bin: ShipModCatalog.ProductKey("mod.lined", maker))); + PricedPackage("mod.nothing", lines: true, new Sale("Acme", Bin: new CultRecordKey("product:nowhere"))); + PricedPackage("mod.shippedbin", lines: true, new Sale("Acme", Bin: shipped)); + PricedPackage("mod.ownbin", lines: true, new Sale("Acme"), new Sale("Rival", Bin: ShipModCatalog.ProductKey("mod.ownbin", maker))); + + PricedPackage("mod.binofbin", lines: true, new Sale("Acme", Bin: shipped), new Sale("Rival", Bin: ShipModCatalog.ProductKey("mod.binofbin", maker))); + + var (catalog, excluded) = ShipModCatalog.ResolveCatalog(Shipped, Derived, Mods); + + Assert.Equal(new[] { "mod.binofbin", "mod.cross", "mod.nothing" }, excluded.Select(entry => entry.Package).OrderBy(id => id, StringComparer.Ordinal)); + Assert.All(excluded, entry => Assert.Contains("bins a line", entry.Reason)); + Assert.Equal(Derived, catalog); + using var cache = AetheriaStores.Open(Derived); + Assert.Contains("mod.ownbin product 1", cache.GetAll<FactionProductData>().Select(product => product.Name)); + Assert.DoesNotContain("mod.cross product 0", cache.GetAll<FactionProductData>().Select(product => product.Name)); + } + // A package's station kind is checked per package: a bad one is left out, named with its reason, and the derived catalog // still opens. The shipped catalog's own check is unchanged. [Fact] diff --git a/tests/Aetheria.Shared.Tests/ShipProductTests.cs b/tests/Aetheria.Shared.Tests/ShipProductTests.cs index 0ee2db012..638f408b6 100644 --- a/tests/Aetheria.Shared.Tests/ShipProductTests.cs +++ b/tests/Aetheria.Shared.Tests/ShipProductTests.cs @@ -104,13 +104,14 @@ public sealed class ShipProductTests : IDisposable public void ValidateRefusesAnOfferedHullWithoutSchematicLinesAsComposeDoes() { Environment.CurrentDirectory = _root.Path; - string Bare(string id, bool offered) + string Bare(string id, bool offered, bool nullLines = false, CultRecordKey? bin = null) { - var directory = ShipFixture.WritePackage(Mods, id, id, tweak: ship => { ship.Hull.Price = 100; ship.Visual.SchematicLines = new List<ShipPolyline>(); }); + var directory = ShipFixture.WritePackage(Mods, id, id, tweak: ship => { ship.Hull.Price = 100; ship.Visual.SchematicLines = nullLines ? null : new List<ShipPolyline>(); }); var path = Path.Combine(directory, "ship.cc"); using var cache = ShipAuthoringStore.Open(path, writable: true); var product = Product(id + " product", _acme, id); product.NotOffered = !offered; + if (bin is { } line) product.Bin = new ProductBin { Line = new CultRecordRef<FactionProductData>(line), Floor = 1f }; ShipAuthoringStore.WriteProduct(cache, id, product); cache.FlushAsync().Wait(); return path; @@ -120,6 +121,14 @@ public sealed class ShipProductTests : IDisposable Assert.Equal(1, code); Assert.Contains("no schematic", error); Assert.Equal(0, Run("validate", Bare("mod.standin", offered: false)).Item1); + // A null SchematicLines is no schematic, as for compose. + var (nullCode, _, nullError) = Run("validate", Bare("mod.nulled", offered: true, nullLines: true)); + Assert.Equal(1, nullCode); + Assert.Contains("no schematic", nullError); + // A bin naming no shipped product and no product of the package is refused, as compose excludes it. + var (binCode, _, binError) = Run("validate", Bare("mod.badbin", offered: true, bin: new CultRecordKey("product:nowhere"))); + Assert.Equal(1, binCode); + Assert.Contains("bins a line", binError); Assert.Equal(new[] { "mod.standin" }, ShipModCatalog.Compose(Shipped, Derived, Mods).Included); } diff --git a/tools/AetherDb/ShipAuthoringCommands.cs b/tools/AetherDb/ShipAuthoringCommands.cs index 4298bc198..3b3ea9051 100644 --- a/tools/AetherDb/ShipAuthoringCommands.cs +++ b/tools/AetherDb/ShipAuthoringCommands.cs @@ -53,10 +53,10 @@ public static class ShipAuthoringCommands var judged = model != null && File.Exists(model) ? "records and model" : "records only, no model yet"; if (judged == "records and model") ShipModCatalog.ReadPackage(args[1]); else ShipAuthoringStore.ValidateLoaded(hull, ship, products); - // Compose refuses an offered hull with no schematic; the author sees that verdict here, before compose. - // A package with no products is never offered, so the shipped catalog (which only resolves a product's bin) is opened for none. + // Compose's verdict on a package's bins and its offered hull's schematic; the author sees it here, before compose. + // A package with no products has no bin and is never offered, so the shipped catalog is opened for none. using var catalog = products.Length > 0 ? AetherDb.Open().Cache : null; - if (ShipModCatalog.SchematicFault(catalog, ship, products) is { } fault) throw new InvalidOperationException(fault); + if (ShipModCatalog.MarketFault(catalog, ship, products) is { } fault) throw new InvalidOperationException(fault); Console.WriteLine($"{ship.Id}: {hull.Name}, {hull.Hardpoints.Count} hardpoints, {ship.Anchors.Count} anchors, {ship.SchematicLines.Count} lines ({judged})"); return 0; }