[A12d] RedistHeat - Vents/Ducts (Oct 12, v42b) Small heater fix

Started by Latta, March 01, 2015, 01:41:49 AM

Previous topic - Next topic

KillerOrc

I´m having problems with my duct pipes not transporting any cold air. And I can´t figure out why. I´ve gotten it to work before but now it just does not.

I´m running the Ultimate Overhaul Mod Pack from 2015-07-15 and RimWorld 11b.

Can anyone spot what´s wrong? The room is cool and everything seems like it should work...



A big thanks to anyone who tries to help :)

PS: I like this mod a lot, it´s been great before and I could really use it in this run.

Sorry for the big picture, but I have still to figure out how to make images on the forums on which you can click to expand.

Kaballah

Yeah I can't get my ductwork to behave reliably at all either, I wish I had some help for you.  Sometimes it works, then it mysteriously stops.  Since I just installed A11d I'll try kicking it around with no other mods enabled and see if it works better.

One thing in your pic that is unrelated though, you have your big coolers set 1 tile too far in, they actually have connection points for 2 more exhaust ports that make them dramatically more efficient.  Build them 1 tile to the left (in your pic for example) and you can connect those 2 more exhaust ports.

e: Yeah with the small amount of testing I just did it worked fine with only this mod enabled, so my suggestion would be to make this mod LAST in your load order (if you just disable it and re-enable it then it should be bumped to the end).  Existing saves and worlds will complain on load although they should still work anyway, but if you want to be super duper sure, re-roll a new planet, save it and quit/restart the game, and then start a new colony.  And sacrifice a few muffalo.

Kaballah

For my more thorough test I'll be starting an A11d colony on the ice sheet with all nudists.  Wish me luck  :'(

Kaballah

Making this mod load LAST seems to work reliably so far, my duct net shows nice high heat, but the Smart Duct Outlets don't seem to be ticking their heat equalization nearly as often as they used to, so they aren't very effective compared to vanilla heaters.  I think when Tynan adjusted game time in A11's initial release it may have created this problem.  I'm pretty sure the relevant code is in

https://github.com/urty5656/RimWorld-RedistHeat/blob/master/RedistHeat/Building_AirNets/Building_DuctComp.cs

but I can't read it well enough to pick out exactly how it figures how often to tick.  Ninefinger if you're reading this you might have a look there please.

re: my nudist ice sheet colony, regrettably everyone had to put on parkas in about september because the smart vents just can't keep 3x3 rooms warm in -25C or lower  :(

KillerOrc

Quote from: Kaballah on July 23, 2015, 09:39:07 PM
Yeah I can't get my ductwork to behave reliably at all either.........  And sacrifice a few muffalo.

Thank you Kaballah, I will try this and see how it turns out :)

PS: Did not want to quote the whole reply.

Best regards
KO

Kaballah

This is a wild shot in the dark but I wonder if the function TickRare() should have been named TickRate() ?  Depending on how strict the compiler is, something like this might not throw an error when compiled, it would just never get called.

Kaballah

Quote from: Ninefinger on July 24, 2015, 12:20:35 PM
no TickRare is the the tick rate you can also set it to TickLong () which is what i tired to do in my latest test since Tynan added a "Long" Ticker type but it did not work either.

I went through the entire dll and change all TickRare to TickLong and change all xml files to use <tickerType>Long</tickerType>, everything worked without error but the temperature changes were worse lol

Poking around in the game source code, there are four defined tick intervals, in Verse.TickList:
private int TickInterval
{
get
{
switch (this.tickType)
{
case TickerType.Normal:
return 1;
case TickerType.Rare:
return 250;
case TickerType.Long:
return 2000;
default:
return -1;
}
}
}


Fairly sure these are milliseconds, but in any case yeah I see that Long would be worse than Rare.  Comparing Latta's code for Building_DuctComp.cs to the vanilla temperature control items it looks like the thing to tinker with is EqualizationRate, which is passed into this function in
https://github.com/urty5656/RimWorld-RedistHeat/blob/master/RedistHeat/Building_AirNets/Building_DuctComp.cs
private static void ExchangeHeat(Room r, float targetTemp, float rate)
{
var tempDiff = Mathf.Abs(r.Temperature - targetTemp);
var tempRated = tempDiff * rate;
if (targetTemp < r.Temperature)
r.Temperature = Mathf.Max(targetTemp, r.Temperature - tempRated);
else if (targetTemp > r.Temperature)
r.Temperature = Mathf.Min(targetTemp, r.Temperature + tempRated);
}


Pretty sure you need to make EqualizationRate in Building_DuctComp.cs larger.  I don't see any similarity between the formula Latta uses and the formulae used in the vanilla heater/cooler/vent (heaters and coolers both uses Rimworld.CompTempControl to throttle how much energy is transferred between rooms per tick) but that seems to be the obvious step.  I'm pretty sure this became a problem in the initial release of A11 because Tynan made days longer, which is more ticks, which means the old throttle value (EqualizationRate) needed to be made larger to move the same amount of heat in a day's time.  I think.

Just pulling a number out of my butt I would suggest making it 1.0 as a first test.  Since it's so much more of a pain in the ass to set up a duct network with a central heating room and duct intakes and outlets it seems reasonable that Smart Duct Outlets should have at least as much capacity as vanilla heaters/coolers, but unless Latta comes back and explains how this formula is scaled compared to vanilla (or somebody else cares to puzzle it out) then probably a little trial and error will be needed.

Kaballah

Or, y'know, I could try tinkering with the energyPerSecond values in this mod's ThingDefs\Buildings_Duct.xml (which I will do and come back later with some info)

Kaballah

Ninefinger increased EqualizationRate in the code quicker than I found a good solution via changing the xml config, which still might need some tweaking.  Throughout all this testing stuff the duct network has worked fine, although when you change the xml config you do need to deconstruct and rebuild any duct intake/outlet pieces (not the duct pipes themselves).

Ninefinger

#294
Update (24/07/15)
A11d
+Lt Redist Heat
   -Adjusted temperature equalization rate, you can now heat a room in extreme cold, balance still needs further testing.

Download

Computica


Ninefinger

#296
Quote from: Computica on July 25, 2015, 08:03:38 AM
@Ninefinger Google reported your link as Spam.  :P

Shakes fist at Google!  (Fixed!)

Kaballah

Awesome, thanks for updating this.  Round 2 of Nudists on the Ice Sheet :)

Computica

Thanks Nine & Kaba, I'll be giving this a very good play through.
(Off-topic) If anyone is interested I updated the Liandri weapons here: https://ludeon.com/forums/index.php?topic=3328.msg153732#msg153732

Ninefinger

Quote from: Computica on July 25, 2015, 10:15:54 AM
Thanks Nine & Kaba, I'll be giving this a very good play through.
(Off-topic) If anyone is interested I updated the Liandri weapons here: https://ludeon.com/forums/index.php?topic=3328.msg153732#msg153732

Oooooh must have more weapons... soo many weapons already.... so tempting... *licks lips