AetherDb: field-kinds authors the first field kind, "Asteroid"

A chunk's reflectivity comes from its belt's kind, so a catalog with no
FieldKindData leaves every belt dark. The command dry-runs by default and, with
"apply", authors "Asteroid" (cross-section 5 per schematic cell, weight 1)
through one validated Commit batch. Both numbers are for operator review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-30 12:57:41 +02:00
commit efd5118322

View file

@ -36,8 +36,9 @@ public static class Program
case "targeting-catalog": return TargetingCatalog(args.Contains("apply"));
case "targeting-catalog-6c": return TargetingCatalog6c(args.Contains("apply"));
case "targeting-catalog-6d": return TargetingCatalog6d(args.Contains("apply"));
case "field-kinds": return FieldKindsCatalog(args.Contains("apply"));
default:
Console.WriteLine("commands: census, factions, station-fit, hardpoint-fit, loadout [seed], save, settings, settings-dump, dangling [clear <Type.Member>]... [apply], shield-migrate [apply], brownout-migrate [apply], roles-migrate [apply], firing-arc-migrate [apply], targeting-catalog [apply], targeting-catalog-6c [apply], targeting-catalog-6d [apply]");
Console.WriteLine("commands: census, factions, station-fit, hardpoint-fit, loadout [seed], save, settings, settings-dump, dangling [clear <Type.Member>]... [apply], shield-migrate [apply], brownout-migrate [apply], roles-migrate [apply], firing-arc-migrate [apply], targeting-catalog [apply], targeting-catalog-6c [apply], targeting-catalog-6d [apply], field-kinds [apply]");
return 1;
}
}
@ -1474,4 +1475,36 @@ public static class Program
Console.WriteLine($"\nLanded {precisionChanges.Length} Precision changes in Aetheria.cc");
return 0;
}
// Mining Cut 3 (docs/mining-cut-refresh.md): the first field kind. A chunk is detected by reflected light, and
// its reflectivity comes from its belt's kind, so a catalog with no kind leaves every belt dark. This authors
// the one kind Cut 3 needs, "Asteroid"; Cut 7 authors the rest. CrossSection is reflectivity per schematic
// cell of chunk area: 5 sits inside the shipped hulls' 2-15 per cell (Longinus, Djinni), so a mid-size rock
// (3-6 units across, 7-28 cells) reflects like a small ship. Both numbers are for the operator to review.
private static int FieldKindsCatalog(bool apply)
{
var db = AetherDb.Open(catalogWritable: apply);
var kinds = db.Cache.GetAll<FieldKindData>().ToArray();
foreach (var kind in kinds)
Console.WriteLine($" {kind.Name,-12} cross-section {kind.CrossSection,5:0.##} per cell, weight {kind.GenerationWeight:0.##}");
if (kinds.Any(kind => kind.Name == "Asteroid"))
{
Console.WriteLine("\"Asteroid\" is already authored; nothing to do.");
return 0;
}
var asteroid = new FieldKindData { Name = "Asteroid", CrossSection = 5f, GenerationWeight = 1f };
Console.WriteLine($"Adds \"Asteroid\": cross-section {asteroid.CrossSection} per cell, weight {asteroid.GenerationWeight}.");
if (!apply)
{
Console.WriteLine("\nDry run. Pass \"apply\" to author it.");
return 0;
}
CultRecordRefs.Validate(asteroid);
db.Cache.Commit(batch => batch.Upsert(typeof(FieldKindData), asteroid));
Console.WriteLine("\nAuthored \"Asteroid\" in Aetheria.cc");
return 0;
}
}