Puzzle System
Puzzle System
Section titled “Puzzle System”Puzzle Framework Design
Section titled “Puzzle Framework Design”Lock and Key System
Section titled “Lock and Key System”Create flexible puzzle mechanics based on simple lock-and-key principles that can support various puzzle types:
Actor_Puzzle Components
Section titled “Actor_Puzzle Components”- Arrow Component: Root for positioning control
- Static Mesh: Visual representation of puzzle (door, barrier, chest)
- Puzzle Logic: Validation system for solution checking
Actor_Puzzle_Piece Components
Section titled “Actor_Puzzle_Piece Components”- Arrow Component: Root for positioning
- Static Mesh: Visual representation of puzzle piece (lever, button, orb)
- Box Collision: Interaction detection
- Puzzle Reference: Connection to main puzzle actor
Puzzle Communication System
Section titled “Puzzle Communication System”Create interface-based communication between puzzle pieces and main puzzle:
// Puzzle Interface SystemInterface_Puzzle_Piece(Actor) {// Called when puzzle piece is activated// Receives reference to the activating pieceAddActorToCollectedPieces(Actor);ValidatePuzzleCompletion();}
Basic Puzzle Implementation
Section titled “Basic Puzzle Implementation”Simple Collection Puzzle
Section titled “Simple Collection Puzzle”Create straightforward puzzle requiring all pieces to be collected:
Puzzle Setup Variables
Section titled “Puzzle Setup Variables”- Puzzle_Pieces Array: Instance editable array of required puzzle pieces
- Puzzle_Pieces_Collected Array: Runtime tracking of activated pieces
- Completion Logic: Compare array lengths for puzzle completion
Collection Validation
Section titled “Collection Validation”// Basic Puzzle CompletionOnPuzzlePieceActivated(PuzzlePiece) {Puzzle_Pieces_Collected.AddUnique(PuzzlePiece);
if (Puzzle_Pieces_Collected.Num() >= Puzzle_Pieces.Num()) {// Puzzle CompleteDestroyActor(Self); // Remove puzzle barrierSpawnCompletionEffects();}}
Puzzle Piece Setup
Section titled “Puzzle Piece Setup”Configure puzzle pieces for interaction:
- Puzzle Variable: Reference to main puzzle actor (instance editable)
- Interaction Integration: Use existing Interface_Interact system
- Visual Feedback: Effects when piece is activated
Passcode Puzzle System
Section titled “Passcode Puzzle System”Sequential Activation Puzzle
Section titled “Sequential Activation Puzzle”Create puzzles requiring specific activation order:
Passcode Variables
Section titled “Passcode Variables”- Passcode Boolean: Enable passcode mode for order-sensitive puzzles
- Collected Pieces Validation: Check exact sequence match
Passcode Logic Implementation
Section titled “Passcode Logic Implementation”// Passcode Puzzle ValidationOnPuzzlePieceActivated(PuzzlePiece) {if (Passcode_Enabled) {Puzzle_Pieces_Collected.Add(PuzzlePiece); // Allow duplicates
ValidateSequence();} else {Puzzle_Pieces_Collected.AddUnique(PuzzlePiece);}}
ValidateSequence() {ForEach(piece in Puzzle_Pieces_Collected) {expected_piece = Puzzle_Pieces[CurrentIndex];
if (piece != expected_piece) {// Wrong sequence - reset puzzlePuzzle_Pieces_Collected.Empty();SpawnFailureEffects();return;}}
// Sequence still valid - check if completeif (Puzzle_Pieces_Collected.Num() >= Puzzle_Pieces.Num()) {CompletePuzzle();}}
Puzzle Visual Feedback
Section titled “Puzzle Visual Feedback”Success and Failure Effects
Section titled “Success and Failure Effects”Provide clear feedback for puzzle interactions:
Completion Effects
Section titled “Completion Effects”- Niagara Location Sphere: Position for effect spawning
- Success VFX: Green omnidirectional burst for completion
- Failure VFX: Red omnidirectional burst for wrong sequence
- Audio Integration: Sound effects for success and failure states
Feedback Implementation
Section titled “Feedback Implementation”// Puzzle Feedback SystemSpawnCompletionEffects() {effect_location = Niagara_Location.GetWorldLocation();SpawnSystemAtLocation(Green_Success_VFX, effect_location);PlaySound2D(Success_Audio);}
SpawnFailureEffects() {effect_location = Niagara_Location.GetWorldLocation();SpawnSystemAtLocation(Red_Failure_VFX, effect_location);PlaySound2D(Failure_Audio);}
Puzzle Examples and Variations
Section titled “Puzzle Examples and Variations”Common Puzzle Types
Section titled “Common Puzzle Types”Framework supports multiple puzzle variations:
Multi-Switch Puzzle
Section titled “Multi-Switch Puzzle”- Setup: 5 levers that must all be activated
- Use Case: Unlock doors, disable barriers, activate mechanisms
Sequence Puzzle
Section titled “Sequence Puzzle”- Setup: 4 pillars that must be activated in specific order
- Use Case: Combination locks, ritual sequences, security systems
Exploration Puzzle
Section titled “Exploration Puzzle”- Setup: Scattered objects that must all be found and activated
- Use Case: Hidden switches, treasure hunt mechanics
Level Integration
Section titled “Level Integration”Position puzzles strategically in levels:
- Progression Gates: Block access to new areas until solved
- Optional Content: Reward exploration with puzzle-gated treasures
- Difficulty Scaling: Simple collection puzzles early, complex sequences later
Puzzle Polish and Expansion
Section titled “Puzzle Polish and Expansion”Child Blueprint Organization
Section titled “Child Blueprint Organization”Create specialized puzzle types:
- Door Puzzle: Uses door mesh, blocks passage
- Chest Puzzle: Uses treasure chest, contains rewards
- Mechanism Puzzle: Uses machinery, activates environmental changes
Audio-Visual Integration
Section titled “Audio-Visual Integration”- State Changes: Visual/audio feedback when pieces activate
- Progress Indication: Show player how many pieces remain
- Environmental Integration: Puzzles that feel connected to world lore
The puzzle system provides engaging problem-solving gameplay while maintaining simple, extensible architecture that supports both basic collection challenges and complex sequence-based puzzles.