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

FINALY!--- How to reduce enemy attacks

JohnHamm

Landlubber
Storm Modder
I have forever had the complaint that I couldn't move hardly without having 3-5 pirate ships nipping at my sails constantly, I have posted more than once in here about it. (Mostly just venting) but to this point i have not seen a solution.
However I believe the time has finally come.... I found it by mistake of course while trying to change the amount of time that passes while on the world map to a more realistic level...

at any rate... C:\Age of Pirates 2\Program\WorldMap\ worldmap_init.c

about 3/4 of the way down there is this


worldMap.shipSpeedOppositeWind = 0.3;
worldMap.shipSpeedOverWind = 0.8;

//Player ship
worldMap.playerShipActionRadius = 20.0;
worldMap.playerShipX = -1000.0;
worldMap.playerShipZ = -300.0;
worldMap.playerShipAy = 0.0;
//Camera
worldMap.wdmCameraAY = 10.0; //Óãîë ïîâîðîòà êàìåðû
worldMap.wdmCameraY = 130.0; //Âûñîòà êàìåðû
worldMap.wdmCameraRotLock = 1; //Çàáëîêèðîâàòü âðàùåíèå êàìåðû
//Enemy ship
worldMap.enemyshipViewDistMin = 60.0; //Ðàñòîÿíèå íà êîòîðîì êîðàáëü íà÷èíàåò èñ÷åçàòü
worldMap.enemyshipViewDistMax = 120.0; //Ðàñòîÿíèå íà êîòîðîì êîðàáëü èñ÷åçàåò ïîëíîñòüþ
worldMap.enemyshipDistKill = 3000; // homo 07/10/06
//worldMap.enemyshipDistKill = 150.0; //Ðàññòîÿíèå íà êîòîðîì óáèâàåì êîðàáëü
worldMap.enemyshipBrnDistMin = 80.0; //Ìèíèìàëüíîå ðàñòîÿíèå íà êîòîðîì ðîæàåòñÿ êîðàáëü
worldMap.enemyshipBrnDistMax = 130.0; //Ìàêñèìàëüíîå ðàñòîÿíèå íà êîòîðîì ðîæàåòñÿ êîðàáëü
//storm
worldMap.stormViewDistMin = 90.0; //Ðàñòîÿíèå íà êîòîðîì øòîðì íà÷èíàåò èñ÷åçàòü
worldMap.stormViewDistMax = 180.0; //Ðàñòîÿíèå íà êîòîðîì øòîðì èñ÷åçàåò ïîëíîñòüþ
worldMap.stormDistKill = 190.0; //Ðàññòîÿíèå íà êîòîðîì óáèâàåì øòîðì
worldMap.stormBrnDistMin = 100.0; //Ìèíèìàëüíîå ðàñòîÿíèå íà êîòîðîì ðîæàåòñÿ øòîðì
worldMap.stormBrnDistMax = 140.0; //Ìàêñèìàëüíîå ðàñòîÿíèå íà êîòîðîì ðîæàåòñÿ øòîðì
worldMap.stormZone = 90.0;// 120 //Îáùèé ðàäèóñ äåéñòâèÿ øòîðìà

The line marked in red is your friend

I reduced mine to 150 at first and I saw no ships anywhere on the map no matter how far I traveled, and no matter how long i stayed at sea. so I changed it to 1500 and now i see both friendly and enemy ships
(more friendly) but the amount of pirates and enemy nations had been reduced by what seems more than half. Now I don't think this actually reduces the amount of ships on the map after all the line is
worldMap.enemyshipDistKill Hence the partial word in there of "distkill" which I feel certain means the distance you are at that makes them want to kill you... But rather it reduces the area they they will see and move to attack you from
or rather it reduces the amount of ships it still makes it more realistic in my opinion... as far as how often you actually encounter an enemy. and if you add in the change for how fast the day goes by (making it slower) so that you travel\
a realistic distance in a realistic amount of time it really changes the feel of the game.
 
Interesting, nice find mate! I'm sure someone with far better skills than I will put that info to good use! :onya

Personally, I never had much of a problem with the frequency of encounters. Though it can be a bit annoying if you are limping to port for repairs after several major battles. The sea always looking like you were sailing around Cape Horn in a fog bank in the middle of the Caribbean always bothered me a bit though. :?
 
I have forever had the complaint that I couldn't move hardly without having 3-5 pirate ships nipping at my sails constantly, I have posted more than once in here about it. (Mostly just venting) but to this point i have not seen a solution.
However I believe the time has finally come.... I found it by mistake of course while trying to change the amount of time that passes while on the world map to a more realistic level...

at any rate... C:\Age of Pirates 2\Program\WorldMap\ worldmap_init.c

about 3/4 of the way down there is this


worldMap.shipSpeedOppositeWind = 0.3;
worldMap.shipSpeedOverWind = 0.8;

//Player ship
worldMap.playerShipActionRadius = 20.0;
worldMap.playerShipX = -1000.0;
worldMap.playerShipZ = -300.0;
worldMap.playerShipAy = 0.0;
//Camera
worldMap.wdmCameraAY = 10.0; //Óãîë ïîâîðîòà êàìåðû
worldMap.wdmCameraY = 130.0; //Âûñîòà êàìåðû
worldMap.wdmCameraRotLock = 1; //Çàáëîêèðîâàòü âðàùåíèå êàìåðû
//Enemy ship
worldMap.enemyshipViewDistMin = 60.0; //Ðàñòîÿíèå íà êîòîðîì êîðàáëü íà÷èíàåò èñ÷åçàòü
worldMap.enemyshipViewDistMax = 120.0; //Ðàñòîÿíèå íà êîòîðîì êîðàáëü èñ÷åçàåò ïîëíîñòüþ
worldMap.enemyshipDistKill = 3000; // homo 07/10/06
//worldMap.enemyshipDistKill = 150.0; //Ðàññòîÿíèå íà êîòîðîì óáèâàåì êîðàáëü
worldMap.enemyshipBrnDistMin = 80.0; //Ìèíèìàëüíîå ðàñòîÿíèå íà êîòîðîì ðîæàåòñÿ êîðàáëü
worldMap.enemyshipBrnDistMax = 130.0; //Ìàêñèìàëüíîå ðàñòîÿíèå íà êîòîðîì ðîæàåòñÿ êîðàáëü
//storm
worldMap.stormViewDistMin = 90.0; //Ðàñòîÿíèå íà êîòîðîì øòîðì íà÷èíàåò èñ÷åçàòü
worldMap.stormViewDistMax = 180.0; //Ðàñòîÿíèå íà êîòîðîì øòîðì èñ÷åçàåò ïîëíîñòüþ
worldMap.stormDistKill = 190.0; //Ðàññòîÿíèå íà êîòîðîì óáèâàåì øòîðì
worldMap.stormBrnDistMin = 100.0; //Ìèíèìàëüíîå ðàñòîÿíèå íà êîòîðîì ðîæàåòñÿ øòîðì
worldMap.stormBrnDistMax = 140.0; //Ìàêñèìàëüíîå ðàñòîÿíèå íà êîòîðîì ðîæàåòñÿ øòîðì
worldMap.stormZone = 90.0;// 120 //Îáùèé ðàäèóñ äåéñòâèÿ øòîðìà

The line marked in red is your friend

I reduced mine to 150 at first and I saw no ships anywhere on the map no matter how far I traveled, and no matter how long i stayed at sea. so I changed it to 1500 and now i see both friendly and enemy ships
(more friendly) but the amount of pirates and enemy nations had been reduced by what seems more than half. Now I don't think this actually reduces the amount of ships on the map after all the line is
worldMap.enemyshipDistKill Hence the partial word in there of "distkill" which I feel certain means the distance you are at that makes them want to kill you... But rather it reduces the area they they will see and move to attack you from
or rather it reduces the amount of ships it still makes it more realistic in my opinion... as far as how often you actually encounter an enemy. and if you add in the change for how fast the day goes by (making it slower) so that you travel\
a realistic distance in a realistic amount of time it really changes the feel of the game.


NOW I found the actual setting that initiate encounter and not the one that just causes them to attack from certain distances. The above does work some what but. This is the real deal

found in C:\Age of Pirates 2\Program\WorldMap\ worldmap_encgen.c

conveniently located at the very top is
/×àñòîòà øòîðìîâ â ñåêóíäó
#define WDM_STORM_RATE 0.0001
//×àñòîòà òîðãîâöåâ â ñåêóíäó
#define WDM_MERCHANTS_RATE 0.09
//×àñòîòà âîþèùèõ êîðàáëåé â ñåêóíäó
#define WDM_WARRING_RATE 0.015
//×àñòîòà íàïàäàþùèõ êîðàáëåé â ñåêóíäó
#define WDM_FOLLOW_RATE 0.025

I tested this by making them 0 and went back and forth across the map for about 8 minutes real time and so absolutely no one I then reloaded the same save, with the original values and took the same route and had an encounter in seconds.
the top values you can do the same thing with except the top values only hide hide you from their view, but they are still there.

