Project Zomboid

Project Zomboid

Physiks MP Player DataSync Optimizer
Showing 1-10 of 34 entries
< 1  2  3  4 >
Update: 23 Mar @ 10:19am

Physiks MP Data Sync Optimizer - Changelog
Version 1.4.0 - Released March 23, 2025 📅✨

New Features 🌟
Chunk Load Sync Buffer: Added a temporary state buffer on the server (PlayerSyncServer.lua) to queue updates during long chunk loads, ensuring players remain visible when regions are still initializing. 🛠️📦

Proximity-Based Priority: Introduced a priority system in processUpdates to favor syncing players within proximityRange (now 35) first, reducing desync for nearby entities. 🚀👥



Improvements ⚙️
Threshold Adjustments: 🔧
Increased PlayerSync.Thresholds.position from 0.5 to 0.75 in PlayerSyncShared.lua to reduce unnecessary position updates, helping prevent player flickering or disappearing during minor movements. 👻🚫

Lowered PlayerSync.Thresholds.velocity from 0.1 to 0.05 for finer velocity tracking, improving motion smoothness and reducing desync. 🏃‍♂️💨

Sync Interval Tuning: ⏱️
Adjusted updateIntervalNear from 0.05 to 0.03 in PlayerSyncClient.lua and PlayerSyncServer.lua for faster updates in close proximity, addressing disappearing players. ⚡👀

Increased updateIntervalFar from 0.2 to 0.25 to lighten server load during distant syncs, balancing performance during chunk loads. 🌍🏋️

Interpolation Enhancements: 🎮
Raised SyncInterpolation.smoothingFactor from 0.15 to 0.2 in SyncInterpolation.lua for smoother transitions, reducing visible desync during latency spikes. 🌊👍

Increased SyncInterpolation.teleportThreshold from 3.0 to 4.0 to allow more gradual corrections before snapping, minimizing player vanishing effects. 🌀✨

Cache Optimization: 💾
Boosted playersPerTick from 15 to 20 in PlayerSyncServer.lua to process more updates per cycle, cutting down queue buildup during high player activity or chunk transitions. ⏩🚦

Extended cacheUpdateInterval from 1.0 to 1.5 seconds to reduce server overhead during prolonged chunk loading phases. ⏳🖥️

Grid Size Expansion: Increased gridSize from proximityRange * 2 (60) to proximityRange * 2.5 (87.5) in PlayerSyncServer.lua to widen the update radius, ensuring players stay synced across larger areas during chunk loads. 🗺️📏

Bug Fixes 🐛
Player Disappearing on Chunk Edges: Fixed an issue in updatePlayerCache where players near grid boundaries weren’t consistently included in playerGrid, causing them to drop from sync and disappear—now uses a broader overlap check. 🕵️‍♂️✅

Desync During Pause Resume: Patched a bug in PlayerSyncClient.lua where pauseBuffer states weren’t properly flushed after resuming, leading to outdated positions; now ensures immediate sync on unpause. ⏯️🔄
Long Chunk Load Latency: Resolved a server-side delay in processUpdates where batch processing stalled under heavy load, exacerbating desync—optimized queue handling to prioritize recent states. ⏲️🛡️

Update: 15 Mar @ 7:09pm

Changelog
📅 Update Log - March 15, 2025, 07:07 PM PDT

🔄 Version 1.2.1 - Reverted & Refined

🎉 Reverted to the Older, Fan-Favorite System: After listening to community feedback, we’ve rolled back to the original, more beloved version of the Physiks MP DataSync Optimizer. The classic approach to player synchronization and interpolation is back by popular demand!
🔧 Refined Performance: Polished the reverted system with enhanced stability and efficiency. Removed the problematic postUIDraw function to eliminate crashes (e.g., Object tried to call nil in postUIDraw), ensuring a rock-solid experience.
📊 Improved Buffer Handling: Moved pause/resume state processing to the tick and onPlayerUpdate functions, providing a smoother transition without the UI rendering conflicts.
🛡️ Bug Fixes: Addressed runtime errors in SyncInterpolation.lua (line 173) by simplifying the architecture, reducing the risk of invalid player object calls.
🌟 Community-Driven: Thanks to user reports, we’ve fine-tuned this update to deliver the reliability and performance you loved, with a modern twist!

Update: 10 Mar @ 5:44pm

Latest Updates:
Player Sync : Fixed choppy running animations—players now glide naturally unless they’re in combat. No more animation resets every tick!

Zombie Hordes : Clusters zombies into tight-knit packs when players are far, hibernates them beyond 50m—saving server juice.

Chunk Loader : Preloads chunks ahead of players and cleans up old ones every 600 ticks. Seamless exploration, less lag!

Vehicle Optimizer : Deactivates parked cars and tweaks LOD based on player distance (50m threshold). Still hunting the perfect method—setActive dodged us, but we’re closing in!

Log Spam Begone : Logs only fire on state changes or errors—no more tick-by-tick noise. Clean console, happy admin!


