Project Zomboid

Project Zomboid

Generator Sound and Power Range
27 Comments
LordOfLimes 5 Sep @ 7:44am 
@ribs Makes total sense, and as an ONI I totally get it! Lol

You know much more about the technical feasibility of things, so I figured I'd at least get your opinion on it!
ribs  [author] 5 Sep @ 1:43am 
@LordOfLimes

Yeah you are right, vanilla just makes the whole building toxic the moment you turn on a generator inside.

We could try to make a more realistic buildup system, but that would get messy really fast and eat up a lot of CPU. In the end the building would still end up toxic anyway. If you have played Oxygen Not Included you probably know what I mean, late game gas calcs destroy performance.

It is better to just put that energy into creating a mod of a generator shed with proper ventilation. Since I do not have much time these days, I went with the easiest and most CPU friendly option, which is placing the generator near an open door. The system only checks twice and also makes sure the door is open and leads outside, adding a bit more realism. Of course in real life this would never be enough to make a generator safe, but for the game it works fine.
LordOfLimes 4 Sep @ 10:06am 
@ribs awesome, thanks!

To clarify, by no means am I suggesting that you should nerf the effects of CO poisoning - once it reaches a certain concentration, it can kill in under 5mins irl, so if anything the vanilla mechanic is generous!

What bugs me about the vanilla CO mechanic is that if fails to account for the volume of the space and the speed at which poisoning sets in.
ribs  [author] 3 Sep @ 3:14pm 
@LordOfLimes

I’ve also done a deep dive into the "indoor generator" topic. The internet strongly advises against using generators inside and it’s true in about 99% of cases. The gas is highly toxic and can fill a room quickly. However, in the remaining 1%, a well-ventilated generator can run inside without issue but it requires a very good ventilation system.

To simplify gameplay, I made the generator "safe" if you place it near an open window or door. I’ll also make the range of the door customizable but it has to be in the same room.
ribs  [author] 3 Sep @ 3:14pm 
@LordOfLimes

Thank you! I’ve already tested all the variables and the only one that isn’t working for me is the Well-Fed and Stuffed moodles. The rest of the code is working fine. I’m not sure why the moodle isn’t being applied.

I’m mostly just keeping you busy while I work on this one, haha. I was trying to find a mod that does what changing the thresholds for years does. It’s a game changer for me because I really dislike the "light" moodles, like hunger. I’d prefer to just have one big meal a day rather than eating every 2 hours because the mods set the thresholds like that. The same goes for Heavy Lifting. A man at the pinnacle of strength (level 10) shouldn’t be encumbered to lift just a fraction of his own weight. Thirst is another one and basically, every aspect of the character’s needs is something you can rebalance now.
LordOfLimes 3 Sep @ 1:46pm 
@ribs sounds like a plan!

