Skip to content

Reduce server load from zombie monitoring - #1

Draft
Ravenger2709 wants to merge 1 commit into
Brenner650:masterfrom
Ravenger2709:codex/batch-zombie-monitor
Draft

Reduce server load from zombie monitoring#1
Ravenger2709 wants to merge 1 commit into
Brenner650:masterfrom
Ravenger2709:codex/batch-zombie-monitor

Conversation

@Ravenger2709

Copy link
Copy Markdown

What this changes

We have been running ExileZ on a live Esseker server and found that zombie cleanup was one of the recurring server-side hotspots as the zombie count increased. This PR carries the useful part of that production work back to the current ExileZ-Mod structure.

The zombie monitor now processes a bounded batch on each pass instead of scanning every living zombie in one frame. It keeps a cursor between passes, so all zombies are still covered while the work is spread over time. Player lookups are also cached for one second and shared by the monitor, location validation, harassment and horde tasks. This avoids repeatedly building the same allPlayers list and replaces broad nearEntities player searches with distance checks against that small cache.

The two separate protection-device searches were combined into one nearestObjects query. Normal logging remains quiet; batch statistics are emitted only when EZM_Debug is enabled.

Two settings control the scheduler:

  • EZM_MonitorInterval: delay between monitor batches, 5 seconds by default.
  • EZM_MonitorBatchSize: maximum zombies checked in one batch, 50 by default.

Zombie spawning, side assignment and group setup are intentionally unchanged. During production testing we found those parts are sensitive to Ryan Zombies AI behaviour, so this PR stays focused on server-side scheduling and lookup cost.

Database cleanup

The included database examples previously created and updated account.zedkills. They now consistently use account.zombie_kills, matching the addAccountZombieKill query used in our deployed Exile schema. The migration uses ADD COLUMN IF NOT EXISTS, making it safe to run again on an already updated database.

Existing installations that already store data in zedkills should copy that historical value into zombie_kills before dropping or retiring the old column.

Validation

  • The scheduler design was exercised on a live Esseker server with active zombie spawning; server performance improved and zombie targeting remained correct after preserving the original spawn/group behaviour.
  • The upstream-adapted source passes git diff --check.
  • The complete exilez_mod directory was successfully packed into a PBO with PBO Manager.

Because this repository is a newer rework than the version deployed on that server, this is opened as a draft for an additional in-game check against the current upstream build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant