Mods / Windmill Tweaker

Tags: #Tweak
Author: Windows98
Side: Both
Created: Mar 22nd at 2:08 AM
Last modified: Mar 22nd at 9:50 PM
Downloads: 446
Follow Unfollow 15

Latest release (for Vintage Story 1.20.4, outdated):
windmilltweaker_1.0.0.zip  1-click install


PSA: The "outdated" tag is bs. Please test the mod before asking me to update it.

 

A configurator mod for tweaking the power outputs of windmill rotors.

 

Useful for people who just wants a nice and normal looking windmill next to their good looking house. As opposed to needing a whole array of windmills.

 

Also useful for grind masochists who wants to lower the power output so they'll actually need a whole array of windmills.

 

Entirely compatible with my Reversible Windmill Rotor mod.

 

Mod made in 1.20.4, but should work for other versions. (i really oughta update)

Technicalities:

 

Will generate a config file titled "WindmillTweaker.json" within your "ModConfig" folder located next to your "Mod" folder.

 

The file will contain the following fields:

 

-"WindmillTorqueMultiplier" multiplies the output torque of the rotor. Default value is 1.

-"WindmillSpeedMultiplier" multiplies the maximum speed of the rotor. Default value is 1.

 

Important things to note:

 

-The config file, like with any other mods, is generated when a world is loaded.

 

-The "WindmillSpeedMultiplier" value may result in torquier windmills if set too high. This is due to how the game calculates the target speed or the rotor.

 

Feel free to post any issue regarding this mod. 🤙

PSA: The "outdated" tag is bs. Please test the mod before asking me to update it.

Mod Version For Game version Downloads Released Changelog Download 1-click mod install*
1.0.0 446 Mar 22nd at 9:50 PM windmilltweaker_1.0.0.zip 1-click install

Initial release


5 Comments (oldest first | newest first)

💬 Streetwind, Mar 25th at 9:18 AM

Windows98 Thank you, I appreciate the writeup! I now understand things a bit better.

💬 Windows98 , Mar 24th at 3:35 PM

Streetwind

 

To be entirely honest with you, i suck at math. I don't know exaclty how the original code works even after taking a good look at it.

 

The original value this mod multiplies is called as "TargetSpeed" so i originally assumed it was the maximum speed.

 

My guess on why it results in seemingly torquier rotors is because "TargetSpeed" is actually the angular velocity the rotor tries to achieve, not just the maximum speed. So by setting it higher it's capable of crossing that threshold of being able to spin at all.

In addition to effectively increasing the maximum speed.

(If that makes sense, i really have a hard time explaining that.)

 

This is based on a test that i did where i had a minimum sized windmill connected to a serie of helve hammers and the "WindmillSpeedMultiplier" set to something like 1000 with the wind blowing strongly. In vanilla, this windmill would have never move.

But the windmill achieved a decent speed and all the helves were going strong despite torque being left at 1.

 

I haven't tested enough to know exactly how much torquier it gets and my guess is: Not much. At least not on low and reasonable values.

If you play normally on a survival world you might want to set it to something like 1.5 or 2.0, really, it doesn't take a lot for the rotation to start to look silly when messing with this value.

I don't recommend setting it very high or at all for normal gameplay.

If you do experience windmills torquier than your likings, even on relatively low values, you could try lowering the torque a little to compensate.

 

If you are curious and want to look at the code yourself, here is the source code of the game (couldn't find a github link):

This method is located at "Vintagestory.GameContent.Mechanics.BEBehaviorMPRotor", it is called by the method "updateNetwork()" located at "Vintagestory.GameContent.Mechanics.MechanicalNetwork".

 

public override float GetTorque(long tick, float speed, out float resistance)
{
    float targetSpeed = TargetSpeed;                                                                                           <<- This is the value multiplied by "WindmillSpeedMultiplier"
    capableSpeed += ((double)targetSpeed - capableSpeed) * AccelerationFactor;
    float num = (float)capableSpeed;
    float num2 = ((propagationDir == OutFacingForNetworkDiscovery) ? 1f : (-1f));
    float num3 = Math.Abs(speed);
    float num4 = num3 - num;
    bool flag = num2 * speed < 0f;
    resistance = (flag ? (Resistance * TorqueFactor * Math.Min(0.8f, num3 * 400f)) : ((num4 > 0f) ? (Resistance * Math.Min(0.2f, num4 * num4 * 80f)) : 0f));
    float val = (flag ? num : (num - num3));
    return Math.Max(0f, val) * TorqueFactor * num2;                                                                  <<- The "return" is the value multiplied by "WindmillTorqueMultiplier".
}

 

Feel free to post any discovery you make and thanks for your interest!

💬 Streetwind, Mar 24th at 9:44 AM

"The "WindmillSpeedMultiplier" value may result in torquier windmills if set too high. This is due to how the game calculates the target speed or the rotor."

Could you elaborate on this? I'm curious about how the math works, and how I can estimate the impact of the changes I make with this mod. :)

💬 Windows98 , Mar 23rd at 12:05 AM

Deicide I am afraid not but thanks for bringing that up. A command for setting the values on the fly would be amazing and i should totally implement that.


💬 Deicide, Mar 22nd at 11:57 PM

can you use a command like (. or /)set windmillspeedmultiplier 5

 

Im wondering because I'm on linux and cant seem to see the file properly due to my text editor

 

Edit: I fixed it you're good.

 (edit comment delete)
Основной веб-сайт | Почтовый сервер | FTP сервер | Административная панель | API интерфейс | Content Delivery Network | Статические файлы | Ресурсы сайта | Изображения | Файловое хранилище | Блог | Интернет-магазин | Техническая поддержка | Справочная система | Документация | Форум | Новости | Загрузки | Демонстрация | Тестовая среда | Приложение | Медиа контент | Разработка | Промежуточная среда | Бета версия | Безопасная зона | Вход в систему | Панель управления | Портал | Система управления контентом