• 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!

Thanks and Small Contribution

shazbot85

Sailor
Storm Modder
Ahoy mates! First time poster, I just got PotC about a week ago after I got AoP and discovered Piratesahoy.net and I want to thank everyone responsible for the impressive work done with the Build mod. Very impressive work!

I got the directsail mod v1.1 and thought it was pretty cool, but I found one problem with it was the completely random weather changes you get from enabling #define WEATHER_UPDATE_AT_SEA in BuildSettings.h

I like the weather changing but it was too random for me, so I made a couple changes in WhrWeather.c to allow for more reasonable weather changing( wind doing complete 180 was a little crazy). It's easily tweaked but as it is it allows wind direction to change a maximum of about 60 degrees or less an hour and windspeed by 5 knots an hour. There's still a 5% chance the wind will change like before.

#define WEATHER_UPDATE_AT_SEA must be set to 1 for it to work

Went ahead and uploaded it to the websites FTP for potc, it's named mat - Weather mod.rar
 
woah. that's exactly what many of us been looking for! <img src="style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />
 
It isn't perfect, the weather system reinitializes on the sail-ho! and land-ho! events so the wind changes randomly at those points. I also want to make changes the the general weather effects so it doesn't go from sunny to storm instantly, make it transition smoothly.

Is there a post here that lists functions with parameters, returns and generally what they do? It would make working with this code much easier <img src="style_emoticons/<#EMO_DIR#>/duel_pa.gif" style="vertical-align:middle" emoid=":ixi" border="0" alt="duel_pa.gif" />

<!--sizeo:1--><span style="font-size:8pt;line-height:100%"><!--/sizeo-->(the functions PotC specific, not general C functions )<!--sizec--></span><!--/sizec-->
 
I'll see how it works in the mod. <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
I think I've got the Reinitialization problem fixed, just added a simple boolean switch to the function in CCCdirectsail.c and updated the DeleteWeather function in WhrWeather.c to use it. Hurrah <img src="style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> I've uploaded it to the ftp as Mat - Weather Mod update.rar

Want to move on to the weather type switching but it'd be much easier if I had a list of the weather types. Is it an array of data structs? If there is a list of this kind of stuff I'd be much obliged to see it <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />

Requires a new game I guess, funny the previous one didn't.
 
I know next to nothing about code, so I may be wrong, but you seem to know quite a lot about it. One of the biggest problems here is lack of coders, so if you can, it could probably help a lot. <img src="style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
 
I'm happy to upload anything worth while, but I'm no expert. Hobbyist at best, and more familiar with C++ than C. I'd really be pleased to see some documents on the PotC code though, did I say that already? <img src="style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />

There's a load of defined types, structs, enumerations blah blah.. that would help to know what they're about. Since you guys did all this stuff was hoping there'd be some info on it
 
<!--quoteo(post=271912:date=Aug 4 2008, 01:49 PM:name=Dr. Maturin)--><div class='quotetop'>QUOTE (Dr. Maturin @ Aug 4 2008, 01:49 PM) <a href="index.php?act=findpost&pid=271912"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I'm happy to upload anything worth while, but I'm no expert. Hobbyist at best, and more familiar with C++ than C. I'd really be pleased to see some documents on the PotC code though, did I say that already? <img src="style_emoticons/<#EMO_DIR#>/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />

There's a load of defined types, structs, enumerations blah blah.. that would help to know what they're about. Since you guys did all this stuff was hoping there'd be some info on it<!--QuoteEnd--></div><!--QuoteEEnd-->If you look here:
<a href="http://forum.piratesahoy.net//index.php?showtopic=11380" target="_blank">http://forum.piratesahoy.net//index.php?showtopic=11380</a>
Although it's a bit of a read through - it may give you some insight of the "how's".
Hope it helps. <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />
 
Thanks short jack gold! I had read that but I missed the PotC wiki somehow, and I found functions.c in the buildinfo directory which helped too. Still pretty sparse but much better.
 
After several hours of staring at the weather code I think I finally have the right of it. At startup there is a hUGE array of weathers generated all with completely random properties. When you enter battlemode, or whatever it's called, the weather system chooses at random one of the weathers in this array that matches the current game hour with no concern for changes in fog, rain, wind angle or speed. The only checks it makes besides the time is weather it's a heavy thunderstorm or tornado.

The whole thing seems daft to me, I guess they initialized the giant array of weather at startup in an attempt to save runtime resources. Probably for the XboX version.

So I decided I should rewrite the way the weather is generated, I think most of the people playing have PC's that beat the old XboX specs <img src="style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

Also I removed my earlier posts to the FTP, now that I know how the weather system works it's obvious that they're ugly bandaids that cause more problems than they solve <img src="style_emoticons/<#EMO_DIR#>/dp_nogd.gif" style="vertical-align:middle" emoid=":ng" border="0" alt="dp_nogd.gif" />

