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

Fixed Governor Ship Hunting: Target Ships Too Small

Wolve

Sailor
I was wondering...is it possible to make the tiers of the ships that appear for the Shiphunting quests more equal to your own ships? Tier 8/7 is fine as a start, but there is no challenge anymore when you get tier 5+ ships.
For me it would also make more sense if the enemy ships of great nations were of a higher tier, who would send one lonely sloop to harass an enemy island? Also, maybe it would be nice to have the reputation gain to be linked to the challenge? More difficult ship downed gives a bigger boost to your rep.
Just my thoughts on this :)
 
I was wondering...is it possible to make the tiers of the ships that appear for the Shiphunting quests more equal to your own ships? Tier 8/7 is fine as a start, but there is no challenge anymore when you get tier 5+ ships.
It is linked to the level of the player character and adjusted by the difficulty level.
The way it works:
1. Enemy level is determined with this formula:
Code:
   //PB: Generate Rank and Skills
   pRank = sti(PChar.rank);
   if(GetShipCap()) { if((8-GetCharacterShipClass(PChar)) * 2 < pRank) { pRank = (8-GetCharacterShipClass(PChar)) * 2; } } // NK
   irank = makeint((pRank/2.0 + Rand(pRank/2)) * (2.0/3.0 + ((makefloat(GetDifficulty())-1.0)/5.0)) + 0.5);
   if(irank < 1) irank = 1;
2. Character skills are initialized by the Levelling system:
Code:
   rFantom.rank = irank;
   InitCharacterSkills(rFantom);
3. The Tier of the ship is then determined from the captain's Sailing and Leadership skills in the same way that applies to the player in Realistic Game Mode:
Code:
   int maxclass, minclass;
   maxclass = GetShipMinClassForSkills(sti(rFantom.skill.Leadership), sti(rFantom.skill.Sailing));   // PB: Same limit as for player
   if(sti(rFantom.nation) == PIRATE  && maxclass < MAXPIRATECLASS)       maxclass = MAXPIRATECLASS;     // KK
   if(HasSubStr(character_id,"Coastal_Captain") && maxclass < MAXCOASTGUARDCLASS)     maxclass = MAXCOASTGUARDCLASS;   // PB
   if(GetCurrentPeriod() <= PERIOD_EARLY_EXPLORERS || GetCurrentPeriod() >= PERIOD_NAPOLEONIC)
   {
     if(sti(rFantom.nation) == HOLLAND  && maxclass < 3)             maxclass = 3;
     if(sti(rFantom.nation) == PORTUGAL  && maxclass < 3)             maxclass = 3;
   }

   minclass =       maxclass + 2;
   if(minclass > 8)   minclass = 8;

   iShipType = Force_GetShipType(maxclass, minclass, "War", sti(rFantom.nation)); // PS
   GiveShip2Character(rFantom, GetShipID(iShipType), "Ship Name", -1, sti(rFantom.nation), true, true); // PB: Generic Function
All the relevant code for this is near the top of PROGRAM\QUESTS\quests_common.c in the GenerateQuestShip function.

Are you saying that even with a really high character level, you're still only seeing tiny tubs in those quests? If so, please try increasing the difficulty level.
If the problem persists, then I suspect that the Levelling system is doing a crappy job at initializing the captain's skills (see step #2).
That will get sorted though once we get to doing this rewrite: Planned Feature - Use Generic Captain and Ship Generation Functions | PiratesAhoy!

Also, maybe it would be nice to have the reputation gain to be linked to the challenge? More difficult ship downed gives a bigger boost to your rep.
Are you talking about REPUTATION or RELATION points? Should be relation points you get.
These points are calculated the same for all ships and depend mainly on ship size.
So indeed if you have to battle a bigger ship, you'll get more points. That is already in place. :yes

This is the relevant code from PROGRAM\DIALOGS\governor.c:
Code:
       // PB: Add relation points -->
       float points  = stf(GetAttribute(CharacterFromID("Quest pirate"), "Points"));
       if (points < 1.0) points = 1.0;
       ChangeRMRelation(pchar, iNation, points);
       AttackRMRelation(pchar, sti(pchar.quest.generate_kill_quest.nation) );
       // PB: Add relation points <--
 
Yes sorry, I meant relation points :) (sorry, kinda used to the MMORPG system :p).
Right :) no I havent reached taht high of a level (20 atm), but I was kinda used to the original system where everyone would sail in equal tiered/higher tiered ships :p

Thanks for the reply though! Time to increase difficulty and grind a bit faster =D
 
Reputation also exists in the game. That is just something different. ;)

That original system can still be enabled through the in game options menu.
I don't know for sure if it still works though, because I don't think anyone has cared to use it in the past many years.
But you can try if you prefer it like that.
 
Nah this system is fine :) One question though, how fast should those ships of the shiphunter quests get a higher tier? I'm missing too many variables to determine that from those pieces of code :p
Currently I'm lvl 20 with 5 sailing and 6 leadership (both 9 with item buffs, but I figure the buff doesnt count for the calculations) and I have a tier 5 ship. I put the difficulty on Sea Dog but still the Governor gives met quests to battle tier 7 ships. I'd expect some higher tier with the higher difficulty....or should I level even more first?
 
What you could do is to use the Cheatmode to level yourself up to something stupidly high, such as level 50 or something.
Then try to take one of those quests again. If you then still get a Tier 7/8 ship, then definitely something is going wrong.
And if that is indeed the case, I've got a fairly good idea WHERE it goes wrong as well.

In the meantime: @ANSEL, @Jason, @Hylie Pistof or @Grey Roger, have you tried any Governor Ship Hunting quests as well?
Did you observe the same effect of only ever getting really tiny tubs to battle against?
 
