• 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

LarryHookins

Buccaneer
Staff member
Storm Modder
I'm making a new thread to consolidate all the fixes I've been working on.

I've already found and fixed the problem with the game crashing when you try to save a game, and ending up with a corrupted save. Pieter has that code already.

I'm adding points to the worldmap islands to help with island transitions when two islands are close together, or aren't round. This is going to take a lot of testing, and I'm manually sailing to each of the new points to make sure I've got the coordinates right... they don't show up in the sail-to list.

Note that every time you make a change to the world map, you have to run wdmInit() and SetCorrectWorldMapPosition() in the console for the changes to take effect on a saved game. New games would use the new world map, but old ones have the world map saved with the game. We may be able to automate this, running wdmInit() every time you load a game if it doesn't take too long on a slow computer.

These new points aren't necessary or even useful if you're sailing in Iron Man mode, as the islands are farther apart and do not have problems with direct sail transitions. I may look at adding a switch for the new points to remove them for Iron Man, although the player shouldn't notice any difference.

I've added code to increase (or decrease if you wish) the size of the HUD and other on-screen displays for those with high resolution monitors. This is mostly working, but needs testing on a monster resolution monitor to make sure it works for super-high resolutions. Some of the text doesn't scale, and I'm using the two default font sizes with a switch to decide which one to use, normal or small, depending on the scale selected. Currently the scale is set in globals.c but eventually a slider on the options screen would be useful.

I have JUST NOW found and hopefully fixed the problem with the ships being in the wrong place after a direct sail transition. Not only the display of your ship on the map, but the world coordinates were wrong, and you could end up in the open sea somewhere on the map with no islands around anywhere. Or off the map. I saw some nasty cases before I went looking for that code. My test cases work, but I want to test it during normal sailing.

More to come.

Hook
 
Thanks Redbeard.

Newer programmers prefer to write new code. I found that as I got some years of experience, I preferred finding and fixing bugs in other people's code. It's actually harder to do than writing new code, but it's an interesting challenge. For me, bug hunting is one of the most enjoyable parts of the game. :)

Hook
 
@LarryHookins, by the sounds of it, you are a bloody Hero! :bow

Would it be an idea to include that worldmap updating in Reinit?
Then if necessary, F11 would take care of it.
 
Using F11 is fine for the developers, but for regular players who may not know that the world map has been changed or that F11 needs to be pressed are going to run into problems. I'd prefer to have it automatic somehow. If it's a problem for those people who still run on a 286 (or whatever, I have no idea what the oldest computer PotC runs on is), then it needs to have world map versions that the code checks and runs wdmInit() as necessary. If performance isn't an issue, it could be done with every load of a save game.

Hook
 
Oh yeah. I forgot my updated historical brass compass face. That's been uploaded elsewhere in the forum and is ready to use.

Hook
 
Using F11 is fine for the developers, but for regular players who may not know that the world map has been changed or that F11 needs to be pressed are going to run into problems.
We always mention for new releases if F11 is necessary.
Reinitializing and correcting stuff for new versions is exactly its purpose, so I think the worldmap update fits right in there. :onya
 
I found a weird timing anomaly while sailing Iron Man.

The first thing I noticed was that I wasn't moving the distance I expected for real time at a given speed, but about 15% shorter, as if my indicated 7 knots was actually about 6 knots. That's an additional 135 yards at 7 knots indicated, or around 240 yards at 12 knots indicated, and this makes a difference at the distances we're sailing in Iron Man. So I did some experiments.

It turns out that limiting frame rate to 30 rather than 60 cuts the time for an hour from 4 minutes 8 seconds to 4 minutes exactly. I'd already experimented with setting the "time compression" of Normal to 1.15 and 1.1 rather than 1.0, and it helped some, but not quite enough for sailing. The major thing that using 1.1 as normal time does is make your character's running speed look normal, where at 1.0 it just looks too slow. Walking speed is a bit faster as well, a brisk walk instead of a leisurely stroll.

Sea Dogs: To Each His Own is already using something like 1.1 normal time. It's probably set somewhere in the game engine. Running in SD:TEHO looks much more normal.

I'm going to do some more experiments, but this is going to depend heavily on the player's computer speed to get it balanced.

Hook
 
Depending on computer speed? Yikes!

@Tingyun made some changes to walking speed not too long ago.
But they're not in the game version you're playing with.
 
I saw the discussion about Tingyun's changes.

I was surprised that just lowering the frame rate limiter from 60 to 30 made the game run a bit faster.

Seriously, the running speed only needs a 10% increase to look normal. With the 10% speed increase, even walking and sailing look better. It's basically like the game was set up to run at 90% of normal speed. Maybe it did on older hardware, given the problems we've got having to use frame rate limiters.

I'm happy with my speed changes so far, but I'll need to test it a bunch before releasing it for general testing. I suspect a few people won't like sword fighting with time speeded up. :)

It looks like we've run out of global variable space. I had one instance where I couldn't even change an int to a float without having the game crash on either save or load. I've already rewritten one of my functions to remove global variables, and as I work on the code I'll try to remove more if I can find any.

Hook
 
What global variable was it?

I always thought they were OK, but @Grey Roger found an example where it wasn't.
Think it was because that variable was stored in an object in the savegame or something.
 
This particular one was TIMESCALAR_SEA when I was trying to fix speed/distance/real time problems. It's an int, I wanted to make it a float. Doesn't matter as I've solved the problem another way.

In another case I couldn't add a new variable in globals.c or internalsettings. In a third case, I couldn't add a variable outside a function.
 
The ballet that is direct sail is much more graceful and elegant if the code is doing what I intended it to do when I wrote it some years ago. I've discovered a number of issues that I've been able to resolve, and have restructured the code to work different ways with open sea and normal modes. It should have worked with open sea no matter what it was doing, but there would be problems with the normal map, because the islands are just too close together. I may have been able to fix that with some new map locations on the extreme ends of the irregular shaped islands, but I'll have to leave Iron Man mode to test that, and I'm especially enjoying Iron Man.

It would be useful to know where people are having the most problems with island transitions so I can give extra attention to those areas. I suspect around Jamaica/Cuba/Hispaniola will be a problem, and I *know* the area around Isla Mona is nasty. The last transition between those two with the new locations was a lot better, but you'll still need to disable direct sail if you're trying to sail up the coast anywhere between Isla Mona and Hispaniola, and probably Mona and Puerto Rico as well.

The default "time compression" of 1.11 is working nicely. People will have to experiment to find the right balance for their computers, but that's unlikely to be a problem. Just make the default 1.0 and no one will know it's there unless you tell them.

Hook
 
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

Hook
 

Attachments

  • sea.c
    59.1 KB · Views: 204
As long as I'm uploading fixes, here's the HUD/Interface scale changes. Same game version as above.

Change the scale in globals.c to your liking. It's set to 1.5 in the file I uploaded. If you want the normal size back, change it to 1.0 to do that.

I did not add the scaling to reinit.c, not sure if it's needed there, as I've run reinit with original code without problems.

Hook
 

Attachments

  • HUD Scale.rar
    41.4 KB · Views: 156
And, so we can have them all in one place, the replacement for the historical brass compass.

Hook
 

Attachments

  • compass2.tga
    256 KB · Views: 159
  • compass2.tga.rar
    38.7 KB · Views: 140
Back
Top