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

Hook's fixes

And the fix for games crashing when you try to save. This may not fix all instances of crashing, for example when we've added too many variables outside functions.

This goes in the INTERFACE folder.

Hook
 

Attachments

  • interface.c
    62.4 KB · Views: 106
Thanks for the link Pieter. I'd seen that thread and the ones it points to, but good to have a quick reference to find it again. I was wondering if anyone had anything newer.

Ok, the problem with getting teleported somewhere you didn't want to be is in sea.c where SetCorrectWorldMapPosition() should only be called if you've just loaded a saved game. I'm still doing some testing on this, but it should fix the teleport problem. This goes in SEA_AI.

version:
Build 14 Beta 4 WIP: 2 Apr 2016
Savegame Compatibility: 14.932
That's a bit dated. The most recent version is 28th July. (Or, if you want to try experimental updates, a ZIP update on 23rd September plus a further ZIP update from @Levis on 7th October.) One addition in the 28th July version of "sea.c" is these two lines by @Pieter Boelen:
Code:
   DeleteAttribute(rPlayer, "Anchoring");           // PB: Just to make sure this is gone
   DeleteAttribute(rPlayer, "ForceReload");         // PB: Just to make sure this is gone
Attached is your version of "sea.c" with those lines added. I'm not sure how important they are but this brings your version of "sea.c" into line with the 28th July install.

The 7th October update contains a more drastically modified version of "sea.c". I'll leave it to @Levis to incorporate your changes into that version.
 

Attachments

  • sea.c
    59.3 KB · Views: 84
Fantastic, @LarryHookins! :cheers

Attached is your version of "sea.c" with those lines added. I'm not sure how important they are but this brings your version of "sea.c" into line with the 28th July install.
Those lines prevent the player from potentially getting stuck when the game code does something weird.
Not likely to happen, but it is still possible so it's better to have those lines than not.
 
Directsail is working nicely with the open sea mod. I moved Cuba north and a bit east on map_scaled.tga.tx so that when you're at Santiago your ship icon appears at the right spot on the island. I'll have to sail to Havana to see if the size needs scaling, and I want to test that some more anyway.

I'm having so much fun watching the directsail debug information scrolling past that I've added a Navigator's Report. It looks like this:

Code:
== Navigator's report:
== Navigator's report:  The time is 13:32
== Navigator's report:  We are sailing at 7.6 knots
== Navigator's report: 
== Navigator's report:  The closest islands are:
== Navigator's report:  Eleuthera    distance: 4612 yards ENE  5 hours
== Navigator's report:  Cuba         distance: 20744 yards SW  20 hours
== Navigator's report:  Turks        distance: 21567 yards EbS  21 hours
== Navigator's report:
== Navigator's report:  The closest landfalls are:
== Navigator's report:  Eleuthera    Alice Town Port    distance: 3523 yards  NEbN  3 hours
== Navigator's report:  Cuba         Punta de Maisi     distance: 18696 yards  SW  18 hours
== Navigator's report:

It will have a toggle to turn it on and off and otherwise display at appropriate times.

Hook
 
I tested Havana and the map_scaled.tga.tx seems correct.

This goes in RESOURCE\Textures\INTERFACES\Maps.

Hook
 

Attachments

  • map_scaled.tga.rar
    600.1 KB · Views: 75
I have restructured the directsail code and done some tweaks, bug fixing and testing, and I'm satisfied that it works for the general case on the open sea map. I still have a few more cases I want to test, but I'll need to test the normal map first to make sure I haven't broken it. For the most part, the normal map uses the existing code, although it might be in another place in the program, and I don't know if other changes have introduced bugs.

The old directsail code should have worked for the open sea map no matter what it did, but it wasn't handling turning off encounters when it was about to transition to another island, and I've fixed that. I also reinstated the notification when you are about to transition to another island so the player will know to disable directsail if necessary.

I've moved a couple more islands on the map, but the changes are small, unlike Cuba.

I got a good war story out of the testing. I was sailing at night, it was very dark, and I had an encounter convoy show up. I ignored them because I hadn't seen any pirates in a very long time, and couldn't see the ships anyway. My first indication of a problem was noticing that the directsail debug traces mentioned an enemy ship. I started looking in earnest, and realized they were a convoy of 4 or 5 pirate square riggers, and I was about to sail right through the freaking middle of their convoy, with no hopes of turning away to avoid them. They didn't seem to notice me until they were under about 200 yards distance, when they turned to attack. I took one good broadside at close range which reduced my hull by 16% and killed one crew and wounded another. All other shots missed. I was able to get away with minimum damage, and the next midnight my hull was repaired by my crew with a few planks left over. My wounded crewman? He got better. :)

Hook
 
Well, I didn't break direct sail on the normal map. It could use a few more tweaks, but it works as well as it did before. Which is to say you'll still end up too close to your destination a lot of the time.