I will definitely check out your Custom Moodles Threshold mod, but it might take me a little longer to get to as work has picked up lately. On the bright side, once I actually get to it, it shouldn't take very long to test! Is there any sandbox option/moodle threshold you want me to focus on testing?
(Also, because I realize we're getting off topic in this thread, I have subscribed to the other one, so feel free to respond there.)
ribs  [author] 2 Sep @ 12:12pm 
@LordOfLimes I just finished the last mod I wanted to make before starting the refactorings. It is called Custom Moodle Thresholds, and I invite you to test it:
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3560934901

You and @FCF are making strong points. I think this mod is doing too much at once. It might be better to split it: keep this mod only for changing the vertical and horizontal range in the sandbox settings and the zombie attraction sound, and create another one for the skyscraper fix and silent generator (since both use the same file). With the new modding knowledge, we can make this happen now and test each part separately.
LordOfLimes 29 Aug @ 7:39pm 
@ribs Of course! I am excited to see all these mods you are putting out; they seem real promising! Let me know when/if you need more testing done on this or any of your other mods. Keep up the good work - it is definitely appreciated! (:
ribs  [author] 29 Aug @ 6:32pm 
@LordOfLimes
Thank you for your response. I will look into it as soon as I can. I am still collecting more code to improve this mod, but I am getting close to reviewing it. I made three more mods, and there are two left. I plan to finish one today, another tomorrow, and then return here. The changes I make to those mods will also be applied here, which is why I am doing them first.

Yes, generators are very dangerous indoors, but I think having an open door or window might reduce the risk. I will check into it.

@Tatsuya
That is true. Carbon monoxide poisoning is no joke, though the way it is handled in vanilla seems exaggerated.
Tatsuya 29 Aug @ 4:31am 
>inside the building
You are flooding the entire building with invisible, possible odorless, toxic fumes. That's intended vanilla behavior and you should never do this in real life either.
LordOfLimes 28 Aug @ 8:34pm 
Possible Bug / Mechanic Issue:
When I turn the generator on inside the building, all 26 floors instantly become toxic (max severity Toxic Fumes moodle). I'm not sure if this is a bug or just a vanilla mechanic that needs reworking, but it makes indoor generators nearly unusable. If it's not a bug, could there be a temporary fix to help balance this?
LordOfLimes 28 Aug @ 8:34pm 
@ribs after some further testing, I figured out what was wrong... but encountered another problem in the process.

The generator sandbox settings for both tests were as follows:
- 100 Tile horizontal range
- 30 Layer vertical range
- Exterior Generators = True

First Test:
I tried placing the generator on the exterior of the building, but close enough to connect
(Coordinates: X 12760 Y 1528 Z 26). The top few floors of the building were powered (I forgot to count how many exactly... but definitely less than 30).

Second Test:
I placed the generator inside the building (Coordinates: X 12769 Y 1529 Z 26), which powered all 26 floors of the building successfully! :D
FCF 27 Aug @ 11:26pm 
I wanted to find silent generate but I can't find your mod by searching "silent generator".
I suggest you change the name of this mod so people can find this mod easier or are there tags being used in steam mod page?
ribs  [author] 26 Aug @ 6:12pm 
@Cryrisa
I'm working on some mods and built a framework to improve the Sandbox <--> Mod options integration. Stay tuned for updates!

@LordOfLimes
I tested it on a 10-story building, and as you can see in the image, it removed the cap in the sandbox. Could you share the coordinates for the location and what you did? I can test it on my end too. Make sure you overwrote the class file (see the discussion) and disconnected/reconnected the generator. You can confirm the overwrite worked if you’re able to set the radius above 15 using the mod options.

@Rhendak Actually, there’s no limit on how big you can make the generator radius now. I just said 100 as the max because it pretty much covers the whole renderable area. But feel free to try bigger values and test it out.
Cyrisa 24 Aug @ 8:13pm 
Could you change the options to be apart of the sandbox options instead? This would cause hell in MP with everyone loading their own settings when a generator renders in.
LordOfLimes 24 Aug @ 6:12pm 
@Clippy sorry for the wait, but I finally got around to testing the version of this mod that was supposed to remove the vertical cap on the generator range. Sadly, it didn't seem to work, though I have no idea why this is. Perhaps you missed another cap written somewhere in the code?
Rhendak 24 Aug @ 3:45pm 
Is it possible to increase the generator tile range, beyond the standard hard coded 100 tiles?
ribs  [author] 23 Aug @ 6:29pm 
I thought about making a video on how to modify the classes, but we’re already pushing our luck just by explaining what needs to be done.
It’s better to leave it at that.
Let the people who really know what they’re doing handle the hard way. Most people will just use the easy way anyway, and I can’t make it any easier than it already is. Maybe by making a real http link, but again, let’s not push it.
LordOfLimes 23 Aug @ 6:05pm 
Never mind... I just realized I totally missed the portion of text above!
LordOfLimes 23 Aug @ 6:03pm 
@Clippy I read the description and it looks simple enough! I hate to bother you about such a tiny thing, but in the discussion post, but would you mind italicizing and separating the lines of code from the instruction text? It's really not that big a deal if not -- I more ask for the sake of other users in the future.
ribs  [author] 23 Aug @ 5:53pm 
The sandbox settings were also capped :steamsad: I had to change it to make it work.
I updated the link again and if you can I would like you to test it. Just to be sure the current link ID is vgKGhcMCF7v

But please check out the discussion to understand the changes.
LordOfLimes 23 Aug @ 5:43pm 
@Clippy you work fast! Do you still want me to test it like you suggested or wait until you've checked for additional caps?
ribs  [author] 23 Aug @ 4:52pm 
It seems like TIS put the same cap in several parts of the code. I'm identifying and changing them. Next time I will test the file to make sure there are no caps left.
ribs  [author] 23 Aug @ 4:16pm 
I checked the skyscraper mod file and found the floor cap was added by TIS. The skyscraper mod removed the cap but also replaced the sandbox options with fixed values.

I made an updated class version that removes only the cap while keeping the sandbox settings.

Could you please test it with the mod and compiled class file? The vertical range works both ways so 5 means 5 floors up and 5 floors down.

The updated class file is in the pinned discussion.
LordOfLimes 23 Aug @ 3:41pm 
@Clippy that would be amazing if it's not too much trouble! I am always in favor of giving the player more options when it comes to this sort of stuff! Thanks for the quick response! (:
ribs  [author] 23 Aug @ 3:29pm 
This mod changes the sandbox vars. The skyscraper mod edits the Java class to remove the hard-coded skyscraper limit. You can use both together without any issues.

The sound mod changes the same file though so they overwrite each other. Should I make a version that includes both the skyscraper patch and the reduced player sound? I will look into it.
LordOfLimes 23 Aug @ 3:08pm 
Congrats @Clippy on the new mod! I saw your link on the skyscraper-bunker generator mod and am curious... does this fix the same issue?