Commit graph Aetheria/Assets/Scripts/ServerShared/Behaviors/Sensor.cs
Author SHA1 Message Date
Meta Vens
9de7756006 Visibility 4b: a ping or a lock paint is an emission heard within its range over its intercept factor
Entity.Emit posts an ActiveEmission (item, range / InterceptFactor) from Sensor's sweep and LockWeapon's
Track paint; Sense hears every other ship's emissions within HearRange x HearingMultiple x obscuration
through RecordReveal, bearing only, feeding no track. SensorData key 13 and LockWeaponData key 34 carry
InterceptFactor (absent reads 1). Unverified at this commit: the headless suite has not run yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:56:50 +02:00
Meta Vens
d8b7f33d90 Visibility 4a: retire the ping's light signature; Emission is never light
SetSignature refuses Emission; Sensor.PingVisibility (key 7) is retired and
Ping() writes no signature; Sense's Emission skip, the departure subtraction
and SignatureOn are deleted. Tests: SetSignatureRefusesEmission,
APingNoLongerBrightensThePinger; fixtures drop PingVisibility.

Not yet built or tested at this commit (verify job follows).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 20:51:46 +02:00
Meta Vens
6894c2093e Entity records reveals and derives Contact; ChunkInfo reads PassiveInfoPerSignature
The observer's Entity owns a reveal book keyed (subject, item). Sense records a
light act when its strength times PassiveInfoPerSignature clears the detection
threshold; PublishInbox records an emitter whose paint arrived. ReceivePaint takes
the emitter and its item. ContactOf derives Detected, Tracked, Classified and
Identified from track, reveals, the zone clock and GameplaySettings.BearingMemory.
ChunkInfo's arithmetic moves into PassiveInfoPerSignature; ActiveSensors fills one
buffer instead of allocating per call.

Not yet built or tested: verify follows with the tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 18:25:57 +02:00
Meta Vens
d2709d550e Sensor: one reset of the swept set; a ping belongs to its zone; PaintModeTests pin the ending step and the return inbox
The idle _reached.Clear() at the end of Execute is deleted: Ping() is the one per-ping reset
(ASecondPingCrossesTheSameShipAgain). A sweeping tick drops reached subjects that left the zone,
and a ping ends when its pinger is in another zone than it began in. New tests: the ending step's
band, every return credited, an inactive ally posted none, Deactivate clearing the inbox, a ping
ending on a zone change, and a leave-and-return subject crossed again.

Not yet verified: no verify job has run on this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:42:16 +02:00
Meta Vens
dd896528cc Sensor: the pinger's swept set decides each crossing once; allies credit a published ping return inside the bistatic oval
Deletes the stateless interval crossing (_previousRadius, PreviousRadius, Crossing) and the allied-pinger scan over
other ships' Sensors. The pinging Sensor remembers the subjects its wavefront has reached (_reached), in the beam
or not, and a subject's first sweeping tick inside the radius is its one crossing. On it the pinger paints, credits
itself and posts a PingReturn to each ally; Entity publishes returns with paints (PublishPaints is now
PublishInbox) and the ally's own sensors credit them for one tick at the geometric mean range, inside
Rt x Rr < PingRange^2, through the geometric mean of both legs' obscuration (ruling ally-echo-bistatic-oval).
This commit builds and replaces the sensor the previous commit's tests were written against.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:22:29 +02:00
Meta Vens
c47ced9cfd Paints carry search or track; a ping sweep warns every ship it crosses in its beam; allies hear the return silently
LockWarning becomes PaintWarning with a PaintMode (Search for a ping sweep, Track for a lock);
Entity.IncomingLocks becomes IncomingPaints. Sensor replaces the _pingedEntities set with a stateless
crossing rule over the previous and current wavefront radius, limited to a new BeamWidth stat (key 12,
absent reads 360), and credits allied pings from the receiving sensor's own sensitivity and distance.
The HUD lock indicator follows Track paints only. Folds in the radiator sampling-instant pin.