another good thing is that you do not have to restart a new game!
 
NOW I found the actual setting that initiate encounter and not the one that just causes them to attack from certain distances

Ty for the info. Started some tests as adventurer, pirate nation, combined mod, encounters few.
I have tested these numbers:

#define WDM_STORM_RATE 0.0001

#define WDM_MERCHANTS_RATE 0.09

#define WDM_WARRING_RATE 0.015

#define WDM_FOLLOW_RATE 0.015

Then :

#define WDM_STORM_RATE 0.0001

#define WDM_MERCHANTS_RATE 0.09

#define WDM_WARRING_RATE 0.005

#define WDM_FOLLOW_RATE 0.005


Result: Most encounters merchants as expected (9 in every ten). A few pirates, even less battle encounters (don't know why). Overall i'd say it's more realistic, sometimes the map is almost empty, sometimes there are 3-4 sails around you.

I wish i could mod the way encounter nation is selected, so a dutch patrol would be generated near dutch colonies and merchant traffic would be greater near ports.
 
Dont really need a modfile, just open that file up and edit in the new values. I havent seen much of a difference, but i havent played in like a year either so........
 
void wdmShipEncounter(float dltTime, float playerShipX, float playerShipZ, float playerShipAY)
{
int numShips = wdmGetNumberShipEncounters();
if( CheckAttribute(pchar,"worldmap.shipcounter") ) {
numShips = numShips - sti(pchar.worldmap.shipcounter);
}
if( numShips < 0 )
{
trace("Warning! World map ship quantity < 0 : numShips = " + numShips);
trace("pchar.worldmap.shipcounter = " + pchar.worldmap.shipcounter);
numShips = 0;
}
if(numShips < 8)
{
//Âåðîÿòíîñòè ïîÿâëåíèÿ
wdmTimeOfLastMerchant = wdmTimeOfLastMerchant + dltTime*WDM_MERCHANTS_RATE*1000.0*iEncountersRate;
wdmTimeOfLastWarring = wdmTimeOfLastWarring + dltTime*WDM_WARRING_RATE*1000.0*iEncountersRate;
wdmTimeOfLastFollow = wdmTimeOfLastFollow + dltTime*WDM_FOLLOW_RATE*1000.0*iEncountersRate;
//Âåðîÿòíîñòü îò êîëè÷åñòâà ñîçäàííûõ
float nump = 1.0 - numShips*0.15;
//Âûáèðàåì
if(rand(1001) + 1 < wdmTimeOfLastMerchant)
{
wdmTimeOfLastMerchant = 0.0;
wdmCreateMerchantShip(0.8 + rand(10)*0.03);
}
else
{
bool encoff = false;
if(CheckAttribute(pchar,"worldmapencountersoff") == 1)
{
encoff = sti(pchar.worldmapencountersoff);
}
if(encoff == false)
{
if(rand(1001) + 1 < wdmTimeOfLastWarring)
{
wdmTimeOfLastWarring = 0.0;
wdmCreateWarringShips();
}
else
{
if(rand(1001) + 1 < wdmTimeOfLastFollow)
{
wdmTimeOfLastFollow = 0.0;
if(!IsStopMapFollowEncounters())
{
wdmCreateFollowShip(0.8 + rand(10)*0.05);
}
}
}
}
}
}
else
{
wdmTimeOfLastMerchant = 0.0;
wdmTimeOfLastWarring = 0.0;
wdmTimeOfLastFollow = 0.0;
}
}

This code in worldmap_encgen.c checks if there are less than 8 encounters created (numShips). If so, it adds a quantity to the time since last encounter of any given type was created. Then if any of them is greater than random number 1-1000 a new encounter of that type is created. The time quantity added is multiplied by several factors like encounters rate (the option you select at game start) and the rate defined in worldmap_globals.c. So the larger those numbers the higher the frequency of their encounter types creation. WARRING must be sea battles encounters, and FOLLOW must be chasers. (This is my interpretation, i could be wrong, note: the emoticon is the eight number)

I played this game a year ago and i remember it was a nightmare when i was chased non stop by punitive squadrons, pirates, patrols and everything. This time i haven't played too much but with several changes like this my game experience has been better.
 
this annoyed me untill i just cheated my character to start with each nation flag. Now it isnt an issue unless bounty hunters or gentleman of luck chase me, which is rare. I think having a high stealth reduces chasers/followers as well.
 
Back
Top