• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Wind direction in the Caribbean

:wp remeber my earlier attempts at making the worldmap more interesting? I still want to get them back ...
Oh, yes!

storm generation can be handled by code in some degree. You can increase or decrease the chance of a storm being generated depending on the location of the ship.
You can? That'd be interesting!
 
Just leaving a note for myself, to be careful to check compass wind readings, and where the ai reads the wind direction, to make sure they use the modified one.
 
If the actual wind is updated, that should reflect on the interface and AI as well.
 
That makes sense. I get paranoid sometimes. ;)

BTW, I think I have it figured out. I may have it completed within the next hour. Or I am wrong and it will be awhile because I'll have to start over.
 
@Pieter Boelen @Levis

Done. So it took me longer than expected because an issue came up--because of the way wind trends and angle changes work, my functions were continously forcing the wind back west in a way that was shrinking changes and making it very hard to get other directions.

What I had to do was weaken the exponents for the conversion way below what would be expected (so looking at the function now, you'd think it isn't causing enough of a westerly trend, but trust me, it is, when you consider the wind changes).

Then I had to magnify the max angle wind changes (remember, my function shrinks changes in the westward direction, and also we need to be able to overcome the trend sometimes). The result is similar magnitude of changes and stickiness in western winds, but there can be sudden (and unstable and usually short lasting) shifts to other directions. I would think that is actually pretty accurate.

I calibrated those back and forth, changing exponents, and max wind angle change, testing in game, and calibrating again, until I go something that looks right.

Here's the new code:

Code:
    //rWindA = frand(MAX_ANGLECHANGE);
    rWindA = frand(3); //TY We need something a bit more dramatic to work with the trade winds system, it condenses wind changes

Code:
    // TY Caribbean trade winds blow west conversion
    if(!bWhrStorm && !bWhrTornado)  // TY real Carribean winds blow towards the west 90% of the time, we are modeling that while still preserving the chance of winds blowing east at full speed (as is realistic) and turning it off during unpredictable weather events.
    {
        fWindA = (((fWindA-PI)^3)/(PI)^2 + PI);    //TY PI is north. So this points the wind mostly north, then we need to translate it to the west. West is 0.5 * PI The exponents look less dramatic than they should be, but it is needed because of the limited wind changes creating a strong western trend
        if(fWindA >= 0.5 * PI)
        {
            fWindA = fWindA - 0.5 * PI // TY preserving continuity as we shift the function to the west
        }
        else
        {
            fWindA = (2*PI + fWindA - 0.5 * PI) //TY I'm not simplifying the formula so the meaning stays clear. We are shifting the negative number over to where it belongs as a positive number between 0 and 2 PI
        }
    }

Notice this should be VERY safe. I'm not messing with any of the current mechanics, just transposing results.

And I've playtested maybe a couple hunded wind changes across various settings. All works well.

Now, there may be some future calibration, but let's take a look at what it does now:

And here is a list of wind directions, recording with the final settings. There is a large amount of randomness, as there should be, but the westward trend is clear. For simplicity I am just saying the main direction, so which it is closest to.
W
N
W
W
E
W
W
W
W
E
W
W
W
W
W
W
S
E
E
W

The fact that E is more prevalent than S or N is just the result of random numbers being funny that way, in other tests the N and S were coming up much more often than E, its just this final test I did that had that oddity. Random is funny that way.

File attached. I'm putting it up in my experimental zip now. It looks pretty good to me. :)

Any thoughts or concerns?
 

Attachments

  • WhrGeneration.c
    10.9 KB · Views: 170
Last edited:
My only issue with this, is I suspect its going to act in the end like real life did, making certain ship types not too viable.

For instance, in POTC you are moving all around the map for the various campaign and charter missions. Playing on something like ironman here would be brutal. In Sid Meier's Pirates making the journey from say Jamaica to Nevis easily took twice the time. You might find charter missions or missions with time limits significantly harder. It also forces you to stock much more food and rum due to the increased travel times. If you are planning on copying Pirates! I remember Sloops and the smaller ships couldn't make the same journeys as say a frigate. You simply couldn't spare the space for loot when you where full of food and other essential supplies.

Furthermore, will the AI be affected? I imagine chasing a ship is going to get alot more frustrating if he turns say, east and you can't keep up. :p

