
NeuroLag
A smart, resource-aware optimization plugin that dynamically adjusts Mob AI based on server TPS and RAM to ensure a lag-free SMP experience
237
4
Список изменений
[1.7.0] — 2026-05-01 — Major Architecture & Algorithm Improvements
🚀 Major Features
-
Safe Mode for Critical State
- Added
safe-modeconfiguration option under critical TPS tier - Implemented
SafeModeOptimizerto selectively disable dangerous AI components while preserving essential game mechanics - Prevents over-optimization that breaks villager trading, mob escaping water, and other critical behaviors
- Added
-
LagEngine Refactoring
- Extracted optimization logic into dedicated classes following Single Responsibility Principle:
MobCuller- Entity culling with intelligent importance scoringAIThrottler- AI throttling and tick managementSpawnSuppressor- Spawn rate adjustment logic
- Improved code maintainability and testability
- Extracted optimization logic into dedicated classes following Single Responsibility Principle:
-
Event-Driven Architecture
- Implemented EventBus pattern for decoupled optimization logic:
OptimizationEventBus- Central event dispatcherOptimizationEvent- Event data containerOptimizationListener- Interface for event handlers- Enables plugins/addons to react to optimization state changes
- Implemented EventBus pattern for decoupled optimization logic:
-
Mob Importance Scoring System
- Created
MobImportanceScorerwith comprehensive importance evaluation:- Base scores for all entity types (bosses: 1000, villagers: 100, hostile: 10-20, etc.)
- Dynamic scoring factors: named mobs (10x), tamed mobs (20x), equipment (1.5x)
- Integration with MobCuller for intelligent culling decisions
- Created
-
Mob Behavior Groups
- Implemented
MobBehaviorGroupssystem for targeted optimization:- PASSIVE (low priority): Cows, pigs, sheep, chickens
- AGGRESSIVE (high priority): Zombies, skeletons, creepers
- NEUTRAL (medium priority): Endermen, iron golems
- SPECIAL (preserve): Villagers, bosses, named mobs
- AQUATIC (water-based): Dolphins, guardians, squids
- Implemented
🧠 Algorithm Improvements
-
RegionOptimizer Enhancements
- Dynamic Region Sizing: Automatically adjusts region size based on player count
- 0-5 players: 16 chunks (large regions)
- 6-20 players: 8 chunks (medium regions)
- 21-50 players: 4 chunks (small regions)
- 50+ players: 2 chunks (very small regions)
- Hot Region Decay: Regions gradually cool down when players leave
- Heat decays at 5% per second when no players present
- Prevents regions from staying hot indefinitely
- Dynamic Region Sizing: Automatically adjusts region size based on player count
-
PredictiveScheduler Algorithms
- EWMA (Exponentially Weighted Moving Average): Better short-term TPS prediction
- Alpha smoothing factor of 0.3 for optimal responsiveness
- Linear Regression: Trend analysis for TPS decline detection
- Combines simple average, EWMA, and trend for robust prediction
- More accurate lag prevention than simple hourly averages
- EWMA (Exponentially Weighted Moving Average): Better short-term TPS prediction
🛠️ Configuration Management
-
Annotation-Based Validation
@ConfigValidationannotation for field-level validation rulesConfigValidatorclass with automatic validation on reload- Validates numeric ranges, required fields, and boundary warnings
- Provides clear error messages and validation reports
-
Config Migration System
- Automatic version checking and stepwise migrations
- Backup creation before migration with rollback capability
- Supports migration of config.yml, features.yml, monitors.yml, systems.yml
- Preserves user settings while updating structure
📚 Documentation
-
Comprehensive Config Guide
CONFIG-GUIDE.mdwith detailed explanations for all settings- Usage examples, recommended values, and troubleshooting tips
- Clear organization by functional areas
-
Enhanced Config Comments
- Added detailed explanations to all YAML configuration files
- Section headers and inline comments for better understanding
- Security notes and setup instructions where applicable
🔧 Code Quality Improvements
-
Single Responsibility Principle
- Each class has a single, well-defined responsibility
- Reduced coupling between components
- Improved testability and maintainability
-
Modern Java Practices
- Updated deprecated Bukkit method usage
- Proper exception handling and logging
- Thread-safe data structures where appropriate
🎯 Performance Optimizations
-
Intelligent Culling
- Prioritizes removing low-importance mobs first
- Preserves named, tamed, and special mobs
- Reduces impact on gameplay while maintaining server performance
-
Targeted Optimization
- Behavior-based optimization strategies
- Different approaches for different mob types
- More efficient than one-size-fits-all approach
🔄 Backward Compatibility
- Seamless Migration
- Automatic config updates preserve existing functionality
- Graceful handling of missing or corrupt configuration files
- No breaking changes to existing setups
🐛 Bug Fixes
-
Fixed Memory Leaks
- Proper cleanup of event listeners and cached data
- Thread-safe collections with proper synchronization
-
Improved Error Handling
- Better exception messages and logging
- Graceful degradation when components fail
- Validation prevents invalid configurations
Файлы
NeuroLag-1.7.0.jar(5.61 MiB)
ОсновнойМетаданные
Канал релиза
Release
Номер версии
1.7.0
Загрузчики
BukkitPaperPurpurSpigot
Версии игры
1.21–1.21.11
Загрузок
9
Дата публикации
2 дн. назад