Hope to post my new work soon
 
actually, my PC can hardly run the game. but what the heck, let's see if it makes that much of a difference.
 
<!--quoteo(post=272213:date=Aug 6 2008, 11:41 AM:name=Dr. Maturin)--><div class='quotetop'>QUOTE (Dr. Maturin @ Aug 6 2008, 11:41 AM) <a href="index.php?act=findpost&pid=272213"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->After several hours of staring at the weather code I think I finally have the right of it. At startup there is a hUGE array of weathers generated all with completely random properties. When you enter battlemode, or whatever it's called, the weather system chooses at random one of the weathers in this array that matches the current game hour with no concern for changes in fog, rain, wind angle or speed. The only checks it makes besides the time is weather it's a heavy thunderstorm or tornado.

The whole thing seems daft to me, I guess they initialized the giant array of weather at startup in an attempt to save runtime resources. Probably for the XboX version.

So I decided I should rewrite the way the weather is generated, I think most of the people playing have PC's that beat the old XboX specs <img src="style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />

Also I removed my earlier posts to the FTP, now that I know how the weather system works it's obvious that they're ugly bandaids that cause more problems than they solve <img src="style_emoticons/<#EMO_DIR#>/dp_nogd.gif" style="vertical-align:middle" emoid=":ng" border="0" alt="dp_nogd.gif" />

Hope to post my new work soon<!--QuoteEnd--></div><!--QuoteEEnd-->I for one will look forward to it. <img src="style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" />
 
I've got a rough system working but it needs tuning, probably take about a week if I can spend a few hours a day on it. Contrary to what I said it should reduce the system resources required by a heck of a lot.