Just some food for thought. I like the idea, but its one of those things that should probably be kept on the higher realisms. I'd also suggest maybe modifying the timed missions to account for destinations to the east or whatnot.

Something to think about.
 
@ Redbeard,

Interesting points! And nice to see another fan of Sid Meier's Pirates. :)

It might indeed add value to ship types that have better sailing properties against the wind, and make some of the square rigged ones a bit less attractive (if the player refuses to use the worldmap). I actually think that might be good, making less of a bigger is always better effect. Given the distribution of colonies and consumption of food supplies, I'm not sure that will be an issue here. Maybe in Pirates you had trouble because you were playing in early stages where the spanish controlled everything, and you angered them too much to use their ports. Here, there is a pretty even distribution of national ports.

Yes, the AI will be affected, in exactly the same way as the player. In fact, the system is entirely the same, but instead of a completely random wind direction that gets rolled ever hour or so, now the randomness has a tendency.

Merchant delivery missions are an interesting point. Might have to rely on the player to make decisions in that regard--not sure how easy it would be to have direction factor into the distance modifier. As for the time limits, I think they might be genrous enough anyway.

One note: this is sort of an inherently ironman limitation, because at least right now the World Map seems the same superfast speeds in all directions. I don't know how wind is supposed to work for worldmap sailing, I normally just play directsail, but my class 1 ship of the line test ship zips just as fast along the world map no matter the direction it seems. I can't imagine it would get tedious in any way for players using the world map.

But if a player does limit themselves to direct sail, I'd imagine the prefered trade route would be to sail north from barbados, then east hiting the islands and Zig zagging as needed, and then tacking southeast to hit the dutch held islands.

I wonder how many players limit themselves to direct sail only, and refuse to use the world map, who would be hesitant about this change? Do you use the worldmap Redbeard?

Because my thinking would be the default should be toggled on, and maybe an optional toggle to turn it off. The default that way because the only players that would really be bothered by it are direct sail only players who refuse to use the worldmap to make eastern journeys, and they would probably generally welcome the change to more accurately portray the wind.

Basically, for most players this shouldn't really effect their worldmap experience, it will just be an interesting new mechanic for when they drop into direct sail. For the hardcore directsail only player, they probably want the realism and additional strategic considerations.
 
Last edited:
Worldmap is definitely unaffected, because wind plays no role there.

This is definitely very exciting and it did NOT take more time than *I* expected.
You got something really quickly! :shock
 
Good! I didn't know how the worldmap works, because I always do direct sail, but in that case I really can't imagine this bothering anyone, and should be a nice realistic touch for all players, without slowing anyone down who isn't already choosing to play super realistic. :)

It ended up being pretty easy, because the original coder left a toggled off by default override function in the file for wind properties. Which basically told me exactly where to put my function for everything to work correctly, I just put it right below the overrides. :)
 
Just a quick note. I don't mind transposing the windspeeds which are already calculated, but feel free to actually comment out pieces of code which do that and replace it with your own code. The easier the code is the better. And all code which effectively does nothing should be removed preferbly
 
Just a quick note. I don't mind transposing the windspeeds which are already calculated, but feel free to actually comment out pieces of code which do that and replace it with your own code. The easier the code is the better. And all code which effectively does nothing should be removed preferbly
Maybe that could be done after testing and some feedback?

Also, the old system remains functional inside storms, so the code isn't unused.
 
While in theory this looks an interesting proposal I am not sure how much benefit it will add to game play.

:keith


One worry, near islands we'd still have the western wind. Should we turn it off near islands to allow ships to enter ports easier? Or is there even a simple check for whether the ship is within sight of an island or is on the open ocean in direct sail?

Would be interesting for sure.



It should be possible to find out the distance to land, or at least something similar, because the DirectSail island transfer code (CCCdirectsail.c) checks that too.

I'm not sure if it is necessary though to disable it near islands. More predictable wind direction might make entering/exiting ports easier; at least in some cases.


I wonder how many players limit themselves to direct sail only, and refuse to use the world map, who would be hesitant about this change? Do you use the worldmap Redbeard?


