Commit graph Aetheria/Assets/Scripts/ServerShared/PlayerSettings.cs
Author SHA1 Message Date
Meta Vens
8a0a29e0de Galaxy.IsPrelude is the one owner of whether a run is the prelude: ActionGameManager.IsTutorial and PlayerSettings.TutorialPassed are cut
IsTutorial duplicated Galaxy.IsPrelude; its readers read CurrentGalaxy.IsPrelude, and RunSave.Capture writes
SavedGame.IsTutorial from galaxy.IsPrelude with no isTutorial argument. TutorialPassed was never written and its only
reader was New Game's unreachable main-galaxy branch, which goes with it (S2 brings the main galaxy back as a
scenario). spawnturret's two identical generator branches collapse to one. Old player.cc files still load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 20:26:30 +02:00
Meta Vens
00ebe46abe Move mouse-look sensitivity into the PlayerSettings CultCache global
ActionGameManager.Sensitivity was a Unity-serialized public float2, but
CultMath's float2 isn't Unity-serializable, so ARPG.unity's stored value
loaded as zero and mouse look went dead. Sensitivity is a player
preference, so it belongs in PlayerInputSettings (key 2) with the prior
default (-0.001, 0.001) as a field initializer, so a pre-existing player
store missing the key still deserializes to the working default instead
of zero. ActionGameManager now reads PlayerSettings.InputSettings.Sensitivity
directly; no cached copy on the MonoBehaviour. Adds a pinning test that
simulates an old store lacking key 2 and asserts the default, plus a
round-trip test for a non-default value.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 17:22:09 +02:00
Meta Vens
5c5c3d5e19 Delete the old run, settings, layout and loadout authorities (Cut 10)
The deletion line lands before RunSave, as the spec orders. Deleted, not
demoted:
- PlayerSettings.SavedRun (Key 1 stays unclaimed) and the SavedGame
  constructor that upserted a fresh SavedZone per zone on every save.
- ActionGameManager: the PlayerSettings.msgpack getter, file path and
  writer; the .loadout format (_loadoutPath, Loadouts, SaveLoadout and its
  default-options serializer, the commented loader); OnApplicationQuit and
  SaveState; SaveZone, which had no caller.
- MainMenu's SavedRun Continue branch and both `SavedRun = null` writes.
- InventoryPanel's Save Loadout and Restore Loadout bodies.
- InputDisplayLayout's KeyboardLayouts file reader, ParseJson,
  AssociateInputKeys, SaveLayout and the usings they alone needed.
- AetherDb's Cut 9 importer (Import.cs, legacy-census, import).
- The three-gates note on loading writes; Cut 3 made loading non-writing.
- .gitignore ignores GameData/run.cc and GameData/player.cc instead of
  PlayerSettings.msgpack.

DOES NOT BUILD in Unity: ActionGameManager, MainMenu and InputDisplayLayout
still reference the deleted members until the next commit wires RunSave,
the settings getter and the catalog layout read. Headless builds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 21:51:10 +02:00
Meta Vens
c2026142be Pin AetheriaStores routing with tests; make PlayerSettings readable
Cut 8b. tests/Aetheria.Shared.Tests (xunit, net10.0) builds a temp-directory
catalog through AetheriaStores.Open(catalogWritable: true) per test:
- OpenThenFlushLeavesEveryFileByteIdentical: the catalog, plus run and
  player stores seeded with their globals, a SavedZone and an InputLayout.
- WeaponWrittenThroughGearHandleReloadsAsWeapon
- CatalogRefusesWrites: bytes unchanged too.
- SavedZoneNeverLandsInCatalog: no home without a run store; the snapshot
  schemas show where it landed.
- FactionIsASingletonInstance: through a ref, a ref-keyed map key, and the
  name index.
- MissingCatalogGlobalIsLoud: uses a test-only [CultGlobal] routed to the
  catalog. The game has no catalog globals yet.

The first test found a real defect. PlayerInputSettings.InputActionMap was
keyed by (string, int), and CultLib's untrusted-data MessagePack security
has no hash-resistant comparer for a tuple, so a player store could never
be read back. It is now action name to binding index to path; its two
Unity readers change in the Unity commit.

Each test was checked to fail with the rule it pins removed; see the
report.

Builds: Aetheria.Shared, AetherDb, Aetheria.Shared.Tests (6/6 pass).
Unity does not build yet.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:12:54 +02:00
Meta Vens
a2b54889b4 Move the ServerShared data model onto CultLib's CultCache
Cut 8b. Aetheria.Shared builds headless against GameCult.Caching and
GameCult.Caching.MessagePack at the pinned CultLib; the pin guard also
checks the Caching project exists.

Documents: [CultDocument("aetheria.<type>", "1")] with [MessagePackObject]
and integer [Key]s on the Q7 concrete types (the eight ItemData leaves,
Faction, FactionProductData, PersonalityAttribute, NameFile, OrbitData, the
four BodyData leaves, SavedZone, SavedGame, PlayerSettings, InputLayout).
SavedGame and PlayerSettings are [CultGlobal]; Name members are [CultName].
ItemData, CraftedItemData, EquippableItemData, BodyData and AgentTask lose
[MessagePackObject]; BodyData and AgentTask lose their [Union]s. InputLayout
moves into ServerShared so AetheriaStores can route it.

