Jump to content

Electricity Overhaul Mod


ocbMaurice

Recommended Posts

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.jpggame-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!

Edited by ocbMaurice (see edit history)
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.thumb.png.f185d33e166d03deb9c4b1a03bc0eb62.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!

 

Link to comment
Share on other sites

  • 4 weeks later...

Just a small but probably important update/news: My mods are now also available via 7D2DModLauncher:

 

image.thumb.png.8c6f06994b8e425a81cb9594aaef5dd6.png

 

Thxs to @sphereii for letting me patch his mod crawler to support my GitHub (sub-module) setup!
Some docs on how it was done can be found at https://github.com/OCB7D2D/7D2DModLauncherA19.

 

Edited by ocbMaurice (see edit history)
Link to comment
Share on other sites

Is there any chance that this could be made into a drag and drop, mod folder mod, instead of using a third party mod manager and uploaded to something like nexusmods for a more user friendly experience. The mod itself looks like a dream. Just installing it would be a pain. Especially if you are trying to set up a modded multiplayer (non-dedicated) world with less tech-savy friends.

Link to comment
Share on other sites

The Mod uses DMT technology, meaning it also needs a patched dll in the game folder (so it's not mod-folder only).

I could make zip archives, but then I would need to curate what to include and create one archive for each and every game version.
Also if you want to uninstall/deactivate my mod for another map, user would need to restore those game dlls.
And finally two DMT mods provided this way have a very big chance of being incompatible.
Given all these reasons I believe for this type of Mod the 7D2DLauncher is the easiest way.

Btw. doesn't nexusmods also list mods only with a mod-launcher link!?

 

As for the video tutorial, probably won't have time, but let's see when A20 is around ...

Edited by ocbMaurice (see edit history)
Link to comment
Share on other sites

On 12/2/2021 at 6:05 AM, VestedStorm6108 said:

Snip

They probably won't make it default, as they have said before they are basically done with electricity, and I haven't seen ANYTHING else that does what this does. So we are kinda limited in options, not that this doesn't do a fantastic job.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...