Because my thinking would be the default should be toggled on, and maybe an optional toggle to turn it off. The default that way because the only players that would really be bothered by it are direct sail only players who refuse to use the worldmap to make eastern journeys, and they would probably generally welcome the change to more accurately portray the wind.


Basically, for most players this shouldn't really effect their worldmap experience, it will just be an interesting new mechanic for when they drop into direct sail. For the hardcore directsail only player, they probably want the realism and additional strategic considerations.




You have to remember that even if players don’t use the direct sailing to go from island to island that much – they do use it to sail around islands and go into and out of Port. :keith

As I am sure you are aware the island models that we have are not realistic (being just the models from the original game (e.g. Jamaica, Martinique Cozumel) plus modified versions (e.g. Cuba, Hispaniola, Antigua), and some of the Port entrances are not very big.

For instance I think it may cause problems sailing into Grand Cayman (where you have to sail east through a narrow gap to get to the Port) – and it will definitely cause problems at St Johns, Antigua when sailing out of Port (the narrow entrance to exit the Port is directly East/West.) – See Images



Where are you proposing to put the Toggle – on the Options Screen – or in the Internal Settings file?:read

:drunk
 

Attachments

  • POTC_Cayman_Arrival.JPG
    POTC_Cayman_Arrival.JPG
    218.9 KB · Views: 157
  • POTC_Antigua_Leave.JPG
    POTC_Antigua_Leave.JPG
    165.6 KB · Views: 173
If it becomes significantly harder to sail east, as it is in Sid Meier's "Pirates", then quests which have time limits are liable to break. "Hard Labours of an Assassin" might not be too bad as its missions involve sailing more north/south than east/west, but the "Assassin" storyline may become unplayable. For this reason, I suggest having the toggle off by default.
 
While in theory this looks an interesting proposal I am not sure how much benefit it will add to game play.
It might add some measure of wind-based strategy.
Maybe. Perhaps.

But it could very well also turn out to be annoying instead, especially in Realistic Game Mode.
Hopefully playtesting will tell us which of the two it is.

Where are you proposing to put the Toggle – on the Options Screen – or in the Internal Settings file?:read
I think that depends on how the testing goes.
If it seems to work out OK, maybe no toggle is required. If it is mostly OK, then it can be in InternalSettings.h, defaulting to ON.
If it isn't really OK at all, maybe the default should be OFF. In that case, it should probably be in the Options Screen so that players are more likely to notice it exists.

Until such time though, I'd propose putting it at the bottom of globals.h, which has some more "default OFF" toggles for WIP mods or mods that are temporarily on hold.
 
@Levis @Pieter Boelen

The old system is actually functional 100% of the time, and manages all the speed and angle changes. All that happens is that I map it's 360 degrees back onto a new 360 degrees in a way that the values are weighted towards west, but all values are possible, and then I expand the max angle changes so that it creates sufficient changes over time in the west (where the changes would otherwise be compressed and reduced by the mapping) and unstable but possible times of the wind blowing east. There is nothing to be removed, because I use everything currently in place.

@Talisman

Do you have problems currently sailing into these ports if the wind is blowing west? If so, what is your current method of dealing with it? If you are able to manage it now, you'll still be able to manage it. if you currently wait for the wind to change, you can do that too, it will just be a bit longer than before. Take a look at my play testing direction list (bearing in mind the W hours aren't perfectly west, just sort of point that way). East, South, North all still appear, usually within a few changes. it would be only slightly more annoying than it was before.

EDIT found the place where weather updates are controlled, and it is possible to make it more frequent. Currently, it does it once per hour, which is really once per day on anything but the open sea mod, given how direct sail adds a day per hour. I might want to try updates every 30 minutes or a bit faster--it would address Talisman's concern pretty well I think. Though I think it won't be too much of a problem either way, it should be rare to get a very long run of blowing west winds in a row, but it might be nice to have slightly more frequent changes. Will test and think on it further.

@Grey Roger

Only if the player refuses to use the world map and does pure direct sail. The world map remains completely unaffected. If it were deemed truly a huge concern then the time limits could be adjusted for that one storyline. Or that storyline could have it turned off. Or just rely on the player realizing they need the worldmap. All sorts of solutions that don't involve losing the feature for the 95% of players who will not change a default toggle. ;)



