Commit Graph

54 Commits

Author SHA1 Message Date
058af331e0 pooper_minigame (#62)
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Reviewed-on: #62
2025-11-20 15:16:57 +00:00
8b9f847ef8 Added audio resource to card definition and editor 2025-11-20 11: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
Michal Pikulski
612ca7eae8 Interactables documentaiton 2025-11-11 15:55:38 +01: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
Michal Pikulski
0d8702a5f6 Move some tools for consistency, audo add feature for card debugger 2025-11-07 09:32:43 +01:00
Michal Pikulski
a705b3a829 Semi-working rarity upgrades 2025-11-06 23:18:02 +01:00
Michal Pikulski
d23c000347 Working flipping cards 2025-11-06 23:17:55 +01:00
Michal Pikulski
1c9d0333ea Fix editor compilation issue 2025-11-06 18:23:21 +01:00
Michal Pikulski
b6d8586eab Setup booster page opening 2025-11-06 15:27:08 +01:00
Michal Pikulski
50c0a12391 New card UI, new visual config, new card definitions, new working editor window for authoring! 2025-11-05 23:50:15 +01: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
eeca4973ae Add component search+replace 2025-10-30 10:29:57 +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
2aad46be98 AUtoprogress dialogue 2025-10-27 16:06:47 +01:00
Michal Pikulski
dad1f6498d Pause timescale when game is paused 2025-10-27 15:21:23 +01:00
Michal Pikulski
f5c1ae51cd MPV of save/load system 2025-10-27 14:00:37 +01:00
Michal Adam Pikulski
2abcf5c76a Cleanup the editor assembly and provide a tool overview doc 2025-10-21 14:54:58 +02:00
Michal Adam Pikulski
2fb77e1040 Cleanup the card implementation, add some readme files and update namespaces 2025-10-21 12:10:16 +02:00
Michal Adam Pikulski
af77e07f99 Update the cards to pull in from addressables to wokr in build, remove erronous code preventing building 2025-10-21 10:29:06 +02:00
Michal Adam Pikulski
3e833b8991 Working card system 2025-10-20 16:33:58 +02:00
Michal Pikulski
c3c9fd95a4 Add audio to dialogues 2025-10-17 15:20:51 +02:00
Michal Pikulski
50448c5bd3 Revamp the prompt system, the bootstrapper system, the starting cinematic 2025-10-16 19:43:24 +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
3807ac652c Add support for images in dialogue windows (#19)
- Extend editor nodes with custom DialogueContent data type that holds either image or text
- Extend the dialogue importer to correctly process the new content into updated RuntimeDialogue content
- Update SpeechBubble to be able to display either text or image
- Add a custom property drawer for the DialogueContent to allow easy switching in graph authoring

Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com>
Reviewed-on: #19
2025-10-08 09:34:58 +00:00
10992b43cc Unity Timeline Interaction System Integration (#17)
- Added InteractionTimelineAction component for timeline-driven interactions
- Implemented custom editor for timeline event mapping
- Updated interaction event flow to support timeline actions
- Enhanced character move target configuration
- Improved inspector UI for interactable components
- Added technical documentation for interaction system
- Refactored interaction action base classes for extensibility
- Fixed issues with character binding in timelines

Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com>
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Reviewed-on: #17
2025-10-07 10:57:11 +00:00
Michal Pikulski
f20eae0f6e Randomize window for some property based fun 2025-10-06 16:57:47 +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
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
2ae2bc3ac5 Updates to make sure the build goes through 2025-09-22 15:40:41 +02: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
46755fecb3 Populate minigame with obstacles and monster spawns (#5)
- Simulated "fake" physics and collisions
- Object pooling for tiles, obstacles and monster spawns
- Base monster scoring with proximity triggers and depth multiplier

Co-authored-by: AlexanderT <alexander@foolhardyhorizons.com>
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Reviewed-on: #5
2025-09-21 07:32:56 +00:00
40c3867d29 Add a sprite variant generator and create monster prefabs for heads 2025-09-19 13:14:47 +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
31f2ce338d Component move/copy utility 2025-09-19 10:08:58 +02:00
Michal Pikulski
a455e34ed0 Add a sprite collider generator tool window 2025-09-16 15:39:49 +02:00
Michal Pikulski
75be338065 Working generic object pooling, pool monitor editor tool and batch component adder editor tool 2025-09-16 15:02:57 +02:00
Michal Pikulski
bcc6f05058 Working single-purpose object pooling solution 2025-09-16 15:02:57 +02:00
Michal Pikulski
c5b8561b73 Quick scene browser tab 2025-09-11 15:29:28 +02:00
Michal Pikulski
6c76759057 Touched up editor tool windows 2025-09-11 14:07:58 +02:00
Michal Pikulski
e1ff13db30 Rework interactables into a flatter hierarchy, reenable puzzles as well 2025-09-11 14:07:57 +02:00
Michal Pikulski
5d81a2acfc Move the prefab editor to a dedicated tool window 2025-09-10 15:53:31 +02:00
Michal Pikulski
9579a8ef57 [Util] Add the possiblity to also edit items via the custom editor window 2025-09-10 14:45:25 +02:00
Michal Pikulski
ba56f1ec9c Add a prefab creator window 2025-09-10 13:49:27 +02:00
Michal Pikulski
d19077b907 Add a simple utility to list objects in the current scene 2025-09-10 13:18:44 +02:00
Michal Pikulski
ffd26a4e28 Make the puzzle chain editor work again 2025-09-10 13:08:08 +02:00