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

Fix in Progress DirectSail and WorldMap island transfer inconsistencies

Oh yeah, that picture might be useful for you:
That appears to be the last revision I made back in 2013, so if any changes have been made since then, this image will of course be slightly outdated.
No further changes have been made to it as far as I'm aware.
I thought you made some changes yourself though so that there would be no overlap between the island radii around Cuba/Hispaniola though?
Or am I misremembering?
 
I have never had any problems around Hispaniola, Isla Mona, and Puerto Rico. But there is a problem with that small island just North of Grenada. It is possible to get caught right on the border line and the game is going "land ho!", "land ho!" constantly as you bounce from one island to the next. The only escape is to go to the world map which tosses you South of Grenada.
 
Last edited:
For the sake of clarification, the area i'm struggling with is indicated in the image below in red. It's been so long ago since i last went there though that i've added another area in yellow, but i'm pretty sure it's the red one. In fact, it might be a good idea to use this image to mark all the problematic areas on it. Try sailing into the red area from the North to replicate the problem i had. If you don't, then yay for flukey mods.

WorldMap_radii2_MT.jpg
 
I thought you made some changes yourself though so that there would be no overlap between the island radii around Cuba/Hispaniola though?
Or am I misremembering?
Those changes are represented on that image, which is the best we could do, but not perfect. There was a previous version with even more overlap between those islands.

Come to think of it, the radius around Hispaniola is probably what's causing the issues @morgan terror describes. When sailing around the southernmost tip, you end up leaving the radius completely, which might be a problem.
 
Come to think of it, the radius around Hispaniola is probably what's causing the issues @morgan terror describes. When sailing around the southernmost tip, you end up leaving the radius completely, which might be a problem.

I'm not so sure. My problem concerned the westmost point, if i remember it right. There also seem to be many of such locations right on the edge of a circle, all involving the larger islands. If consistency could be found there though, you'd be right.
 
Figured I'd have a look though the "CCCdirectsail.c" file and found this:
Code:
float GetIslandSize(string island)  // ccc Jan07 returns the aprox radius of an islands coastline
{
   switch(island)
   {
     case "Redmond": return 2000.0; break;
     case "IslaMuelle": return 2000.0; break;
     case "Oxbay": return 2000.0; break;
     case "Conceicao": return 2000.0; break;
     case "Hispaniola": return 7000.0; break;
     case "Cuba": return 8000.0; break;
     case "IslaDeMuerte": return 100.0; break; // KK

     return 1000.0;  // default size for average island
   }
}
That doesn't use the radii as defined on the WorldMap at all.

Looks like that is used to abort DirectSail if you're too close to an island:
Code:
      float coastzone = GetIslandSize(pchar.location)+1000;
//       if ( abs(stf(pchar.Ship.Pos.x)) < coastzone && abs(stf(pchar.Ship.Pos.z)) < coastzone )       // orig code
       float coastdistance = GetDistance2D(0.0, 0.0, stf(pchar.Ship.Pos.x), stf(pchar.Ship.Pos.z));   // LDH 06Jan09
       if (coastdistance < coastzone)     // LDH 06Jan09
       {   
         DSTrace("Directsail encounter aborted, too close to coast of " + FindIslandName(pchar.location) + ", " + makeint(coastdistance) + " of " + makeint(coastzone));
         return;
       }

Other than that, no radii seem to be used in the "accurate navigation" mode.
This was mainly used for the old "Cell Navigation" which is still there in the code, but bypassed by an if-toggle.

So I suppose the solution is probably somewhere in GetMapIslandzone in that same file.

If you use the regular [0] key to disable DirectSail, does it all misbehave as well or does it actually become OK then?

