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

Included in Build 3D Sailing Mode: Reduce Range for Ships Chasing Each Other

I can guarantee that if you think "2" is too short, "3" will be even worse! Try "1" instead. Here's why.
Good catch! That indeed works the exact opposite of what I had in mind.
Thank you very much. :cheers

Crikey! Which idiot dreamed up that system? Not only is it counter intuitive but the levels are out of balance.
Not sure if we should want to change those numbers right now.
The effect when spyglasses and Sail-To menus start providing certain information.
At some point I made a post detailing what the numbers mean, but I cannot seem to find it now.

As the simplest solutions and the least likely to cause brand new unforeseen bugs, @Grey Roger's suggestion sounds like the best idea to me.
Change the number to "1" instead of what is currently there and leave "sea.c" as it already was.

I DO remember that "2" should be the range where the Sail-To and spyglass should tell you the nation of ships in the area.
Do you get that in Realistic Game Mode? If so, can you confirm that indeed happens "too late"?
If so, then perhaps those numbers should indeed be increased.

Just don't swap the order of those ranges for now. ;)
 
Crikey! Which idiot dreamed up that system? Not only is it counter intuitive but the levels are out of balance.

It should be something like:

1: 500

2: 1000

3: 2000

4: 3000

I'm going to change mine to look like that.

"find" didn't find it but a manual search did. :rumgone
Suggestion: don't change the order as the specific cases probably relate to different spyglasses or to ranges at which specific information becomes available, as @Pieter Boelen said. Note that at present range 3000 corresponds to "4", "0", or anything else other than "1", "2" and "3". You would probably get the effect you're looking for by setting them like this:

1: 2000.0
2: 1000.0
3: 500.0
Everything else: 3000.0

Otherwise I suspect you may end up with a cheap spyglass giving longer visibility range than a masterwork spyglass, or being able to see the other ship's crew morale before you can identify its flag. xD
 
That sounds about right, @Grey Roger!

To proceed with this, I'd like to propose the following:

1. FIRST check if the current numbers seem right or wrong; you can do this by checking the information Sail-To/Spyglass give you on ships at various ranges.
For example, if your "equipment" doesn't tell you the nation of a ship, while you personally can easily tell from the flags, then probably "range 2" is too low.

2. Assuming those numbers are NOT right, experiment with those values in sea.c but keep their order the same as they are now.

3. FINALLY test again with the Screwface_functions.c number at "2" (again; like it is since 10 Jan) and observe the AI behaviour of ships in relation to each other and to yourself.
If they still ignore you when you don't think they should, increase that visibility range value to "1" as Grey Roger suggested.

I think that is probably the best way to do it. And I'd certainly like to see all those numbers corrected so that they "seem right".

@Hylie Pistof: Would you be interested in experimenting with this?
 
Ah, so that is why the numbers are oddly set.

I can tinker with it but it will take time. Also, I never use the masterworks spyglass as it is too powerful and I can't see anything with it. So anything I test will be with the good one. I forget its name.
 
Now that I'm at home, I can provide some more details:

There are two functions:

- GetVisibilityRange has those distance values that @Grey Roger shows.
Those numbers get REDUCED based on how foggy it is and again get halved at night.

- GetCharVisibilityRange takes that number and INCREASES it based on character Leadership and Sailing skill.


Then the following game functionality uses these functions:

Within range(3), close range:
- Get "Fire reached magazine" on-screen messages for ships in the area
- Get "Ship Sunk" on-screen messages for ships in the area
- Get "hurrah" sound on any mast falling
- Spyglass shows ship name

Within range(2), medium range:
- Get the "ship has struck her colours" log messages
- Sail-To Menu shows nation flag for ships
- Spyglass shows ship nation
- CHAR - AI ships can find ships as valid targets
- CHAR - AI ships can recognize false flags

Within range(1), large range:
- Spyglass shows ship type
- Sail-To Menu shows ship type icon

Outside range(1), maximum range:
- No information available

The "CHAR" texts there indicate which ones are affected by "captain skills". As you can see, not a whole lot of them.
So I think that should definitely be added, because better skills should mean better visible range.


You can use Trick #3 from here to find all relevant instances: Tutorial - Modding Tips & Tricks | PiratesAhoy!
It isn't all that many, so may be relatively doable for any of you guys to have a look at.


I'm not 100% convinced all this code actually uses the order it is meant to.
The spyglass code for example appears reversed, which would confuse matters something terrible.
But maybe that is just my tired mind talking. :confused:

Anyway, it would for sure be good if somebody were to have a good look at this and make sure it makes internal sense.
If this works well, it really helps the game. But if it doesn't work well, it messes things up quite a bit. :facepalm

Also, I never use the masterworks spyglass as it is too powerful and I can't see anything with it. So anything I test will be with the good one. I forget its name.
You don't actually need to look through it. You can also just refer to what you can see using the Sail-To menu.
 