Isla Mona on the normal map is a major problem. It's too close to both Hispaniola and Puerto Rico. It's fine on the open sea map. At least the added points at the extremes of the island help.

I was sailing around Isla Mona to the northeast, and found myself back at Hispaniola! I should have been sailing *away* from Hispaniola. Then I transitioned back to Mona, then a few minutes later to Puerto Rico, and I was much closer to land than I'd prefer.

I understand that Isla Mona has to be "strategically placed" where it is for one of the quests, but it just isn't going to work well with the normal map. Using open sea, it's in a good spot.

Hook
 
I wonder if there is a way to use the Open Sea Mod distances as Build Default.

Otherwise, maybe Isla Mona should just reload FAR quicker than other islands normally do.
Maybe even have it skipped unless you actually need to go there for story purposes?
 
I'm experimenting.

There are two says of finding distances. One uses the locations in the worldmap, the other uses reload points in Islands. The locations do not scale with open sea but the reloads do. I finally had a reason to display both (for the navigator's report), and it turns out they aren't the same distance, and I haven't seen a good pattern to it yet. But I will.

Using Locations works for the normal map, using Reloads works for open sea, but you can't mix them because they aren't the same scale.

I've tried changing the world map scale from 19.xxx but it does weird things. But it *does* put the islands farther apart, without affecting the scale... you just end up at odd distances when you enter a new island zone. Since the player will have a way to display, that, it should probably be consistent. :)

I've simplified the code and it looks like it works. More testing is in order... good thing I like sailing. :D Let's say it's *almost* ready for a test release.

Hook
 
Current navigator's report using normal map

Code:
== Navigator's report:
== Navigator's report:  The time is 05:15
== Navigator's report:  We are sailing at 14.1 knots
== Navigator's report:
== Navigator's report:  The closest islands are:
== Navigator's report:  Jamaica      distance: 1919 yards WNW  20 minutes
== Navigator's report:  Cayman       distance: 7953 yards WNW  83 minutes
== Navigator's report:  Hispaniola   distance: 8175 yards NE  86 minutes
== Navigator's report: 
== Navigator's report:  The closest landfalls are:
== Navigator's report:  Jamaica           Kingston Fort     distance: 875 yards  NWbW  9 minutes
== Navigator's report:  Hispaniola        Ile a Vache       distance: 5970 yards  NEbE  63 minutes
== Navigator's report:
== Navigator's report:  Island transition to Hispaniola 1669 yards 17 minutes
== Navigator's report:

Times over 90 minutes will be reported in hours.

Directsail seems to be working for the normal map. I haven't researched scale differences between locations and reloads further yet. You still transition closer to your destination island than I'd prefer, but I've fixed most of the problems with new locations. There's not much else to do with that other than move the islands farther apart, or figure out how to scale the reload distances, and it looks like reloads are baked into the island model.

News: A friend on Steam who plays SD:TEHO bought PotC and played the New Horizons mod last night and loves it. One more convert! :D I think he found a used copy on Amazon. I talked him through setting up the game in chat to get a good experience.

Hook
 
Times over 90 minutes will be reported in hours.
Why not over 60? Just being curious here.... :cheeky

News: A friend on Steam who plays SD:TEHO bought PotC and played the New Horizons mod last night and loves it. One more convert! :D I think he found a used copy on Amazon. I talked him through setting up the game in chat to get a good experience.
Brilliant! Even by now 13 years after the initial release of PotC, it seems it is STILL the most thoroughly good game out there. :woot
 
I have it set to display 90 minutes because on the normal map, when sailing between two islands, you'll seldom see a sailing time of over 90 minutes unless it's to another island. This keeps the units consistent for almost everything in the navigator's log so that it's easy to compare. You won't see that many between 60 minutes and 90 minutes, but I find it useful to have. If you're sailing across open sea, you'll see most times in hours, and I don't mind seeing a single "88 minutes" in the middle of that. :)

With the open sea map, the times will be in hours except for the closest landfall, and 90 minutes gives you a finer definition of those times.

I'm experimenting with WDM_MAP_TO_SEA_SCALE to see if I can get a bit more distance between islands without messing too much other stuff up. Does anyone remember why it was set to 19.607843? I suspect it was for timing purposes, but the game will run at different speeds on different computers and depends on your frame rate limiter setting these days. I found that a setting of 25.0 is still a bit low for Santo Domingo to Isla Mona, but 28.0 seems just about right or maybe just a bit far. I need to test Bonaire to Curacao, where 25.0 still put us a bit closer to Curacao than I'd like. There is a discrepancy between the locations and the reaload points, but it's not too bad and unless it's displayed somewhere, you probably won't notice the difference. The biggest problem with doing it that way is that the map picture has the islands too big. I'll be testing the heck out of this before I release it to the wild.

It's possible to ignore Isla Mona for island transitions in the directsail code if the necessary quest isn't active, so you'll never see it normally, although it will appear on the world map.

