Commit Graph

38 Commits

Author SHA1 Message Date
Michal Pikulski
635b74db0a First go at bird pooper controller 2025-11-20 01:29:30 +01:00
Michal Pikulski
6b8420c8c7 Update card sorting MVP 2025-11-19 23:48:41 +01:00
fee5515bbd First MVP of sorting minigame (#60)
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com>
Reviewed-on: #60
2025-11-19 13:56:10 +00:00
235fa04eba Merge a card refresh (#59)
- **Refactored Card Placement Flow**
  - Separated card presentation from orchestration logic
  - Extracted `CornerCardManager` for pending card lifecycle (spawn, shuffle, rebuild)
  - Extracted `AlbumNavigationService` for book page navigation and zone mapping
  - Extracted `CardEnlargeController` for backdrop management and card reparenting
  - Implemented controller pattern (non-MonoBehaviour) for complex logic
  - Cards now unparent from slots before rebuild to prevent premature destruction

- **Improved Corner Card Display**
  - Fixed cards spawning on top of each other during rebuild
  - Implemented shuffle-to-front logic (remaining cards occupy slots 0→1→2)
  - Added smart card selection (prioritizes cards matching current album page)
  - Pending cards now removed from queue immediately on drag start
  - Corner cards rebuild after each placement with proper slot reassignment

- **Enhanced Album Card Viewing**
  - Added dramatic scale increase when viewing cards from album slots
  - Implemented shrink animation when dismissing enlarged cards
  - Cards transition: `PlacedInSlotState` → `AlbumEnlargedState` → `PlacedInSlotState`
  - Backdrop shows/hides with card enlarge/shrink cycle
  - Cards reparent to enlarged container while viewing, return to slot after

- **State Machine Improvements**
  - Added `CardStateNames` constants for type-safe state transitions
  - Implemented `ICardClickHandler` and `ICardStateDragHandler` interfaces
  - State transitions now use cached property indices
  - `BoosterCardContext` separated from `CardContext` for single responsibility

- **Code Cleanup**
  - Identified unused `SlotContainerHelper.cs` (superseded by `CornerCardManager`)
  - Identified unused `BoosterPackDraggable.canOpenOnDrop` field
  - Identified unused `AlbumViewPage._previousInputMode` (hardcoded value)
  - Identified unused `Card.OnPlacedInAlbumSlot` event (no subscribers)

Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com>
Reviewed-on: #59
2025-11-18 08:40:59 +00:00
0aa2270e1a Lifecycle System Refactor & Logging Centralization (#56)
## ManagedBehaviour System Refactor

- **Sealed `Awake()`** to prevent override mistakes that break singleton registration
- **Added `OnManagedAwake()`** for early initialization (fires during registration)
- **Renamed lifecycle hook:** `OnManagedAwake()` → `OnManagedStart()` (fires after boot, mirrors Unity's Awake→Start)
- **40 files migrated** to new pattern (2 core, 38 components)
- Eliminated all fragile `private new void Awake()` patterns
- Zero breaking changes - backward compatible

## Centralized Logging System

- **Automatic tagging** via `CallerMemberName` and `CallerFilePath` - logs auto-tagged as `[ClassName][MethodName] message`
- **Unified API:** Single `Logging.Debug/Info/Warning/Error()` replaces custom `LogDebugMessage()` implementations
- **~90 logging call sites** migrated across 10 files
- **10 redundant helper methods** removed
- All logs broadcast via `Logging.OnLogEntryAdded` event for real-time monitoring

## Custom Log Console (Editor Window)

- **Persistent filter popups** for multi-selection (classes, methods, log levels) - windows stay open during selection
- **Search** across class names, methods, and message content
- **Time range filter** with MinMaxSlider
- **Export** filtered logs to timestamped `.txt` files
- **Right-click context menu** for quick filtering and copy actions
- **Visual improvements:** White text, alternating row backgrounds, color-coded log levels
- **Multiple instances** supported for simultaneous system monitoring
- Open via `AppleHills > Custom Log Console`

Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com>
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Reviewed-on: #56
2025-11-11 08:48:29 +00: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
011901eb8f Refactoring of the interaction system and preliminary integration of save/load functionality across the game. (#44)
### Interactables Architecture Refactor
- Converted composition to inheritance, moved from component-based to class-based interactables. No more requirement for chain of "Interactable -> Item" etc.
- Created `InteractableBase` abstract base class with common functionality that replaces the old component
- Specialized child classes: `Pickup`, `ItemSlot`, `LevelSwitch`, `MinigameSwitch`, `CombinationItem`, `OneClickInteraction` are now children classes
- Light updates to the interactable inspector, moved some things arround, added collapsible inspector sections in the  UI for better editor experience

### State Machine Integration
- Custom `AppleMachine` inheritong from Pixelplacement's StateMachine which implements our own interface for saving, easy place for future improvements
- Replaced all previous StateMachines by `AppleMachine`
- Custom `AppleState`  extends from default `State`. Added serialization, split state logic into "EnterState", "RestoreState", "ExitState" allowing for separate logic when triggering in-game vs loading game
- Restores directly to target state without triggering transitional logic
- Migration tool converts existing instances

### Prefab Organization
- Saved changes from scenes into prefabs
- Cleaned up duplicated components, confusing prefabs hierarchies
- Created prefab variants where possible
- Consolidated Environment prefabs and moved them out of Placeholders subfolder into main Environment folder
- Organized item prefabs from PrefabsPLACEHOLDER into proper Items folder
- Updated prefab references - All scene references updated to new locations
- Removed placeholder files from Characters, Levels, UI, and Minigames folders

### Scene Updates
- Quarry scene with major updates
- Saved multiple working versions (Quarry, Quarry_Fixed, Quarry_OLD)
- Added proper lighting data
- Updated all interactable components to new architecture

### Minor editor tools
- New tool for testing cards from an editor window (no in-scene object required)
- Updated Interactable Inspector
- New debug option to opt in-and-out of the save/load system
- Tooling for easier migration

Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Reviewed-on: #44
2025-11-03 10:12:51 +00:00
Michal Pikulski
bda645dcc3 Updates to minigame switching 2025-10-29 09:57:33 +01:00
Michal Pikulski
b56524f1f2 Updates to the level switcher UI menu, making it much larger 2025-10-28 16:04:44 +01:00
Michal Pikulski
43779c560e Cleanup compile warnings, cleanup logs, spruce up level selection menu 2025-10-28 14:31:17 +01:00
Michal Pikulski
dad1f6498d Pause timescale when game is paused 2025-10-27 15:21:23 +01:00
786167115c Modified Speed of minigame and two small adjustments to prefabs. 2025-10-22 11:03:15 +02:00
MacBuilder
8e90878a97 Updated diving controls and tutorial 2025-10-21 13:47:18 +02:00
Michal Pikulski
09af055d18 Strip UI debug stuff from the game 2025-10-17 14:44:10 +02:00
Michal Pikulski
74339d7c47 Fix pausing etc. issues in the minigame 2025-10-17 13:18:49 +02:00
Michal Pikulski
8274d70924 Remove superflous Update() methods and change the tile spawn buffer to 2 2025-10-17 11:55:30 +02:00
Michal Pikulski
3fc43fa92d Hook up the score display 2025-10-16 23:59:25 +02:00
Michal Pikulski
b2384269e5 Update the Pause menu flow to be slightly less scoffed 2025-10-16 23:19:33 +02:00
Michal Pikulski
cc6e89c003 Fix issue with event triggering multiple times at the end of the minigame 2025-10-15 23:20:38 +02:00
DamianCorazza
e8bf6fbded Fixed tiles not spawning and reduced the speed of the descent. 2025-10-14 14:13:10 +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
57652b87f6 Merge branch 'main' into DamianBranch 2025-10-10 16:49:25 +02:00
Michal Pikulski
81a6becd44 Implement Debug settings and provide an overview of the settings madness 2025-10-10 15:47:38 +02:00
Michal Pikulski
0c5546efd2 Add backbone for card creation and implement Camera minigame mechanics 2025-10-10 14:49:42 +02:00
1fe48c995b Commmit minigame and tile logic 2025-10-10 14:45:23 +02:00
3bd43a4d6d Added New Diving Tiles to the Minigame 2025-10-08 17:15:20 +02:00
dea470f93f Replaced almost all placeholders with final art
Some animations still need to be added and replaced, but most of the sprites are final now.
2025-10-07 13:04:14 +02:00
Michal Pikulski
c46036dce6 Fix speed mismatch between direct and tap movement modes 2025-10-07 10:11:55 +02:00
Michal Pikulski
328e8dea0a Finalize normalized movement settings 2025-10-07 09:42:59 +02:00
Michal Pikulski
348e982930 Use normalized movement settings 2025-10-07 09:28:41 +02:00
b6b2605efb Merge pull request 'DamianBranch' (#15) from DamianBranch into main
Reviewed-on: #15
2025-10-06 10:45:26 +00:00
DamianCorazza
027ff5144e Dialogue test 2025-10-03 08:30:50 +02:00
e713a580a9 puzzlestep_indicators (#14)
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Reviewed-on: #14
2025-10-02 05:42:17 +00:00
f686f28cb8 Create a simple dialogue authoring system, tied into our items (#10)
- Editor dialogue graph
- Asset importer for processing the graph into runtime data
- DialogueComponent that steers the dialogue interactions
- DialogueCanbas with a scalable speech bubble to display everything
- Brief README overview of the system

Co-authored-by: AlexanderT <alexander@foolhardyhorizons.com>
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Reviewed-on: #10
2025-09-29 09:34:15 +00:00
e878a32263 Introduce input modes and Pause Menu (#8)
- Add input mode switching to the Input Manager
- Automatically set input mode on scene load - UI for MainMenu and GameAndUI for other scenes
- Add PauseMenu prefab, auto-loaded via the boostrap system
- Automatically control PauseMenu visibility based on current scene

Co-authored-by: AlexanderT <alexander@foolhardyhorizons.com>
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Reviewed-on: #8
2025-09-25 10:06:51 +00: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
Michal Pikulski
a2b62fc4b1 GO back to a simple ignore file and commit all meta assets 2025-09-01 16:19:19 +02:00
Michal Pikulski
76e9b9d99a Initial Repo Commit 2025-08-06 17:00:32 +02:00