• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Electricity Overhaul Mod

ocbMaurice

New member
I'd like to proudly present my Electricity Overhaul Mods:

https://www.nexusmods.com/7daystodie/mods/1713

This mod tries to solve issues with the existing electricity implementation

and tries to improve overall handling with power items and sources. It lets

you form bigger grids with multiple power source that feel more natural.
It consists of several other smaller mods that should all work standalone.
Pick the ones you like and install them beside the overhaul mod.

https://github.com/OCB7D2D/ElectricityOverhaul | Nexus (A20/BepInEx)
https://github.com/OCB7D2D/ElectricityWireColors | Nexus (A20/Harmony)
https://github.com/OCB7D2D/ElectricityWorkarounds | Nexus (A20/Harmony)
https://github.com/OCB7D2D/ElectricityButtonsPush | Nexus (A20/Harmony)
https://github.com/OCB7D2D/ElectricityNoWires | Nexus (A20/Harmony)

https://github.com/OCB7D2D/ElectricitySolarRecipes | Nexus (XML)
https://github.com/OCB7D2D/ElectricityLamps | Nexus (A20/Harmony)

https://github.com/OCB7D2D/ElectricityWindPower | Nexus (A20/Harmony)

Important note about power items and wiring lost

I had various reports about power item resets, which I always took seriously,

but was also pretty sure was a vanilla thing (just couldn't pin my finger on any

specific issue that could cause it). As of July 2022 I found at least one very

dangerous case that pretty much seems to explain what users are reporting.

https://github.com/OCB7D2D/ElectricityWorkarounds | Nexus now has a fix for it!

You can find them also on nexusmods (see top nexusmod link).

in-game.jpg


SMX Compatibility Patch 1. Sep 2022 (1.0.2)
 

  • [SMX] Add compatibility patch for power source UIs
  • [ULM] Only repair solar cells in maintenance stations
  • Avoid "no engine" state if wind/solar items have no quality
Auto-Translations 27. July 2022 (1.0.1)
 

  • Fix localization issue (typo in translation key)
  • Add automated translations for 27 languages via DeepL
  • Fix battery bank hover text if batteries have no qualities (DF)
  • Update README.md for changed (optional) server xml config


Undead Legacy Support 21. May 2022 (1.0.0)

  • Introducing compatibility for Undead Legacy (experimental)
    Rename this mod to e.g ZElectricityOverhaul to load after UL
  • Charging demand for batteries changes according to fill state
    Nearly empty batteries charge faster than nearly full ones
  • Items in solar banks and windmills degrade very slowly
    Can be repaired quite easily (maintenace needed ~10d)
  • Replaces BatteryChargeDemand for min/max smoothstep configs
  • Adds new game option to prefer fuel over batteries
  • Adds extended info when hovering over power sources
    Needs OcbRemoteDescription to work in multiplayer
  • Adds German translations
Compatibility Update 18. Apr 2022 (0.9.3)

- Fix EnumGamePrefs patching to be more dynamic
  Fixes compatibility with Alpha 20.4 (b38)

- Fixes server.xml parsing on dedicated servers (0.9.1)

Performance Update 11. Jan 2022 (0.9.0)

This release only tries to optimize CPU utilization and to improve frame update
congestion. As such this update is kinda experimental, although the changes seem
rather safe, but there will always be dragons. So if you're happy with version 0.8.0
you don't need to upgrade immediately. Upgrading existing maps should be possible,
but you should always make a Backup when early adopting such a mod upgrade!

Compatibility Update 2. Jan 2022 (0.8.0)

- Fixed some compatibility issues with other mods
  We now use `OutputPerStack` as a scaling factor
  We no longer hard-code `MaxFuel` for generators
- Cleaned up and refactored update routine a bit
- Improved and fixed `EnumGamePrefs` patching

Linux Update 28. Dez. 2021 (0.7.4)

There is also a version for linux, but you need to start the game via s special
startup scripts to get the pre-loading hook working (e.g. startmodserver.sh).
Those script will also be installed after the first initial loading of the mod.

https://github.com/OCB7D2D/ElectricityOverhaul/archive/refs/tags/0.7.4.zip

Important Update 10. Dez. 2021 (0.7.2)

I have ported this mod over to A20. Unfortunately given the nature of what it

changes, it still is not 100% working out of the box with A20, but I got it pretty

close! You can download this mod like any other regular modlet, but once you

start up the game for the first time you get a "scrambled" start screen and the

console should show up (otherwise you can bring it up with F1). It should tell you

that it has installed some additional files into the game folder that allows preload

patching via BepInEx, which this mod requires to work correctly. You should just

need to restart the game once after installing this mod and it should work OOTB.

Latest downloads can always be found on the GitHub repository, e.g.:

https://github.com/OCB7D2D/ElectricityOverhaul/archive/refs/tags/0.7.3.zip

This is all very experimental at the moment, but I hope it does work out!

The main features of this overhaul mod are:

  • Power sources can be connected like every other power item
  • Power can be taken from any upstream power source
  • Prioritize renewable energy before using gasoline
  • Additional grid demand/supply and charge statistics
  • Batteries are all charged/discharged when in a bank
  • Recipes for solar panels and cells (behind engineering perk)
  • Solar power gradually fades in and out at dawn and dusk.