My friend who just bought the game is testing making fleets spawn farther away when you engage them from the world map. It was a problem in TEHO as well because you could spawn in the middle of a big fleet. Does anyone still use the world map anyway? :D

Hook
 
No clue why there is that strange decimal number for the worldmap scale.
I think it was set to that before I ever joined the forum, so that was quite a while ago. ;)

The fleet generation distance is already much better with Open Sea Mod ON, isn't it?
I think there's a way to increase it further, but I can never remember how.

Pretty sure there are still plenty of people using the worldmap.
 
There must be a way, because he said he got it working. Stuff at the bottom of worldmap_init.c. I'm waiting to see if it's consistent after he plays for a while. He had to start a new game, although I told him about wdmInit() in the console.

I'm happy with the distances stuff spawns during directsail. I've only seen the open map with Iron Man, and that disables world map. I know you can set it separately.

I'm finding the normal map to be much better with the scale set to 28. Sailing down the eastern islands to see how it looks for each one, and the real test will be Bonaire to Curacao, although Isla Mona works fairly well at that scale. I added code to skip Isla Mona and that's much nicer. It can eventually be set with a conditional so that it will appear when the quest is active, but the island is just too big for where it's located on the normal map. Petit Tabac looks much better where it is, and may be a small island. I've only seen it once, but I'll be passing it on the way south.

I hate the idea of making a new map graphic with the islands in the same place as they are now, but about 70% their current size, but I'll do it if I have to. The first thing I though of when I saw the map was that the islands needed to be smaller.

I had an odd situation just now where the Charlestown store on Nevis had gold listed at about 1200, also the price on the merchant screen was 1200, but merchant was only paying 800. A problem with gold being discovered on nearby St Martin?

Hook
 
I added code to skip Isla Mona and that's much nicer. It can eventually be set with a conditional so that it will appear when the quest is active, but the island is just too big for where it's located on the normal map.
It is essential that Isla Mona appears in at least three storylines - "Ardent", "Assassin" and "Woodes Rogers".
 
It is essential that Isla Mona appears in at least three storylines - "Ardent", "Assassin" and "Woodes Rogers".
To clarify, it only affects Isla Mona being skipped while using DirectSail. It is still on the WorldMap.
Plus it can be temporarily enabled in DirectSail when you have to visit there for specific quest purposes.
I think that's the idea anyway....

I hate the idea of making a new map graphic with the islands in the same place as they are now, but about 70% their current size, but I'll do it if I have to. The first thing I though of when I saw the map was that the islands needed to be smaller.
I wonder if perhaps @Grey Roger could assist with that once you've got the underlying code ready?

I had an odd situation just now where the Charlestown store on Nevis had gold listed at about 1200, also the price on the merchant screen was 1200, but merchant was only paying 800. A problem with gold being discovered on nearby St Martin?
No clue what's up with that. Maybe make a new Bug Tracker entry for that?
 
To clarify, it only affects Isla Mona being skipped while using DirectSail. It is still on the WorldMap.
Plus it can be temporarily enabled in DirectSail when you have to visit there for specific quest purposes.
I think that's the idea anyway....
There's the problem. Someone who prefers to DirectSail has to be able to get to Isla Mona during any of those stories. Especially in "Ardent", where things aren't always as linear as they are in some other storylines, plus you may want to visit your Taino friends at any time regardless of whether there's a quest active. (One quest may be initiated by visiting the Taino chief, which won't work if you can't get to Isla Mona unless there's a quest active!) The same may be true for "Woodes Rogers" and the Swedish colony; @Jack Rackham can say whether he wants his Swedish colony permanently accessible or only available at specific times.

I wonder if perhaps @Grey Roger could assist with that once you've got the underlying code ready?
No, partly because I really need to get on with "Ardent" and partly because I like the worldmap the way it is.
 
There's the problem. Someone who prefers to DirectSail has to be able to get to Isla Mona during any of those stories. Especially in "Ardent", where things aren't always as linear as they are in some other storylines, plus you may want to visit your Taino friends at any time regardless of whether there's a quest active. (One quest may be initiated by visiting the Taino chief, which won't work if you can't get to Isla Mona unless there's a quest active!) The same may be true for "Woodes Rogers" and the Swedish colony; @Jack Rackham can say whether he wants his Swedish colony permanently accessible or only available at specific times.
The "temporary flag to enable DirectSail for the island" could be left enabled for as long as you and @Jack Rackham want, I'm sure.

No, partly because I really need to get on with "Ardent" and partly because I like the worldmap the way it is.
It is just to get the display map to match up with the 3D world. Just one texture file.
 
In WoodesRogers you'll get access to IslaMona only when fullfilled a number of missions.
In any other storyline the Swedish colony on IslaMona should not be there at all. (or at least locked)
 
Back
Top