• 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

mjh623

Rum Runner
I appreciate the idea of the ships being able to capsize in a storm if left broadside to the waves. In theory, it adds an interesting new element to storms rather than just heaving to and wait it out. However, in practice, the smaller ships spinning to the left constantly and being completely out of the control of the player makes this aspect just a game of chance rather than sailing skill. Avoiding storms doesn't work either, as they can show up completely unannounced when using Direct Sail. It should probably be turned off until the spinning ship bug is sorted out. Three times now I have lost ships I had invested a good amount of playing time into because of something completely beyond my control. Now, I am a stubborn old cuss, so I either continue on or start over. Others, particularly new people you are trying to attract to the Build, may throw up their hands in disgust and decide the game is not worth playing because of something like this.
 
Well irR4tiOn4L said he found the code... but he's been offline for a while, and I don't think he mentioned where he found said code. :facepalm
 
Aha; here's the thread which mentions it: http://forum.pirates...post__p__389189
Seems Flayed One is the one who actually said he found the code, but irR4tiOn4L said he knew how to use it.
That still implies that he found it as well, though... I think. :?
 
HA! I suppose THIS is the code that causes it. Seems to be intentional too.
PROGRAM\SEA_AI\AIShip.c:
Code:
		// rotate impulse
// 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;
}
arCharShip.Impulse.Rotate.y = fRotate;
}
}
// NK <--
Try to replace with:
Code:
		// rotate impulse
// 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;
}
arCharShip.Impulse.Rotate.y = fRotate;
}
}*/
// NK <--
If I am correct, this should put an end to rotating in storms altogether.
Please test and let me know how it works and whether this does any harm to gameplay if disabled.
 
You, sir, never cease to impress! The absence of that code does the trick! :woot :bow

Now that ships can be controlled again, we probably need to find how to reduce sail damage in storms.
We don't want players having full control again, only to have shredded sails by the end of the storm!
That would not only be unfair, but it seems unrealistic that storms can put so many holes in your sails.