Unverified at this commit (first build still to run).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:05:16 +02:00
Meta Vens
1d14edea3a Signatures: every light signature names its channel and item through Entity.SetSignature
VisibilitySources holds Signature (channel, strength, item); the eight direct writes
go through the one writer; Visibility stays the sum; SignatureOn(channel) splits it.
VisibilityData gains Key(3) Channel. No number changes. Not yet built or tested at this
commit (verification follows).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 09:13:24 +02:00
Meta Vens
0fb5ac1dfc Sensor.Gain takes the obscuration of its sight line
Gain stays the one detection rule: both branches are scaled by the fraction
of the signal that survives the clouds between observer and target
(Zone.Obscuration, exactly 1f with none, so the pre-cloud trace is
bit-identical). The entity loop passes it for pings and passive ticks and
PassiveRate for the chunk position. Entity.cs is untouched: a lock falls by
the existing detection-threshold rule when info does. Adds the sensor-level
facts to VapourCloudTests. Builds; not yet run (verify job follows).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 20:22:16 +02:00
Meta Vens
f803151681 Mining index: a general targeting index fed by providers; the linear chunk scan goes
Zone.Targets (TargetingIndex) answers Within and best-first Best over
ITargetProvider regions. EntityTargets offers the observer's VisibleEntities;
BeltTargets keys each belt's rocks into kinetic bands and bounds each segment's
annular sector for distance, bearing and visibility. Entity.VisibleChunksInReach
queries the index with DetectionReachPerVisibility, an upper bound from the
sensors' hull. Zone.ChunksNear and AsteroidBelt.InnerRadius are deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:02:51 +02:00
Meta Vens
a1d27cfc04 Mining Cut 3: extract the detection gain rule into Sensor.Gain
Sensor.Execute's ping and passive gain arithmetic moves, term for term and in
the same multiplication order, into one static function, Sensor.Gain. The
entity loop calls it; Sensor.PassiveRate calls it for the on-demand chunk
query that follows. SensorGainExtractionChangesNothing holds the recorded
EntityInfoGathered trace bit for bit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 12:56:13 +02:00
Meta Vens
8bbf280756 Resolve request/brownout conflict: evaluate power requests nominally
A power request may not depend on power supply (Cut 6/F6), and continuous
consumers brown out through a power term on their own performance stats
(Cut 7). For Radiator (PumpedHeat) and AetherDrive (Torque) those were the
same stat, making six shipped catalog records illegal and leaving six
BrownoutTests cases skipped.

Resolved per the operator's ruling: a power request is evaluated
nominally -- what the item wants at full supply, not what it is currently
managing. EquippedItem.EvaluateNominalPower (mirroring ConditionRatio's
own NominalContext) pins only PowerSupplyFactor to 1; Heat/Durability
stay live, since they are not the term a request would be circular
through. Every PowerRequest/RefreshReserve/RefreshInputCapacitor
implementation now reads a StatValidation.PowerRequestFields stat through
it, so the same stat can carry a brownout curve and be a request field
without the request depending on its own answer.

StatValidation.ValidateNoPowerSupplyOnRequest (F6's static half of the
rule, forbidding the term outright) is deleted -- nominal evaluation
removes the circularity at the root instead. Only the dynamic
modifier-chain half (StatModifier.ValidateNoPowerSupplyChain) still
refuses anything, since EvaluateNominalPower forwards ScaleModifier/
ConstantModifier unchanged (real, not nominal).

Un-skips BrownoutTests' six Radiator/AetherDrive cases and adds two new
regression tests (a direct EvaluateNominalPower probe, and a two-tick
Radiator demand check) backed by a new mutation harness. Updates the four
PowerCurveTests/AetheriaStoresTests cases that pinned the now-superseded
static refusal to instead assert acceptance. GameData/Aetheria.cc is
unchanged and still validates.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 06:58:57 +02:00
Meta Vens
55249beb98 Cut 5: priority tiers replace PowerBus's single shared GrantRatio
PowerTiers.cs names five tiers (Critical/High/Medium/Low/Utility) and their
per-behaviour-kind defaults: Radiator is Critical (the closest thing this game
has to life support -- a starved radiator cascades into wear and shutdown
across the whole hull), Shield is High, Thruster/AetherDrive are Medium,
ConstantWeapon/InstantWeapon are Low, and Sensor/EnergyDraw are Utility.
IPowerConsumer.DefaultPowerTier lets each behaviour own its own default.