So far using the numbers suggested by Grey Rodger and (2) it seems hostile ships notice me around 2000 yards in the day. My sailing and leadership are currently (7). This is fine for me and is close to what I'm used to.
 
Numbers as suggested by @Grey Roger now included in my game for testing on the next update.
I'll keep the "range(2)" in Screwface_functions.c for now then and we'll see what happens.

I'd appreciate if somebody could check the logic of this code though:
Code:
     distance = Ship_GetDistance2D(mchref, chref);
     if (distance < GetVisibilityRange(3)) {
       if (distance >= GetVisibilityRange(2)) {
         SendMessage(&objISpyGlass,"lsslllflll",MSG_ISG_UPDATE, "", shipType, -1, -1, -1, -1.0, -1, -1, -1);
       } else {
         if (distance >= GetVisibilityRange(1)) {
           SendMessage(&objISpyGlass,"lsslllflll",MSG_ISG_UPDATE, "", shipType, -1, -1, -1, -1.0, -1, -1, shipNation);
         } else {
           SendMessage(&objISpyGlass,"lsslllflll",MSG_ISG_UPDATE, shipName, shipType, -1, -1, -1, -1.0, -1, -1, shipNation);
         }
       }
       SendMessage(&objISpyGlass,"ll",MSG_ISG_VISIBLE, true);
     }
I'm not 100% convinced it works the right away around.

Once that is checked, I'll probably change those function calls to check character skills too.
 
Code:
if (distance < GetVisibilityRange(3))
{ if (distance >= GetVisibilityRange(2))
That's wrong, for a start. With the values as they are now, or with the revised values suggested by @Hylie Pistof and re-arranged by me, 'GetVisibilityRange(3)' will return a lower value than 'GetVisibilityRange(2)'. So if 'distance' passes the first condition then it has to fail the second - it can't simultaneously be less than 500.0 and greater than or equal to 1000.0!

If the range brackets are used correctly anywhere else then that code probably needs the "1" and "3" swapped round.

I'm not entirely sure why "Sailing" and "Leadership" skills ought to apply here. Perhaps "Sailing" can help identify the exact type, but knowing how to set sails or command men is irrelevant to the others. Personally I don't know one sail from another and can barely lead a tame puppy but even I can probably read a ship's name and tell you the nationality of its flag at about the same range as Admiral Nelson.
 
Thanks for confirming my suspicion that they are swapped. I'll change them around.

The use of skills in there must have been Pirates KK's idea. At the moment that goes virtually unused, so I figure either it should be used more or be removed altogether.

I can tell you from experience that experience does play a notable role in being able to spot things at greater distances.
It can be quite hard to tell a ship from the horizon at maximum range for example, but you get better at that as you keep doing it.
 
All sorts of corrections to visibility ranges now included in the ZIP here:
Mod Release - Build 14 Beta 4 Internal WIP For Testing | PiratesAhoy!

@Grey Roger: If you could use WinMerge on that archive to double-check what I did, I'd definitely appreciate it.
As far as I can tell, a lot of it never made much sense, tended to work reversed and therefore never served its purpose.
Hopefully that has been corrected properly now.
 
The modified ranges have been in the mod for three weeks now.
Who has been playing recently? Did you notice any ships NOT chasing each other when they probably should have been?

Additionally, if you use Realistic Game Mode, have you noticed more Spyglass/Sail-To Menu information showing up as ships get closer?
 
Somebody (everybody!) please enlighten me if ships at sea appear to be behaving themselves reasonably now.
Maybe no comments means everything is good now, but I much prefer positive feedback over being forced to assume stuff due to deafening silence.
 
I have watched some sea battles and they seemed to proceed normally. I actually participated in one large one with ships all over the place and they behaved well.
POTC4_2016_03_20_08_04_11_938.jpg
 
I have watched some sea battles and they seemed to proceed normally. I actually participated in one large one with ships all over the place and they behaved well.
Then I think our combined efforts on this have paid off! Good to hear indeed.

Plus in the end, it now DOES use the number that I proposed. With the increased ranges suggested by @Grey Roger.
So that makes internal sense now too. :woot
 
Oh! I had forgotten about that but have noticed that hostile ships don't seem to be concerned about me until I start getting close to cannon range.
 
Oh! I had forgotten about that but have noticed that hostile ships don't seem to be concerned about me until I start getting close to cannon range.
Should be the range at which you can tell their nation using the spyglass.
Does that seem about right to you?
 
Ya, I'm happy with the way it works. It really sucked to see fleets of warships coming around from the back side of an island to attack me.
 
It really sucked to see fleets of warships coming around from the back side of an island to attack me.
That was indeed pretty much why I wanted to change it. ;)
Except at the time they were doing it to NPC ships, but it would have affected the player as well.
It seemed a bit over-the-top to me. :cheeky
 
Back
Top