• 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 Ship Encounter Chances Correction

Code:
Fantom_GenerateEncounter: type = L - Corsar, # Mer = 0, Mer MAX = 0, Mer MIN = 0, # War = 8, War MAX = 1, War MIN = 1
ERROR - Force_GetShipType: unable to find ship, returning a default ship instead
ERROR - Force_GetShipType: Maxclass = 1, Minclass = 1, Per = The Spanish Main, Nat = England, Type = War
ERROR - Force_GetShipType: unable to find ship, returning a default ship instead
ERROR - Force_GetShipType: Maxclass = 1, Minclass = 1, Per = The Spanish Main, Nat = England, Type = War
ERROR - Force_GetShipType: unable to find ship, returning a default ship instead
ERROR - Force_GetShipType: Maxclass = 1, Minclass = 1, Per = The Spanish Main, Nat = England, Type = War
ERROR - Force_GetShipType: unable to find ship, returning a default ship instead
ERROR - Force_GetShipType: Maxclass = 1, Minclass = 1, Per = The Spanish Main, Nat = England, Type = War
ERROR - Force_GetShipType: unable to find ship, returning a default ship instead
ERROR - Force_GetShipType: Maxclass = 1, Minclass = 1, Per = The Spanish Main, Nat = England, Type = War
ERROR - Force_GetShipType: unable to find ship, returning a default ship instead
ERROR - Force_GetShipType: Maxclass = 1, Minclass = 1, Per = The Spanish Main, Nat = England, Type = War
ERROR - Force_GetShipType: unable to find ship, returning a default ship instead
ERROR - Force_GetShipType: Maxclass = 1, Minclass = 1, Per = The Spanish Main, Nat = England, Type = War
ERROR - Force_GetShipType: unable to find ship, returning a default ship instead
ERROR - Force_GetShipType: Maxclass = 1, Minclass = 1, Per = The Spanish Main, Nat = England, Type = War
The game trying to generate an encounter of 8 Tier 1 ships? Uh? WHY???

Also this:
Code:
Fantom_GenerateEncounter: type = L - Pirate, # Mer = 2, Mer MAX = 0, Mer MIN = 0, # War = 1, War MAX = 4, War MIN = 4
ERROR - Force_GetShipType: unable to find ship, returning a default ship instead
ERROR - Force_GetShipType: Maxclass = 3, Minclass = 3, Per = The Spanish Main, Nat = Pirate, Type = Trade
ERROR - Force_GetShipType: unable to find ship, returning a default ship instead
ERROR - Force_GetShipType: Maxclass = 3, Minclass = 3, Per = The Spanish Main, Nat = Pirate, Type = Trade
Game is asking for 2 merchant ships between tiers ZERO and ZERO? And that ends up being interpreted as being Tier 3? :modding
 
Last edited:
Eight? That's pretty good. Here is seven 1st rates.
Seven 1st rates.jpg
 
Holy crap. One day that "encounter code" really has to be looked it. I don't think it does what we want it to. :facepalm
 
Damn right it doesn't do what we want it to. I still encounter far too many pirate fleets consisting of one Kreyser and two Aurora class frigates (Colonial Powers period).
If anything, we should never have to encounter more than one of those in pirate hands at any one time, let alone three.
I'd expect a pirate fleet to consist of much smaller ships, anyway.

It's really ironic that I'm so annoyed to see my own ships so often. :facepalm
 
We might want to try setting up that Encounters init file a bit differently. Apparently what I ran into yesterday DID make sense according to the code there is.

ENCOUNTER_TYPE_LCORSAR
"heavyweights looking for another Battle at Trafalgar"
Enc_AddShips(rEnc, "War", 6, 10);
Enc_AddClasses(rEnc, -1,0, 0, 1, 1);


That is the game asking for between 6 and 10 Tier 1 ships. Shouldn't even a huge battle fleet consist of multiple tiers of ships?
And many nations and periods don't have tier 1 ships, causing our favourite error. Perhaps we should loosen up the criteria here? Allow for up to Tier 3 ships, for example?


ENCOUNTER_TYPE_LPIRATE
"PIRATES OF THE CARIBBEAN"
Enc_AddShips(rEnc, "War", 1, 3);
Enc_AddShips(rEnc, "Trade", 1, 2);
Enc_AddClasses(rEnc, -1,0, 0, maxpirate1, maxpirate3_2);


That's a bug right there. The game does ASK for 1-2 trade ships, but has Tier "0" set for them.
Plus that "maxpirate" code looks really weird to me. What should a real pirate encounter look like?