References: Guid and DatabaseLink<T> members become CultRecordRef<T>;
Guid-keyed maps become ref-keyed with [CultReference(..., many: true)];
ZonePack holds refs to orbit and body records. Runtime maps (Zone orbits,
bodies and belts, cargo ItemsOfType, agent targets) key by CultRecordKey.
Identity is the record key: ID comparisons become reference or key
comparisons. StatModifierData.RequireBehavior is a simple type name.

AetheriaStores.Open composes the catalog (read-only unless writable), run
and player stores, one home per type. CultRecordRefs carries IsSet, a
null-safe Get(ref), RefOf (key from TryGetHandle) and Upsert.
ItemManager.GetData is the one item resolution path. MathResolver is
declared by [assembly: CultCacheFormatterResolver].

Inspector attributes: text, range and asset path map onto CultLib's
CultInspector attributes (asset path only on string members); every
replaced Aetheria attribute keeps [Inspectable] for the runtime panel.

Builds: Aetheria.Shared. Does not build: AetherDb and the Unity project,
which follow.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 19:00:42 +02:00
Meta Vens
7006a6b0dd Restore the stable legacy Unity project 2026-08-10 14:57:50 +01:00
Meta Vens
3f2614cec0 Demote runtime player settings projection 2026-06-13 18:48:53 +01:00
Meta Vens
344776fd00 Demote player settings from MessagePack 2026-06-13 08:50:00 +01:00
Meta Vens
b539b9b6e8 Disable legacy local save authority 2026-06-13 05:21:22 +01:00
Reinier Vens
b93d2d213b Graphics Settings + Disabling Minimap Asteroids
Created graphics settings data structure
Added nebula quality option to graphics settings
Added option to display asteroids in minimap (expensive)
2022-07-18 08:44:54 +01:00
Reinier Vens
81acaf2a47 In Game Input Screen
Implemented saving/loading of custom input settings
Incorporated Input Screen in game
Organized UI scripts into folders
Deleted some unused UI scripts
Reimplemented Fog Blur (by copying modified DoF to assets)
2021-05-08 07:35:16 +01:00
Reinier Vens
da1caec7d6 Drag & Drop Input Reassignment
Implemented Drag and Drop operations for reassigning inputs in input screen
2021-05-07 19:51:23 +01:00
Reinier Vens
40c244190b Mouse Bindings + Action Bar
Implemented mouse bindings for input screen
Implemented action bar bindings for input screen
2021-05-06 18:43:23 +01:00
Reinier Vens
296a7f2958 Input Screen Refactoring
Cleaned up the code for the input screen and refactored to prepare for mouse binding
Consolidated wormhole and dock keys into one "Interact" key
2021-05-06 02:34:19 +01:00
Reinier Vens
ecd52b20c8 UI Improvements
Target box now has bars for visibility and HP
Hit indicator appears when target is damaged by player's weapons
WIP narrative integration
2021-04-27 16:44:44 +01:00
Reinier Vens
b1bd89a687 Mini Galaxy Gen
Added flags to game manager and player settings to check tutorial status
Created alternate galaxy generation process for tutorial
2021-04-22 02:53:06 +01:00
Reinier Vens
11bfc739fe Aetheric Drive
Added Aetheric Drive hardpoint and item behavior
Added Drive RPM UI to HUD
Fixed death not disabling continue option
Disabling global input when dialog is visible
Fixed loadout generator failure when zero price item present
Replaced fixed top speed with drag coefficients
2021-04-14 03:29:14 +01:00
Reinier Vens
b171b940dc Significant Digits Hotfix
Formatting code was consuming the sigdigs whenever it was used. Whoops!
2021-04-13 02:16:03 +01:00
Reinier Vens
54f7e3a66f Properties Panel Overhaul
Marking player location on galaxy map
Fixed non-input field focus disabling global key map
Player start ship is now always the same
Loadout generator now demands exact match for item dimensions
Thermal damage now triggers ItemDamaged event = player can die from cockpit wear!
Properties panel now has a much more attractive UI
Implemented curve control for properties UI
Centralized number formatting in player settings
Moved significant digits to player settings
Added temperature unit option in player settings
2021-04-13 01:50:42 +01:00
Reinier Vens
b6828a975a Save/Load and Main Menu Submenus
Redid all of the property panel UI prefabs (oof)
Implemented saving and loading of the game state
Moved sector generation to sector constructor (along with loading from save file)
Entity settings now separate from player settings
Player settings (incl. saved run) now statically accessible from game manager
Added animations and submenus to the main menu
Unified main menu settings and properties panel styles for prefab reusability
2021-03-14 03:56:49 +00:00
Reinier Vens
1092159063 Thermal Performance Threshold & Thermal Override
Items will switch themselves off below a customizable threshold to avoid damage
Player can toggle thermal override to disable safety shutdown
Selecting an item allows player to select whether the item will override
Clicking on the background of an inventory panel will display general ship settings (including thermal shutdown threshold)
Performance Stat evaluation has been moved to EquippedItem, slight performance improvement
Item online and active status are now reactive properties
Created player settings file to store e.g. shutdown threshold
Fixed crash when entering wormhole while enemies are visible
2021-03-07 01:10:31 +00:00