Travel

docs/travel-system.md

FeudalSim Travel System Documentation

Overview

The travel system forms a core gameplay element of FeudalSim, enabling players to journey between locations with realistic time calculations, dynamic weather effects, and random encounters. This document outlines the enhanced travel system implementation.

Key Features

1. Immersive Journey Visualization

  • Animated Travel Progress: Visual representation of travel with route-specific animations
  • Weather Effects: Dynamic visual representation of different weather conditions
  • Day/Night Cycle: Time-aware journey visualization
  • Terrain-Specific Travel: Different travel modes based on route type (road, sea, mountain, etc.)

2. Dynamic Weather System

  • Weather Types: Clear, cloudy, rain, storm, snow, fog, windy
  • Weather Intensity: Scale from 1-5 affecting travel speed and encounter probability
  • Visual Effects: Animated weather overlays (rain, snow, lightning)
  • Travel Impact: Weather conditions modify travel time calculations

3. Encounter System

  • Contextual Encounters: Different types based on route and danger level
  • Encounter Types: Merchants, bandits, travelers, wildlife, refugees, nobles
  • Interactive Choices: Multiple response options with meaningful consequences
  • Conditional Options: Special choices based on character skills, reputation, or inventory
  • Visual Storytelling: Illustrated encounter scenes with narrative descriptions

4. Journey Narration

  • Journey Log: Running narrative of travel events and observations
  • Random Observations: Context-aware observations based on route type, time of day, and region
  • Milestone Events: Special events at journey progress markers
  • Encounter Chronicles: Record of encounters and their outcomes

5. Reactive Travel Speed

  • Route Type Modifiers: Different speeds based on terrain (roads fast, mountains slow)
  • Weather Impact: Weather conditions affect travel speed
  • Character Attributes: Skills, mounts, or equipment modify travel speed
  • Energy System: Travel consumes character energy based on distance and conditions

6. Interactive Points of Interest

  • Discoveries: Random discoveries during travel
  • Rest Points: Optional stops at inns, camps, or villages
  • Detours: Optional side-paths with risk/reward tradeoffs

Technical Implementation

Components

  • WeatherDisplay: Visualizes current weather conditions with animated icons
  • TravelAnimation: Animated journey progress with terrain and weather effects
  • TravelEncounter: Interactive encounter system with narrative choices
  • TravelPanel: UI for selecting destinations and viewing routes

Hooks

  • useTravel: Core hook managing travel state, progress, and encounters
  • Tracks journey progress in real-time
  • Handles encounter generation and resolution
  • Manages travel logs and notifications

API Endpoints

  • POST /api/travel: Initiates travel between locations
  • GET /api/travel: Retrieves current travel status
  • DELETE /api/travel: Cancels current journey

Data Models

  • Location: Information about places in the game world
  • Route: Connections between locations with properties
  • TravelStatus: Current travel state for a character
  • Encounter: Information about a journey encounter

User Experience Flow

  • Pre-journey
  • View nearby locations
  • See route information (distance, danger, type)
  • Check weather conditions
  • Begin journey
  • During Journey
  • Watch travel animation progress
  • Receive journey updates in log
  • Encounter random events requiring choices
  • Track remaining time
  • Journey Completion
  • Arrival notification
  • Final encounter resolution
  • Entry to destination location

Weather Effects on Travel

| Weather | Travel Speed Effect | Encounter Chance | Visual Effect | |---------|---------------------|------------------|---------------| | Clear | +10% | -5% | None | | Cloudy | No change | No change | Darkened sky | | Rain | -15% | +5% | Rain droplets | | Storm | -30% | +15% | Lightning | | Snow | -25% | +10% | Snowfall | | Fog | -20% | +20% | Reduced visibility | | Windy | -5% | No change | None |

Route Types

| Route Type | Base Travel Speed | Special Encounters | Visual Style | |------------|------------------|-------------------|--------------| | Road | Standard | Merchants, Nobles | Brown path | | Path | -30% | Travelers | Light path | | River | +20% | Merchants, Pirates| Blue water | | Sea | +30% | Pirates, Sea creatures | Deep blue water | | Mountain | -50% | Wildlife, Bandits | Rocky terrain| | Forest | -40% | Wildlife, Bandits | Green canopy |

Encounter Types

| Type | Frequency | Danger | Possible Outcomes | |----------|-----------|--------|-------------------| | Merchant | Common | Low | Trading, Information | | Bandit | Based on danger | High | Combat, Negotiation, Theft | | Traveler | Common | Low | Information, Trading | | Wildlife | Route-dependent | Medium | Combat, Evasion | | Refugee | Uncommon | Low | Aid, Information | | Noble | Rare | Varies | Quests, Reputation |

Future Enhancements

  • Companions: Travel companions affecting journey events
  • Mounts: Different mounts with unique travel properties
  • Time of Day: Day/night cycle affecting travel and encounters
  • Seasons: Seasonal effects on travel and environments
  • Group Travel: Traveling with other players
  • Regional Events: Large-scale events affecting all travelers in a region

Integration with Game Systems

  • Economy: Travel costs, tolls, and trade opportunities
  • Combat: Hostile encounters may lead to combat
  • Reputation: Actions during travel affect regional reputation
  • Knowledge: Information gathered during travel expands world knowledge
  • Skills: Character skills influence travel speed and encounter outcomes

This enhanced travel system transforms journeys from simple point-to-point transitions into engaging gameplay experiences that contribute to the immersive medieval world of FeudalSim.

All articles