Skip to main content
File: Assets/_MolcaSDK/_VR/Scripts/Scenario/Scoring/ScoringConfig.cs

Aggregation layers

ScoringConfig instances are used at step, activity, and scenario levels: See Step scoring auxiliary, Activity scoring, and Scenario scoring.

ScoringType

None, PointValue, Binary, TimeBonus, TimePenalty, Countdown, Accuracy. Shared tuning: scoreMultiplier, allowNegativeScore.

Implementation detail

Use CalculateScore(float timeTaken, float accuracy = 1f) as the single source of truth for formulas. Inspect Type (the active ScoringType) and type-specific fields: basePoints, correctPoints / incorrectPoints (Binary treats accuracy >= 0.5 as correct), time windows for TimeBonus, pointsPerSecond for TimePenalty / Countdown, minPoints / maxPoints, then scoreMultiplier and allowNegativeScore clamp. IsTimeBased() is true for TimeBonus, TimePenalty, and Countdown. GetMaxPossibleScore() returns an upper bound for UI caps.

When to use

Embed ScoringConfig (serialized class, not necessarily a standalone asset) wherever scoring is configured: StepScoringAuxiliary, ActivityScoring, ScenarioScoring. Choose None when the layer should not contribute numeric score but you still want a placeholder in the Inspector.

Troubleshooting

  • Scores always zeroType may be None; or time-based config has maxPoints / windows set so the formula yields 0 at current timeTaken / accuracy.
  • Binary feels inverted — Accuracy is 0–1: use StepScoringAuxiliary.SetCorrect / SetIncorrect (or SetResult(bool)) so CalculateScore treats correct as 0.5 and above and incorrect below 0.5.
  • Unexpected negatives — Enable allowNegativeScore or raise minPoints / adjust TimePenalty rate; final value is still multiplied by scoreMultiplier.

Unity Editor

Embedded ScoringConfig on StepScoringAuxiliary or standalone asset if you use ScriptableObject variants.

ScoringConfig in Unity Inspector