Ludeon Forums

RimWorld => Releases => Mods => Outdated => Topic started by: Kyna Tiona on January 11, 2017, 03:50:24 AM

Title: [A16] Link's Mods - Solar Weather, Expert Quality
Post by: Kyna Tiona on January 11, 2017, 03:50:24 AM
Downloads


Downloads:


   
   
Solar Weather   2017-1-11c      GDrive (https://drive.google.com/open?id=0B2anpda682AVNTVyNWVFeDVFWnM)         Rebalances solar panels around adverse weather, adding some realism.
Expert Quality   2017-1-14b      GDrive (https://drive.google.com/open?id=0B2anpda682AVSzNmYlBRZTdldmM)         Makes crafted items' quality more consistent.

How to install:
- Unzip the contents and place them in your RimWorld/Mods folder.
- Activate the mod in the mod menu in the game.

(http://i.imgur.com/mUReEDY.png) (https://creativecommons.org/licenses/)






Solar Weather

Description:
Rebalances solar panels to work more like wind turbines. They have a higher maximum output (3000W over the old 1700W), but their output fluctuates based on adverse weather conditions in addition to light levels. You may find solar panels to be a far more effective energy source than wind turbines in an area with amenable weather and cool temperatures, rather than their previous state of simply not being competitive.

As an added feature, they now display how much of their output is being stifled by roofs or weather.

(http://i.imgur.com/nDMKw0N.png?1)

Balance:
Solar panels' outputs relative to vanilla are much higher output on clear days, around the same in rain and light snow, much less in fog and rainy thunderstorms, and none at all in hard snow. Heat will also lower output, and latitude is as bad for solar as ever, so the driest biomes will require their own cautious decisions.

You should see a much higher total power output, but it will fluctuate more and have more frequent outages, requiring more careful energy management overall. Feedback would be greatly appreciated.

Compatibility:
This modifies solar panels' and eclipses' defs as well as replacing solar panel's thing class, making it incompatible with basically anything that alters solar panels or eclipses.

Credits
I would've just floundered around for a bit before giving up on modding RimWorld if Grim hadn't gotten me started. Thanks, Grim!






Expert Quality

Description:
You may have seen your Godlike tailer put out a shoddy tuque or your Incompetent artist make an excellent sculpture and found this odd. From a storytelling standpoint, it's easy to explain as the former having a bad day and the latter showing signs of potential greatness, which is an enjoyable narrative.

...The first few times. However, if you looked at the numbers, you'd find that the chance of making a shoddy item don't drop below 1% until Strong Master. A "Skilled Professional" makes a poor item every fifth attempt. This is because vanilla RimWorld uses a simple normal distribution (https://en.wikipedia.org/wiki/Normal_distribution) model, where any result is possible (if not always likely) at any skill level.

This can be considered true to life, but that may or may not make it enjoyable. For me, the consistency with which "planet-class masters" and "legendary" crafters make middling or low-quality goods makes me doubt the validity of those titles while wondering what the point of having skilled crafters is.

This took me out of the experience, so I replaced the previous model with a more tabletop-esque model. The specific formulas (as well as precise numbers) are included in the download, but the gist is that you should see more consistent results from your crafters, for good and for ill.

Balance:
Previously, it was difficult to have a functional import/export economy, as too many of your manufactured goods would come out being worth less than the raw materials. This is no longer the case, making it potentially quite profitable to buy raw materials from traders, turn it in to a quality item, and then sell it back.

As vanilla was not really designed for this dynamic, this may or may not break the economic system. It also radically increases the value of skilled crafters, so you may find that vanilla learning speed feels faster than it should. Feedback would be greatly appreciated.

Compatibility:
This does nothing but detour a single function that does nothing but return a random quality level relative to the crafter's level. This should be 100% compatible with everything except another mod to do the same thing.

Requires the ever-amazing HugsLib (https://ludeon.com/forums/index.php?topic=28066.msg298791#msg298791).

[attachment deleted by admin due to age]
Title: Re: [A16] Solar Weather
Post by: Senio on January 11, 2017, 08:24:12 AM
Thanks.
Title: Re: [A16] Solar Weather
Post by: deathstar on January 11, 2017, 08:29:10 AM
Very cool changes, should be part of vanilla really! Do you think it's possible for desert-biomes to give a boost to solar energy generated during sunny weather?
Title: Re: [A16] Solar Weather
Post by: Senio on January 11, 2017, 09:42:47 AM
Quote from: Caraise Link on January 11, 2017, 03:50:24 AM

Rebalances solar panels to work more like wind turbines. They have a higher maximum output (3000W over the old 1700W), but their output fluctuates based on adverse weather conditions in addition to light levels. You may find solar panels to be a far more effective energy source than wind turbines in an area with amenable weather and cool temperatures, rather than their previous state of simply not being competitive.

As an added feature, they now display how much of their output is being stifled by roofs or weather.

Hi,Caraise Link
how can modify 3000w max? i think 3000w too much
Title: Re: [A16] Solar Weather
Post by: Canute on January 11, 2017, 10:28:16 AM
I didn't try them yet, but
- does the panels can get dusty or snowed too ?
If not maybe ask the author from Mars, the panells of his mod will get dusty during a sandstorm.
Title: Re: [A16] Solar Weather
Post by: vlad_1492 on January 11, 2017, 10:47:00 AM
Thanks for this, I like the added realism.

I wonder if latitude could be factored in, as the further from the equator you go the more atmosphere the light gets filtered through, reducing available energy. 

Dust and snow would be awesome!
Title: Re: [A16] Solar Weather
Post by: XeoNovaDan on January 11, 2017, 11:01:09 AM
Quote from: Senio on January 11, 2017, 09:42:47 AM
how can modify 3000w max? i think 3000w too much

My knowledge in C# is non-existent; I only know a limited amount of Python, Lua (from when I vainly tried to take up Scripting on ROBLOX donkey's years ago), and XML, but I think I can provide an answer to this.

You'll want to go to Source/ExampleMod/ExampleMod/CompPowerPlantSolarWeather.cs, and change the following:

private static readonly float MaxDayPower = 1f; on line 15

Change 1f to the variable of your suiting, assuming 1f is equivalent to 3000W. For example, 0.6f would be 1800W (if I'm not mistaken). I think a nice number would be 2100W or 0.7f
Title: Re: [A16] Solar Weather
Post by: Senio on January 11, 2017, 11:15:14 AM
Quote from: XeoNovaDan on January 11, 2017, 11:01:09 AM
Quote from: Senio on January 11, 2017, 09:42:47 AM
how can modify 3000w max? i think 3000w too much

My knowledge in C# is non-existent; I only know a limited amount of Python, Lua (from when I vainly tried to take up Scripting on ROBLOX donkey's years ago), and XML, but I think I can provide an answer to this.

You'll want to go to Source/ExampleMod/ExampleMod/CompPowerPlantSolarWeather.cs, and change the following:

private static readonly float MaxDayPower = 1f; on line 15

Change 1f to the variable of your suiting, assuming 1f is equivalent to 3000W. For example, 0.6f would be 1800W (if I'm not mistaken). I think a nice number would be 2100W or 0.7f

Thank you , nice number 2100w
Title: Re: [A16] Solar Weather
Post by: asquirrel on January 11, 2017, 11:37:04 AM
Wow, great mod man!  I agree this is something that should be included in the vanilla version!
Title: Re: [A16] Solar Weather
Post by: Senio on January 11, 2017, 01:00:51 PM
Waiting wind turbines fixed  :D :D
Title: Re: [A16] Solar Weather
Post by: swampslug on January 11, 2017, 02:27:28 PM
Quote from: XeoNovaDan on January 11, 2017, 11:01:09 AM
Quote from: Senio on January 11, 2017, 09:42:47 AM
how can modify 3000w max? i think 3000w too much

My knowledge in C# is non-existent; I only know a limited amount of Python, Lua (from when I vainly tried to take up Scripting on ROBLOX donkey's years ago), and XML, but I think I can provide an answer to this.

You'll want to go to Source/ExampleMod/ExampleMod/CompPowerPlantSolarWeather.cs, and change the following:

private static readonly float MaxDayPower = 1f; on line 15

Change 1f to the variable of your suiting, assuming 1f is equivalent to 3000W. For example, 0.6f would be 1800W (if I'm not mistaken). I think a nice number would be 2100W or 0.7f

Wouldn't changing line 39 of Defs\ThingDefs_Buildings\Buildings_Power.xml from
<basePowerConsumption>-3000</basePowerConsumption>
to
<basePowerConsumption>-2100</basePowerConsumption>
achieve the same effect without having to recompile the dll?
Title: Re: [A16] Solar Weather
Post by: XeoNovaDan on January 11, 2017, 03:21:07 PM
Quote from: swampslug on January 11, 2017, 02:27:28 PM
Wouldn't changing line 39 of Defs\ThingDefs_Buildings\Buildings_Power.xml from
<basePowerConsumption>-3000</basePowerConsumption>
to
<basePowerConsumption>-2100</basePowerConsumption>
achieve the same effect without having to recompile the dll?

Hmm, didn't see that :P
Title: Re: [A16] Solar Weather
Post by: Kyna Tiona on January 11, 2017, 06:31:24 PM
Quote from: Senio on January 11, 2017, 08:24:12 AM
Thanks.

You're very welcome!

Quote from: deathstar on January 11, 2017, 08:29:10 AM
Very cool changes, should be part of vanilla really! Do you think it's possible for desert-biomes to give a boost to solar energy generated during sunny weather?

I am deeply embarrassed to say that I had to look this up when making the mod. Deserts don't actually get more sunlight per se; the sun is pretty indiscriminate in that regard. They just don't have so much rain, fog, snow, etc. to stop it from reaching the surface.

My understanding is that clouds don't actually hinder solar panels as much as you'd think either, and RimWorld's weather system doesn't currently handle clouds anyway. Deserts are probably fine the way they are. Especially because cold deserts are a thing, and on super-cold planets, they stand to be as amazing as wind turbines on ice sheets.

Actually, this mod is probably broken for colonies made on ice sheets near the equator of a super-cold planet. Oops!

Quote from: Canute on January 11, 2017, 10:28:16 AM
I didn't try them yet, but
- does the panels can get dusty or snowed too ?
If not maybe ask the author from Mars, the panells of his mod will get dusty during a sandstorm.

Solar panels are typically placed at an angle so that snow and other debris tends to rolls off. The panels themselves also tend to be as much as ~20 C warmer than their environment, so in most weather conditions snow will melt and slide off even if it's stuck firmly.

Realistically, cleaning should probably be a thing, but I felt it was a lot of work to make for a mechanic that many players would probably just find frustrating.

Quote from: vlad_1492 on January 11, 2017, 10:47:00 AM
I wonder if latitude could be factored in, as the further from the equator you go the more atmosphere the light gets filtered through, reducing available energy. 

Vanilla totally does this, actually. I was honestly depending on it for balance, because otherwise the poles would be solar energy havens.

Quote from: XeoNovaDan on January 11, 2017, 03:21:07 PM
Hmm, didn't see that :P

Geez, guy, I went and made responsible code just for these situations, and you go and overlook it~
Title: Re: [A16] Solar Weather
Post by: Qwynn on January 12, 2017, 12:22:14 AM
Oh! This looks interesting to try out!

On load up though I get this warring. Should we be concerned about that?


Type CompPowerPlantSolarWeather probably needs a StaticConstructorOnStartup attribute, because it has a field PowerPlantSolarBarFilledMat of type Material. All assets must be loaded in the main thread.
Verse.Log:Warning(String)
Verse.StaticConstructorOnStartupUtility:ReportProbablyMissingAttributes()
Verse.PlayDataLoader:<DoPlayLoad>m__6F8()
Verse.LongEventHandler:ExecuteToExecuteWhenFinished()
Verse.LongEventHandler:UpdateCurrentAsynchronousEvent()
Verse.LongEventHandler:LongEventsUpdate(Boolean&)
Verse.Root:Update()
Verse.Root_Entry:Update()
Title: Re: [A16] Solar Weather
Post by: Kyna Tiona on January 12, 2017, 12:47:36 AM
Quote from: Qwynn on January 12, 2017, 12:22:14 AM
On load up though I get this warring. Should we be concerned about that?

Oh, I didn't realize that was throwing a warning. I guess I forgot to run it in dev mode to see the full log, lesson learned. It looks like an easy fix, so I'll look into it in a moment. I don't expect it will cause any noticeable problems in the meantime.

EDIT: Updated, this should be fixed now.
Title: Re: [A16] Solar Weather
Post by: Zebukin on January 12, 2017, 12:44:43 PM
I like the idea for balance! Will try it!
Title: Re: [A16] Link's Mods - Solar Weather, Expert Quality
Post by: Kyna Tiona on January 14, 2017, 05:41:20 AM
Renamed the thread "Link's Mods", as I've added a mod for changing how crafted item quality is handled. Check the first post for details~

EDIT: In which I forget to include the graphs in the Expert Quality download. [Slaps forehead] Fixed.
Title: Re: [A16] Link's Mods - Solar Weather, Expert Quality
Post by: azulusthra on January 14, 2017, 06:32:08 AM
Will solar weather work with modded solar panels(skullywag's small solar stuffed)?
Title: Re: [A16] Link's Mods - Solar Weather, Expert Quality
Post by: Kyna Tiona on January 14, 2017, 07:03:10 AM
Quote from: azulusthra on January 14, 2017, 06:32:08 AM
Will solar weather work with modded solar panels(skullywag's small solar stuffed)?

Unfortunately not. I could probably rework Solar Weather to be compatible with mods that add solar panels that use the same thing class, but Skullywag's mod replaces rather than extends the existing class. There's not a whole lot I could do without collaborating with Skullywag to make them compatible, and that seems like probably not worth the effort coordinating.
Title: Re: [A16] Link's Mods - Solar Weather, Expert Quality
Post by: Qwynn on January 29, 2017, 08:05:14 PM
What about something like SD's Advanced Power Generation, which only adds a single new solar panel? If a patch is doable through def files alone I could do it myself (probably), but if it requires doing anything with the DLL that might be beyond me. Figured I'd ask before attempting something futile. XD
Title: Re: [A17] Link's Mods - Solar Weather, Expert Quality
Post by: Tahvohck on September 06, 2017, 12:45:23 PM
For anyone that still uses this, I patched Expert Quality to work with the new Harmony (https://github.com/pardeike/Harmony) library included with HugsLib A17. Attached the patched mod to this post. It's somewhat dirty, but does the trick (i.e. the references for the sln could be cleaned up, but none of the actual heavy lifting code had to be changed).

Edit: Don't trust this right now, actually. The code is running but RimWorld isn't yet getting the value.
Edit2: Now passing __result by ref, problem fixed.

[attachment deleted by admin: too old]