Fog fix:
- Check all 4 viewport corners before drawing fog
- If entire viewport is within revealed area, skip fog entirely
- Prevents polygon rendering artifacts at high zoom levels
Building animation:
- Changed range from 75-125% to 100-150%
- Buildings now grow up to 50% taller but never shrink below normal
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Buildings slowly grow and shrink using sine wave animation
- Speed: 0.001 (slow breathing), Range: ±30% height variation
- Uses requestAnimationFrame for smooth 60fps animation
- toggleBuildingAnimation() function to enable/disable
- Enabled by default
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- W now moves toward top of screen (map bearing direction)
- S moves toward bottom of screen
- A/D move left/right relative to current view
- Works for both on-screen buttons and keyboard WASD
- Uses destinationPoint() for accurate geographic movement
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Root cause: Uncaught "Source already exists" error in onGPSSuccess
was breaking execution flow before the WASD interval could start.
Fixes:
- Check if source exists before adding (use getSource instead of flag)
- Wrap layer/source removal in try-catch to handle edge cases
- Wrap source/layer creation in try-catch to prevent breaking execution
- Update existing source data instead of recreating when possible
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add getLatLng() and setLatLng() shims to MapLibre Marker prototype
- Force auto-center ON when entering test mode via WASD
- Add console.log debugging to trace WASD button events
- Debug: pointerdown/up/cancel/lostcapture, startMove, stopMove, doMove
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Restart GPS tracking when disabling test mode
- Add resetWasdState() to clean up movement interval on mode toggle
- Add lostpointercapture handler for when buttons are hidden mid-press
- Add pointerleave handler for edge cases
- Reset WASD state when enabling or disabling test mode
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Restore 3D building effect (pitch: 45, maxPitch: 60)
- Add drawProjectedCircle() helper that samples 48 points and projects each to screen coords
- Replace ctx.arc() circles with projected polygons for both homebase and player explore radius
- Fog circles now correctly render as ellipses when map is tilted
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace touch/mouse events with Pointer Events API for WASD buttons
- Add setPointerCapture for reliable hold detection on mobile
- Fix fog of war radius calculation to use Math.hypot for rotation support
- Add pitch event listener for fog updates
- Disable map pitch/tilt to keep fog circles correct (temporary)
- Show WASD controls when GPS Test Mode enabled via admin panel
- Add CSS touch-action and tap-highlight fixes for mobile
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Make combat container scrollable (max-height: 90vh, overflow-y: auto)
- Reduce skill button size: 70px min-height, 8px padding, 28px icons
- Reduce combat log height from 100px to 70px
- Make flee button more compact with margin-top spacing
- Skill buttons now show icon on top, name below, MP cost at bottom
- All skills and flee button accessible via scrolling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add exploreRadiusMultiplier and homebaseRadiusMultiplier state variables
- Apply multipliers in updateFogOfWar() and isInRevealedArea()
- Generalize Daily Skills section to display all unlocked utility skills
- Create generic activateUtilitySkill() function with effect type handling
- Add explore_radius_multiplier and homebase_radius_multiplier effect types
- Add fog effect options to admin panel utility skill dropdown
- Add periodic buff timer to update countdowns and handle expiry
New effect types for utility skills:
- explore_radius_multiplier: Multiplies player's 50m explore radius
- homebase_radius_multiplier: Multiplies homebase's 800m reveal radius
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 50m explore radius that follows player when outside homebase
- Secondary reveal circle only appears when player is outside 800m homebase radius
- Update isInRevealedArea() to check both homebase and player position
- Update fog of war on GPS position changes and after combat
- Geocaches within player's explore radius now become visible
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements three-tier icon fallback: class/monster override → base skill → emoji.
Adds multer-based file uploads in admin panel for base skills, class skills,
and monster skills. Icons stored in /mapgameimgs/skills/ directory.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fog of war: map dimmed in nav mode, homebase reveals 800m radius
- Geocaches only visible within revealed area
- Added reveal_radius to player stats for future leveling
- Added monster_spawn.mp3 sound effect on monster spawn
- Fixed spin_grow animation (smoother, counter-clockwise)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Bug: Location-restricted monsters could spawn outside their zone because
the check used player position, but monster spawns 30-60m away.
Fix:
- Calculate spawn position BEFORE filtering eligible monster types
- Check if spawn position is within zone, not player position
- Use OSM tag's configured spawn_radius instead of hardcoded 400m
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Features:
- New admin page for OSM tags: manage prefixes, visibility, spawn radius
- Global settings: base prefix chance (25%), double prefix chance (10%)
- Tags auto-enabled when prefixes are added
- Dynamic prefix spawning: monsters can get 0, 1, or 2 prefixes
- Font size reduction for prefixed monster names
- Kill tracking database for future quests/bestiary
- Homebase discovery: auto-discover nearby POIs via Overpass API
Database:
- osm_tags table: tag config with multiple prefixes per tag
- osm_tag_settings: global prefix settings
- player_monster_kills: tracks all monster kills with full names
API Endpoints:
- /api/admin/osm-tags - CRUD for OSM tags
- /api/admin/osm-tag-settings - global prefix settings
- /api/osm-tags - public API for enabled tags
- /api/user/monster-kill - record kills
- /api/geocaches/discover-nearby - Overpass API integration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Increase monster count to 16-24 (doubled)
- Add slow wandering behavior - monsters drift to new positions
- Make login card semi-transparent with backdrop blur
- 4 second smooth transitions for wandering movement
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Random monsters appear behind the login card
- Monsters cycle through random animations (idle, attack, skill, flip, etc.)
- Loads actual monster types from API for variety
- Animations stop when user logs in for performance
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Location-specific monsters (like grocery-only spawns) don't need
the "Cart Wranglin'" prefix since they're already themed for that
location. The prefix now only applies to monsters that can spawn
anywhere but happen to be near a special location.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add spawn_location column to monster_types table (database.js)
- Add tags array to geocaches for location tagging (geocaches.json)
- Add spawn location dropdown in admin panel monster editor (admin.html)
- Update spawn logic to filter monsters by location restriction (index.html)
- Update name prefix logic to use tags instead of icons
- Add grocery tag to Walmart and H-E-B geocaches
Monsters can now be configured to only spawn near specific location types
(grocery, bank, park, restaurant). The "George the Moop" monster can be
set to spawn_location="grocery" to only appear near grocery stores.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Implement stats sync engine with debouncing/rate limiting to fix save spam
- Add Walmart and H-E-B grocery store geocaches
- Add "Cart Wranglin'" prefix for monsters spawning near grocery stores
- Fix monster spawn levels to never exceed player level
- Show WASD controls for all users when GPS is off
- Add George the Moop monster assets
- Add animations.js for monster animation definitions
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add monster attack animation (rubber band snap towards player)
- Fix animation direction (now snaps left towards player)
- Add orange highlight on attacking monster
- Fix animation persistence through DOM rebuilds
- Prevent login music playing over game music on refresh
- Check for existing auth before starting login music
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Fix class skill names: Game now reads from class_skills table (what admin edits) instead of legacy class_skill_names table
- Add per-hit targeting mode for multi-hit skills (configurable in admin)
- Music now attempts autostart on page load
- WASD keyboard controls auto-enable test mode (like on-screen buttons)
- Update CLAUDE.md with Docker restart vs rebuild documentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Key fixes:
1. Add pagehide handler for reliable mobile saves
2. Add visibilitychange handler - refresh stats when tab becomes visible
3. Add cache: 'no-store' to all stats API calls to bypass browser cache
4. Mount service-worker.js in docker-compose (was using stale cached version)
This ensures:
- Mobile saves reliably when switching apps or closing
- Desktop fetches fresh data when tab becomes active
- Browser cache never serves stale API responses
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Service Worker changes:
- Bump version to v1.0.1 to invalidate old caches
- Use network-first strategy for all API calls
- Use network-first strategy for HTML files
- Only use cache-first for static assets (CSS, JS libs, images)
Server changes:
- Serve service-worker.js with no-cache headers
- Serve HTML files with no-cache headers
Client changes:
- Detect service worker updates and auto-reload page
- Check for updates on every page load
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Generate unique server session ID on startup
- Client detects session ID mismatch on reconnect and forces re-login
- Add "Kickems" as Trail Runner's custom name for basic_attack skill
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Declare userLocation properly (was implicit global)
- Sync testPosition to real location on first GPS fix
- Sync testPosition when toggling GPS off for seamless manual mode
- Disable gpsTestMode when starting real GPS tracking
- Use userLocation instead of map center when enabling test mode via admin
Fixes issue where position would jump between two spots when toggling GPS.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add toast notification system with CSS animations for user feedback
- Add WebSocket broadcast for admin panel changes (monsters, skills, settings)
- Client auto-refreshes when admin makes changes
- Add HP/MP regen settings to admin panel (intervals, percentages, home multipliers)
- Fix SQL parameter mismatch in saveRpgStats (data_version = excluded.data_version)
- Implement optimistic updates in admin panel for immediate feedback
- Add broadcastAdminChange helper with client count logging
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create SKILLS.md with base skill reference documentation
- Update CLAUDE.md with comprehensive RPG system documentation
- Update README.md with game features and mechanics overview
- Fix race condition where auto-save could overwrite server data
- Add statsLoadedFromServer flag to prevent premature saves
- Move startAutoSave() to after server data loads
- Add save error notifications to user
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add on-screen WASD control pad for movement testing
- Implement hold-to-move for continuous movement on direction buttons
- Add music system with 5 tracks: overworld, battle, victory, death, homebase
- Music pauses/resumes instead of restarting when switching tracks
- Add home base reset button in admin panel
- Implement double-tap for home base placement on mobile
- Fix WASD controls visible when dead (z-index above death overlay)
- Add MP regeneration while walking
- Clear monsters when entering home base area
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Combat skill buttons now:
- Check both hardcoded SKILLS and database SKILLS_DB
- Display class-specific skill names (e.g., "Brand New Hokas")
- Use fallback icon for database-only skills
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously auto-center was turned off after the first GPS fix.
Now it stays on, keeping the map centered on the player's position.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Removed hardcoded PLAYER_CLASSES and SKILL_POOLS constants
- Added loadClasses() function to fetch classes from /api/classes
- Dynamically builds PLAYER_CLASSES from database with skills
- Dynamically builds SKILL_POOLS from class_skills with choice_groups
- Updated showSkillChoice() to use class-specific skill names
- Updated selectSkill() to display class-specific skill names
- Added safety fallbacks for level-up stat gains
- Classes loaded on app initialization alongside skills/monsters
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GPS Test Mode (WASD movement) now automatically enables when an admin
user logs in, improving the development/testing experience.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Modified executePlayerSkill() to loop through all living monsters when
skill.target === 'all_enemies'
- Each target gets individual hit chance roll
- Added Whirlwind skill (75% ATK to all enemies, 12 MP) to database seeds
- Added whirlwind to Trail Runner class skills for testing
- Fixed skill seeding to check for existence before inserting
- Added try-catch for class skill names to prevent duplicate errors
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix death system: add clearMonsterEntourage(), set HP to 0 on death
- Add movement-based monster spawning (configurable distance)
- Add admin-editable spawn settings (interval, chance, distance)
- Add home base HP/MP regeneration when player is nearby
- Update character sheet to show damage range, accuracy, MP cost
- Change WASD test step from 11m to 1m
- Fix monster spawning after respawn
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add visual status/buff overlays on combat sprites (100x100px full overlay)
- Monster skills can now have custom names per monster
- Skills admin page for full skill CRUD
- Fix monster buff skills (defend) to properly buff instead of damage
- Fix custom skill names appearing in combat log
- Auto-copy default images when creating new monsters
- Add monster toggle endpoint fix
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add admin.html with monster/user/settings management UI
- Add admin API endpoints with adminOnly middleware
- Add game_settings table for configurable settings
- Replace emoji monster icons with PNG images (50px map, 100px battle)
- Add mapgameimgs/ directory with default fallback images
- Fix mobile geocache tap by checking for markers before preventDefault
- Increase geocache marker touch target to 64x64px
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Skill Selection System:
- Added 3 new alternative skills (quick_step, second_wind, finish_line_sprint)
- Created SKILL_POOLS for level 2, 3, 5 skill choices
- Added skill choice modal on level up
- Players now choose 1 of 2 skills at milestone levels
- Combat UI shows only unlocked skills
- Character sheet displays learned skills
Monster Database Migration:
- Renamed "Discarded GU" to "Moop" (Matter Out Of Place)
- Created monster_types table for storing monster definitions
- Added CRUD methods for monster types
- Added /api/monster-types endpoint
- Frontend now loads monster types from API
- Auto-seeds Moop monster on first run
- Ready for admin UI and multiple monster types
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Phase 3: Character sheet modal (click class name in HUD)
- Display all stats (HP, MP, ATK, DEF)
- Show XP progress bar with level milestones
- Show unlocked/locked skills based on level
- Fix mobile double-tap inconsistency (50/50 bug)
- Add monster check to native touchend handler
- Block press-and-hold navigation when monsters present
- Both touch handlers now consistently prioritize combat
- Increase monster touch targets to 70x70 with visible tap area
- Add pointer-events:none to trails in nav mode
- Add interactive:false to accuracy circles
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Features:
- Trail Runner class with 4 skills (Attack, Brand New Hokas, Runner's High, Shin Kick)
- Skill level requirements (unlock at levels 1, 2, 3, 5)
- Discarded GU monster type with dialogue escalation phases
- Multi-monster combat: all entourage monsters join fight simultaneously
- Target selection system (click to select enemy)
- Sequential monster turns after player action
- XP bar in HUD showing progress to next level
- Server-side RPG stats persistence (survives cache clear)
Technical:
- Added rpg_stats table to database
- Added GET/PUT /api/user/rpg-stats endpoints
- Fixed auth token name mismatch (accessToken vs authToken)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fixed updateUndoButton null reference at line 1543
- Added null check before accessing DOM element properties
- Tracks now load properly
- Hamburger menu confirmed functional
- All critical JavaScript execution errors resolved
This commit represents a stable, working state after multiple fix attempts documented in FIX_ATTEMPTS.md
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed 20+ syntax errors caused by incorrect event listener wrapping
- Fixed null reference error in updateTrackList function
- Added null checks for trackCount and trackList elements
- Corrected all misplaced closing braces in arrow functions
- Separated nested if statements that were incorrectly combined
- Hamburger menu now functional
- Track loading error resolved