Skip to content

Add Needle Thread arcade game mode#427

Open
Shombith03 wants to merge 10 commits into
developmentfrom
claude/add-needlethread-dolphin-scripts-GVgoI
Open

Add Needle Thread arcade game mode#427
Shombith03 wants to merge 10 commits into
developmentfrom
claude/add-needlethread-dolphin-scripts-GVgoI

Conversation

@Shombith03

Copy link
Copy Markdown
Contributor

Summary

Implements the complete Needle Thread arcade game mode, a multiplayer racing game where players navigate a procedurally-generated helix course at high speed, destroy hostile structures through drift collisions, and compete to finish first while meeting volume destruction targets.

Key Changes

Core Game Logic

  • NeedleThreadController: Main game controller managing track spawning, race progression, scoring, and multiplayer synchronization
    • Procedural track generation with intensity-based scaling
    • Helix course with configurable radius based on game intensity
    • Server-authoritative race completion and score calculation
    • Golf-rules scoring system (lower scores win)
    • Network synchronization of final scores and race results

Scoring & Tracking

  • NeedleThreadScoreTracker: Monitors race progression and calculates final scores

    • Tracks elapsed race time for winners
    • Calculates penalty scores for non-winners based on remaining hostile volume
    • Integrates with UGS telemetry reporting for analytics
    • Exposes vessel telemetry stats (drift time, boost time, volume destroyed)
  • VolumeDestructionTurnMonitor: Tracks hostile structure destruction progress

    • Monitors volume destroyed by local player
    • Determines race completion when threshold is met
    • Updates UI with remaining volume to destroy

UI & Presentation

  • NeedleThreadScoreboard: Custom scoreboard formatting

    • Displays race time (MM:SS:MS) for winners
    • Shows remaining echo hits for non-winners
    • Dynamic banner based on winner's domain
  • NeedleThreadHUD: Real-time player card updates

    • Tracks hostile volume destroyed per player
    • Updates cards as destruction progresses
  • NeedleThreadEndGameController: End-game cinematic integration

    • Determines win/loss state
    • Displays appropriate victory/defeat messaging
    • Shows race time or remaining echo hits in score reveal

Analytics & Reporting

  • NeedleThreadStatsReporter: Submits race statistics to UGS

    • Reports winner race times and volume destroyed
    • Tracks vessel telemetry data
    • Integrates with existing analytics pipeline
  • UGSStatsManager: Extended with ReportNeedleThreadStats() method

    • Tracks best times per intensity level
    • Submits scores to leaderboards

Game Configuration

  • Added NeedleThread game mode enum (value 39)
  • Added PlayGameNeedleThread call-to-action target type
  • Updated arcade game asset with proper display name and description
  • Configurable parameters: base segment count, straight line length, helix intensity scaling, volume-to-finish threshold

Notable Implementation Details

  • Uses Netcode for multiplayer synchronization with server-authoritative race completion
  • Implements golf-rules scoring where lower times are better for winners
  • Non-winners receive penalty scores (10000 + remaining volume) to maintain leaderboard ordering
  • Track seed is synchronized early (1.5s after spawn) to ensure all clients generate identical courses
  • Supports both override and networked volume-to-finish targets for flexible difficulty tuning
  • Integrates with existing vessel telemetry system for comprehensive player performance analytics

https://claude.ai/code/session_01DgiJuVhagfk4BufQqsrrB8

claude and others added 10 commits March 20, 2026 00:18
New multiplayer game mode where Dolphin players race along a track,
collect crystals to charge explosions, and destroy dartboard structures.
Winner is first to reach hostile volume destruction threshold.

New scripts:
- NeedleThreadController: multiplayer race controller with volume-based win
- NeedleThreadScoreTracker: tracks elapsed time and volume destroyed
- VolumeDestructionTurnMonitor: ends turn when volume threshold reached
- NeedleThreadEndGameController: victory/defeat with time or echo hits left
- NeedleThreadScoreboard: formats winner time and loser echo hits
- NeedleThreadHUD/HUDView: live hostile volume destroyed display
- NeedleThreadStatsReporter: UGS telemetry reporting

