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

Mod Release Open Sea Mod and Realism Settings

Oh... So if you're testing and you DO run into a location where the waves are too high, let me know so I can set the code right. :doff
 
Well ... I admit that I rarely would see that, because I very rarely walk on board my ship's deck when at sea. But I promise to take a look at, especially at rough sea, to test it.
 
No need for all that; just let me know if you do run into stuff like that by any chance. :doff
 
3) Time has changed. It seems that hours are much shorter than before and this makes tacking into the wind a waste of time as it takes most of an hour to complete a tack, and then the wind changes forcing another tack.

I support Hylie here.
While I can not say if time has actually changed - I am very sure it has changed during the whole 2.3-2.4-2.5 progress.

A game hour being short in real time means you have to tack more often when direct sailing. This may not be much of an issue for world map players, but it is a huge issue for direct- and open seas sailors. Especially between islands, we often use time compression, and then that wind changing any hour (in real time: any minute or so) can be really nasty, especially if you are tacking.
I don'`t know how best solve this ... perhaps game time could be brought closer to real time, or perhaps it could be arranged that wind will not change any hour.
Personally, I'd be quite happy with wind changing 4 times a day.

Since in reality I'm a land lubber I have no idea what's realistic here. But I understand that direction of wiind is not an entirely random thing at all, but dependant on region, and perhaps season. So it would possibly not be unrealistic to have it be a bit more constant.
 
I noticed there were some port and deck locations where the waves still pass through the bottom of the location model, so I've been fixing that today by decreasing their MaxSeaHeight.
But while I was at it, for those deck and cabin locations that DO allow it, I've been enabling BIGGER waves. That should add a bit to the atmosphere in the game.
So when you're walking around your ship in a storm or visiting your captain's cabin, you will actually see some proper waves out there.
Cool!
 
I can understand that the Open Sea Mod can have that effect, based on the code I've seen.
But didn't you already have that when you had the Open Sea Mod in use on Beta 2.3?
Or could it be that somehow you had the InternalSettings.h with the non-Open Sea Mod values in use combined with the rest of it?

You can also try opening PROGRAM\NK.c and finding this line:
Code:
TIMESCALAR_SEA =                                    15;        // INT - how many seconds of gametime one second of realtime is at sea
Replace that 15 with 5, which is the same value as without the Open Sea Mod. Maybe that will help?

You are both playing with Open Sea Mod ON, right?
 
But why would it change now? It was ok for a year or more and now it is too fast. This faster time messes up other things like trade missions that might now time out and battles are a mess now.

The only way I can get the open Sea mod to work at all now is to set it in internalsettings.h and then run Iron Man for a while. Then when I switch to Realistic mode it works.
Something got broken somewhere.
 
That's interesting. Open seas works very well with me, but then again, I'm exclusively running it together with iron man mode.
 
But why would it change now? It was ok for a year or more and now it is too fast. This faster time messes up other things like trade missions that might now time out and battles are a mess now.

The only way I can get the open Sea mod to work at all now is to set it in internalsettings.h and then run Iron Man for a while. Then when I switch to Realistic mode it works. Something got broken somewhere.
I really haven't the foggiest what happened. When you first mentioned this, I double-checked if the Open Sea Mod is being properly initialized, but the values all check out.

