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

Need Help Making waves!

Status
Not open for further replies.

modernknight1

Field Marshall of Hot Tubs
Staff member
Storm Modder
So along with the harbor improvements I've made with vessel clutter and ships sailing away, I've wanted to fix something else for a very long time and am hoping I can solicit some ideas...

So what I want are realistic looking swells while you're walking around in the harbor just like in New Horizons.

I have managed to improve it to some extent by changing the entries for MaxSeaHeight and MaxWaveHeigh in locations_loaders.c

There is a noticeable improvement in your boat and ship rocking slightly and the tide coming much further in and much higher. You can even see some shallow waves out at sea instead of the completely flat sea I've become so used to. So it is better but I think it could be so much better and as good as POTC if I knew what to change or look for. While the sea height is changing the waves seem to be really wimpy.

What can I do to get some serious wave action happening while in port? While searching I found the following and am wondering what these functions are and what they do? Ideas are MOST appreciated. Thanks!!! MK

on = !on;
if( on ) {
LayerFreeze("realize",on);
LayerFreeze("execute",on);
LayerFreeze("sea_realize",on);
LayerFreeze("sea_execute",on);
} else {
if(bSeaActive && !bAbordageStarted) {
LayerFreeze("sea_realize",on);
LayerFreeze("sea_execute",on);
} else {
LayerFreeze("realize",on);
LayerFreeze("execute",on);
 
We did do some stuff on wave harmonics at some point, but mainly it is the MaxSeaHeight that is involved.
Careful with that though; small waves are better than waves passing over piers and through the floor of your location models.
I once tried to increase the value for cabins and ship decks, which made for some cool effects in storms,
but I couldn't manage to prevent the water from passing through the deck and ultimately ended up deleting that modification of mine again.

SWhile searching I found the following and am wondering what these functions are and what they do? Ideas are MOST appreciated. Thanks!!! MK

on = !on;
if( on ) {
LayerFreeze("realize",on);
LayerFreeze("execute",on);
LayerFreeze("sea_realize",on);
LayerFreeze("sea_execute",on);
} else {
if(bSeaActive && !bAbordageStarted) {
LayerFreeze("sea_realize",on);
LayerFreeze("sea_execute",on);
} else {
LayerFreeze("realize",on);
LayerFreeze("execute",on);
I haven't the foggiest, really. Some engine-stuff to draw the sea, I think. Better not touch it.
 
Is this in COAS ?

"Serious wave action" can happen in this game only if you change the harmonics.

http://www.piratesahoy.net/threads/weather-high-waves-mod.20059/

In here I have done that for the open sea, tho I guess it's too extreme for the traditional player.


Just to be clear, I should have named this topic "Making Waves in Harbors". I am very happy with the complete overhaul I have already done on very realistic weather and waves in open sea mode - and I have shown my work in several of my videos.

Specifically I want to make the harbors look more like what you have in New Horizons. I have looked at the MaxSeaHeight settings in every instance where it applies. However I have been looking to see if the engine recognizes attributes that are not in the locations files. So MaxSeaHeight and MaxWaveHeigh give me some effects, but I'm wondering if there are Min Sea or Min Wave attributes???

I am looking to set some parameters somewhere so that their is a basement and a ceiling. The basecase statement in loacations_loader.c is this...


//Locators=============================================================================
Sea.MaxSeaHeight = 0.5;
if(CheckAttribute(loc, "MaxWaveHeigh"))
{
if(stf(loc.MaxWaveHeigh) > 0.0)
{
Sea.MaxSeaHeight = stf(loc.MaxWaveHeigh);
}
}
//Locator's radiuses
int j, k, gnum, lnum;
aref locator_rad;
if(CheckAttribute(loc, "locators_radius") != 0)
{
makearef(locator_rad, loc.locators_radius);
gnum = GetAttributesNum(locator_rad);
for(j = 0; j < gnum; j++)
{
//Group radius
aref rdgrp = GetAttributeN(locator_rad, j);
string rdgname = GetAttributeName(rdgrp);
float rad = MakeFloat("" + rdgrp);
SetLocatorGroupRadius(loc, rdgname, rad);
//Some locators radius
lnum = GetAttributesNum(rdgrp);
for(k = 0; k < lnum; k++)
{
aref rdloc = GetAttributeN(rdgrp, k);
string rdlname = GetAttributeName(rdloc);
rad = MakeFloat("" + rdloc);
SetLocatorRadius(loc, rdgname, rdlname, rad);
}

So this is what I have been tweaking and playing with to some good effect....and you're right Pieter, I have dialed it in to where the water is coming right over the docks and up onto the shore in storms. I rather liked the effect actually and decided to keep it. I think POTC keeps ships in harbors when you go into your cabin etc. But in COAS your cabin location can only be accessed when you're actually at sea, so its a completely different implementation - thus I'm not worried about waves coming into my cabins. I am going to check the weather files again to see if there is anything germane to harbors only because tide comes in and out and gets higher as a function of time by hour and day which I think is tied to the weather files in the same way it happens at open sea.

I'm going to also start looking at the locations files for individual places to see if there are any clues. I am missing something that allows actual swells to occur. I'm not even looking for huge swells, just small ones would be great.

MK
 
I'm pretty sure PotC doesn't have any tides at all and suspect CoAS is the same on that.

The size of the waves in PotC depends on the speed of the wind. If there's a lot of wind, you'll have large waves, but it can also be near-glassy calm.
There aren't any minimum values for the waves; just max ones.
 
I will make a video to show my progress. Tide may not be the correct way to put it gamewise, but it looks like tide because it gets higher and lower and comes farther in and out each hour - dramatically over time. I looked at the vid I just shot and it does appear that the waves get more dramatic with storms as a function of wind. So I am going to key in on wind. I wonder if I could write in a max wind attribute into the locations_loader file somewhere? Possible?

MK
 
Would require quite a bit of figuring out. And I don't know how the CoAS weather system works.
I only vaguely know the PotC one, but that has been substantially rewritten by the mods.

Why do you want a max wind? I thought you wanted a min.
Max wave height is to prevent the waves from passing through/over the location and making things look stupid.
 
In PotC there is a specific setting for harbours different from all other attributes like a separate page. So whatever you do to open sea that won't affect it, and yeah, wind is essential. There isn't tide, but because the waves move, this creates that illusion.
 
This is from GeneratorUtilitie.c

Can anyone explain the functions of any of these definitions to me. I'm wondering if this could be something I could modify to get the effect I want.

////////////////////////////////////////
// SEA
////////////////////////////////////////
float Sea_TurnRateMagicNumber();
{
return 244.444; //162.962; //244.444; *2/3
}

//#define WIND_NORMAL_POWER 18.0 // äåëèòåëü äëÿ ñèëû âåòðà íà öèôåðáëàòå - âëèÿåò íà ìàõ ñêîðîñòü

float Sea_ApplyMaxSpeedZ(aref arCharShip, float fWindDotShip) //float fTRFromSailDamage,
// arCharShip - êîðàáëü íà ÍÏÑ, fTRFromSailDamage - ïàðóñà 0..1, fWindDotShip - íàïðàâëåíèå âåòðà -1..1
{
ref rShip = GetRealShip(sti(arCharShip.Type)); // áàçà
float fMaxSpeedZ;
float fWindAgainstSpeed;
//fMaxSpeedZ = (0.16 + fTRFromSailDamage / 1.2) * stf(arCharShip.MaxSpeedZ);
fMaxSpeedZ = stf(arCharShip.MaxSpeedZ);
fWindAgainstSpeed = stf(rShip.WindAgainstSpeed);// / 1.7; // ìèí fWindAgainstSpeed = 0.8 - ìàõ 10.5
if (fWindDotShip >= -0.1)
{ //ïî âåòðó
fMaxSpeedZ = fMaxSpeedZ * (0.81 + fWindDotShip / (1.9 + pow(fWindAgainstSpeed, 0.33)));
}
else
{ //ïðîòèâ âåòðà
fMaxSpeedZ = fMaxSpeedZ * (0.75 - fWindDotShip/3.2 - pow(abs(fWindDotShip), fWindAgainstSpeed)); // òóò åñòü âëèÿíèå êîäà â ÅÕÅ
}

return fMaxSpeedZ;
}
 
Doesn't look familiar, I'm afraid.
Looks to be related to maximum ship speed; not what you're looking for, I think.
 
Not having any luck with this. Every island shore and port has water as flat as a pancake. I would be willing to pay for help with this one. I have managed to get some slight waves during storms and that's it.

MK
 
A MaxWind increased will not help, because it is set to occur all types of wind /at least in potC/ from 5 knots to 30. So even if you set maxwind at 50, the majority of the chances will remain from anywhere between 5 and 50 knots, which won't be satisfactory again;
So the MinWin has to be raised up to let's say 15 knots. That's done with the command - if (winds < 15) winds = 15;. In this occassion one will miss of course a nice wind of 10 knots for example, but I am afraid that's the only way it can be.

That said, from testing I have come to understand, that it won't always work as set. There are some bugs in this game /and I think COAS is built upon PotC/ - which don't always include all parameters set. Thus I am encountering at one and the same parameters at one and the same wind at around 25 knots - once perfect waves, other time - almost flat sea, although rarer. I am afraid the situation around islands and in harbours is exactly from these exclusions that are most probably bugs or miscalculation of the weather system.



Do such waves satisfy you ? I am afraid that such ones cannot be had in this game:

Waves_on_Straddie_beach.jpg
 
The waves in your video are exactly what I'm looking for! :keith The POTC builds have always had those great waves you show in the vid and that's what I want in COAS.

I did not realize there was a "winds" attribute or command. I knew about NSWeather.WindSpeed and have tried using that but with no result. So where/what file(s) are you inserting the code... if (winds < 15) winds = 15; ??? Is it in locations.loader or in each location's individual port and shore code? Could you give me an example of this inserted in the file location it applies to?

Thanks for the help Mate!

MK
 
This is PotC command but I just realized it won't do in COAS as I have looked into it today... There is this in Coas,WhrSea:

"Sea.Sea2.SimpleSea = sti(InterfaceStates.SimpleSea)"

I looked about it and couldn't find where it links to. But I suspect that it is a command that simplifies sea on land and island cases /you have these two +sea case all in all/. "Island" is the sea shore when you sail around it, and "land" is the harbour with the buildings. In these two cases I think the AI receives order to simplify it and not execute harmonics etc, just goes to 0.0 for many things....I can't find what it does exactly but I think this is the problem. I looked into COAS Combined Mod which is closer to the vanilla COAS and it is the same situation. Dnno but in AOP 1 was it the same ? Or someone changed something afterwards /for COAS -AOP 2/ screwing the harbours and island shore ?! I don't remember in what point in time these things got missing.
 
Well thanks for the clue at least priatnia! :onya.....I will experiment. I KNOW there has to be a way to get waves in the towns and island shores. I know someone with some code knowledge has to be reading this topic from the views. PLEASE any examples or suggestions would be appreciated.

THANKS!

MK
 
If there were such people, they would have done it well for the release of the game years ago ...

I remain with the conviction the islandshore and harbour locations miss components from the sea generation that makes it look well with waves as open sea. This means that unless something is added, the current things won't go anywhere near a wavy shore, whatever we try.
 
If there were such people, they would have done it well for the release of the game years ago ...

I remain with the conviction the islandshore and harbour locations miss components from the sea generation that makes it look well with waves as open sea. This means that unless something is added, the current things won't go anywhere near a wavy shore, whatever we try.

I don't necessarily agree with your opinion that someone would have done it already. After all POTC has always been the game that coders were more interested in. COAS has not had that much "love" and still has TONS of potential. I will PM JA and see if he might be interested in taking a crack at it.

So using your argument of "Sea.Sea2.SimpleSea = sti(InterfaceStates.SimpleSea)" , I simply thought if we could tell the game to set something else it might default to normal weather and wind. So everywhere the simplesea definition was set to true, I set it to false. Everywhere the statement above occurs I set it to "Sea.Sea2.SimpleSea = sti(startGameWeather)". Then I set the windspeed values in Sea, WhrSky, WeatherUtilite, Weather, and locations.loader to the formula you specified based on <15.

The game runs, but you can tell something is TRYING to happen. There are still no actual waves, but you can see a layer of water below the surface that is moving much more and the reflections are moving around as if there should be waves there. There is also a tiny bit of game lag and I notice more video processing memory is being tapped. I think I'm on to something, but it just seems like there is a transparent glass pane over the port/shore ocean preventing it from going above a set height. I' not giving up yet and am hoping for more clues.

MK
 
In fact this was there before - few layers moving here and there, and - they are waves because they cover the shore a little and they wihdraw then small. Plus I managed to get the boat going up and down a bit, so it moves in all directions - vertically and horizontally, and this is not something else but waves. But it is too little to have the effect we want - and still far away from PotC. I can videotape it if you want, but it doesn't swell as a wave, kind of too broad movement, and too flat. :boom:
 
And it's pitifull because, in PotC the harmonics of waves consist of 3 layers h1-h3. In AOPs you can see usually 4 layers, in some cases such as storms are utilized up to 8 layers h8 .... And all this is totally not utilized, or should I say screwed up with a pancake flat sea everywhere by default...
 
Status
Not open for further replies.
Back
Top