ADVANCED_TRAVEL_SYSTEM.md 4.6 KB

Advanced Travel System: Tunnels and Ferry Crossings

Overview

The advanced travel system adds strategic depth to journey planning by introducing special travel options that require player decisions and resources.

Tunnel System

Detection

  • Automatic Recognition: Roads passing through mountain regions are identified as potential tunnels
  • Mountain Threshold: 3+ adjacent mountain tiles indicate tunnel conditions
  • Pathfinding Integration: Tunnels appear as special segments in calculated routes

Travel Options

  1. With Torches (Recommended)

    • Speed: 0.8x cost (20% faster than normal roads)
    • Cost: 10 gold per torch required
    • Safety: Safe and well-lit travel
    • Detection: Player inventory checked for available torches
  2. Without Torches (Risky)

    • Speed: 3.0x cost (200% slower than plains!)
    • Cost: Free but dangerous
    • Risk: Very slow, potential for getting lost
    • Experience: Atmospheric but inefficient

Player Experience

Special Travel Options Available:
Tunnel detected from (15,20) to (18,20)

Options:
☐ Use Tunnel (with torches) - 10 gold, fast travel
☐ Use Tunnel (without torches) - Free, very slow
☐ Use Standard Route - Go around mountains

Would you like to purchase torches for 10 gold?

Ferry System

Detection

  • Dock Proximity: Searches for dock tiles within 8 tiles of route endpoints
  • Water Validation: Ensures 70%+ water between dock points
  • Distance Limits: 3-15 tile range for viable ferry routes
  • Cost Calculation: 25 gold per tile + 50 gold minimum

Ferry Options

  • Speed Advantage: 0.7x cost (30% faster than going around)
  • Cost Structure: Distance-based pricing
  • Route Planning: Automatically suggests ferry when beneficial

Player Experience

Special Travel Options Available:
Ferry crossing available from Port Anchor (12,8) to Harbor Bay (18,15)

Ferry Details:
- Distance: 8 leagues across water
- Cost: 250 gold (25 gold per league + 50 base fee)
- Time Saved: 30% faster than overland route
- Alternative: 18 tile detour through plains and forests

Accept ferry crossing for 250 gold?

Integration Features

Smart Route Planning

  • Cost-Benefit Analysis: Compares special options with standard routes
  • Resource Awareness: Checks player inventory and gold
  • Time Efficiency: Highlights faster options
  • Player Choice: Always offers standard route alternative

UI Components

  • Option Selection: Radio button interface for travel choices
  • Cost Display: Clear pricing and resource requirements
  • Inventory Check: Shows available torches and gold
  • Route Comparison: Standard vs special route information

Debug Information

=== SPECIAL TRAVEL OPTIONS ===
Tunnel detected from (15,20) to (18,20)
Ferry crossing available from (12,8) to (18,15)
==============================

Terrain Integration

Updated Movement Costs

Terrain Base Cost With Special Options
Tunnel (with torches) 0.8x Recommended route
Tunnel (without torches) 3.0x Emergency option
Ferry 0.7x Water crossing
Dock 0.8x Port infrastructure

Pathfinding Enhancements

  • Multi-Option Routes: Single destination, multiple travel methods
  • Resource-Aware: Considers available inventory items
  • Economic Planning: Balances speed vs cost
  • Player Agency: Never forces expensive options

Technical Implementation

Key Methods

  • CheckForSpecialTravelOptions(): Analyzes calculated path for opportunities
  • IsTunnelSegment(): Detects road segments through mountains
  • HasFerryOption(): Identifies viable water crossings
  • ShowSpecialTravelOptionsUI(): Presents choices to player

Resource Management

  • Torch Tracking: Inventory integration for tunnel travel
  • Gold Management: Cost verification before travel
  • Alternative Routes: Always provides free standard option

Strategic Gameplay

Decision Making

  • Resource Management: Spend gold for convenience vs save money
  • Time vs Cost: Fast expensive routes vs slow free routes
  • Risk Assessment: Dark tunnels vs safe but longer routes
  • Exploration Rewards: Finding efficient travel networks

Economic Impact

  • Trade Routes: Efficient paths become valuable
  • Resource Trading: Torches gain strategic value
  • Port Towns: Ferry access increases settlement importance
  • Mountain Passes: Tunnel routes create chokepoints

This system transforms travel from simple pathfinding into strategic resource management with meaningful player choices!