KelnMaar's Multiplayer Statistics


Advanced statistics tracking for multiplayer games including distance traveled, crafted items count, active crafts monitoring, combat stats, building stats, mining stats, playtime tracking, Space Age features, comprehensive 22-tier rank system with advanced scoring algorithms, achievement system with notifications, player rankings and comparison tools, and data visualization

Utilities
18 days ago
2.0
250
Character

Changelog

Version: 6.2.0
Date: 04. 02. 2026
  Technical:
    - Migrated GUI event handling to use stdlib2 library
    - Refactored core modules (gui, rankings, stats, planet_stats) to utilize stdlib2 features
    - Code cleanup and optimization in control.lua
Version: 6.1.0
Date: 03. 02. 2026
  Features:
    - MAJOR: Integrated professional time series charts using factorio-charts library
    - Added high-resolution line graphs with multi-resolution data (30s, 12h, 7d intervals)
    - Real-time visualization of Rank Score, Distance Traveled, Items Crafted, Playtime, and Combat
    - Automatic data persistence across save/load cycles with chunk management
    - Enhanced rank progress display with large icons, progress bars, and percentage indicators
  UI Improvements:
    - Completely redesigned Historical Charts section with professional styling
    - Improved chart frame borders and alignment with proper Factorio UI standards
    - Centered legends with color-coded series labels matching graph lines
    - Cleaner rank progress layout with prominent current rank display
    - Better visual hierarchy and spacing throughout statistics windows
  Technical:
    - Implemented RRDtool-style cascading aggregation for efficient time series storage
    - Extended buffer lengths: 120 points (60min), 144 points (12h), 168 points (7days)
    - Automatic chunk allocation and cleanup for render surfaces
    - Fixed data persistence issues with light IDs and render objects
  Dependencies:
    - Added required dependency: factorio-charts >= 1.0.7
    - Added optional dependency: bobpower >= 2.0.0
  Special Thanks:
    - nickelbob for the excellent factorio-charts library