EquippableItem.PowerTier (Key 12) is the stored, player-choosable tier on the
unit rather than the design; EquippedItem's constructor seeds a kind default
the first time a unit is equipped, only when the field is still
PowerTiers.Unassigned, and never again -- a tier is a stored choice, not
something the bus re-derives.

PowerBus.AllocateTiers walks tiers lowest-number-first: a tier is granted in
full before the next tier sees anything left, an empty tier passes its whole
share down, and within a tier every consumer rations by the same
grant/demand fraction so unequal requests still divide proportionally. A new
TierGrantRatio[] exposes each tier's own ratio for a future UI (Cut 8) to
read starvation from directly, instead of reconstructing it from every item's
PowerSupply.

Deletes EquippedItem.SortPosition, IOrderedBehavior and Reactor.Order (its
only implementer): the bus already steps before any equipment's Execute, so
equip/behaviour order never decided who got fed even before this cut, and
nothing else needed the interface (subject to the map's O3 operator check).

docs/stats-and-power-cut.md Cut 5 / §1.3.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 02:58:38 +02:00
Meta Vens
8dacabb3d8 Cut 4: input capacitors close the last direct capacitor spend
Deletes Entity.CanSpendCapacitorCharge/TrySpendCapacitorCharge (and the
now-dead _capacitors bookkeeping list that only fed them) -- Cut 3's
named, temporary exception for the four instant draws. InstantWeapon
(both fire sites), Sensor.Ping, and Shield.CanTakeHit/TakeHit now spend
from their own InputCapacitor, filled continuously by PowerBus like
every other IPowerConsumer instead of touching the entity's shared bus
capacitors directly.

InputCapacitor's Capacity/Rate derive from the owning item's Energy and
Cooldown, with an authored-override hook (ChargedWeapon repurposes its
previously-unused ChargeEnergy stat as that override, per the map's own
instruction, rather than adding a new field). A weapon/sensor fire
attempt only ever spends exactly Capacity, so it only ever succeeds at
full charge -- no fractional shot. Shield is the map's named exception:
its reserve is continuous, not an activation buffer, so it allows a
partial draw; its size (no Energy/Cooldown pair exists on Shield) is a
flagged judgment call, not a spec'd formula.

Adds InputCapacitorTests.cs (8 tests) and
mutation_tests_stats_power_cut4.py (7 mutations, all behave as
declared); removes the one PowerBusTests.cs test and Cut 3 mutation
case that exercised the now-deleted Entity methods.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 22:52:15 +02:00
Meta Vens
f1fd64ac60 Cut 3: PowerBus replaces TryConsumeEnergy/CanConsumeEnergy
Deletes Entity.CanConsumeEnergy/TryConsumeEnergy and Reactor's own capacitor
draining/filling (the demand-mechanism halves of Reactor.cs:90-141); adds
PowerBus (one per Entity, stepped once per tick before equipment executes),
IPowerConsumer on the five continuous draw sites (EnergyDraw, Thruster,
AetherDrive, Radiator, ConstantWeapon), and EquippedItem.PowerSupply as the
bus's grant ratio. Reactor keeps only its heat/throttle arithmetic, now driven
by PowerBus.NetDraw instead of an accumulator any behaviour could add into.

The four instant draws (InstantWeapon's burst/shot, Sensor's ping, Shield's hit
taken) are out of scope for the bus this cut per the map; they spend capacitor
charge directly and atomically via the new Entity.TrySpendCapacitorCharge/
CanSpendCapacitorCharge, replacing TryConsumeEnergy's old partial-drain-then-
refuse bug for that path too. Named, temporary exception closed by Cut 4.

docs/stats-and-power-cut.md Cut 3.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 21:39:38 +02:00
Meta Vens
6140a06a0a Swap Unity.Mathematics usings for CultMath
Every Unity.Mathematics using, alias and qualified name under Assets\Scripts
and tools now names CultMath. The nine `using static ...noise;` lines are
gone: snoise lives on CultMath's math. UnityExtensions loses float4.ToColor
and Color.ToFloat4, which duplicate the bridge's ToColor and ToCultMath; the
float3 colour pair stays because the bridge has none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 17:39:12 +02:00
Meta Vens
7006a6b0dd Restore the stable legacy Unity project 2026-08-10 14:57:50 +01:00
Meta Vens
39a0dc8737 Sync daemon authority migration 2026-06-21 09:37:54 +01:00
Meta Vens
01fc810eb4 Restore behavior runtime state from typed Continue 2026-06-16 09:01:05 +01:00
Meta Vens
70c9e965a1 Bypass configs for heavy behaviors 2026-06-15 19:29:34 +01:00
Meta Vens
f220da035e Stop non-weapon heavy behaviors retaining configs 2026-06-15 18:02:04 +01:00
Meta Vens
399efc3851 Delete legacy payload key annotations 2026-06-14 22:39:44 +01:00
Meta Vens
32187038eb Demote behavior construction configs 2026-06-14 21:48:43 +01:00
Meta Vens
16a92b0173 Persist behavior runtime state in checkpoints 2026-06-14 14:29:04 +01:00
Meta Vens
5196ee4c3c Delete dead RuntimeInspectable metadata 2026-06-14 10:23:09 +01:00
Meta Vens
3d2dfcd82d Rename runtime projection keys to legacy payload keys 2026-06-13 21:19:53 +01:00
Meta Vens
6a4f3f9ccc Rename runtime projection field keys 2026-06-13 20:35:49 +01:00
Meta Vens
066597e70b Replace runtime MessagePack DTO keys 2026-06-13 15:02:32 +01:00
Meta Vens
b0d2aa1156 Purge Newtonsoft state annotations 2026-06-13 04:56:50 +01:00
Reinier Vens
4489b18452 Action Bar (WIP)
Refactor item instance to use DatabaseLink
Labels now pop up when aiming at loot
Yeeted HUD trigger group UI into the abyss
Created rebindable action bar (missing: assigning actions)
Created Consumable Items
Refactored behaviors to work on consumable items
Implemented Velocity Conversion Behavior
2021-04-18 05:13:20 +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
a51c402fc5 Reflected Visibility
Ships are now more visible in lit areas (depending on cross section stat in Reflector behavior)
Refactored all behaviors to remove context & entity references (can get them from equipped item reference if needed)
Fixed crash when enemy dies of heatstroke while targeted
Exponential decay for visibility now uses correct time-independent formula
Refactored item inspection in properties panel (now consistent between equipped items vs. inventory and store items, shows effect of heat on stats)
Reordered item properties and added spacing between groups
2021-04-12 04:20:52 +01:00
Reinier Vens
968783bf9c Database Improvements
Brought in all the myriad improvements to the database tools from the Stream Pixels project
Added configurable nested entry grouping
2021-04-07 01:27:35 +01:00
Reinier Vens
526a737a4d Modular Database Tools
Extracted all inspector code for database inspector into a single class per supported field type and wrote reflection code to invoke them automatically
Removed all Aetheria-specific code from database tools
Database View editor is now abstract and supports arbitrary grouping of entry types; specific users must implement their own database view
2021-03-31 04:07:11 +01:00
Reinier Vens
645fcf4b09 Sensor Ping
Added ping feature to sensors, pulsing a wave of revealing light into the level
Added IEventBehavior interface, used by sensors and weapons, for behaviors containing event subscriptions which need to be reset when EntityInstance is disposed
Implemented sensor impact for locked weapons (lock speed varies with sensor acquisition)
Added ping cooldown bar to HUD
Added spline curve implementations to AetheriaMath, applied better mapping to wormhole transition animation
Tweaked loadout generator to prefer larger items to a controllable degree (e.g. very important for cargo bays, less for shop inventory), shop inventory bans non-ship hulls and manages internal space more effectively
2021-03-21 01:55:25 +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
Reinier Vens
4b10923448 Heat Performance Curves + Wear & Tear
Added heat variation option for Performance Stats
Ability to toggle radiators on/off using H key
Item durability loss (Wear) is now heat dependent and incurred only when used
Restricted equip/unequip to docked (inactive) entities
Fixed race condition causing exceptions in database sync code
2021-03-04 03:58:46 +00:00
Reinier Vens
b53e4aec8c Combat & Visibility & Collisions
Converted entity materials to new fade shader
Implemented visibility system
Refactored per-instance entity code to run inside monobehavior on entity instances
Created state machine AI for enemy ships with basic patrol and combat routines
Removed legacy AI code (controller item behaviors)
Added automatic trigger group assignment for matched weapons
Created ship collision system
Created shield VFX and colliders
2021-02-26 19:01:47 +00:00
Reinier Vens
8d4bd04891 AI State Machine First Pass
Implemented first pass on code-driven state machine logic for flexible AI agents
2021-02-11 03:14:20 +00:00
Reinier Vens
fddd485262 Hellfire
Targeting
Target locking
Crosshairs
Improved HUD schematic feedback
Equipment Heat Damage
Equipment Disabling
2021-01-10 03:59:47 +00:00
Reinier Vens
c4be204cd0 First Flight
Added MPL license headers
SectorRenderer renders entities in sector, manages particle systems for ship thrusters
Thrusters apply torque based on orientation and position relative to ship center of mass
GameManager controls the player ship's thrusters
Player can dock with station if they are near
2020-12-22 03:13:43 +00:00
Reinier Vens
f643f6cc8a New Inventory System + Overhaul
Removed universal GameContext references
Refactored GameContext: It's now only responsible for item management. As such it's now called ItemManager
GlobalData is gone, relevant settings are distributed amongst specialized settings classes
Entities are no longer database entries, references to them are now direct - Zone is reponsible for storing them in ZonePacks
Controller subtypes are now generic classes, class argument is task type
Inventory is now a 2D grid instead of a list
Entity temperature is now a 2D grid instead of a number
Item sizes are now arbitrary shapes instead of a number
Hardpoints are now arbitrary shapes instead
Equipped items have their own temperatures
Map view now displays sunlight colors
Integrated Allegorithmic Substance Plugin
Imported Djinni ship and assigned Substance materials
Removed Node Editor framework (might come back later but needs work to integrate with behavior system)
2020-12-10 23:20:38 +00:00
hyperion51
50a8059ed4 Super Sexy Properties Panel
Properties panel now allows nested lists with foldouts, item selection and click callbacks
Properties Panel UI has a new look
Refactored lambdas in control module code into methods for readability
2020-05-31 03:10:11 +01:00
hyperion51
8cd4ea3dc5 Massive Item Behavior Refactoring
Item behaviors are now separated into more granular units, allowing designers to create more interesting items by combining behaviors
2020-05-12 01:42:13 +01:00
hyperion51
fc94531566 Behavior Canceling & Grouping
Behaviors are now grouped, behaviors within a group can cancel execution of the rest of the group
2020-05-11 01:17:10 +01:00
hyperion51
6aeb2ae280 Entity Persistence Refactoring
Entities refactored to enable robust persistence
Entities detect stale data references and reload behaviors
2020-05-06 04:56:36 +01:00
hyperion51
7cd24147ae Behavior Refactoring
Behaviors and PerformanceStats are no longer associated solely with Ships, instead there's a generic Entity class which will also be used for stations and turrets.
2020-04-09 10:33:16 +01:00
Renamed from Assets/Scripts/ServerShared/ItemBehaviors/Sensor.cs (Browse further)