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

Storms and Spinning Ships

Try just decreasing those 0.02 values to something less and see what happens.
 
Keep this bit like this:

/*float fRotate = stf(arCharShip.Impulse.Rotate.y) + (frnd() * 0.08 - 0.04);
if (fRotate > 0.07) { fRotate = 0.07; }
if (fRotate < -0.07) { fRotate = -0.07; }*/


And change this:

case 0: arCharShip.stormimp = fRotate; fRotate -= 0.02; break;
case 1: arCharShip.stormimp = fRotate; fRotate -= 0.02; break;

To this:

case 0: arCharShip.stormimp = fRotate; fRotate = 0.02; break;
case 1: arCharShip.stormimp = fRotate; fRotate = -0.02; break;

This seems to make this mod work ok, I've only had two storm events to test it in so far, but i've been able to steer in both directions AND lost control temporarily to the left AND the right(sort of goes into a shallow spin which you can counter with some hard rudder). I've left the values as is currently, but will try with maybe 0.01 instead at some point. If anyone else wishes to try the stuff above out we can see if this is good to get back in the game. It does make storms more interesting, and maybe they can be made even more so :sail
 
I'm still interested to know if it makes a difference for this if you use Realistic or Arcade Game Mode.
 
When I played in arcade mode I never had any problems. In realistic mode it was spin cycle until very recently.
 
You need to ask! :razz

Realistic all the way, infact the only time i played PotC in arcade mode was on the xbox(well ok and a bit of testing on PC later), as there was no other way! My main reason for getting PotC on PC was to get the Build Mod and leave all that behind :sail
 
That does seem to negate my thought then that Realistic Game Mode might have bigger problems with spinning. :facepalm
 
Probably depends on the ship type though; with how many different ships did you try?
I vaguely recall the pinnaces were notorious for spinning.

And change this:

case 0: arCharShip.stormimp = fRotate; fRotate -= 0.02; break;
case 1: arCharShip.stormimp = fRotate; fRotate -= 0.02; break;

To this:

case 0: arCharShip.stormimp = fRotate; fRotate = 0.02; break;
case 1: arCharShip.stormimp = fRotate; fRotate = -0.02; break;
It just occurs to me that this does NOT seem correct.
fRotate -= 0.02 means "take the existing value of fRotate and substract 0.02 of that value".
However, fRotate = -0.02 means "override the existing value of fRotate with -0.02 .
The correct code would probably look like this:
Code:
case 0: arCharShip.stormimp = fRotate; fRotate -= 0.02; break;
case 1: arCharShip.stormimp = fRotate; fRotate += 0.02; break;
That will randomly add or substract a 0.02 value from the fRotate value.
Not entire sure what effect that'll have...
 
Aha! well yes that does look better than my attempt. In terms of ships tested with my fix it is just the starting Lugger. But 100% of the time prior to the complete comment out of this section of code, in a storm the Lugger would always end up spining to the left, no matter if you just held down 'right' from storm start.

With the code commented out that stopped 100% of the time, but also it meant that the storm event becomes pretty minor, you can just set your course to avoid the tipping angle(so head into the storm or turn with your back to it), let go the controls and wait for it to finish, which is pretty boring, and not that big a deal, which is what this code was trying to amend i think.

Looking at the open lines in this section of code i just saw the two sets of values, one positve and the other negative:

/*float fRotate = stf(arCharShip.Impulse.Rotate.y) + (frnd() * 0.08 - 0.04);
if (fRotate > 0.07) { fRotate = 0.07; }
if (fRotate < -0.07) { fRotate = -0.07; }*/