This here is where the worldmap coordinates get set based on your 3D Sailing Mode position, for example:
Code:
string GetMapIslandzone(string Island)
// Screwface Jan07, converts your Seaview coords to mapcoords and checks if you are near some island
// Only called if ACCURATE_NAVIGATION is true
// LDH optimizations - 13Mar09
{
   ref Pchar = GetMaincharacter();

   DSTrace("== Directsail checked island zone at " + GetStringTime(stf(Pchar.CurrentTime)));

   if (!CheckAttribute(worldmap, "islands."+Island))   // LDH so we don't try getting island after mooring - 05Jan09
   {
     DSTrace("** GetMapIslandzone tried to process " + Island);
     return "";
   }

   float psX = MakeFloat(pchar.Ship.Pos.x);
   float psZ = MakeFloat(pchar.Ship.Pos.z);
   float ix = MakeFloat(worldMap.islands.(Island).position.rx);
   float iz = MakeFloat(worldMap.islands.(Island).position.rz);

   //REAL CONVERTION OF YOUR SEAVIEW COORDS IN WORLD MAP COORDS
   worldMap.playerShipX = (psX/WDM_MAP_TO_SEA_SCALE) + ix;
   worldMap.playerShipZ = (psZ/WDM_MAP_TO_SEA_SCALE) + iz;

I think for that to be accurate, it does require the coordinates of the islands on the WorldMap to correspond with the 3D models for Sailing Mode.
To make this extra confusing, this scale is CHANGED between Open Sea Mod ON/OFF (e.g. Arcade and Realistic Game Mode).
But doesn't that logically have to be a fixed scale factor based on the size of the 3D world and the WorldMap?
And should that scale factor not have been changed when @Armada redid the worldmap?
 
I play the open sea mod and have no problems around Hispaniola. In fact it can take a day or more to sail to Isla Mona or Puerto Rico. I believe that is because the islands are much smaller in the open sea mod. It has a different map with different island scales.
 
I believe that is because the islands are much smaller in the open sea mod. It has a different map with different island scales.
A different "Archipelago Map Interface", yes. But the worldmap itself remains unchanged, of course.
Which is what makes me wonder if it is even possible to have different scale values and them both making sense. :confused:

@morgan terror: Do you use Realistic/Iron Man Game Mode already?
If not, set OPEN_SEA_MOD to 1 at the top of PROGRAM\InternalSettings.h and see if that changes the behaviour on this.
Would be interesting to find out for sure!
 
@morgan terror: Do you use Realistic/Iron Man Game Mode already?
If not, set OPEN_SEA_MOD to 1 at the top of PROGRAM\InternalSettings.h and see if that changes the behaviour on this.
Would be interesting to find out for sure!

It was indeed off for me. I'm currently stuck in a tavern though, and up to my neck in dialogue code, so any results from this will be a while. Maybe better to have someone else try.
 
I thought I saw yesterday that it is still in use to abort DirectSail too close to the coast.
That's the first part I quoted above.

@morgan terror: You are the one who knows what to look for.
So if you do get to playing the game, please do try.
Not the biggest priority though, mainly because this is probably no quick fix.
 
I thought I saw yesterday that it is still in use to abort DirectSail too close to the coast.
That's the first part I quoted above.
Ah, yes, you're right. I've misread the condition there and though that branch is not executed when ACCURATE_NAVIGATION is on.
 
@morgan terror: You are the one who knows what to look for.
So if you do get to playing the game, please do try.
Not the biggest priority though, mainly because this is probably no quick fix.

Well, i've made a new savegame, and tried rounding the westmost corner (so the one i'd previously marked in red, not yellow) both with and without the opensea mod turned on. Turning it on indeed avoids the problem, while leaving it off always triggers it.
 
Well, i've made a new savegame, and tried rounding the westmost corner (so the one i'd previously marked in red, not yellow) both with and without the opensea mod turned on. Turning it on indeed avoids the problem, while leaving it off always triggers it.

I am getting a bit confused - surely the area marked in red is on the eastern side of Hispaniola not the western. :shrug.

:drunk
 
I am getting a bit confused - surely the area marked in red is on the eastern side of Hispaniola not the western. :shrug.

:drunk

...I'm an idiot. Not the first time i've made that mistake. I was sailing south at the time, that's why. But yes, it's the easternmost end. The marker i put on the map is accurate.
 
Last edited:
Looking at CCCDirectSail.c, I'd really like to remove all cell navigation code (when it was the last time it was used?), reorganize what is left, and then debug it do death...
Although that's not the enterprise to embark on at the time when we are trying to get a relatively stable public release
@Pieter Boelen: So, want me to look at this? I'll have some free time in the first half of January and if I want to have something testable by then, I better start now :)
 
@Pieter Boelen: So, want me to look at this? I'll have some free time in the first half of January and if I want to have something testable by then, I better start now :)
This is certainly an annoying issue with the ship jumping around on the worldmap to places where you weren't before.
So if it could be solved, that would be BRILLIANT! If you're willing to do this, by all means, go for it! :dance
 
This is certainly an annoying issue with the ship jumping around on the worldmap to places where you weren't before.
When I was testing that coastal guard issue, in one instance I happened to be suddenly teleported right into some rock. At least that's how it looked at 20x speed :)

So if it could be solved, that would be BRILLIANT! If you're willing to do this, by all means, go for it!
I'll see what I can do. I hope to clean up the code quite a bit and if there are serious math or logic bugs I might be able to find them.
But honestly, I do not expect to solve all transition problems. The engine just wasn't created to handle more or less realistic sailing. :)
 
Back
Top