Recent Fixes:
Squashed OnTick Not Present errors by locking events to server-side only.

Vehicles now (almost) play nice—debugging BaseVehicle methods to get that sweet optimization working. Stay tuned!
Config Tweaks:
combatSyncRange: 10 | chunkPreloadDistance: 3 | chunkCleanupTicks: 600

zombieHibernationRange: 50 | hordeClusterTicks: 300 | hordeClusterSize: 5
Built for server admins who want performance without the headache. More fixes and polish coming soon—let’s keep the zeds at bay!

Update: 17 Feb @ 2:59pm

🛠️ Mod Setup and Initialization
🔧 Added Standalone bit32 Module:
Set up a custom implementation of bit32 for bitwise operations. This allows the mod to perform operations in a way that ensures compatibility across various systems (including LuaJIT).
✅ Ensured Safe Module Loading: Added error handling to log and stop execution if bit32 module fails to load. This helps avoid issues when the module is unavailable.
🔗 Integrated Bitwise Operations: Leveraged bit32 for efficient bit-packing and unpacking, ensuring optimal data synchronization and compression.
🕹️ Synchronization & Interpolation Enhancements
⚡ Player State Synchronization (Syncing) Improvements:
📦 Added Efficient State Packing: Implemented batch update mechanism to sync multiple player states at once, reducing network traffic.
🔄 Improved Player Interpolation: The mod now smoothly applies player positions, velocity, animations, and stance adjustments with SyncInterpolation. This minimizes teleportation and "rubberbanding" by interpolating player states based on latency.
⚙️ Configurable Smoothing Factor: Introduced smoothingFactor to control the interpolation speed, improving accuracy and responsiveness.
🧠 Batch Updating with Improved Synchronization
🔄 Batch Update Mechanism:
💾 State Packing: Implemented a batching system that uses bitPackState to group multiple player states into a single packet. This reduces the overhead of handling individual updates and ensures faster, more efficient network communication.
📤 Error Handling for Updates: Added checks to ensure bitPackState exists before attempting to send batch updates. Logs an error if the method is unavailable.
🛑 Cooldown Mechanism: Introduced a cooldown system to prevent excessive update frequency. The system now batches updates only when the cooldown period has elapsed, ensuring smooth performance without overloading the server or client.
🧑‍💻 Event Handling and Error Prevention
🔐 Safeguarded OnTick Event:
🛠️ Event Validation: Wrapped the Events.OnTick handler in additional checks to ensure that all functions are properly defined and initialized. This prevents the system from attempting to add nil event handlers, which was causing the error.
⚠️ Detailed Error Logging: Enhanced error messages to log more specific details, such as the failure of missing functions (like PlayerSync.bitPackState) and handling unexpected nil values for important objects.
⏱️ Prevented Infinite Error Loops: By ensuring that event handlers are correctly added and initialized, we avoided the thousands of repeating errors that were flooding the logs.
🧩 Miscellaneous Improvements
🔄 Pending Updates Initialization: Added a check to ensure that the pendingUpdates table is initialized before use, preventing errors when trying to interact with it.
⏳ Update Frequency Control: The cooldown system now adjusts the frequency of batch updates dynamically, ensuring that synchronization occurs at a reasonable interval, keeping the server and client in sync without excessive network usage.

Update: 16 Feb @ 3:05pm

Update: 16 Feb @ 6:16am

Bit Packing & Bandwidth Reduction

Efficient data compression using bit packing for player states.
Batch updates to reduce network strain and improve responsiveness.
Interpolation & Smooth Movement

Enhanced interpolation for remote players to reduce jitter.
More accurate position updates with improved distance calculations.
🧠 Smarter State Updates
Dynamic update intervals:
0.1s when near other players (improves combat sync).
0.5s when farther away (reduces unnecessary updates).
1.0s when no players are nearby (optimizes network usage).
Threshold-based updates to avoid redundant data transmissions.
Better animation syncing by correctly retrieving the current animation state.

Update: 15 Feb @ 8:58pm

Fixes & Improvements
✅ Fixed PlayerSync Initialization Issue

PlayerSync is now globally initialized using _G.PlayerSync to ensure it's accessible across all scripts.
Prevented local scope override that caused "ERROR: PlayerSync is not initialized." at runtime.
✅ Improved Module Loading with Error Handling

checkModule() function now verifies that modules load properly before proceeding.
Added better error messages to detect failed module dependencies.
✅ Enhanced Debugging Output

Added [DEBUG] log statements to help track initialization steps.
More detailed warnings for missing StateKeys, ensuring proper synchronization.
Next Steps
Further optimization of bit-packing and interpolation logic.
Additional validation checks to improve sync stability in high-player-count servers.

Update: 15 Feb @ 2:56pm

Explicitly require("shared.PlayerSyncShared") before calling checkModule("shared.PlayerSyncShared") in DataSync.lua

Update: 12 Feb @ 5:03am

Update: 11 Feb @ 11:03pm