More generally, the predictability of winds should often work to the player advantage, as they can plan around them in their routes. There is a reason that in the lowest difficulty level of Sid Meier's pirates the winds always blew west, and it became more random at higher difficulty levels.

I think there is a danger in focusing on a mythical pseudo-ironman player, who wants the realism of direct sail only, but finds realistic Caribbean winds annoying. That person should be rare enough that they can toggle it off themselves, while the much more common world map players and direct sail-only and likes realism players have it toggled on by default (provided it works out in testing)

That seems to be the best logic for toggles: the default fits the vast majority of players. Also, I'm not convinced the pseudo-ironman direct sail only player who hates realistic winds actually exists. ;)
 
Last edited:
Also, @Talisman , if you are willing to try out the current version and provide feedback, I promise I will keep adapting it until you find it a fun addition and it does not annoy you when entering ports facing west. :)

If in play testing it does prove a problem, one solution would be to turn off the conversion when close to land, justifying it by the effect of the island on the wind. I was discussing this port entry issue with Pieter earlier in he thread, and he explained it would likely be possible.
Quoting Pieter:
"It should be possible to find out the distance to land, or at least something similar, because the DirectSail island transfer code (CCCdirectsail.c) checks that too. I'm not sure if it is necessary though to disable it near islands. More predictable wind direction might make entering/exiting ports easier; at least in some cases."

So, if you are willing to playtest and you end up finding port entry burdensome, I will try adding that check to disable it when close to land. :)
 
Currently experimenting with making a new random system for weather updates (so instead of wind ALWAYS changing exactly when the hour changes, it will be a bit less predictable, you know, like the weather should be ;) )
 
"It should be possible to find out the distance to land, or at least something similar, because the DirectSail island transfer code (CCCdirectsail.c) checks that too. I'm not sure if it is necessary though to disable it near islands. More predictable wind direction might make entering/exiting ports easier; at least in some cases."
This is the relevant code:
Code:
coastdistance = GetDistance2D(0.0, 0.0, stf(pchar.Ship.Pos.x), stf(pchar.Ship.Pos.z))
That gets the distance between the (0,0,0) coordinate of the current island model (usually somewhere near the middle) and the player ship position.
Not technically "to the coast", but still indicative of the relevant distance.
 
I think that depends on how the testing goes.

If it seems to work out OK, maybe no toggle is required. If it is mostly OK, then it can be in InternalSettings.h, defaulting to ON.

If it isn't really OK at all, maybe the default should be OFF. In that case, it should probably be in the Options Screen so that players are more likely to notice it exists.


Until such time though, I'd propose putting it at the bottom of globals.h, which has some more "default OFF" toggles for WIP mods or mods that are temporarily on hold.



I am not sure this is a good idea ( hiding it in globals.h – do you mean globals.c ) – given the low level of feedback received on the forum for any changes.

I would much prefer it to be on the Options Screen from the start ( or at least in Internal Settings.h ) so that there is a greater chance that people will be aware of the change – can play around with it and thus hopefully comment on it.

@Talisman

Do you have problems currently sailing into these ports if the wind is blowing west? If so, what is your current method of dealing with it?

Firstly you should know I play with Arcade Mode – the others are far to “boring” and take up too much time. And I just do not have the patience for them.


To answer the above question - get frustrated :modding:modding:modding – use Sail To and loose game immersion.



EDIT found the place where weather updates are controlled, and it is possible to make it more frequent. Currently, it does it once per hour, which is really once per day on anything but the open sea mod, given how direct sail adds a day per hour. I might want to try updates every 30 minutes or a bit faster--it would address Talisman's concern pretty well I think. Though I think it won't be too much of a problem either way, it should be rare to get a very long run of blowing west winds in a row, but it might be nice to have slightly more frequent changes. Will test and think on it further.


Weather updates every 30 minutes would be a help – but even then it may still be a problem, and change the game play experience.



@Grey Roger


Only if the player refuses to use the world map and does pure direct sail. The world map remains completely unaffected. If it were deemed truly a huge concern then the time limits could be adjusted for that one storyline. Or that storyline could have it turned off. Or just rely on the player realizing they need the worldmap. All sorts of solutions that don't involve losing the feature for the 95% of players who will not change a default toggle.
C:\Users\user1\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png



