This document breaks down the Android detective game project into manageable modules and tasks with priority, difficulty, and feasibility assessments.
Purpose: Foundation for game state, time management, and game flow control.
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Create data classes/models for: GameState, Player, Time, Flags
- Implement serialization/deserialization for state persistence
- Define game phase enum (Tutorial, Introduction, Investigation, GameOver)
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Implement time unit system (5-minute minimum unit)
- Time progression based on actions
- Time limit tracking and enforcement
- Time-based event triggers
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Main game loop controller
- Phase transitions (Start → Tutorial → Introduction → Investigation → End)
- Action validation and execution pipeline
- State persistence (save/load game)
- Status: ❌ NOT PLANNED
- Reason: Not needed - basic validation is sufficient for predefined actions (investigate, question, move, accuse). No free-form actions require advanced validation.
Purpose: Interface with LLM for content generation, conversations, and dynamic responses using Hybrid Architecture (upfront structure generation + lazy loading for dynamic content).
Architecture Overview:
- LLM 1 (Initializer): Generates complete game structure upfront (characters, places, clues, timeline)
- LLM 2 (Intro Generator): Generates introduction text before game starts
- LLM 3-4 (Runtime): Generate dynamic content on-demand (dialogue, descriptions)
- Epilogue Generator: Generates epilogue text on game end
- Note: No caching system - prompts are unique per context, making caching inefficient
- Priority: HIGH (Critical Path)
- Difficulty: LOW-MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Set up LLM API client (OpenAI, Anthropic, or local model)
- API key management and secure storage
- Request/response handling with error handling
- Rate limiting and retry logic
- Support for multiple LLM instances (different models for different purposes)
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Single comprehensive LLM call at game start
- Generate complete game structure from user input/keywords:
- Characters: Full details (name, traits, is_criminal, known_clues, mental_state, items, unlock_conditions)
- Places: Full details (name, traits, available_clues, items, connections, unlock_conditions)
- Clues: Complete structured data (who, what, when, where, why, unlock_conditions)
- Timeline: Complete event schedule with structured data
- Ensure specificity and avoid generic responses
- Use structured output (JSON schema, function calling) for reliable parsing
- NOT generating: dialogue, detailed descriptions (these are lazy-loaded)
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Single LLM call after LLM 1 generates GameState
- Generate compelling, spoiler-free introduction text
- Input: Public information from GameState (title, description, characters, places, timeline)
- Output: Introduction text (3-7 paragraphs) in JSON format
- Shown to player before game starts
- No spoilers (isCriminal, hidden clues excluded)
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM-HIGH
- Feasibility: ✅ POSSIBLE
- Status: ✅ IMPLEMENTED
- Description:
- Generate conversations on-demand when player questions a character
- Input: character data, player's collected clues, current time, player's question, cooperation level
- Output: character dialogue response, potential new clues
- Character personality and knowledge-based responses
- Context-aware responses (time, player's clues, mental_state)
- Basic clue extraction from dialogue responses (structured output)
- Priority: MEDIUM
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Status: ✅ IMPLEMENTED
- Description:
- Generate descriptions on-demand when player investigates a place or views character
- Input: place/character data, current time, timeline events, player's clues
- Output: contextual descriptions (place appearance, character expressions/appearance)
- Event descriptions based on timeline and player actions
- Epilogue generation for game endings (separate Epilogue Generator)
- Status: ❌ NOT PLANNED
- Reason: Free-form action system is too complicated to implement and validate. Game uses predefined actions only (investigate, question, move, accuse).
- Status: ❌ NOT PLANNED
- Reason: Too complicated. Timeline events are processed with basic logic only (character movement, place changes, flags). No LLM-based component updates needed for current gameplay.
- Status: ✅ BASIC VERSION IMPLEMENTED
- Description:
- Basic clue extraction from LLM 3 (Dialogue) responses using structured output
- Clues are extracted from dialogue responses via JSON schema
- No enhanced extraction system needed - current implementation is sufficient
- Status: ❌ NOT PLANNED
- Reason: Caching is inefficient since prompts are unique per context (different time, different player clues, different questions). No significant cache hit rate expected.
Purpose: Manage game entities (characters, places, clues, timeline).
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Character data model (name, traits, is_criminal, known_clues, mental_state, hidden, unlock_conditions, items)
- Character state tracking
- Character location management
- Character unlock/reveal system
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Place data model (name, traits, available_clues, hidden, unlock_conditions, items, current_characters)
- Place-to-place movement system
- Distance-based time calculation for movement
- Place unlock system
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Clue data model (who, whom, time, place, content, unlock_conditions)
- Clue discovery/unlock system
- Clue collection and inventory
- Clue dependency tracking
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM-HIGH
- Feasibility: ✅ POSSIBLE
- Description:
- Timeline data structure (past events, future events)
- Event scheduling and triggering
- Character movement tracking in timeline
- Timeline-based component updates
- Priority: MEDIUM
- Difficulty: LOW-MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Track game flags (found clues, player tools, selected choices, current location)
- Flag-based condition checking
- Flag persistence
Purpose: User interface and interaction components for Android app.
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Main game view layout
- Time display widget
- Current location display
- Player inventory/clue display area
- Priority: HIGH (Critical Path)
- Difficulty: LOW-MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Scrollable text view for game narrative
- Typing animation for text display
- Rich text formatting support
- Text history/view log
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Predefined action buttons (Investigate, Question, Move, Accuse)
- Context-sensitive action menu
- Action confirmation dialogs
- Status: ❌ NOT PLANNED
- Reason: Free-form action system is not implemented. Game uses predefined actions only.
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Character selection for questioning
- Place selection for investigation/movement
- Character/place information display
- Visual indicators for available actions
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Chat-like interface for questioning
- Character portrait/name display
- Message bubbles for dialogue
- Loading indicators during LLM response
- Priority: MEDIUM
- Difficulty: LOW-MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Game content input screen (keywords/story)
- Difficulty settings (cooperation level, criminal behavior, clue requirements)
- Game start button
- Settings persistence
- Status: ❌ NOT PLANNED
- Reason: Tutorial system is not needed. Game is intuitive enough with predefined actions. Mock data serves as backward compatibility and LLM fallback only.
- Priority: MEDIUM
- Difficulty: LOW-MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Win/lose screen display
- Epilogue display
- Restart/new game options
- Game statistics
- Priority: LOW
- Difficulty: LOW-MEDIUM
- Feasibility: ✅ POSSIBLE
- Status:
⚠️ MIGHT IMPLEMENT - Description:
- Save game functionality using Room database
- Load game screen with save slots
- Save game metadata (date, time, progress)
- Game state serialization already supported (kotlinx.serialization)
Purpose: Implement game rules, action consequences, and win/lose conditions.
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Status: ✅ IMPLEMENTED
- Description:
- Handle place investigation actions
- Trigger LLM 4 (Description Generator) to generate place description
- Generate clues based on investigation (direct extraction from available clues)
- Time consumption calculation
- Failure conditions (time-based, insufficient prerequisites)
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM-HIGH
- Feasibility: ✅ POSSIBLE
- Status: ✅ IMPLEMENTED
- Description:
- Initiate questioning with character
- Trigger LLM 3 (Dialogue Generator) for conversation flow
- Extract clues from conversation (via structured output from LLM 3)
- Cooperation level affecting responses (passed to LLM 3)
- Time consumption calculation
- Conversation history tracking
- Priority: HIGH (Critical Path)
- Difficulty: LOW-MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Handle location movement
- Distance-based time calculation
- Location unlock checking
- Update current location state
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM-HIGH
- Feasibility: ✅ POSSIBLE
- Status: ✅ IMPLEMENTED (Simple Version)
- Description:
- Handle player accusation of criminal
- Simple validation: checks if accused character is criminal (isCriminal flag)
- Trigger game end condition (win/lose)
- Note: Advanced evidence validation not implemented - simple check is sufficient for current gameplay
- Status: ❌ NOT PLANNED
- Reason: Free-form action system is not implemented. Game uses predefined actions only.
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM-HIGH
- Feasibility: ✅ POSSIBLE
- Status: ✅ IMPLEMENTED (Basic Version)
- Description:
- Process timeline events based on current time
- Basic event processing: character movement, place changes, crime events, custom events
- Updates game state with flags and character locations
- Note: No LLM-based component updates - uses basic logic only. Game is playable without dynamic LLM updates.
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Description:
- Check game end conditions:
- Successful accusation with sufficient evidence
- Time limit exceeded
- Player death (special condition)
- Criminal confession (special condition)
- Trigger appropriate ending
- Check game end conditions:
- Priority: HIGH (Critical Path)
- Difficulty: MEDIUM
- Feasibility: ✅ POSSIBLE
- Status: ✅ IMPLEMENTED (Basic Version)
- Description:
- Update components after each action/time unit
- Apply timeline events to components (basic logic only)
- Update character states, place states, clue availability
- Handle unlock conditions
- Note: No LLM-based component updates - uses basic state management only
- ✅ Core Game Engine & State Management (1.1, 1.2, 1.3)
- ✅ LLM Integration Layer (2.1, 2.2, 2.3, 2.4, 2.5, Epilogue Generator)
- ✅ Game Content System (3.1, 3.2, 3.3, 3.4, 3.5)
- ✅ Android UI - Main Components (4.1, 4.2, 4.3, 4.5, 4.6, 4.7, 4.9)
- ✅ Game Logic - Core Actions (5.1, 5.2, 5.3, 5.4, 5.6, 5.7, 5.8)
- ❌ Action Validation System (1.4) - Not needed
- ❌ LLM 5: Action Handler (2.6) - Too complicated
- ❌ LLM 6: Component Updater (2.7) - Too complicated
- ❌ LLM Response Caching System (2.8) - Inefficient
- ❌ Enhanced Clue Extraction (2.7) - Basic version sufficient
- ❌ Free Action Input UI (4.4) - Not implementing free actions
- ❌ Free Action Handler (5.5) - Not implementing free actions
- ❌ Tutorial Screen (4.8) - Not needed
⚠️ Save/Load System UI (4.10) - Might implement with Room database
Most tasks are feasible with standard Android development and LLM API integration.
- Action Validation (1.4, 5.5): Not implemented - not needed for predefined actions.
- LLM 5: Action Handler (2.6): Not implemented - free-form actions too complicated.
- LLM 6: Component Updater (2.7): Not implemented - basic timeline processing sufficient.
See TECH_STACK.md for comprehensive tech stack recommendations.
Quick Summary:
- Language: Kotlin
- UI: Jetpack Compose
- Architecture: MVVM + Hilt (DI)
- State Management: StateFlow
- Networking: Retrofit + OkHttp
- Database: Room Database
- LLM: OpenAI API (GPT-3.5-turbo/GPT-4)
- JSON: kotlinx.serialization
- Async: Kotlin Coroutines
- ✅ Core game engine and state management (1.1, 1.2, 1.3)
- ✅ Basic data models (3.1, 3.2, 3.3, 3.4, 3.5)
- ✅ LLM API client setup (2.1)
- ✅ LLM 1: Initial Content Generator (2.2) - Upfront generation
- ✅ LLM 2: Intro Generator (2.3) - Introduction text generation
- ✅ Complete Character, Place, Clue, Timeline systems (3.1, 3.2, 3.3, 3.4)
- ✅ LLM 3: Dialogue Generator (2.4) - Lazy loading for conversations
- ✅ LLM 4: Description Generator (2.5) - Lazy loading for descriptions
- ✅ Epilogue Generator - Game ending text generation
- ✅ Basic clue extraction from dialogue (structured output)
- ✅ Core action handlers (5.1, 5.2, 5.3, 5.4)
- ✅ Timeline event processing (5.6) - Basic logic only
- ✅ Win/lose conditions (5.7)
- ✅ Component update logic (5.8) - Basic state management
- ✅ Main game screen (4.1, 4.2)
- ✅ Action selection UI (4.3)
- ✅ Conversation UI (4.6) - Integration with LLM 3
- ✅ Character & Place selection UI (4.5)
- ✅ Game Start Configuration (4.7)
- ✅ Game over screens (4.9)
⚠️ Save/Load System (4.10) - Might implement with Room database