Modified:
- GameModes enum: added NeedleThread = 39
- CallToActionTargetType: added PlayGameNeedleThread = 435
- UGSStatsManager: added ReportNeedleThreadStats method
- ArcadeGameNeedleThreader.asset: updated Mode, DisplayName, Description,
  SceneName, Vessels (Dolphin), and CTA target

https://claude.ai/code/session_01DgiJuVhagfk4BufQqsrrB8
GameDataSO lives in CosmicShore.Soap namespace. The stats reporter
references it directly as a serialized field, unlike the controller
and score tracker which inherit it from base classes.

https://claude.ai/code/session_01DgiJuVhagfk4BufQqsrrB8
- SkimmerImpactor.OwnDomain and isInitialized now null-check the skimmer
  reference before accessing Domain/IsInitialized, preventing NullRef when
  collisions happen before VesselController.Initialize() completes

- Create DolphinVesselTelemetry with ExplosionsTriggered and VolumeDestroyed
  tracking (Dolphin previously fell through to DefaultVesselTelemetry)

- Register DolphinVesselTelemetry in VesselTelemetryBootstrapper switch

https://claude.ai/code/session_01DgiJuVhagfk4BufQqsrrB8
The Dolphin's charge→explosion ability was completely broken:

1. VesselChangeResourceByPrismEffectSO: Script used old API (halved
   resource instead of adding charge). Now uses ResourceChangeSpec
   matching the asset's _change field (adds 0.5 to Energy per prism hit)

2. DolphinVesselChangeResourceByCrystalEffect: Wrong resource index (1=Boost
   instead of 0=Energy). Fixed to consume Energy when hitting crystal.

3. DolphinVesselExplosionByCrystalEffect: Wrong resource index (1=Boost
   instead of 0=Energy). Fixed so explosion scales off accumulated charge.

4. NeedleThread scene: Added DartBoard prefab to SegmentSpawner's
   guaranteedSpawnables so dartboard structures spawn alongside the track.

https://claude.ai/code/session_01DgiJuVhagfk4BufQqsrrB8
The DartBoard prefab had a stale 'trailBlock' field name that didn't match
the renamed 'greenPrism' (via FormerlySerializedAs("greenTrailBlock")),
causing both greenPrism and redPrism to be null at runtime. This produced
"The Object you want to instantiate is null" in SpawnLeafObjects.

Now correctly references GreenDartBlock and RedDartBlock prefabs.

https://claude.ai/code/session_01DgiJuVhagfk4BufQqsrrB8
- GreenDartBlock: fix null onPrismVolumeModified and onPrismStolen SO refs
  that caused NullReferenceException in PrismScaleAnimator.ExecuteOnScaleComplete
- PrismScaleAnimator: add null-safety for onPrismVolumeModified.Raise()
- SpawnableDartBoard: add hostileToAll flag (Domains.None) so all prisms
  are hostile to every player's explosions
- DartBoard.prefab: enable hostileToAll by default
- SegmentSpawner: add ConfigureGuaranteedDistribution() for distributing
  guaranteed shapes along the track at each segment position
- NeedleThreadController: distribute DartBoards along track at 0.2x scale
  instead of one large cluster 420 units from origin

https://claude.ai/code/session_01DgiJuVhagfk4BufQqsrrB8
- NeedleThreadController: change dartBoardScaleFactor from 0.2 to 0.5
  (half of original size, not 5x smaller which made them invisible)
- PrismEffectHelper: silently skip damage when Player is null instead of
  spamming LogError — this happens when vessel collides with prisms
  before player assignment completes during game start

https://claude.ai/code/session_01DgiJuVhagfk4BufQqsrrB8
The previous approach called Spawn() repeatedly on the same prefab-based
SpawnableBase reference, which caused cache/state issues resulting in only
one DartBoard appearing. Now instantiates an independent copy of the
SpawnableDartBoard for each segment position, calls Spawn() on the fresh
instance, then destroys the temporary spawnable. Each Spawn() call has
clean state and produces a fully initialized DartBoard.

https://claude.ai/code/session_01DgiJuVhagfk4BufQqsrrB8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants