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

Encounters

Kohistan

Landlubber
First idea is to put in distance to an encounter when going from world map to 3d sailing. Especially when you meet a fleet you often load right on top of them.
It annoys my realism sense and what I was thinking is that when you load an encounter from world map to 3d sailing, there should always be some distance from you to the encounter, if possible this could vary depending on stealth. This way it feels more real when you have your look-out call out a sail in world map sailing.

I don't know the exact amount, since it should be a setting which feels realistic and aren't too far away so it feels you have to sail forever to get to the battle. This also opens up for escape and chases for the enemies as well as yourself.
I would try to mod it myself, but I have no idea where to begin.

Another tweak I would love to see is that enemies that are vastly inferior to yourself, wouldnt start chasing you in world map, its just weird that when you then load up 3d sailing they dump all their cargo and then run like hell. Same goes for enemies that chase you into a friendly port. Why would they risk ship and crew just to get pounded to pieces by the cities fortifications. They should turn around if you get to port before they do...

I'm not a total newbie in terms of coding, but I have no experience with the code in CoAS, so I wouldnt know where to start with this. But I reckon there are a file that controls the load process from world map encounter to 3d sailing, which would hold some if not all of the information to make the above changes?
 
The distance should be doable, but I'm not sure where that value is in the code.
Isn't it so that if you enter 3D sailing mode near a fleet on purpose,
but still at a distance, you'll also be a distance off in 3D sailing mode?

The AI things you mention make sense of course, but I reckon we need to do that in the source code.
While we do have that and thus theoretically should be able to figure that one out,
we're still a long way off actually doing something with it.
 
The distance should be doable, but I'm not sure where that value is in the code.
Isn't it so that if you enter 3D sailing mode near a fleet on purpose,
but still at a distance, you'll also be a distance off in 3D sailing mode?

I skimmed through some of the files which should be attached to this event - and I found this in worldmap_reload.c
Code:
bool WdmAddEncountersData()
{
bool isShipEncounter = false;
//Óäàëèì âñå ñóùåñòâóþùèå çàïèñè îá ìîðñêèõ ýíêîóíòåðàõ
ReleaseMapEncounters();
//Êîëè÷åñòâî êîðàáåëüíûõ ýíêîóíòåðîâ â êàðòå
int numEncounters = wdmGetNumberShipEncounters();
//Ïîçèöèÿ èãðîêà íà êàðòå
float mpsX = MakeFloat(worldMap.playerShipX);
float mpsZ = MakeFloat(worldMap.playerShipZ);
//Ïîçèöèÿ èãðîêà â ìèðå
float wpsX = MakeFloat(wdmLoginToSea.playerGroup.x);
float wpsZ = MakeFloat(wdmLoginToSea.playerGroup.z);
//Ïåðåáèðàåì âñå ýíêîóíòåðû êàðòû
for(int i = 0; i < numEncounters; i++)
{
//Ïîëó÷èì èíôîðìàöèþ î äàííîì ýíêîóíòåðå
if(wdmSetCurrentShipData(i))
{
//Åñëè íå àêòèâåí, òî ïðîïóñòèì åãî
if(MakeInt(worldMap.encounter.select) == 0) continue;
//Äîáàâëÿåì èíôîðìàöèþ îá ìîðñêèõ ýíêîóíòåðå
string encStringID = worldMap.encounter.id;
if(encStringID == "") continue;
encStringID = "encounters." + encStringID + ".encdata";
if(CheckAttribute(&worldMap, encStringID) == 0) continue;
int mapEncSlot = FindFreeMapEncounterSlot();
if(mapEncSlot < 0) continue;
ref mapEncSlotRef = GetMapEncounterRef(mapEncSlot);
aref encDataForSlot;
makearef(encDataForSlot, worldMap.(encStringID));
CopyAttributes(mapEncSlotRef, encDataForSlot);
//Îòìå÷àåì ñâåðøåíèå êîðàáåëüíîãî ýíêîóíòåðà
isShipEncounter = true;
//Îïèñûâàåì åãî ïàðàìåòðû
string grp; grp = "group" + i;
float encX = MakeFloat(worldMap.encounter.x);
float encZ = MakeFloat(worldMap.encounter.z);
wdmLoginToSea.encounters.(grp).x = wpsX + (encX - mpsX)*WDM_MAP_ENCOUNTERS_TO_SEA_SCALE;//WDM_MAP_TO_SEA_SCALE;
wdmLoginToSea.encounters.(grp).z = wpsZ + (encZ - mpsZ)*WDM_MAP_ENCOUNTERS_TO_SEA_SCALE;//WDM_MAP_TO_SEA_SCALE;
wdmLoginToSea.encounters.(grp).ay = worldMap.encounter.ay;
wdmLoginToSea.encounters.(grp).type = mapEncSlot;
wdmLoginToSea.encounters.(grp).id = worldMap.encounter.id;
//Ïîìå÷àåì ýíêîóíòåðà íà óäàëåíèå
encStringID = worldMap.encounter.id;
encStringID = "encounters." + encStringID;
if(CheckAttribute(&worldMap, encStringID + ".quest") == 0)
{			
worldMap.(encStringID).needDelete = "Reload delete non quest encounter";
}
}
}
return isShipEncounter;
}