The weather system as of build 13 ( build 14b8 it's almost the same) does about 3500-4500 evaluations on every weather change. So far my new system does around 45-54 evaluations every hour. It's much less because I only have to evaluate the previous weather instead of a list of 384 different weathers. I'm curious if it will be possible to update weather by the minute instead of hour, that would be cool <img src="style_emoticons/<#EMO_DIR#>/diomed.gif" style="vertical-align:middle" emoid=":dio" border="0" alt="diomed.gif" />
 
<!--quoteo(post=272310:date=Aug 7 2008, 12:08 PM:name=Dr. Maturin)--><div class='quotetop'>QUOTE (Dr. Maturin @ Aug 7 2008, 12:08 PM) <a href="index.php?act=findpost&pid=272310"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I've got a rough system working but it needs tuning, probably take about a week if I can spend a few hours a day on it. Contrary to what I said it should reduce the system resources required by a heck of a lot.

The weather system as of build 13 ( build 14b8 it's almost the same) does about 3500-4500 evaluations on every weather change. So far my new system does around 45-54 evaluations every hour. It's much less because I only have to evaluate the previous weather instead of a list of 384 different weathers. I'm curious if it will be possible to update weather by the minute instead of hour, that would be cool <img src="style_emoticons/<#EMO_DIR#>/diomed.gif" style="vertical-align:middle" emoid=":dio" border="0" alt="diomed.gif" /><!--QuoteEnd--></div><!--QuoteEEnd-->
By the hour would be good - especially if you reduce the system loading as much as you hope.
A lot goes on at the turn of the hour so (and as you are talking minutes) what about 45 mins past the hour - things seem to be a lot less busy then.
Keep at it though, whatever you decide. <img src="style_emoticons/<#EMO_DIR#>/bow.gif" style="vertical-align:middle" emoid=":bow" border="0" alt="bow.gif" />
 
Just a quick post - I've been working too on the weather system and will soon post in <a href="http://forum.piratesahoy.net//index.php?showtopic=11999" target="_blank">this</a> topic what I've managed to do so far - but I do have changed the system so that it consider minutes in stead of hours. Please note that my purpose was just to work on the sunset and sunrise hours - wich is mixed up with the weather system, as you must have noticed.
 
<!--quoteo(post=272353:date=Aug 8 2008, 05:55 AM:name=a simple virtual sailor)--><div class='quotetop'>QUOTE (a simple virtual sailor @ Aug 8 2008, 05:55 AM) <a href="index.php?act=findpost&pid=272353"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Just a quick post - I've been working too on the weather system and will soon post in <a href="http://forum.piratesahoy.net//index.php?showtopic=11999" target="_blank">this</a> topic what I've managed to do so far - but I do have changed the system so that it consider minutes in stead of hours. Please note that my purpose was just to work on the sunset and sunrise hours - wich is mixed up with the weather system, as you must have noticed.<!--QuoteEnd--></div><!--QuoteEEnd-->On the basis of - two heads are better than one - it looks like we should get a result here. <img src="style_emoticons/<#EMO_DIR#>/doff.gif" style="vertical-align:middle" emoid=":doff" border="0" alt="doff.gif" />
 
I've basically done away completely with the old weather system and began new, I didn't know anyone was working on it already. Maybe when we've both finished we can compare and collaborate changes?

Yes I noticed the sun rose in the west.. maybe it does in russia? <img src="style_emoticons/<#EMO_DIR#>/cool.gif" style="vertical-align:middle" emoid="8)" border="0" alt="cool.gif" />
 
<!--quoteo(post=272412:date=Aug 8 2008, 12:18 PM:name=Dr. Maturin)--><div class='quotetop'>QUOTE (Dr. Maturin @ Aug 8 2008, 12:18 PM) <a href="index.php?act=findpost&pid=272412"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I've basically done away completely with the old weather system and began new, I didn't know anyone was working on it already. Maybe when we've both finished we can compare and collaborate changes?

Yes I noticed the sun rose in the west.. maybe it does in russia? <img src="style_emoticons/<#EMO_DIR#>/cool.gif" style="vertical-align:middle" emoid="8)" border="0" alt="cool.gif" /><!--QuoteEnd--></div><!--QuoteEEnd--> Why don't you PM each other now? <img src="style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />

And as for the sun rising in the west - that has been well documented on the various forums, and I think may be hard coded in.
The general opinion being, it would cause too much disruption to try to change.
 
Wow; this is AMAZING! Thanks very much for working on this!
It's great to have another coder again; it doesn't matter if you're not a professional coder; the same goes for pretty much all of us. You'll fit right in. <img src="style_emoticons/<#EMO_DIR#>/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />

I recall that CouchcaptainCharles, who made the DirectSail mod, deliberately had the DirectSail updates take place a few minutes AFTER the whole hour to decrease the chance of crashes. As Short Jack Gold says, a lot of calculations are performed on the whole hour. <img src="style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />

The sun problem was introduced with the new worldmap.
In the stock game it rose in the right place.
However, the new worldmap is actually upside down.
You just hardly notice it. Except in the sun rise/set directions.
Hook looked into it before, but could not find a way to change it.
The only thing I could think of is rotating the worldmap 180 degrees,
but I'm not sure if we could do that at all.
And if we could, it'd require updating of pretty much all the coordinates in the game. <img src="style_emoticons/<#EMO_DIR#>/piratesing.gif" style="vertical-align:middle" emoid=":shock" border="0" alt="piratesing.gif" />
 
I have most parts of my new weather system working as they should. As of now I've got:

Updating Sun Azimuth and Angle by the hour (data from August 21, 1700)

Converted the nicer sky textures from AoP and aligned them to fit with the sun where applicable( like sunrise and sunset)

"Weighted" weather changes - Wind Angle, Wind Speed, Fog Density, Rain, and lighting all fluctuate within defined limits

Added the moon that traverses the sky, azimuth and angle updated by the hour

and a few other things:

Fog won't appear while the sun is in the sky - The hot caribbean sun would burn off any fog pretty quickly I think, but there is an increased chance of fog with temperature changes eg. sudden rain, after sunset and before sunrise. Never been in the caribbean though, so if fog is common during the day I'd be happily corrected.

"Storm" and "Lighting" only appear at the highest level of bad weather, dependent on wind speed and rain density - both must be high, you will never be becalmed in heavy weather and likewise hurricane force winds will not hit without the heavy rains and storm to go with it

Changes in weather are "ballasted" - if the random changes of rain, wind or fog show a pattern of increase or decrease it is likely to continue until a limit is hit and the 'ballast' is reset. So the rain might pickup from a light shower to a heavy pouring or wind might go from a light breeze to a medium gale. But it's mostly improbable to have extreme changes from becalmed seas to hurricane forces, it can happen but much more gradually

To do:
Fine tune the balances between weather variables
Add remaining skies from AoP - alter system to select from skies suitable for the weather (eg. overcast skies if it's likely to begin to rain next hour)
Add function for setting the weather - When a quest or game event needs a special weather
Merge with build 14b8, or whicher is the newest version - well if you guys decide you like it

Mostly the tedious annoying stuff left <img src="style_emoticons/<#EMO_DIR#>/dry.gif" style="vertical-align:middle" emoid="<_<" border="0" alt="dry.gif" />
Looking at the how the weather is updated I'd have to change a lot of stuff in different source files to get it to update by the minute, and I don't want to mess around with half a dozen other peoples code lol <img src="style_emoticons/<#EMO_DIR#>/thwalkplank.gif" style="vertical-align:middle" emoid=":walkplank" border="0" alt="thwalkplank.gif" />
 
Back
Top