ENCOUNTER_TYPE_LMERCHANT2
"TREASURE FLEET!!! - TRANS ATLANTIC (deep ocean waters) merchants - ESCORTED by warships"
Enc_AddShips(rEnc, "Trade", 2, 4);
Enc_AddShips(rEnc, "War", 2, 6);
Enc_AddClasses(rEnc, -1,MAXMERCHANTCLASS, MAXMERCHANTCLASS, 1, 2);


Does that look like a proper setup for a Treasure Fleet?
And if it IS a Treasure Fleet, shouldn't it be a Spain-only encounter? Perhaps we can fill up its holds with gold and silver for real too.

Anyway, if someone can tell me what types of encounters we should have, I can change the coding accordingly.
We could probably limit encounters to one nation only where appropriate and perhaps disable them in certain periods too.
And loosening up the tier numbers shouldn't be a big problem, because the period/nation chance values will get to influence things properly then.
 
That is the game asking for between 6 and 10 Tier 1 ships. Shouldn't even a huge battle fleet consist of multiple tiers of ships?
And many nations and periods don't have tier 1 ships, causing our favourite error. Perhaps we should loosen up the criteria here? Allow for up to Tier 3 ships, for example?
Definitely allow for Tier 1-3 ships in that instance, both for variety and to avoid issues in earlier periods.

That's a bug right there. The game does ASK for 1-2 trade ships, but has Tier "0" set for them.
Plus that "maxpirate" code looks really weird to me. What should a real pirate encounter look like?
What I'd expect to see is either a flotilla of smaller ships (say Tiers 6-8, both war and merchant), or a single warship between Tiers 4 and 6.
That's a rough outline to work with, at least.

Does that look like a proper setup for a Treasure Fleet?
And if it IS a Treasure Fleet, shouldn't it be a Spain-only encounter? Perhaps we can fill up its holds with gold and silver for real too.
Looks good to me, but we should probably loosen up the warship Tiers to between 1 and 4. The sheer quantity of them will be difficult enough to defeat, anyway.
 
I made some slight changes to the code so that the largest minimum warship tier is 3, so those HUGE encounters will now allow Tier 1-3 ships as per your suggestion.
Did the same for all other encounters. Set all unique pirate encounters to "pirate only" and the "Treasure Fleet" to Spain only.
Not sure if that works, but we'll find out in testing soon enough.

This is a short overview of all encounters in the game:
Code:
    case ENCOUNTER_TYPE_MERCHANT0:
       encountertype = "Merchant 0: single merchant";
     break;
     case ENCOUNTER_TYPE_MERCHANT1:
       encountertype = "Merchant 1: merchants with a light escort";
     break;
     case ENCOUNTER_TYPE_MERCHANT2:
       encountertype = "Merchant 2: a single merchant with heavy escort";
     break;
     case ENCOUNTER_TYPE_PATROL:
       encountertype = "Patrol: a small patrol";
     break;
     case ENCOUNTER_TYPE_FLEET:
       encountertype = "Fleet: warships";
     break;
     case ENCOUNTER_TYPE_CORSAR:
       encountertype = "Corsar: -->PIRATE ONLY<--, warships";
     break;
     case ENCOUNTER_TYPE_PIRATE:
       encountertype = "Pirate: -->PIRATE ONLY<--, small craft";
     break;
     case ENCOUNTER_TYPE_PUNITIVE_SQUADRON:
       encountertype = "Punitive Squadron: a rag-tag bunch";
     break;
     case ENCOUNTER_TYPE_LMERCHANT0:
       encountertype = "L - Merchant 0: Shallow Waters Merchant Fleet, a group of merchants";
     break;
     case ENCOUNTER_TYPE_LMERCHANT1:
       encountertype = "L - Merchant 1: Coastal Waters Merchant Fleet, an escorted group of merchants";
     break;
     case ENCOUNTER_TYPE_LMERCHANT2:
       encountertype = "L - Merchant 2: -->SPAIN ONLY<--, Trans-Atlantic Treasure Fleet, a convoy";
     break;
     case ENCOUNTER_TYPE_LPATROL:
       encountertype = "L - Patrol: Regional Patrol, a large patrol";
     break;
     case ENCOUNTER_TYPE_LFLEET:
       encountertype = "L - Fleet: Regional Patrol, a small fleet";
     break;
     case ENCOUNTER_TYPE_LCORSAR:
       encountertype = "L - Corsar: ARMADA, a battle fleet";
     break;
     case ENCOUNTER_TYPE_LPIRATE:
       encountertype = "L - Pirate, -->PIRATE ONLY<--, a rag-tag bunch";
     break;
     case ENCOUNTER_TYPE_LPUNITIVE_SQUADRON:
       encountertype = "L - Punitive Squadron, a scratch patrol";
     break;
