Project Zomboid

Project Zomboid

Better Generator Info
Näytetään 1–9 / 9
Päivitys: 4.10. klo 14.05

Päivitys: 4.10. klo 11.36

Better Generator Info — Power Range Optimization Update

  • Registry Lifted & Snapshot Seeding
    The generator registry is now initialized earlier, allowing live power tracking with no start-up hitch.
    A seeded ON/OFF snapshot prevents false rebuilds when opening the Generator Info window.

  • Localized Union Rebuilds
    When a generator streams in, only its local power footprint is recalculated.
    This replaces the old full-map union rebuild and completely removes load-in hitches.

  • Stride-Gated Union Polling
    ON/OFF checks now run at a smart interval instead of every frame — maintaining instant responsiveness without wasted cycles.

  • Coordinate-Based Edges
    All overlays are stored as immutable coordinates, so chunks can unload and reload seamlessly without visual gaps.

  • No-Hitch Window Opening
    Cached union data is reused when reopening the Generator Info window; no more stutter on open even with many active generators.

  • Early-Out Rendering
    Frames with no visible overlays are skipped entirely, and `getCore()` is cached per frame to minimize native calls.

  • Refined Overlay Hierarchy
    Union overlay draws first (powder blue), per-generator ring draws on top using live ON/OFF color cues.

  • Empirical Testing
    Verified smooth performance in Project Zomboid Build 42.12 (SP).

Result:
Zero hitch, zero gaps, fully incremental power visualization.

Päivitys: 4.10. klo 9.18

Updated all Translations for the new Buttons

Päivitys: 4.10. klo 7.05

Removed backup file

Päivitys: 4.10. klo 6.54

Better Generator Info — Power Range Overhaul

  • Added a new Power Range Stencil system — now uses the engine’s true reach test (IsoGenerator.isPoweringSquare()) to pre-compute the exact powered area and outer ring.
  • Introduced an ultra-smooth Union Overlay (all powered tiles) using cached stencils — no frame hitching, even on large bases.
  • Edge outlines are now stored as immutable coordinates rather than IsoGridSquare objects — ensures perfect redraws even when map chunks unload and reload (no more missing ring segments).
  • Removed the temporary “auto-refresh on LoadGridsquare” logic — no more stutter as tiles stream in.
  • Generator ON/OFF and Connect/Disconnect actions are fully event-driven — overlay updates instantly when power states change.
  • Maintains accurate coloring (good = powered, bad = off) and lightweight alpha blend consistent with the vanilla highlight system.
  • Empirical testing verified in Build 42.12 SP.

Result:
Zero hitch, zero gaps, 100% accurate power visualization.

Päivitys: 3.10. klo 17.50

Better Generator Info — Update Notes

What’s new
  • Added “THIS” button in Generator Info to toggle the focused generator’s ring.
  • Union overlay now includes generators only when Activated & Connected.

Performance
  • Union rebuilds only on real changes (add/remove, on/off, connect/disconnect).
  • Smaller scan area by considering eligible generators only.
  • Faster edge building via memoized power checks and a quick distance pre-check.
  • Result: smoother overlay; almost a zero hitch even with multiple active generators.

Reliability
  • Event-driven generator list stays in sync.
  • Hooks: ISPlugGenerator (connect/disconnect) and ISActivateGenerator (on/off).
  • Removals handled via OnObjectAboutToBeRemoved.
  • Activation snapshot catches auto-off (fuel/condition) and non-UI changes.

UI/UX
  • Buttons hide automatically when the global overlay option is disabled.
  • Union uses a warm cache when possible to minimize hitching on enable.

Fixes
  • Fixed rare crash from a shadowed
    next()
    .
  • Corrected title-bar button positioning.
  • Newly connected/activated generators are added immediately and trigger a single union refresh.

Päivitys: 3.10. klo 5.50

Update — Power Range Overlay (B42.x)

  • Per-generator ring (ON or OFF): exact outer perimeter via engine reach test; green when ON, red when OFF.
  • Union overlay (optional): powder-blue outline from nearby active generators only; cluster BFS (neighbors-of-neighbors) so overlaps aren’t cut off; culled where the selected gen already powers tiles.
  • UI: compact title-bar All toggle (persists per-player) + ModOptions master switch: Enable Power Range Overlay.
  • Performance: one-Z build + event-driven rebuilds (on toggle/target/state flip). No hitching.
  • Fixes/Polish: robust color getters, safe title-bar anchoring, correct outer-edge rendering.
  • Localization: All translations for additional entries updated.

Päivitys: 28.9. klo 19.29

Update: Fuel Gauge & Reliability Improvements

  • Added optional Fuel Gauge in Generator Info (default Off) — toggle in mod options.
  • Gauge respects Required Electricity Level; hidden if the player doesn’t meet it.
  • Clean horizontal in-window bar with smooth red → PZ-green gradient.
  • Hover tooltip: unified localized string, white border, shows Fuel % and hours remaining (respects Convert to Real Time).
  • Accurate percentage across UI: unified rounding and single source of truth for fuel%.
  • Centralized logic in BGI_Helpers (fuel %, consumption L/h or %/h, hours remaining, level gating).
  • Fixes: hover placeholder issues (extra %, %3), nil-percent crash, options ID consistency.
  • Updated Localization files for All Languages

Päivitys: 27.9. klo 15.54

Update: Mod Revived and Updated for Build 42.12

This update revives the original Generator Time Remaining mod by Bananaut and Undefined, bringing it up to date for the latest build.

Changes
  • Adopted and re-released as Better Generator Info.
  • Fixed compatibility with Build 42.12 (vanilla generator now reports fuel use in litres per hour).
  • Corrected calculation of remaining time — shows accurate days and hours left based on tank size and consumption.
  • Added support for optional real-time conversion (displays remaining time in real-world hours based on sandbox day length).
  • Preserved vanilla look and feel; seamlessly extends the existing Generator Info Window.

Credits
  • Original mod created by Bananaut and Undefined.