Commit Graph

31 Commits

Author SHA1 Message Date
Michal Pikulski
a049c6a750 Update methods to be internal, remove invocation bloat 2025-11-10 21:59:47 +01:00
Michal Pikulski
01caca1878 Add docs and clear the zero-width-backspace-formatting 2025-11-10 15:56:30 +01:00
Michal Pikulski
7565b189b9 Add distinction between managed awake and managed start 2025-11-10 15:52:53 +01:00
Michal Pikulski
2127bf37b2 Add boosters to minigame again 2025-11-07 17:26:29 +01:00
d2e79f058b Merge branch 'ui-overhaul' 2025-11-07 16:56:51 +01:00
de2966fb1e Cinematics and UI overhaul 2025-11-07 16:47:10 +01:00
e27bb7bfb6 Refactor interactions, introduce template-method lifecycle management, work on save-load system (#51)
# Lifecycle Management & Save System Revamp

## Overview
Complete overhaul of game lifecycle management, interactable system, and save/load architecture. Introduces centralized `ManagedBehaviour` base class for consistent initialization ordering and lifecycle hooks across all systems.

## Core Architecture

### New Lifecycle System
- **`LifecycleManager`**: Centralized coordinator for all managed objects
- **`ManagedBehaviour`**: Base class replacing ad-hoc initialization patterns
  - `OnManagedAwake()`: Priority-based initialization (0-100, lower = earlier)
  - `OnSceneReady()`: Scene-specific setup after managers ready
  - Replaces `BootCompletionService` (deleted)
- **Priority groups**: Infrastructure (0-20) → Game Systems (30-50) → Data (60-80) → UI/Gameplay (90-100)
- **Editor support**: `EditorLifecycleBootstrap` ensures lifecycle works in editor mode

### Unified SaveID System
- Consistent format: `{ParentName}_{ComponentType}`
- Auto-registration via `AutoRegisterForSave = true`
- New `DebugSaveIds` editor tool for inspection

## Save/Load Improvements

### Enhanced State Management
- **Extended SaveLoadData**: Unlocked minigames, card collection states, combination items, slot occupancy
- **Async loading**: `ApplyCardCollectionState()` waits for card definitions before restoring
- **New `SaveablePlayableDirector`**: Timeline sequences save/restore playback state
- **Fixed race conditions**: Proper initialization ordering prevents data corruption

## Interactable & Pickup System

- Migrated to `OnManagedAwake()` for consistent initialization
- Template method pattern for state restoration (`RestoreInteractionState()`)
- Fixed combination item save/load bugs (items in slots vs. follower hand)
- Dynamic spawning support for combined items on load
- **Breaking**: `Interactable.Awake()` now sealed, use `OnManagedAwake()` instead

##  UI System Changes

- **AlbumViewPage** and **BoosterNotificationDot**: Migrated to `ManagedBehaviour`
- **Fixed menu persistence bug**: Menus no longer reappear after scene transitions
- **Pause Menu**: Now reacts to all scene loads (not just first scene)
- **Orientation Enforcer**: Enforces per-scene via `SceneManagementService`
- **Loading Screen**: Integrated with new lifecycle

## ⚠️ Breaking Changes

1. **`BootCompletionService` removed** → Use `ManagedBehaviour.OnManagedAwake()` with priority
2. **`Interactable.Awake()` sealed** → Override `OnManagedAwake()` instead
3. **SaveID format changed** → Now `{ParentName}_{ComponentType}` consistently
4. **MonoBehaviours needing init ordering** → Must inherit from `ManagedBehaviour`

Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com>
Reviewed-on: #51
2025-11-07 15:38:31 +00:00
Michal Pikulski
43779c560e Cleanup compile warnings, cleanup logs, spruce up level selection menu 2025-10-28 14:31:17 +01:00
Michal Pikulski
cc797f09ef Update the rotation enforcement to automatically lock device into
desired orientation.
2025-10-24 16:48:45 +02:00
5a85a602bd Revamp game pausing and input handling. Fix minigame tutorial and end sequence. (#39)
- Revamp pausing and centralize management in GameManager
- Switch Pause implementation to be counter-based to solve corner case of multiple pause requests
- Remove duplicated Pause logic from other components
- Add pausing when browsing the card album
- Fully deliver the exclusive UI implementation
- Spruce up the MiniGame tutorial with correct pausing, hiding other UI
- Correctly unpause after showing tutorial
- Fix minigame ending sequence. The cinematic correctly plays only once now
- Replaying the minigame works

Co-authored-by: Michal Adam Pikulski <michal@foolhardyhorizons.com>
Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com>
Reviewed-on: #39
2025-10-24 11:09:32 +00:00
Michal Adam Pikulski
35acaddca5 FIx the issue of end game screen appearing twice 2025-10-22 11:50:24 +02:00
Michal Adam Pikulski
00f6d2c6c6 Add a dirty booster pack opening sequence 2025-10-21 15:40:47 +02:00
journaliciouz
d1792014db Added feedback on photography in diving game 2025-10-20 23:18:31 +02:00
9df43b8f53 Implemented Flash Feedback to the Diving Minigame 2025-10-20 16:19:08 +02:00
6e5a6c049f Underwater rushed audio job 2025-10-17 16:31:23 +02:00
Michal Pikulski
74339d7c47 Fix pausing etc. issues in the minigame 2025-10-17 13:18:49 +02:00
journaliciouz
09ae4b5ba7 WIP 2 2025-10-16 22:45:13 +02:00
journaliciouz
4fc005b082 WIP 2025-10-16 22:35:23 +02:00
eab8899720 WIP game over diving 2025-10-16 16:23:48 +02:00
b425d2b4f4 Stuck cinematics 2025-10-15 17:35:34 +02:00
5f46c963b5 Implemented Diving tutorial 2025-10-15 15:58:19 +02:00
DamianCorazza
782e068575 Monster Animations and monster flipping according to which wall it's coming from 2025-10-14 21:00:03 +02:00
Michal Pikulski
e8180b21bf Strip debug logging from the game, fix screen weirdness 2025-10-14 15:54:11 +02:00
9c44a0c91f photo_input_switch (#27)
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Reviewed-on: #27
2025-10-14 07:09:16 +00:00
Michal Pikulski
0c5546efd2 Add backbone for card creation and implement Camera minigame mechanics 2025-10-10 14:49:42 +02:00
Michal Pikulski
0e17516df7 Add a pausable interface and make minigameobjecs pausable 2025-10-08 12:36:08 +02:00
Michal Pikulski
f1f4234c2a Wait for correct screen orientation 2025-09-30 13:13:37 +02:00
63cb3f1a8c Revamp the settings system (#7)
- A Settings Provider system to utilize addressables for loading settings at runtime
- An editor UI for easy modifications of the settings objects
- A split out developer settings functionality to keep gameplay and nitty-gritty details separately
- Most settings migrated out of game objects and into the new system
- An additional Editor utility for fetching the settings at editor runtime, for gizmos, visualization etc

Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Co-authored-by: AlexanderT <alexander@foolhardyhorizons.com>
Reviewed-on: #7
2025-09-24 13:33:43 +00:00
5305c20b00 Create a diving minigame MVP (#6)
- Obstacles
- Tiles
- Object pooling
- Monster spawns
- Scoring
- Minigame End

Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Co-authored-by: AlexanderT <alexander@foolhardyhorizons.com>
Reviewed-on: #6
2025-09-22 12:16:32 +00:00
2ec5c3d855 Working monster spawns 2025-09-19 13:46:24 +02:00
d110616907 Add Monster Spawn points, monster head placeholders. Add utility for prefab variation by sprite selection. 2025-09-19 12:51:25 +02:00