I'm not sure but to me, that looks like it has some relations to where you are placed in terms of an encounter.
 
See if you can find the #define for WDM_MAP_ENCOUNTERS_TO_SEA_SCALE , then increase it and see if that improves things. :onya
 
See if you can find the #define for WDM_MAP_ENCOUNTERS_TO_SEA_SCALE , then increase it and see if that improves things. :onya


This works as well:
Code:
wdmLoginToSea.encounters.(grp).x = wpsX + (encX - mpsX)*WDM_MAP_ENCOUNTERS_TO_SEA_SCALE+300;//WDM_MAP_TO_SEA_SCALE;
wdmLoginToSea.encounters.(grp).z = wpsZ + (encZ - mpsZ)*WDM_MAP_ENCOUNTERS_TO_SEA_SCALE+300;//WDM_MAP_TO_SEA_SCALE;

This will set you about half a radar distance from the encounter if you are on top of them in world map. So it's probably a bit too much, but just to give you an idea of distance.
 
Presuming that x is longitude and y is latitude, I reckon that method will put you always 300 "units" to the North and East of wherever you would otherwise end up. I do recommend doing it with the WDM_MAP_ENCOUNTERS_TO_SEA_SCALE scalar instead, though it's of course up to you to do with your game what you want. :doff
 
See if you can find the #define for WDM_MAP_ENCOUNTERS_TO_SEA_SCALE , then increase it and see if that improves things. :onya
The constants are in worldmap_globals.c
I have changed from:

#define WDM_MAP_TO_SEA_SCALE 50
#define WDM_MAP_ENCOUNTERS_TO_SEA_SCALE 25


to:

#define WDM_MAP_TO_SEA_SCALE 50
#define WDM_MAP_ENCOUNTERS_TO_SEA_SCALE 50


Now if you engage a patrol encounter at the longest distance you appear in the sea at 2000 (not sure meters???)
If you wait until the "sail on" option is not available the distance is 1000 more or less.
So efectively doubles it. But in merchant encounters the distance is shorter :shrug .
 
#define WDM_MAP_TO_SEA_SCALE 50 .... I wonder if this is how much info around playership is loaded? Im goin to play with this .
 
WDM_MAP_TO_SEA_SCALE appears to be the scale factor between the distance between you and an encounter on the worldmap and in 3D sailing mode.
 
WDM_MAP_TO_SEA_SCALE set to 90 resulted in weird things happening when going from world map to the sea and vice/versa. For instance, leaving the pirate settlement in barbados, if i am in sea mode and quicksail to one of the shores (ruin shore for instance) and go to worldmap from there, my ship is still inside the ring that wont let you out of barbados, whereas with the vanilla value, my ship would be outside that ring on the worldmap when leaving from ruin shore. I would have to sail extra far away from Ruin Shore to be able to go to world map and not be stuck in the Barbados rock ring.

I forget how this setting affected encounters.
 
If the game is putting you right on top of an encounter when you enter the 3D map from the world map, something got broken. In the vanilla game, your distance and direction on the world map as well as wind direction and speed normally come into effect when you enter the 3D zone. If you are north at the extreme of your running range from the enemy with a southern wind, you SHOULD come onto the 3D map north of the enemy a fair ways off with a southerly wind as well. (just to provide an example)

Cap'n Drow
 
I have yet to be thrown directly on the enemy in my encounters. The vanilla game method seems to be working just fine.
 
Back
Top