You mean the 95% of players who if they think the game has changed for the worst – will just not play it anymore – ( or go and play an earlier version ) – without commenting on the changes at all . :yes :yes


I think there is a danger in focusing on a mythical pseudo-ironman player, who wants the realism of direct sail only, but finds realistic Caribbean winds annoying. That person should be rare enough that they can toggle it off themselves, while the much more common world map players and direct sail-only and likes realism players have it toggled on by default (provided it works out in testing)


That seems to be the best logic for toggles: the default fits the vast majority of players. Also, I'm not convinced the pseudo-ironman direct sail only player who hates realistic winds actually exists.



I don’t think the discussion is about “ pseudo-ironman” players ( who anyway will probably like the challenge of real Caribbean winds ) – at least it is not from my side – I am just talking about players who like to sail short distances around islands – chasing Coast raiders – sailing to Smuggling Beaches etc. Or on arrival at/departure from an island like to sail into and out of the Port or beach in Direct Sail – rather than using the World Map to go Straight from or to the Port.


Using the World Map to spawn directly into the Port – or Sail directly out of it avoids the question of the wind entirely. :p


EDIT:- you are aware that there is an even harder level than Iron Man ( called Realistic Caribbean – I think from memory – which is Direct Sail only and increases the distances & times taken to Sail between the Islands to those for the actual Caribbean ). There is a toggle for it somewhere. (probably hidden by @Pieter Boelen :p :rofl )



Also, @Talisman , if you are willing to try out the current version and provide feedback, I promise I will keep adapting it until you find it a fun addition and it does not annoy you when entering ports facing west.
C:\Users\user1\AppData\Local\Temp\msohtmlclip1\01\clip_image002.gif


If in play testing it does prove a problem, one solution would be to turn off the conversion when close to land, justifying it by the effect of the island on the wind. I was discussing this port entry issue with Pieter earlier in he thread, and he explained it would likely be possible.

Quoting Pieter:

"It should be possible to find out the distance to land, or at least something similar, because the DirectSail island transfer code (CCCdirectsail.c) checks that too. I'm not sure if it is necessary though to disable it near islands. More predictable wind direction might make entering/exiting ports easier; at least in some cases."

So, if you are willing to playtest and you end up finding port entry burdensome, I will try adding that check to disable it when close to land.
C:\Users\user1\AppData\Local\Temp\msohtmlclip1\01\clip_image002.gif

Unfortunately I have very little spare time at the moment & have not even managed to play the game at all since the end of June :(
(the images I posted were taken from Saves made in May). This situation is unlikely to change in the near future.

My main concern is St Johns, Antigua ( sailing out of Port – through the narrow gap ) – since St Johns is a Naval Base – a lot of players sailing in/out of there may have large Naval ships. And I don’t know how easy it will be to tack against the wind through that gap. ( I think you said in another post that you used a large Class 1 ship – I could be confusing you with someone else though – if so perhaps you could try it and see what it is like.)



Sorry for the long reply.

:cheers
 
EDIT:- you are aware that there is an even harder level than Iron Man ( called Realistic Caribbean – I think from memory – which is Direct Sail only and increases the distances & times taken to Sail between the Islands to those for the actual Caribbean ). There is a toggle for it somewhere. (probably hidden by @Pieter Boelen :p :rofl )
What you are referring to is the Open Sea Mod.
That is included as part of the Iron Man Mode, but also has a separate toggle at the top of InternalSettings.h .

I am not sure this is a good idea ( hiding it in globals.h – do you mean globals.c ) – given the low level of feedback received on the forum for any changes.
I suggested that only as long as it isn't quite ready yet for regular inclusion in the main mod.

Once it is included, my preference is for it to be ON by default.
Otherwise people will never know it exists.

I only hide toggles when I've got a good reason to do so.
For example, when a feature development is on hold but I don't want to lose it completely from the game code.

People who throw a temper tantrum when they don't like something without ever bothering to ask about it or report anything at all are people we basically cannot take into account.
If we start being afraid of hypothetical silent people, then we might as well stop doing anything at all.
In the end, if people provide no feedback, that is their own stupid mistake.
 
Back
Top