Every new run is a scenario: the script harness, the tutorial and main galaxies as scenarios, the New Game submenu and six test arenas
A Scenario is an abstract C# class compiled with the game: Generate picks the galaxy through GalaxyStage (Main or Prelude, at the scenario's seed, the background noise drawn from the same seed), Stage places the run's first entities through ScenarioStage (Fit, Bare, Generated, Preset, Player, Place, Cargo), which collects named failures and admits nothing. RunStart generates the galaxy, the arena under Ambient and admits everything through Zone.Admit, all or nothing. The aetheria.scenario record, ScenarioShip, ScenarioEntity, RunStart.Check and the null-scenario branch are cut. New Game opens a submenu: Tutorial Galaxy and Main Galaxy, then (editor and development builds) Djinni Shakedown, Starved Reactor, Arcs, Duel, Launcher Angles and Long Haul, each with its brief. MainMenu.Launch is the one way into a new run; ActionGameManager.PendingScenario carries the scenario to StartGame once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8a0a29e0de
commit
d0782a7d14
31 changed files with 1173 additions and 611 deletions
|
|
@ -1,38 +1,27 @@
|
|||
using System.Collections.Generic;
|
||||
using GameCult.Caching;
|
||||
using MessagePack;
|
||||
using CultMath;
|
||||
|
||||
// A scenario is an arena whose conditions are present at spawn (docs/scenarios-cut.md): the player's ship and every
|
||||
// other entity already fitted and placed. Authored catalog data, read at runtime; RunStart stages it into a new run.
|
||||
// It sets conditions and nothing else: once staged, its entities are ordinary run state.
|
||||
[CultDocument("aetheria.scenario", "1"), MessagePackObject]
|
||||
public class Scenario
|
||||
// A scenario is one way to set up a new run (docs/scenarios-cut.md, R): a script, compiled with the game, that says
|
||||
// which galaxy to generate and what the run starts with. New Game lists them (Scenarios). RunStart runs one: it
|
||||
// generates the galaxy through GalaxyStage, the arena under Ambient, and admits what Stage placed through a
|
||||
// ScenarioStage. A scenario only declares; once staged, everything it placed is ordinary run state.
|
||||
public abstract class Scenario
|
||||
{
|
||||
[CultName, Key(0)] public string Name;
|
||||
[Key(1)] public string Brief; // the conditions in a line or two, shown in the menu
|
||||
[Key(2)] public uint Seed; // the arena galaxy derives from it, so every launch has one layout
|
||||
[Key(3)] public bool Ambient; // false: planets, orbits and stations, but no generated ship or turret
|
||||
[Key(4)] public ScenarioShip Player;
|
||||
[Key(5)] public List<ScenarioEntity> Entities = new List<ScenarioEntity>();
|
||||
}
|
||||
public abstract string Name { get; }
|
||||
|
||||
// A preset placed in the arena. A ship hull stages a Ship; a turret hull an orbital entity with no orbit, which stays
|
||||
// where it is put.
|
||||
[MessagePackObject]
|
||||
public class ScenarioShip
|
||||
{
|
||||
[Key(0)] public CultRecordRef<Loadout> Loadout;
|
||||
[Key(1)] public float2 Position; // zone xz
|
||||
[Key(2)] public float2 Direction; // zero keeps the entity's default heading
|
||||
[Key(3)] public List<CultRecordRef<EquippableItemData>> Cargo = new List<CultRecordRef<EquippableItemData>>(); // first cargo bay
|
||||
}
|
||||
// The conditions and what to verify in them, shown under the scenario's button.
|
||||
public abstract string Brief { get; }
|
||||
|
||||
[MessagePackObject]
|
||||
public class ScenarioEntity : ScenarioShip
|
||||
{
|
||||
[Key(4)] public ScenarioStance Stance; // applied both ways between this entity and the player
|
||||
[Key(5)] public bool Piloted; // a Minion flies it; otherwise it has no agent and stays put
|
||||
// Zero draws the seed from the clock, so each launch is a new galaxy. Anything else fixes the galaxy, its
|
||||
// background and its arena, so every launch has the same layout.
|
||||
public virtual uint Seed => 0;
|
||||
|
||||
// False: the arena keeps its planets, orbits and stations but generates no ship or turret, so nothing wanders into
|
||||
// the scenario's conditions.
|
||||
public virtual bool Ambient => true;
|
||||
|
||||
// Which galaxy the run is in: stage.Main() or stage.Prelude().
|
||||
public abstract Galaxy Generate(GalaxyStage stage);
|
||||
|
||||
// What the run starts with: exactly one stage.Player, and anything else the scenario places.
|
||||
public abstract void Stage(ScenarioStage stage);
|
||||
}
|
||||
|
||||
public enum ScenarioStance
|
||||
|
|
|
|||
Loading…
Reference in a new issue