If anyone has any suggestions what should or should NOT be a part of them, let me know.

I'm compiling another Beta 3 WIP version now and will post that later this evening.
In this, you get a log message for each encounter, telling you what it is so that people can check if what they see in the game seems about right.

It'll also be VERY important to keep an eye out for those "cannot find appropriate ship" errors.
We still have on-screen logs for those as well. Hopefully we can get this code behaving the way we want soon and we can do away with those messages.
 
Last edited:
It would be nice to get rid of those onscreen messages. It seems the pirates are the most affected and often end up sailing yachts and such.
 
Well, I'm uploading the new edition now. Did a bit of quick testing and didn't run into anything that seemed wrong yet.
Wrong as per the code, that is. I just don't know about something being historically wrong. But that's what we've got you for! :cheers

As long as it turns out the game code is NOT broken, we should be able to sort this out properly soon. All we need is some feedback from playtesting.
The log messages will tell us where to look and the Select Storyline interface would allow us to check ship availability too. :dance
 
Sounds very good, there is solely kreyser frigates and sloops on the horizon in 2.5. Had to start a new storyline to see another ship.

BTW what happened to these music packs that once were there to replace the "Standard" ? Why are they not anywhere to be seen anymore ?
 
Sounds very good, there is solely kreyser frigates and sloops on the horizon in 2.5. Had to start a new storyline to see another ship.
If you run into stuff that seems wrong like that to you again, please post your compile.log . We'll try to sort it out properly this time. :doff

BTW what happened to these music packs that once were there to replace the "Standard" ? Why are they not anywhere to be seen anymore ?
They are additional downloads and not included by default. They'll need their code files rewritten though since the system was changed and they're VERY out-of-date too.
So they will require a fair bit of work before you'll see them again. Have to fix and finish other stuff first, unless somebody else wants to do it.
 
It seems in Napoleonic, there really aren't many larger ships available to Holland, resulting in encounters consisting of many the same-type ships like this one:
Code:
Fantom_GenerateEncounter: type = L - Punitive Squadron, a scratch patrol, # Mer = 0, Mer MAX = 0, Mer MIN = 0, # War = 5, War MAX = 1, War MIN = 4
Force_GetShipType: Maxclass = 1, Minclass = 4, Per = Napoleonic, Nat = Holland, Type = War, Loop = 0, Ship ID = RN_Surprise
Force_GetShipType: Maxclass = 1, Minclass = 4, Per = Napoleonic, Nat = Holland, Type = War, Loop = 1, Ship ID = NL_Essex
Force_GetShipType: Maxclass = 1, Minclass = 4, Per = Napoleonic, Nat = Holland, Type = War, Loop = 0, Ship ID = RN_Surprise
Force_GetShipType: Maxclass = 1, Minclass = 4, Per = Napoleonic, Nat = Holland, Type = War, Loop = 1, Ship ID = NL_Essex
Force_GetShipType: Maxclass = 1, Minclass = 4, Per = Napoleonic, Nat = Holland, Type = War, Loop = 1, Ship ID = RN_Surprise
Perhaps in such instances we should just disable those encounters with large ships altogether?
So.... which encounter types should be disabled for what nations in what time periods?
 
well I know the old and new music-code so I can merge the old music-addons .. Can do that together with fixing my own addon ;)
 
Perhaps in such instances we should just disable those encounters with large ships altogether?
So.... which encounter types should be disabled for what nations in what time periods?
Disabling them will probably be fine. I would assume the same applies to Portugal in various periods?
 
well I know the old and new music-code so I can merge the old music-addons .. Can do that together with fixing my own addon ;)
If you'd want to do that, it'd be very welcome. Then at least we can back to having all that operational again.
Would be useful also to have them all in the same order. Plus have missing entries added from the standard pack to prevent silence.

Disabling them will probably be fine. I would assume the same applies to Portugal in various periods?
Probably, yes. Just need to know what needs disabling when and I should be able to sort out some coding for that.
 
Extract attached to your main game folder to have all larger encounters disabled for Holland and Portugal in Early Explorers and Napoleonic.
Be sure to report if you run into any other encounters that don't seem right and/or are not varied enough.
 
Got it; will try to test it to some extent and let you know if anything isn't right.
 
Does anyone have any comments on this yet? Even a simple "seems OK in this time period" would be useful.
At least that would give us an idea of what is NOT still messed up. :rolleyes:
 
Back
Top