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

POTC Sea Colour

reefs used to be pretty. now they keep scaring the crap out of me once i finally see them.
 
The extra foam on the water are nice. It makes it look like a windy whitecap day. The wake is now more visible too.

I don't like not being able to see the fish and the bottom of the ship, but I'm also not liking still being able to see the straight lines on the bottom where different textures meet. Instead of transparency, maybe some underwater fog might work better. Is that possible?
 
See this code from PROGRAM\BATTLE_INTERFACE\BattleInterface.c:
Code:
// Screwface : to fade from lagoon color to sea blue color
void BI_Refreshseacolor_out()
{
int init = 0;
if(CheckAttribute(&BattleInterface, "refreshcolor_out")) init = sti(BattleInterface.refreshcolor_out);
else{If(CheckAttribute(&BattleInterface, "tempcol")) return;} // if a process is not in progress
//trace("color updated frame : "+init);
if(init==0)
{
//trace("color : 30,55,100");
int r = 124;
int g = 202;
int b = 215;
int r2 = 109;
int g2 = 185;
int b2 = 240;
BattleInterface.tempcol.framejump = init;
}
else
{
r = sti(BattleInterface.tempcol.red);
g = sti(BattleInterface.tempcol.green);
b = sti(BattleInterface.tempcol.blue);
r2 = sti(BattleInterface.tempcol.red2);
g2 = sti(BattleInterface.tempcol.green2);
b2 = sti(BattleInterface.tempcol.blue2);
}
if(init>sti(BattleInterface.tempcol.framejump)+2)
{
if(r>30) r--;
if(g>55) g--;
if(b>100) b--;
If(r2<255)r2++;
If(g2<255) g2++;
If(b2<255) b2++;
Sea.GF3.WaterColor = argb(0,r,g,b);
Sea.GF3.SkyColor = argb(0,r2,g2,b2);
if(stf(Sea.WaterAttenuation)>=0.8) 
Sea.WaterAttenuation = 0.8;
else
Sea.WaterAttenuation = stf(Sea.WaterAttenuation) + 0.0035;
BattleInterface.tempcol.framejump = init;
}
BattleInterface.tempcol.red = r;
BattleInterface.tempcol.green = g;
BattleInterface.tempcol.blue = b;
BattleInterface.tempcol.red2 = r2;
BattleInterface.tempcol.green2 = g2;
BattleInterface.tempcol.blue2 = b2;
init++;
BattleInterface.refreshcolor_out = init;
if(r<=30 && g<=55 && b<=100) init= - 1;
if(init==-1) {
DeleteAttribute(&BattleInterface, "refreshcolor_out");
DelEventHandler("frame", "BI_Refreshseacolor_out");
DeleteAttribute(&BattleInterface, "tempcol");
}
}

// Screwface : to fade from sea color to lagoon color
void BI_Refreshseacolor_in()
{
int init = 0;
if(CheckAttribute(&BattleInterface, "refreshcolor_in")) init = sti(BattleInterface.refreshcolor_in);
else{If(CheckAttribute(&BattleInterface, "tempcol")) return;} // if a process is not in progress
//trace("color updated frame : "+init);
if(init==0)
{
int r = 30;
int g = 55;
int b = 100;
int r2 = 255;
int g2 = 255;
int b2 = 255;
BattleInterface.tempcol.framejump = init;
}
else
{
r = sti(BattleInterface.tempcol.red);
g = sti(BattleInterface.tempcol.green);
b = sti(BattleInterface.tempcol.blue);
r2 = sti(BattleInterface.tempcol.red2);
g2 = sti(BattleInterface.tempcol.green2);
b2 = sti(BattleInterface.tempcol.blue2);
}
if(init>sti(BattleInterface.tempcol.framejump)+2)
{
if(r<124) r++;
if(g<202) g++;
if(b<215) b++;
If(r2>109)r2--;
If(g2>185) g2--;
If(b2>240) b2--;
Sea.GF3.WaterColor = argb(0,r,g,b);
Sea.GF3.SkyColor = argb(0,r2,g2,b2);
if(stf(Sea.WaterAttenuation)<=0.3) 
Sea.WaterAttenuation = 0.3;
else
Sea.WaterAttenuation = stf(Sea.WaterAttenuation) - 0.0035;
BattleInterface.tempcol.framejump = init;
}
BattleInterface.tempcol.red = r;
BattleInterface.tempcol.green = g;
BattleInterface.tempcol.blue = b;
BattleInterface.tempcol.red2 = r2;
BattleInterface.tempcol.green2 = g2;
BattleInterface.tempcol.blue2 = b2;
init++;
BattleInterface.refreshcolor_in = init;
if(r>=124 && g>=202 && b>=215) init= - 1;
if(init==-1) {
DeleteAttribute(&BattleInterface, "refreshcolor_in");
DelEventHandler("frame", "BI_Refreshseacolor_in");
DeleteAttribute(&BattleInterface, "tempcol");
}
}
I think there's a good chance that this code contains the place where to fix that "colour reset" effect.
 
