Mods / Pelagus: Simple Wind Direction

Category: #Other #Tweak
Author: Rhoun
Side: Both
Created: Apr 15th at 10:35 PM
Last modified: Apr 15th at 10:36 PM
Downloads: 3035
Follow Unfollow 38

Latest file for Various v1.19.x:
pelagus_simplewinddirection_1.0.0.zip 1-click install


EDIT: This mod was still not enough for my liking, so feel free to check my wind direction randomizer.

 

Fork of https://mods.vintagestory.at/simplewinddirection

It just adds a config to change how often wind direction changes time and area-wise.

It works with Joy Of Sailing and any mod that relies on vanilla wind calculation.

Config, it's a bit of a guess because I'm not the author:

{
 
  "areaScale": 3.0, //affects size of areas with same wind. Bigger number mean bigger areas with same wind direction
  "timeScale": 2.0 //affect how fast wind speed (or how often wind changes, not sure) changes with passage of time, bigger number means slower changes
  "timeScaleConstant": 25.0, //Similar to timeScale, but bigger number here means faster changes

}

Here's the code for how mod calculates wind, so you can try to make your better guess:

private void OnGetWindSpeed(Vec3d pos, ref Vec3d windSpeed)
{
    double windMagnitude = windSpeed.X;
    

    windSpeed.X = Math.Abs((xNoise.Noise(pos.X / areaScale, api.World.Calendar.TotalHours * timeScaleConstant / timeScale, pos.Z / areaScale) * wrapTimes) % 2d - 1) * 2d - 1d;
    windSpeed.Z = Math.Abs((zNoise.Noise(pos.X / areaScale, api.World.Calendar.TotalHours * timeScaleConstant / timeScale, pos.Z / areaScale) * wrapTimes) % 2d - 1) * 2d - 1d;

    windSpeed.Normalize();
    windSpeed *= windMagnitude;
}

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v1.0.0 3035 Apr 15th at 10:36 PM Show pelagus_simplewinddirection_1.0.0.zip Install now

8 Comments (oldest first | newest first)

💬 RhounAuthor, Apr 20th at 12:37 PM

Thank you for the suggestion, but I've moved from this mod already to my own wind randomizer so I don't plan to change this one in any way.

Mainly because here winds stay the same for a selected area and I wanted the same wind direction across the whole map that changes over time.

Feel free to check it here - https://mods.vintagestory.at/pelaguswinds

codeAtorium

💬 codeAtorium, Apr 20th at 4:34 AM

Just to explain a little better, since the description seems confused.  The timeScale and timeScaleConstant are just the numerator and denominator of a fraction that multiplies the passage of time.  So if you set it to timeScale 1.0 and timeScaleConstant 2.0 that's like 1/2.  So you'll get the same result if you set them to 25.0 and 50.0.  If it were me, I would have used a single number, and that woud just be a flat scale, but if you want that, just set timeScale to 1.0 and then adjust the constant as a single number. 

If you have the source, I can alter it so it uses only single number.  You'd be able to set it to 0.08 to get the same result as the defaults 2.0/25.0.

💬 codeAtorium, Apr 20th at 4:27 AM

Using noise is the right way.  Looks good to me.

💬 RhounAuthor, Apr 16th at 8:41 PM

Sure, added it to description, Lord_Spuddington

💬 Lord_Spuddington, Apr 16th at 5:02 PM

Any chance you could elaborate a little on what each of the settings do?

💬 RhounAuthor, Apr 16th at 11:51 AM

Yes, it'll work just fine with Joy of sailing.

It's the main reason why I forked it in the first case, because with the original mod the wind direction changes way too often for me & players on my server.

RenayEdor

💬 Moby_, Apr 16th at 8:50 AM

RenayEdor The OG SWD overrides a vanilla world thing and that's what Joy of Sailing gets, there's no domain-related anything so it should work just fine

💬 RenayEdor, Apr 16th at 4:47 AM

I'll be the first to ask:
Is it compatible with Joy of Sailing? Or would it be up to them to add compatability with you?

(edit comment delete)