I cheated my character to lvl 50, walked to the governor and still vs a Ketch. Sailed to a different island to get the quest there, request to sink a sloop.
 
I hope some other people can share their experiences on this one as well.
This could very well be a real bug and, if so, I may know where it goes wrong too.

Tonight I can probably give you some extra debug code so we can double-check my suspicions.
 
Yes! I think the ships in Governors quest tend to be to small, its very seldom I have to fight a big one,
but it happens some of the times.
 
Yes! I think the ships in Governors quest tend to be to small, its very seldom I have to fight a big one,
but it happens some of the times.
Thanks. In that case, I'll call this "Confirmed". I'll see if I can figure out what to do about it, though I cannot guarantee when that will be.
For now I am being kept occupied with all sorts of other things (decidedly NOT modding!).
 
I had a critical look through the relevant code related to this, but cannot see it obviously being wrong.
My original suspicion actually does not seem to apply.

@Wolve: After a "too tiny" boat has been generated, please execute this line through console:
Code:
DumpAttributes(CharacterFromID("Quest pirate"));
Then upload your compile.log; that should tell us the exact stats for the enemy captain and hopefully give us more information of what happens here.

You could also set all these toggles to 2 at the top of PROGRAM\Characters\Leveling.c:
Code:
#define DEBUG_EXPERIENCE   0           //(int) on 0 no messages are given. on 1 only error, on 2 everything is given.
#define DEBUG_POSTINIT     0           //(int) on 0 no messages are given. on 1 only error, on 2 everything is given.
#define DEBUG_NOAUTOLEVEL   0           //(int) on 0 no messages are given. on 1 only error, on 2 everything is given.
#define DEBUG_PERKSELECT   0           //(int) on 0 no messages are given. on 1 only error, on 2 everything is given.
#define DEBUG_OFFICERPRICE   0           //(int) on 0 no messages are given. on 1 only error, on 2 everything is given.

Because this is going to generate a LOT of data in compile.log, I recommend doing this:
1. Make a savegame standing in front of the governor
2. Close the game
3. Start the game and load that save
4. Execute console using F12
5. Wait 30 seconds or so, then close the game again
6. Post compile.log here
 
Here ya go. If you need more help just let me know :)
That does indeed explain it:
Code:
quest = True
  meeting = 0
  officertype = navy captain
  officerprice = 1413
rank = 19
reputation = 25
experience = 436353
  leadership = 0
  fencing = 0
  sailing = 0
  accuracy = 0
  cannons = 0
  grappling = 0
  repair = 0
  defence = 0
  commerce = 0
  sneak = 0
skill =
  freeskill = 0
  leadership = 1
  charmod = 0
  importance = 380
  bonus = 1.0000000
  modifier = 0
  party = 1
  ship = 1
  shipclass = 7
  fleetsize = 1
  fencing = 1
  charmod = 0
  importance = 375
  bonus = 1.0000000
  sailing = 1
  charmod = 0
  importance = 249
  bonus = 1.0000000
  accuracy = 1
  charmod = 0
  importance = 267
  bonus = 1.0000000
  cannons = 1
  charmod = 0
  importance = 277
  bonus = 1.0000000
  grappling = 1
  charmod = 0
  importance = 15
  bonus = 1.0000000
  repair = 1
  charmod = 0
  importance = 9
  bonus = 1.0000000
  defence = 1
  charmod = 0
  importance = 142
  bonus = 1.0000000
  commerce = 1
  charmod = 0
  importance = 9
  bonus = 1.0000000
  sneak = 1
  charmod = 0
  importance = 259
  bonus = 1.0000000

The captain does get the intended rank and officer type, but does NOT get the skills.
If all his skills are only 1, then indeed he cannot command anything bigger than a bathtub.

Clearly some code functionality that is meant to occur does not happen. Or it does, but too late.
 
Dammit, this is a NASTY one. I managed to make a "fix" so that the guy DOES get initialized.
But probably still TOO LATE!
 
@Wolve: Extract attached to your main game folder and see if that makes a difference.

I added some extra "override" code so that I can force a character's skills to be determined RIGHT NOW.
What happened is that the skills were "leisurely added at a later time".

In this case that threw all the subsequent logic out of whack,
because then the captain got his skills assigned AFTER the game checked how good he was to determine the size of his command.

What happened:
1. Character is created with Leadership and Sailing at 1
2. Game is told to initialize the skills
3. Game checked the skills to determine the biggest ship this captain can command (values still at 1)
4. Game actually gives the captain his skills, which is TOO LATE because he already needed to have them at the previous step!
 

Attachments

  • QuestCaptainFix.zip
    54.2 KB · Views: 70
I tried the file above. It almost dont make a difference, but now I get very tiny ships to fight.
 

Attachments

  • compile.log
    29.7 KB · Views: 84
It almost dont make a difference, but now I get very tiny ships to fight.
It can't possibly be worse than it was.
And this actually looks better than it did:
Code:
Force_GetShipType: Maxclass = 5, Minclass = 7, Per = The Spanish Main, Nat = Spain, Type = War, Loop = 0, Ship ID = Galeoth2
Apparently the captain CAN command ships up to Tier 5 now. He just happened to still randomly get assigned a smaller one.
Compare to the earlier situation where this line would always have said "Maxclass = 7, Minclass = 8" or something like that.

If you keep playing more of these quests, larger ships should start to appear again.
Or, if you want to quickly test this, use Cheatmode to give yourself a MUCH higher character level.
Then you should REALLY start to see the bigger ships!

How's this, for example?
upload_2016-4-10_20-12-47.png
 
Back
Top