Now that looks promising! Nice find, Pieter. :doff
I'll tinker with the numbers and see if it changes correctly.

EDIT: Confirmed. Just change both instances of the equivalent of rgb(30,55,100) to the numbers defined in WhrInitValues.c, and everything fades in and out smoothly. :onya

Here's my versions of both files for people to test. I've tweaked the sea colour and attributes slightly more, and hopefully have reached a good result.
If there are still concerns over the transparency, then I can try to adjust it further.
However, due to the apparent lack of relationship between water depth and transparency, I don't think there's much more that can be done to correct it.
What I'll also say is this: don't forget, we've been used to water which has been far too transparent until now, so it will look odd to begin with.

View attachment WhrInitValues.c

View attachment BattleInterface.c

One more thing, the best way to make the changes work is to press F11 in-game, reload to a different location, and save the game there.
From then on, any changes you make to the files should show up instantly when you reload the new savegame.
 
Bugger. That's probably because I'm using Patch 6 still. Someone will need to WinMerge this with the P7-2 version. :facepalm
 
I used Winmerge to copy over only the different colors and it doesn't crash my install. Didn't sail to any lagoons yet tho.

It seems to work for me.
 
I recently noticed something. I was sailing the Boussole, a large fast flushdeck frigate, and when it has a good tailwind it leaves a long strong wake behind it. Now I'm sailing a smaller slower fluyt and it leaves hardly any wake at all. This suggests to me that there is code somewhere that modifies the wake according to speed. I wonder if this could be modified to make the wake more pronounced in general. :nerbz
 
I think it's to do with the line "Sea.Pena.Color = argb...etc" in WhrInitValues.c, which I did change in the files I posted above. That's probably not speed-related, though.
Other than that, the actual textures the engine uses are in RESOURCE/Textures/WEATHER/SEA/PENA, and they can be enhanced or replaced if need be.
 
Clearly those textures have never been touched by modders, then! There's a first time for everything, they say...

Anyway, how are people finding the new sea? Is there anything else that might need to be changed, besides the wake? :shrug
 
well, it's more interesting. in terms of gameplay, the reefs have become more of a surprise, which isn't neccesarily a bad thing. in fact, seeing them dissapear down into the depts is quite creepy. downside is that some of the sea floors used to look quite nice and are now invisible, but i believe that was the point in the first place.
 
Well hopefully you can still see the sea bed in areas where the lagoon mod works, so that's not a problem.
If that mod needs tweaking to allow it, then that can be done.
 
I recently started tinkering with this WhrInitValues file again, because I'm still curious as to what some of the attributes do. :mm
In particular, the 'Weathers.Sea.FrenelCoefficient' line is what has me interested. I seem to recall increasing the value before and seeing little to no change whatsoever.
However, I did some reading up on this (actually known as the Fresnel Coefficient), and amongst many pages of complicated formulae,
I figured it might be better to lower the value instead (don't ask why, I'm still not entirely sure myself).

Anyway, doing so has yielded some interesting results! Changing the FC from 0.5 to 0.1 made the sea considerably more 'shiny', much more like a realistic liquid than it was before.
I thought it might be a little too much, so settled for 0.2 instead. The effect, which also makes reflections more vivid, is most noticeable at certain times of day, and at certain viewpoints.
It's a bit hard to demonstrate with a screenshot, but I can tell you it seems to look more realistic than before.

I've also tweaked the 'WaterAttenuation' value from 0.9 down to 0.4, which seems to reduce the colour intensity of the sea slightly.
This is a subtle effect which makes the water colour appear more realistic at certain times of day.

Don't take my word for it; see attached file to try out the new effects yourself (goes in PROGRAM > Weather > Init). Any feedback would be appreciated. :doff
 

Attachments

  • WhrInitValues.c
    12.6 KB · Views: 139
Anybody tried the new shiny water, yet? Anyone...? :will
It would be nice to have some feedback so we can decide whether this is worth putting in the next patch, or whether further tweaks are needed.
 
I have just DLed it. It's raining today so all outdoor work is halted. Maybe I can now do something for the first time in a week.
 
That's a good sign, then. :doff

For those who are yet to try the changes, here's my best attempt to capture the improvement in a single screenshot:

NewSea1.jpg

It's not perfect, and a video would be more effective, but you can get a general idea of the more vivid colours in the reflections, at least.
 
Back
Top