feat(minigame): Phase 2.2 - Adaptive Difficulty and Scoring Enhancements#116
Merged
feat(minigame): Phase 2.2 - Adaptive Difficulty and Scoring Enhancements#116
Conversation
- Add PerformancePoint struct with weighted scoring (success 60%, speed 25%, efficiency 15%) - Add LevelChange enum for UI feedback events - Replace simple bool tracking with detailed performance history - Add recency weighting (recent results have higher impact) - Add difficulty weighting (harder scenarios count more) - Extract constants to src/constants/difficulty.rs - Add #[must_use] attributes to key methods - Add comprehensive tests for all new functionality All 1176 tests passing.
- Add ScoreCalculator with combo tracking and performance tiers - Add ScoreBreakdown for detailed score display in UI - Integrate scoring into MiniGameSession - Add constants: combo bonus (10%/level, max 50%), difficulty multipliers - Time bonus up to 50%, efficiency bonus 25% for optimal
- Add MultiplierState struct with grace period system - Add MultiplierChange enum for UI events - Grant grace at streak milestones (10, 25, 50) - Grace prevents multiplier reset on single failure - Integrate with MiniGameSession
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #116 +/- ##
==========================================
+ Coverage 86.07% 86.56% +0.48%
==========================================
Files 91 92 +1
Lines 19471 20586 +1115
==========================================
+ Hits 16760 17820 +1060
- Misses 2711 2766 +55
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Add enhanced stats display to arcade mode UI: - Show combo count with highlight when >= 5 - Display grace indicator [G] when multiplier protection active - Show difficulty level with tier name (Beginner/Intermediate/Advanced) - Add best combo to game over screen Improvements: - Use difficulty constants from constants/difficulty.rs - Extract COMBO_HIGHLIGHT_THRESHOLD constant for maintainability - Use ASCII [G] instead of emoji for terminal compatibility
Add minigame_games_played field to UserProfile to track total arcade games played. Display arcade mode statistics in the Statistics screen: - High Score - Best Streak - Games Played Implementation: - Add minigame_games_played field with serde(default) - Increment counter in handle_minigame_game_over using saturating_add - Add render_arcade_statistics section to statistics.rs - Add unit tests for field initialization and counter increment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 2.2 enhances Arcade Mode with smarter difficulty adaptation, improved scoring mechanics, and better multiplier feedback.
Sub-Phase 2.2.1: Enhanced Adaptive Difficulty
PerformancePointstruct for weighted performance trackingLevelChangeenum for UI notificationsSub-Phase 2.2.2: Enhanced Scoring System
ScoreCalculatorwith combo trackingScoreBreakdownfor detailed score displaySub-Phase 2.2.3: Multiplier Improvements
MultiplierStatewith grace period systemMultiplierChangeenum for UI animationsSub-Phase 2.2.4: UI Feedback
take_level_change(),take_multiplier_change()for event consumptionlevel_progress(),streak_for_next_tier()for progress displayTest plan
Changes
src/minigame/difficulty.rssrc/minigame/scoring.rssrc/minigame/stats.rssrc/minigame/session.rssrc/constants/difficulty.rssrc/constants/gameplay.rs