• 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

I discovered an error in cccdirectsail.c right after I uploaded it.

TRACEALLLOGS should be TraceAndLog. It doesn't blow anything up, but somehow it didn't trigger an error. TraceAndLog() is a function, TRACEALLLOGS is an int, and the line was TRACEALLLOGS("something or other");

Looks like I also forgot to include the new historical brass compass. I did that one before I was recording my changes.

Hook
 
A new version of the scale map. It will look like this when it's finished. It's still a work in progress.

Hook
 

Attachments

  • map scale 30 v2.jpg
    map scale 30 v2.jpg
    318.9 KB · Views: 153
Has anyone reported problems with the game crashing immediately upon going to your ship from the dock, or during a directsail island transition? I've had a few of those lately, and I'm trying to determine if it was a change I made or if it existed before.

Hook
 
There are some rare CTDs with going from Port to Shipdeck. I dont use directsail that often, but I can't remember of any crashes related to that. Only one time, when I wanted to enter my shipdeck on sea, the game transitioned exactly at the same moment, which resulted in a ship only with rigging and sails and complete loss of control of the game.

Those port to shipdeck crashes were quite often with certain bigger decks and an older GPU.
 
Thanks @Pillat. The problem is somewhere in the sea_ai.dll, everything in the sea_ai folder, and happens when you log into the 3d world on your ship. It happens to me mostly when going to my ship from the dock, and on island transition. It could possibly happen when you first load a game... I think.

I don't think it depends on your ship, but something in the AI. Unfortunately, the game logs don't say, and the Event Viewer only says, "sea_ai.dll".

Hook
 
Ladies and Gentlemen, I present to you for your amusement and edification, Isla Mona, in its true size and shape.

This was plotted from the 3D map. I sailed around the island 3 times, once to plot the points to draw a general outline, a second time to adjust the outline, and a third time to add details. The southwest of the island can be adjusted a bit more, but this will show you what it actually looks like.

Happy navigating. :)

Hook
 

Attachments

  • map Isla Mona.jpg
    map Isla Mona.jpg
    333.4 KB · Views: 141
Ooo, I found a nasty bug that was suddenly causing a CTD in sea_ai.dll about every 5-10 times I loaded to sea. The problem was, it only started a day after I added the key command to toggle the navigator's log, so I couldn't be sure it wasn't my code.

After trying numerous combinations of fixes and collecting 21 compile logs and a few error and system logs, I found a condition that couldn't exist, so I went looking elsewhere in the code. I found that the flags environment was being deleted in the code to delete the rigging environment, and that was causing the crash, with no useful information in the logs. I modified the code a bit so that flags wouldn't get deleted inappropriately, and I'm testing it now. A similar problem may be causing some of the rope errors we occasionally see in the systems log, and I'll be looking for that as I test.

I think the error was usually reported in the error log, but wasn't causing a crash until something I did with the controls, possibly simply setting them to default. People won't be doing that very often.

I'll be looking at the code that writes the options file, as there's always been a bug that causes garbage characters to be appended at the end occasionally, and there may be a solution to the need to delete the options file if commands are added. No guarantees on that one, though.

There are a LOT of textures needed for Tortuga that don't exist.

The intermediate scale map is coming along nicely. It turns out that Eleuthera is almost as big as Hispaniola. You couldn't even fix that on the normal map, as it would run off the top of the map. You might as well call it Florida, and probably could with some modifications to the island model. Of course, you'd be able to sail around the north through Lake Okeechobee. :) I'll post a screen shot of the map from the game after I've sailed around the small islands from Puerto Rico to Cartagena to verify their positioning on my map.

Do we have a screen shot key?

Hook
 
@Talisman Thank you Sir!

You can always use the Print Screen key.... but it just copies the image to the clipboard. You have to open a graphics program, make a new file, and paste the clipboard into the new file, then save it. Unless you know of a better way (he says hopefully).

Hook
 
Indeed Print Screen requires copy pasting but with windowed mode enabled, that isn't so bad and this is what I normally use myself.

The F8 method does bypass that; you just have to convert TGA to JPG then.

Alternative is to get an external screenshot program like Fraps and many others.
 
You can always use the Print Screen key.... but it just copies the image to the clipboard. You have to open a graphics program, make a new file, and paste the clipboard into the new file, then save it. Unless you know of a better way (he says hopefully).
If you're using Windows 8 or Windows 10, Printscreen will save an image to "[User name]\Pictures\Screenshots" each time you press it, which is pretty convenient.
 
Well, F8 produces a black picture, and with Windows 10 I couldn't find anything anywhere in the user folder, and it wasn't in Pictures and no folders labelled Screenshots. Oh well, I can still do it the hard way.
 
Its a black picture because the alpha channel is still there :) remove it with e.g. XnView and the screenshot will appear
 
@Pillat Oh cool! I wouldn't have figured that out on my own. Need to convert it to jpg anyway, and that removes the alpha channel. Photoshop displays a normal picture, but irfanview shows it as all black. After conversion to jpg, it was fine.

Hook
 
As promised, here's the final version of the intermediate map, scale30, as displayed in your game.

I've reduced the size of the ship icon a bit so it looks less like a console game for the scale30 and open sea maps.

Hook
Scale 30 Map.jpg
 
I'm still getting sea_ai.dll crashes, and I hope to avoid that with the new version. I disassembled the sea_ai.dll code and the offending code is an intentional game crash (it runs an INT3 instruction, google INT3), probably an "assert" command in the original C code that wasn't removed for production. It's intended for use with a debugger, which I doubt we have. The assert command is often used to test out of memory errors and index out of range errors, which shouldn't happen normally, but can show up during development. At least some of the index out of range errors are handled by the run time code and produce entries in the error.log file. My best guess at this point is that it's an index out of range that wasn't caught by the run time code.

I have never in my entire career used the assert command. It's evil. At least post an error message before aborting the program.

A function is called which tests the contents of a memory location plus offset against a couple of values, and if it doesn't like the result returns a -1. When the calling code gets the -1, it simply crashes the game. If you're running a debugger, you know what happened and why. Without it, you get a CTD. It is... a bit difficult... to determine exactly what values it's testing from the disassembled code.

While I can read Intel assembly language, and even write it if I have to, it's not my favorite thing. (Motorola assembly, on the other hand, is an absolute dream!) If there are any Intel assembly gurus around, sea_ai.dll crashes at location 0X00004f87.

Hook
 
Back
Top