...and just copied that format in the code lower down that was set the same(and i feel was responsible for the spinning left bug). Even though that section needs to remain commented out(it ctd's on game boot up otherwise), it was the pattern of postive then negative that i though this section was lacking:

case 0: arCharShip.stormimp = fRotate; fRotate -= 0.02; break;
case 1: arCharShip.stormimp = fRotate; fRotate -= 0.02; break;

That just didn't look right in a bit of code meant to generate an either/or situation, that looked like duplicates of one or the other, which might end in 'only spin left' etc? Still my fix of:

case 0: arCharShip.stormimp = fRotate; fRotate = 0.02; break;
case 1: arCharShip.stormimp = fRotate; fRotate = -0.02; break;

Does seem to work currently, on my Lugger, but maybe it just cancels something out rather than gives the desired effect, so i'm now going to try your suggestion as that does indeed sound more like what i was aiming for. So i'll make it this:

case 0: arCharShip.stormimp = fRotate; fRotate -= 0.02; break;
case 1: arCharShip.stormimp = fRotate; fRotate += 0.02; break;

And report back :nk
 
Well ok that seems to work fine, better even than mine. It's a little more sublte, in that the swings to left or right are not so severe and you can counter them well enough. Looking at that fix you came up with Pieter it does make more sense, i might play around with the values a bit, to see if i can make the lack of control swings a bit more aggresive maybe? As it is it is much better than the swing to the left bug(obviously), but also much better than commenting the whole section out imho. We can tweak the values and see what they should end up being.
 
The only difference between the code I posted and the original bugged code is that there's a + instead of a - in one instance of the code.
Just that as a difference is NOT going to solve the problem. Although you haven't encountered it yet, with the code I posted, the bug must still exist.
I suspect it depends on ship type though; try some different size ships in a storm and see if any of them go spinning.
Alternatively, change the + back into a - (effective restoring the code to Patch 6 unfixed original) and see if the spinning ships return.
 
Well i'm restarting the game over and over, so i generaly only have the Lugger in play. Having said that i've done a couple of storms with the code as was(so a minus(-) in place of the plus(+)) and in storms i just end up spinning to the left, i can sometimes reduce the amount of spin by pressing down constantly on the 'D' key, but it never turns to the right and releasing the 'D' key results in the spin left bug.

With the code chage to the plus(+) you can turn left AND right and you don't get the spinning left bug during or after the storm event. During the storm you can't just set your course and wait for it to pass(as you can with this section of code commented out), you will get turned left or right and have to counter that(which you can, but couldn't with the spinning left bug). I'll keep testing this but that simple change to this code seems to resolve the bug as far as i'm concerned, so much so that it is now part of my game and i can forget about the spinning left bug during storms(atleast in the Lugger, not sure about other ships). If not a total fix, in relation to other ships maybe, it is a step in the right direction and probably good to go in the next patch/update.
 
The small ships like the lugger have a much harder time in storms than the big ones. Those are the ones I usually get capsized in. So if you say it works with a lugger, then it should work for everything.
 
ok heres a weird thing. With the code as this:

case 0: arCharShip.stormimp = fRotate; fRotate -= 0.02; break;
case 1: arCharShip.stormimp = fRotate; fRotate += 0.02; break;


I don't seem to get the spinning left bug, or atleast in the storm events can steer my ship to port and starboard(with a little persistence!). But i was just trying the code like this:

case 0: arCharShip.stormimp = fRotate; fRotate -= 0.05; break;
case 1: arCharShip.stormimp = fRotate; fRotate += 0.05; break;


And that was a right pain to control(maybe i had the tiniest fraction more control than with the old 'spinning left' setting?) and after the storm, my ship was left spinning left(no pun intended!). wtf! So it might not be the fix for the bug per say, but with the values set at - = 0.02 and += 0.02 ;it is a large improvement on where we were.

My strom chasing ended when i chased a twister - it ripped my hull apart in a few passes and i sank....to be greated by those video clips of the great white shark(not seen those before!)
:shock
 
INCREASING the values. Ah, that does sound dodgy! :shock
So you're saying that things work seemingly properly with this code?
Code:
// NK -->
float fRotate = stf(arCharShip.Impulse.Rotate.y) + (frnd() * 0.08 - 0.04);
if (fRotate > 0.07) { fRotate = 0.07; }
if (fRotate < -0.07) { fRotate = -0.07; }
float fRotate = stf(arCharShip.Impulse.Rotate.y);
if(frnd() < 0.5)
{
if(CheckAttribute(arCharShip,"stormimp"))
{
arCharShip.Impulse.Rotate.y = arCharShip.stormimp;
DeleteAttribute(arCharShip,"stormimp");
}
}
else
{
if(!CheckAttribute(arCharShip,"stormimp"))
{
switch(rand(9))
{
case 0: arCharShip.stormimp = fRotate; fRotate -= 0.02; break;
case 1: arCharShip.stormimp = fRotate; fRotate += 0.02; break; // PB: Not just port
}
arCharShip.Impulse.Rotate.y = fRotate;
}
}
// NK <--
 
INCREASING the values. Ah, that does sound dodgy! :shock
So you're saying that things work seemingly properly with this code?

You need to keep the first section commented out(or it will CTD on loading up) like this:

Code:
// NK -->
/*float fRotate = stf(arCharShip.Impulse.Rotate.y) + (frnd() * 0.08 - 0.04);
if (fRotate > 0.07) { fRotate = 0.07; }
if (fRotate < -0.07) { fRotate = -0.07; }*/
float fRotate = stf(arCharShip.Impulse.Rotate.y);
if(frnd() < 0.5)
{
if(CheckAttribute(arCharShip,"stormimp"))
{
arCharShip.Impulse.Rotate.y = arCharShip.stormimp;
DeleteAttribute(arCharShip,"stormimp");
}
}
else
{
if(!CheckAttribute(arCharShip,"stormimp"))
{
switch(rand(9))
{
case 0: arCharShip.stormimp = fRotate; fRotate -= 0.02; break; 
case 1: arCharShip.stormimp = fRotate; fRotate += 0.02; break; // PB: Not just port - was -= 0.02 (spin left bug fix?) - july 2011
}
arCharShip.Impulse.Rotate.y = fRotate;
}
}
// NK <--

And so far, in just the Lugger, you have full control in storms BUT can't just set your course, let go the controls, and wait for the storm to end.

I'm still concerned that by increasing the values i still got the spinning left bug, BUT from getting that bug 100% of the time with the old values(in the starting Lugger), this 'fix' seems to stop it. I don't quite understand why, but a negative and a positive value in the math would make sense when dealing with port and starboard(or fRotate) values in a game. Probably ;)
 
With only -, you would get the impulses stacking on top and making you spin more and more.
However, when the chance for + is equal to -, they'll cancel each other out and just stop your course from being steady.
That's what I think is going on anyway....
 
yeah, that sounds about right. I'm guessing it must have been a typo from the start in the original code for this. The + makes all the difference, but the values need to be kept low as my experiments with 0.05 proved. I've been using the code posted just above in my game for a while now, and i'm pretty happy with it. Storms are a serious concern now, in that i have to battle against them turning my ship to port or starboard(and i can control that now to some extent) but not annoying like with the spin-left bug.
 
Ah, progress! Have you tried using the console to give yourself a big ship to see how it works?
 
Back
Top