Version: 6.0.0
Date: 03. 02. 2026
  Features:
    - MAJOR: Complete Factorio 2.0 Energy Statistics Overhaul
    - Added high-fidelity [CALC] mode for energy statistics with 100% accuracy
    - Implemented 5-tier property cascade for power production (supports Bob's Power, Angel's, etc.)
    - Support for Burner Generators, Solar Panels, and advanced 2.0 prototypes
    - UI: Added global vertical scrolling support for Planet Stats window
    - UI: Planet Stats window now automatically adapts to screen resolution (max 750px height)
  Optimizations:
    - Improved dynamic entity scanning (now discovers modded types like burner-generators)
    - All power API calls are now protected (pcall) to prevent crashes with modded prototypes
    - Switched to theoretical maximum values in [CALC] mode for better infrastructure planning
  Bugfixes:
    - Fixed Planet Stats [API] mode not working in Factorio 2.0 (migrated to surface.get_electric_network_statistics)
    - Fixed Solar Panels showing 0.0 MW production at night in [CALC] mode
    - Fixed Burner Generators (Bob's Mods) missing from statistics
    - Fixed critical crash when accessing proto.max_energy_usage in 2.0
    - Fixed window overflow issues on small resolutions with many entities
Version: 5.8.8
Date: 03. 02. 2026
  Features:
    - Planet stats now uses asynchronous data collection (200 entities per tick) for better performance
    - Planet stats GUI now uses two-column layout (Production left, Power/Shortages right)
    - Main stats window is now draggable with position saved per player
  Optimizations:
    - Power statistics now use electric_network_statistics API when available
    - Reduced game lag when opening planet stats on large bases
  Bugfixes:
    - Fixed planet stats hotkey not working when setting was disabled by default
    - Fixed planet stats GUI duplicating content when updated
    - Fixed action buttons changing from icons to text after GUI refresh
Version: 5.8.7
Date: 03. 02. 2026
  Features:
    - Added new hotkey Shift+Alt+R to toggle player rankings window
  Optimizations:
    - MEMORY: Fixed dashboard_data and chart_history memory leak when player leaves game
    - PERFORMANCE: Added rank calculation caching with 5-second TTL to reduce CPU usage
    - PERFORMANCE: Added damage batching for on_entity_damaged event (buffer flushed every 30s)
    - PERFORMANCE: Incremental crafted_items cleanup every 100 crafts instead of only on player leave
  Bugfixes:
    - Added nil checks to GUI functions to prevent crashes with invalid/disconnected players
Version: 5.8.6
Date: 03. 02. 2026
  Bugfixes:
    - Fixed hardcoded Russian strings in GUI buttons (Details, History, Compare, Charts) - now properly localized
    - Fixed nil-access errors in control.lua when gui_state was not initialized
    - Enabled planet_stats hotkey (Shift+Alt+P) - was previously commented out in data.lua
    - Removed duplicate style definitions in data.lua that were overwriting each other
    - Localized all Russian strings in planet_stats.lua for proper i18n support
  Documentation:
    - Updated FAQ.md with correct version (5.8.6), achievement count (36), and removed obsolete Update Frequency setting references
    - Added missing localization key "history" to all 8 language files
    - Added new localization keys for planet_stats debug section
  Technical:
    - Cleaned up data.lua - reduced from 305 to 233 lines by removing duplicate styles
Version: 5.8.5
Date: 27. 07. 2025
  Bugfixes:
    - CRITICAL: Fixed nth_tick intervals to use permanently fixed constants instead of configurable values
    - CRITICAL: Removed "Update Frequency" setting that was causing multiplayer desyncs when changed
    - CRITICAL: All nth_tick values (1800, 600, 36000) are now hardcoded and will never change
    - Fixed multiplayer desync caused by different tick registration between save/load cycles
    - Multiplayer stability is now guaranteed - tick events remain consistent across all game sessions
  Technical:
    - Removed settings.startup["multiplayer-stats-update-frequency"] completely
    - UPDATE_FREQUENCY, CLEANUP_FREQUENCY, GUI_REFRESH_FREQUENCY are now immutable constants
    - Simplified event registration logic to prevent any future desync possibilities
Version: 5.8.4
Date: 27. 07. 2025
  Bugfixes:
    - CRITICAL: Complete overhaul of nth_tick event system to eliminate all multiplayer desync errors
    - CRITICAL: Fixed hardcoded tick values (600, 36000) that caused "nth_ticks not re-registered" errors
    - CRITICAL: Implemented unified module constants for all periodic events (main, cleanup, GUI refresh)
    - CRITICAL: Added script.on_nth_tick(nil) to clear handlers before re-registration
    - Added error handling with pcall wrappers for all nth_tick handlers to prevent crashes
    - Improved error reporting with detailed messages for debugging nth_tick issues
    - Enhanced event lifecycle management for rock-solid multiplayer stability
Version: 5.8.3
Date: 27. 07. 2025
  Bugfixes:
    - CRITICAL: Fixed nth_tick registration using module constants instead of storage access in script.on_load()
    - CRITICAL: Eliminated storage access during on_load event to prevent multiplayer desynchronization
    - Fixed "nth_ticks not re-registered" error by using proper Factorio API patterns
    - Improved nth_tick event lifecycle management for multiplayer stability
Version: 5.8.2
Date: 27. 07. 2025
  Bugfixes:
    - CRITICAL: Fixed "nth_ticks not re-registered" multiplayer desync error when loading saves
    - CRITICAL: Improved nth_tick event registration to prevent script event mismatches
    - Fixed update frequency caching to ensure consistent behavior across save/load cycles
    - Improved error handling for multiplayer synchronization
Version: 5.8.1
Date: 27. 07. 2025
  Optimizations:
    - PERFORMANCE: Improved update frequency from 5 seconds to 30 seconds (300 -> 1800 ticks) for better server performance
    - PERFORMANCE: Added player update queue system to process players in batches instead of all at once
    - PERFORMANCE: New setting "Max Players Per Update Cycle" allows fine-tuning performance for large servers
    - PERFORMANCE: Reduced maximum players processed per cycle from unlimited to 5 (configurable 1-20)
    - PERFORMANCE: Player queue automatically rebuilds when players join/leave for optimal distribution
  Settings:
    - Added "multiplayer-stats-max-players-per-update" startup setting (default: 5, range: 1-20)
    - Updated setting descriptions with performance recommendations for large servers
    - Improved minimum/maximum values for update frequency setting (300-3600 ticks)
  Technical:
    - Optimized main statistics update loop to prevent performance spikes on large multiplayer servers
    - Better memory management with existing 30-point history limitation per category
    - Queue-based player processing ensures fair update distribution across all connected players
Version: 5.8.0
Date: 25. 07. 2025
  Changes:
    - Planet Statistics system temporarily disabled as Work-In-Progress (WIP)
    - Added new startup setting "Enable Planet Statistics" (disabled by default)
    - Planet Statistics code preserved but inactive until feature is production-ready
    - Planet Statistics GUI, hotkeys, and commands disabled to prevent potential issues
    - Feature will be re-enabled in future version after optimization and testing
  Technical:
    - Conditional loading of planet_stats module based on startup setting
    - All planet statistics event handlers wrapped in enable/disable checks
    - Hotkey registration commented out in data.lua (manual setup required for testing)
    - Complete preservation of planet statistics codebase for future development
Version: 5.6.0  
Date: 25. 07. 2025
  Major Features:
    - Added comprehensive Planet Statistics system for real-time monitoring of planetary production
    - New Planet Statistics GUI displays current production, power generation/consumption, and resource shortages
    - Interactive shortage alerts with one-click entity pinging for quick troubleshooting
    - Auto-updates when switching between planets and space platforms
    - Supports all Space Age surfaces including Nauvis, Vulcanus, Fulgora, Gleba, Aquilo, and space platforms
  Features:
    - New hotkey Shift+Alt+P to toggle Planet Statistics window
    - Smart power balance calculations with color-coded indicators (green/red)
    - Production overview showing top active recipes with productivity metrics
    - Resource shortage detection for assembling machines, furnaces, and chemical plants
    - Real-time entity status monitoring with detailed ingredient analysis
    - Multiplayer ping system - ping shortage locations to alert other players
    - Command "/planet-stats" for quick access to planetary statistics
    - Auto-positioning of statistics window in right side of screen for optimal visibility
  Translation:
    - Complete localization support for Planet Statistics across all 8 languages
    - Added 20+ new localization strings for Planet Statistics interface
    - Full translation coverage: English, Russian, Chinese, Japanese, Korean, Spanish, Portuguese, Vietnamese
Version: 5.5.0
Date: 25. 07. 2025
  Translation:
    - Added complete Chinese (Simplified) localization with all 268 strings translated
    - Added complete Japanese localization with all 268 strings translated
    - Added complete Korean localization with all 268 strings translated
    - Added complete Spanish (Spain) localization with all 268 strings translated
    - Added complete Portuguese (Brazil) localization with all 268 strings translated
    - Added complete Vietnamese localization with all 268 strings translated
    - Mod now supports 8 languages total: English, Russian, Chinese, Japanese, Korean, Spanish, Portuguese, Vietnamese
    - All achievement names, rank system, GUI elements, and mod settings are fully localized
    - Complete support for Space Age features across all languages