InitOpenSeaMod is called on Start New Game, Load Savegame or exit the Options Menu.
Then if Realism Mode > 1 (eg. Iron Man Mode as that is #2) or OPEN_SEA_MOD is 1 in InternalSettings.h, then the Open Sea Mod values are loaded instead of the normal ones.
You can tell if this works by checking the map you have in your inventory as every time the function is called, it will give you the appropriate map:
Code:
// stljeffbb Jan 15 2012 -->
void InitOpenSeaMod()
{
    ref PChar = GetMainCharacter();
    if(iRealismMode>1 || OPEN_SEA_MOD)
    {
        DIRECTENCOUNTERCHANCE =                                22;        // chance in percent that an encounter fleet appears every hour
        DIRECTENCOUNTERDISTANCE =                            2250;    // distance from player at which random ships appear
        ISLANDSWITCHDISTANCE =                                30000.0;// for islandcell mode only: distance from island at which transfer to neighbour island starts
        ENCOUNTERBREAK =                                    6.0;    // LDH - Changed to float, number is hours per encounter, directsail is called every 5 minutes occasionally
        // so you can let the clock run faster (by increasing #define TIMESCALAR_SEA in InternalSettings.h ), meaning longer voyagetimes, without getting too many encounters.
 
        TIMESCALAR_SEA =                                    15;        // INT - how many seconds of gametime one second of realtime is at sea
        MAX_WBALLAST =                                        10;        // INT - how far the weighting will swing in favor of current trend.. use positive integer between 0 and 50 - 0 is no swing - 50 is major swing.. this is for Windspeed
        MAX_RBALLAST =                                        10;        // ^^DITTO for rain
        MAX_FBALLAST =                                        10;        // ^^DITTO for fog
 
        MAX_WINDCHANGE =                                    3;        // INT - How much the wind CAN change in one hour - use positive integer between 0 and 20
        MAX_FOGCHANGE =                                        3;        // INT - ^^DITTO for fog
        MAX_RAINCHANGE =                                    3;        // INT - ^^DITTO for rain
 
        COASTRAIDER_CHANCE =                                0.01;    // FLOAT - Generates local ships in ports and around the islands. Some are local merchants, others pirates.
                                                                    // 0.0 : Stock PotC, no local ships at all
                                                                    // 0.1 - 0.9 : The higher that value the more pirates instead of merchants appear
        NAVYRAIDER_CHANCE =                                2.0;    // FLOAT - Ditto, but chance that raider is a foreign warship. Chance for that is coastraider_chance * navyraider_chance
        MIN_ENEMY_DISTANCE_TO_DISABLE_MAP_ENTER =            100.0;    // FLOAT - original value is 500 - Petros: reset to 500.0 to prevent trouble
        MIN_ENEMY_DISTANCE_TO_DISABLE_ENTER_2_LOCATION =    100.0;    // FLOAT - original value is 500
        RANGE_TO_ENEMY =                                    3500;    // INT - in feet/yards/whatever unit the game uses.
 
        WDM_MAP_TO_SEA_SCALE =                                60;        // orig 19.607843 for this and next line
        WDM_MAP_TO_SEA_ENCOUNTERS_SCALE =                    60;        // was 60 in build, 10.0 in stock. NK 05-04-30
 
        if(CheckCharacterItem(PChar,"map"))
        {
            TakeItemFromCharacter(PChar, "map");
            GiveItem2Character(PChar, "map_scaled");
        }
    }
    else
    {
        DIRECTENCOUNTERCHANCE =                                50;        // chance in percent that an encounter fleet appears every hour
        DIRECTENCOUNTERDISTANCE =                            1000;    // distance from player at which random ships appear
        ISLANDSWITCHDISTANCE =                                5000.0; // for islandcell mode only: distance from island at which transfer to neighbour island starts
        ENCOUNTERBREAK =                                    1.0;    // LDH - Changed to float, number is hours per encounter, directsail is called every 5 minutes occasionally
        // so you can let the clock run faster (by increasing #define TIMESCALAR_SEA in InternalSettings.h ), meaning longer voyagetimes, without getting too many encounters.
 
        TIMESCALAR_SEA =                                    5;        // INT - how many seconds of gametime one second of realtime is at sea
        MAX_WBALLAST =                                        25;        // INT - how far the weighting will swing in favor of current trend.. use positive integer between 0 and 50 - 0 is no swing - 50 is major swing.. this is for Windspeed
        MAX_RBALLAST =                                        25;        // ^^DITTO for rain
        MAX_FBALLAST =                                        25;        // ^^DITTO for fog
 
        MAX_WINDCHANGE =                                    5;        // INT - How much the wind CAN change in one hour - use positive integer between 0 and 20
        MAX_FOGCHANGE =                                        5;        // INT - ^^DITTO for fog
        MAX_RAINCHANGE =                                    5;        // INT - ^^DITTO for rain
 
        COASTRAIDER_CHANCE =                                0.2;    // FLOAT - Generates local ships in ports and around the islands. Some are local merchants, others pirates.
                                                                    // 0.0 : Stock PotC, no local ships at all
                                                                    // 0.1 - 0.9 : The higher that value the more pirates instead of merchants appear
        NAVYRAIDER_CHANCE =                                0.4;    // FLOAT - Ditto, but chance that raider is a foreign warship. Chance for that is coastraider_chance * navyraider_chance
        MIN_ENEMY_DISTANCE_TO_DISABLE_MAP_ENTER =            500.0;    // FLOAT - original value is 500 - Petros: reset to 500.0 to prevent trouble
        MIN_ENEMY_DISTANCE_TO_DISABLE_ENTER_2_LOCATION =    500.0;    // FLOAT - original value is 500
        RANGE_TO_ENEMY =                                    3000;    // INT - in feet/yards/whatever unit the game uses.
 
        WDM_MAP_TO_SEA_SCALE =                            19.607843;    // orig 19.607843 for this and next line
        WDM_MAP_TO_SEA_ENCOUNTERS_SCALE =                19.607843;    // was 60 in build, 10.0 in stock. NK 05-04-30
 
        if(CheckCharacterItem(PChar,"map_scaled"))
        {
            TakeItemFromCharacter(PChar, "map_scaled");
            GiveItem2Character(PChar, "map");
        }
    }
}
// stljeffbb Jan 15 2012 <--
Since the Realism Mode and InternalSettings options are in the same if-statement, they are being treated the same too.
So it makes no difference if you use Iron Man Mode or the InternalSettings toggle.

One thing you can try if you think it isn't working right is to open and close the Options Menu; that should set the values back to Open Sea Mod ones.

The only thing that might be messing us up is the whole "weird stuff happening with global variables" thing.
That is what messed us up on the fencing skill increase and I saw something similar today with the treasure quest payment code.
Perhaps I'd have to recode it all to character attributes? That'll be a bit of a pain! :facepalm
 
- NEED HELP! -

We're going to need to track this issue down properly, I suppose. Please extract attached to your PROGRAM folder.
Whenever you are doubtful that the Open Sea Mod and/or time progression are properly enabled or disabled, press F12.

This will log on the screen (and to compile.log for future analysis) whether the game considers the mod to be ON or OFF, along with ALL current values of the mod.
These should at all times correspond to the values from PROGRAM\NK.c (see my post above) for either the ON or OFF state, depending on which applies.
Any sort of mismatch is going to cause unintentional weird effects and will need to be fixed.

I hope you'll be able to do some checks so that we can analyse this. Unfortunately I don't play enough either way to be able to notice if it is wrong. :modding
 

Attachments

  • console.zip
    2.9 KB · Views: 102
Ok, I will try this. But! This is not a case of sometimes it works and sometimes it does not work. It is always like this. So this console thingy will probably show nothing wrong.
Most likely a new game is needed to find the problem because that is where it all goes wrong.
 
The console will show what it is actually doing. :shrug

To further my research on this, I am comparing values to the ones from the Open Sea Mod as contained in the Beta 2.3 Light installer:
Code:
#define DIRECTENCOUNTERCHANCE 22   // chance in percent that an encounter fleet appears every hour was 50 stljeffbb Jan 15 2012
#define DIRECTENCOUNTERDISTANCE 2250 // distance from player at which random ships appear was 1000 stljeffbb Jan 15 2012
#define ISLANDSWITCHDISTANCE 30000.0 // for islandcell mode only: distance from island at which transfer to neighbour island starts
#define ENCOUNTERBREAK 6.0 // LDH - Changed to float, number is hours per encounter, directsail is called every 5 minutes occasionally was 1.0 stljeffbb Jan 16 2012
// so you can let the clock run faster (by increasing #define TIMESCALAR_SEA in internalSettings.h ), meaning longer voyagetimes, without getting too many encounters.

#define TIMESCALAR_SEA                15            // INT - how many seconds of gametime one second of realtime is at sea was 10 stljeffbb Jan 15 2012 
#define MAX_WBALLAST                    10        // INT - how far the weighting will swing in favor of current trend.. use positive integer between 0 and 50 - 0 is no swing - 50 is major swing.. this is for Windspeed orig 25
#define MAX_RBALLAST                    10        // ^^DITTO for rain orig 25
#define MAX_FBALLAST                    10        // ^^DITTO for fog orig 25
#define MAX_ABALLAST                    10.0    // FLOAT - ^^DITTO for wind angle orig 25

#define MAX_WINDCHANGE                    3        // INT - How much the wind CAN change in one hour - use positive integer between 0 and 20 orig 5
#define MAX_FOGCHANGE                    3        // INT - ^^DITTO for fog orig 5
#define MAX_RAINCHANGE                    3        // INT - ^^DITTO for rain orig 5
#define MAX_ANGLECHANGE                    1.0        // FLOAT - ^^DITTO for wind angle orig 1
 
#define COASTRAIDER_CHANCE             0.01            // FLOAT - Generates local ships in ports and around the islands. Some are local merchants, others pirates. 
                                                // 0.0 : Stock PotC, no local ships at all
                                                // 0.1 - 0.9 : The higher that value the more pirates instead of merchants appear
#define NAVYRAIDER_CHANCE             2.0         // FLOAT - Ditto, but chance that raider is a foreign warship. Chance for that is coastraider_chance * navyraider_chance WAS 0.4 stljeffbb Jan 16 2012
#define MIN_ENEMY_DISTANCE_TO_DISABLE_MAP_ENTER            100.0    // FLOAT - original value is 500 - Petros: reset to 500.0 to prevent trouble
#define MIN_ENEMY_DISTANCE_TO_DISABLE_ENTER_2_LOCATION    100.0    // FLOAT - original value is 500
#define RANGE_TO_ENEMY                3500        // INT - in feet/yards/whatever unit the game uses.  Was 3000 stljeffbb Jan 23 2012

#define WDM_MAP_TO_SEA_SCALE    60    //orig 19.607843 for this and next line
#define WDM_MAP_TO_SEA_ENCOUNTERS_SCALE        60  //was 60 in build, 10.0 in stock. NK 05-04-30
Compare to the Beta 2.5 code:
Code:
        DIRECTENCOUNTERCHANCE =                                22;        // chance in percent that an encounter fleet appears every hour
        DIRECTENCOUNTERDISTANCE =                            2250;    // distance from player at which random ships appear 
        ISLANDSWITCHDISTANCE =                                30000.0;// for islandcell mode only: distance from island at which transfer to neighbour island starts
        ENCOUNTERBREAK =                                    6.0;    // LDH - Changed to float, number is hours per encounter, directsail is called every 5 minutes occasionally
        // so you can let the clock run faster (by increasing #define TIMESCALAR_SEA in InternalSettings.h ), meaning longer voyagetimes, without getting too many encounters.

        TIMESCALAR_SEA =                                    15;        // INT - how many seconds of gametime one second of realtime is at sea
        MAX_WBALLAST =                                        10;        // INT - how far the weighting will swing in favor of current trend.. use positive integer between 0 and 50 - 0 is no swing - 50 is major swing.. this is for Windspeed
        MAX_RBALLAST =                                        10;        // ^^DITTO for rain
        MAX_FBALLAST =                                        10;        // ^^DITTO for fog

        MAX_WINDCHANGE =                                     3;        // INT - How much the wind CAN change in one hour - use positive integer between 0 and 20
        MAX_FOGCHANGE =                                         3;        // INT - ^^DITTO for fog
        MAX_RAINCHANGE =                                     3;        // INT - ^^DITTO for rain

        COASTRAIDER_CHANCE =                                 0.01;    // FLOAT - Generates local ships in ports and around the islands. Some are local merchants, others pirates.
                                                                    // 0.0 : Stock PotC, no local ships at all
                                                                    // 0.1 - 0.9 : The higher that value the more pirates instead of merchants appear
        NAVYRAIDER_CHANCE =                                 2.0;     // FLOAT - Ditto, but chance that raider is a foreign warship. Chance for that is coastraider_chance * navyraider_chance
        MIN_ENEMY_DISTANCE_TO_DISABLE_MAP_ENTER =            100.0;    // FLOAT - original value is 500 - Petros: reset to 500.0 to prevent trouble
        MIN_ENEMY_DISTANCE_TO_DISABLE_ENTER_2_LOCATION =    100.0;    // FLOAT - original value is 500
        RANGE_TO_ENEMY =                                    3500;    // INT - in feet/yards/whatever unit the game uses.

        WDM_MAP_TO_SEA_SCALE =                                60;        // orig 19.607843 for this and next line
        WDM_MAP_TO_SEA_ENCOUNTERS_SCALE =                    60;        // was 60 in build, 10.0 in stock. NK 05-04-30
 
Actually, that did lead me to find something wrong: I had left out MAX_ABALLAST. Perhaps that caused the issue?
Extract attached to your PROGRAM folder and let me know if that helps any.
NO new game required; this will initialize properly as soon as you load your savegame. :doff
 

Attachments

  • OpenSeaFix.zip
    46.2 KB · Views: 96
Uh ohhh.... :boom:

Twice I sailed from Jamaica to Grenada only to CTD when I landed and tried to save. Same errors both times.
 

Attachments

  • error.log
    834 bytes · Views: 112
  • system.log
    9 KB · Views: 98
I'm glad you can read all that stuff. It's all Chinese to me. :pirate07:
The stuff above is pretty simple. You should see Pirate_KK's code I'll have to adapt for Beta 3: now THAT is Chinese to ME as well! :shock

Twice I sailed from Jamaica to Grenada only to CTD when I landed and tried to save. Same errors both times.
What is THAT???
Code:
RUNTIME ERROR - file: interface\interface.c; line: 1584
no memory
RUNTIME ERROR - file: interface\save_load.c; line: 1038
no memory
RUNTIME ERROR - file: interface\interface.c; line: 1584
no memory
Never seen that before. Don't like the look of it.
That is on continuing a savegame, right? Perhaps a new game is required? Let me try. :facepalm

Also, what ship still uses "50DI.TGA.tx"? I thought we replaced all uses of that with the regular deck.tga ages ago.
 
That is on continuing a savegame, right? Perhaps a new game is required? Let me try. :facepalm
I just tried loading and older savegame myself, then saving it and it works fine. But I did get that same TownFantoms error, which turns out to be on a line of code that doesn't even exist.
So I suspect that because I took out a #define and replaced it with a variable, the game gets confused. So confused that it might even crash for you.
Do you have the same problem on a new game?
 
Also, what ship still uses "50DI.TGA.tx"? I thought we replaced all uses of that with the regular deck.tga ages ago.

That might be one of the "deck" models that add various details to the stock ships.
I think it could even be a part within one of those models which has been deleted via TOOL, but still calls for the texture it used.
Quite a few of these detail models have the same problem, I think.
 
Back
Top