I'm guessing this is what we need to change, from the same file as above:
Code:
// do damage if storm or tornado
//placed here by MAXIMUS -->
float fExp;
float fWindAttack;
float fDamageMultiply;
float fDamageHP;
//placed here by MAXIMUS <--
if (bStorm && bSeaActive)
{
fWindAttack = 1.0 - abs(fWindDotShip);

fDamageMultiply = fStormProfessional * Bring2Range(0.25, 1.0, 0.0, 1.0, fWindAttack);

// hull damage
// NK -->
fDamageHP = (sqrt(fBaseShipHP) / 15);
// NK <--
Ship_ApplyHullHitpoints(rCharacter, fDamageMultiply * fDamageHP, KILL_BY_TOUCH, -1);

// sails damage
switch (MakeInt(fSailState * 2.0))
{
case 0: MakeSailDmg(iCharacterIndex, fDamageMultiply * (fBaseSailHP / 100.0) * 0.15); break;
case 1: MakeSailDmg(iCharacterIndex, fDamageMultiply * (fBaseSailHP / 100.0) * 0.55); break;
case 2: MakeSailDmg(iCharacterIndex, fDamageMultiply * (fBaseSailHP / 100.0) * 1.1); break;
}
 
Now that ships can be controlled again, we probably need to find how to reduce sail damage in storms.
We don't want players having full control again, only to have shredded sails by the end of the storm!
That would not only be unfair, but it seems unrealistic that storms can put so many holes in your sails.
Isn't that up to the player? Lower sails and have low damage or keep on sailing and get a lot of damage?
With the Capsize Mod, they would need to do a bit of manoeuvring to keep meeting the waves head-on but wouldn't need to keep full sail all the time.
 
Isn't that up to the player? Lower sails and have low damage or keep on sailing and get a lot of damage?
Nevertheless, I think the damage done is too high, and a little unrealistic. :?
I fail to see how strong winds can put holes in sails; it could detach ropes probably, but not create holes.
And since I'd guess trying to lessen the graphical effect might be harder to do, I think lowering the damage multipliers would be better.
 
Decreasing the damage would be done by toning down those scalars in the last three lines of code you posted.
I understand what you mean about the holes looking weird, but that's simply the game's way of showing sail damage. :shrug
 
I understand what you mean about the holes looking weird, but that's simply the game's way of showing sail damage. :shrug
... which is all very well for taking damage from cannon fire, of course. But wind damage is just a nuisance. :facepalm
I might have a go at adjusting those scalars, and see if I can find some more reasonable values.
 
Sounds good. Less damage from storms is fair, because they can now last longer so that compensates a bit.
And there's the added risk of capsizing, so...
 
AND there's also the occasional battle during a storm, which would actually be possible to fight, now! :dance

A little experimenting has lead to three numbers which I think are more suitable; 0.05, 0.15 and 0.25.
Much smaller, I know, but they still leave a few holes here and there. The player would still need 'Storm Helmsman' to reduce the damage further, and reduce the holes down to the odd one or two.

The code for twisters is further down below what you originally posted, but I haven't touched that yet.
What I can't tell is, does the twister code affect the normal damage caused by the wind, or just the damage done on contact?
 
Veeerrryyy iinteresting....:bow

Reduce sail damage? Hopefully not very much. As it is I only see no sails at all after the third storm of a bad voyage. :j3 Then it is either world map or starve to death.
 
Hey everyone, sorry for going AWOL, i was busy at work and other commitments.

Thats the code i was talking about, its quite flawed - i know this because id tried to use it to turn ships in my AI sail upwind code.

Now on how to fix it - i have some ideas ill try out. Basically what ill do is limit the force used to turn the ships.

The question is - what SHOULD ships do in the wind? be blown to face the wind or away from the wind?


The current code was intentional it seems, but it just used way too much force and just spins ships randomly with no regard to the wind.

But what could be done is for example to read foffwind and if you are 90-0 degrees off the wind (whether to port or starboard) to force your ship TOWARD the wind, while if you are 91-180 off the wind, to force your ship AWAY from the wind.

Thus if wind is blowing from 0 degrees, your ship would end up (slowly, not using TOO much force so ships dont spin like they do at the moment) either facing the wind or facing away from it.

The effect could even be proportional to wind speed and be made much stronger when sails are raised.


This would create quite a chaotic effect - finding yourself at 50 degrees you could let the wind turn you to face it but then youd be facing the wind with no maneuverability. Or you could lower sails and try to turn AWAY from the wind, but youd have to reach 90 degrees with sails down, battered by waves


Hope that helps
 
that sounds very realistic if anything. i've always wanted to sail on during storms, and this just might do it. doing it with a ship like the old pirate corvette has a very clipper-like feel to it. the only thing i'd want to point out is that it should be possible to steer against the force of the wind when at, let's say, 120 degrees (unless someone has a more realistic value) and a sailing skill of 5 or 6 at the very least. assuming that you don't have a ship with low manuevrability, that is. it's something that'll have to be fine tuned through playtesting, but i'd like to see this working at all first. in any case, it'll make storms far more of an interesting element to ocean passages. i agree on all your ideas of how to modify the storm itself.
 
For now, I've commented out the code that causes the spinning altogether, so that should at least put an end to the annoyances that it causes.
There already is the Capsize Mod in place to make storms more interesting and challenging than they were in the stock game.
If you haven't played with that yet, the brief explanation is that the game looks at your ship's roll angle and if it is too frequently too large,
things will happen with first the crew morale decreasing (they get seasick from the rolling) and eventually you losing the ship altogether because she capsizes.
Note that this only applies to the player ship, because the AI ships can't understand this mod and therefore it would be unfair against them.

In any case, with the Capsize Mod, what you need to do as player to prevent capsizing is to put your bow to the waves so your ship rolls as little as possible.
For gameplay purposes, if the wind automatically forces your bow into the wind, that probably makes the storms easier to survive.
So maybe it would be an idea if the storm win influence would force your ship away from the wind, so you'd have a force to counter
and you wouldn't be able to put your bow into the waves and then just wait out the storm.

On the other hand, from what I understand some ships have a natural tendency to turn into the wind, while other ships have a natural tendency to turn away from the wind.
I'm not entirely sure what that depends on, but I suppose it's got something to do with the hull and superstructure, their shape and respective sizes.
There's some interesting, potentially useful stuff on this page I just found as well: http://thenauticalsite.com/NauticalNotes/Manouev/MyMan-Lesson02-SHandling.htm
 
i've played with the capsizing present, yes. i never managed to succeed in sailing along with the wind for very long as a result, since it tries to push me around. it is somewhat expected to happen though, since it's normally counteracted by setting specific sails, but you can't do that in this game.
 
:gday Irrat...ir... hey you!


I just got around to installing Pieter's code last night, and it works great! I will post a short video on MODDB soon. I was in an English Bark, which is a small manueverable ship and still lost some cargo before getting turned into the waves. Oh, sailing skill is 1. :shrug
 
Back
Top