game-stats-generator.jpg
game-stats-battery-bank.jpg


game-options.jpg


Additional features from addon mods (also compatible with vanilla game)

  • Color wires according to power state - see which ones are un(der)powered
  • Hide wires when the wiring tool is not equipped (except trip wires and fence posts)
  • Fix issue with power duration and e.g. motion sensors
  • Fix issue with trigger groups forcefully untriggering downstream triggers
  • Fix issue with start delay and triggered duration if trigger is too fast


game-wire-colors.jpg


Compatibility and further notes

This is the first "release" and while I tested it quite thoroughly, I haven't really used this

mod for a full game yet. So I do expect that there are a few bugs lurking in there. I also

don't know how well this will scale in multi-player, since it does add quite a lot more load

than the original implementation, but might be just fine even with bigger and more grids.

I've developed and tested this Mod against version a20.b218.

All the best and good zombie hunting!

 
Last edited by a moderator:
Am I understanding this to mean that you can link multiple parent connections to a power network? If so, how is this arranged? Does it have to still be in a chain, like vanilla, or can I run 2 parallel power sources into the same relay?

 
Every power item can still have only one parent connection, otherwise you can put power sources anywhere in the chain.
So for your setup you need to connect source 1 to source 2 and source 2 to your relay.
Power will then be taken from source 2 first, and when it's saturated, from source 1.

 
Ok. I understand. That arrangement works fine for me. I was looking for a mod that did this cause one of zztentity's poi's is a solar panel farm, and vanilla electricity makes rebuilding that kinda pointless other then for looks. Your mod actually makes it worthwhile, so I will definitely be grabbing the above modlets. :)

 
Neat and makes more complex power grids easier to manage!

The link to the solar recipes modlet seems to be down. Can you reupload it?

 
Can you be a bit more specific? It's hosted on GitHub or how is it supposed to be down? Which link? Where?
See what you guys mean, sorry, forgot to set the repo on GitHub to public ;)

 
Last edited by a moderator:
Solar Panels directly produce watts per ticks (they have no "use" counter). These factors define how much Watts per "Use" you get from fuel and batteries, e.g. a stack of 10'000 fuel should give e.g. 300'000 watt-ticks if the factor is 30 (the game uses ticks as time not hours AFAICT). Batteries have 5'000 to 10'000 max uses, so a level 1 battery should give you 500'000 watt-ticks if the factor is 50. Now if something is consuming 50w per tick, a level 1 battery should last for 10'000 ticks. For batteries this also impacts how fast a they are charged, just with the inverse coefficient.

This is the theory I was going for, but don't shot me if I messed it up somewhere :) I mostly exposed these factors since I wasn't sure how fast I wanted the power sources to drain and to easily play and test with different setting. I certainly wanted to increase the demand for fuel in generators a bit from vanilla (that's why the generator now also can hold up to 5000 fuel), since I wanted to encourage the transition to solar power in the later game to make it "maintenance" free ;)

 
I see. I had them all turned up to the max, as i thought it would make them last a while. The Goal Is to repair and power the whole town my player is living in, kinda lIke glock9's houseflipper series. Lol. Eventually I will power the town With a large solar farm

 
i was reading the github for the solar recipies. have you considered using regular glass blocks, as opposed to the bulletproof variant or the raw material? i have seen a few mods use it as a recipe for various things than have glass (like a redo of the wood windows, uses wood and glass block)

 
The recipe is open for discussion, so yes, I thought about what to use to produce a solar cell. IMO broken glass made more sense than a "glass block". IMO it's not something that should be limiting, beside the time to produce the needed ingredients with the given recipe. But at least there is a use for "broken glass". If you think the recipe should be adjusted, feel free to propose an alternative recipe (ideally in the form of a Pull Request).

 
its not really an issue, just something i noticed form the wording of the Github doc. lol. if you think broken glass is best, its your mod and your way. :)  its not an expensive recipe anyways. lol.

 
Did some more testing (mostly in regard to dedicated server) this weekend and was able

to fix quite a few issues. I believe it should be mature enough now to consider it "stable".

Took me a bit of time to fully grasp what the original code was doing in detail :)

 
Found the time to put another major upgrade into the mod (v0.2.0).

- Battery Banks now have in-game options from which sources they should charge from

- Diesel Generators are no longer favored over Battery Banks for power consumption

image.png

The change was necessary in order to truly have generators as sole backups. This way

a user can decide if batteries should be charged from generators or only from solar

panels. This should hopefully allow for better fine tuned grid management.

Unfortunately this changes implicates that we have to persist these settings in the

save files. In order to allow loading of vanilla maps, I've added an experimental

option, that will read the save file from vanilla and initialize new options with

default settings. Once the save files are written, the new fields are written too.

So make sure to only enable this option exactly once (and make Backups!).

P.s. before this change this mod was fully compatible with existing saves.

All the best and good zombie hunting!

 
Back
Top