• 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 Loyalty/alignment system causes quest characters to desert

Grey Roger

Sea Dog
Staff member
Administrator
Storm Modder
When I went to Port Royale church to make the donation on behalf of Artois Voysey, Two Dogs Fighting appeared, said he didn't want to serve with a spineless worm, and deserted.

That's because of this in case "artois_donate_done":
Code:
OfficersReaction("good");
A 'DumpAttributes' on Two Dogs showed him to have alignment "bad", loyality (sic) 1. And it raises several issues.

First, who decided that Two Dogs should be evil and disloyal? Not me, and as that's my character for use in my storyline, that ought to count for something! It turns out that any character who doesn't have the "loyality" and "alignment" attributes, which is most of them, has them randomly assigned by "Leveling.c" - and in this game, Two Dogs was randomly assigned "bad" alignment and minimum loyalty.

Next: quest characters must be made immune to this. For Two Dogs to desert is very annoying but not disastrous as his part in the storyline is early on. It would be worse if Lucia were to desert like this. And it would derail "Tales of a Sea Hawk" if Danielle decided to quit. Likewise, "Hoist The Colours" would probably break if Joshamee Gibbs left unexpectedly.

And: do we really want this? To the player, it appears as though the character deserts randomly for no apparent reason and with no chance to prevent it. OK, there's a mechanism behind it, but nowhere is this explained to the player - and effectively it is random, as the attributes which control it are set randomly. Perhaps show the officer's alignment and loyalty somewhere? Or, at least, give some indication - maybe the first time he doesn't like something the player did, he complains but doesn't desert right away. Then maybe allow the player to bargain with him or threaten disciplinary action - desertion or mutiny are both grounds for stringing the officer up!
 
This seems to happen elsewhere too - when an officer is knocked out and you revive them with a potion - they tend to walk away from you and not follow as part of your party anymore. I have tried to command them to follow me via dialogue and after a few times doing this then again join my party but I am not sure it is me doing it or maybe it is the random element? You can try it with Clint Eastwood - normally at least one officer gets knocked out in the fight.
 
That's a different problem - the AI can get confused by stunned characters. There's an easy workround for an officer who was stunned, revived, and now walks around at random - go to the "Passengers" interface, remove him from your party, then put him back again.
 
Wow, I'm impressed you actually managed to trigger this! There are so few 'OfficersReaction' lines that this is super rare.

I assume your character was randomly assigned with an insanely low loyalty value.
That way, even a single 'OfficersReaction' was enough to push him over the line.

This is actually a gameplay mechanism I had once wanted to substantially NYPD on.
I still do, but I don't know when, if ever I'll get round to doing it.

For starters, I'd suggest:
- Quest characters should get alignment "neutral" if they don't have anything set already.
- Loyalty should always have a minimum value so that this won't trigger in a hurry.
 
Indeed, a 'DumpAttributes' on Two Dogs from a much earlier savegame showed that he'd been assigned loyalty 5, the minimum possible, right at the start.

I still say quest characters should be completely immune so that there's no chance of derailing a storyline. Alignment "neutral" won't work anyway. Function "OfficersReaction" takes "alignment" as an argument and reduces the character's loyalty if his alignment doesn't match, which means neutral characters will always lose loyalty, to both "good" and "bad" checks. And assigning values to all the quest characters means someone has to go through all of them - whereas all quest characters had better have the "questchar" attribute set, otherwise the levelling system is going to foul them up anyway. The easiest and most reliable way to stop quest characters from deserting is therefore to change "OfficersReaction" to do nothing if "questchar" is set.
 
Add a check so that "neutral" exists and 'OfficersReaction' does nothing on that.
Then ensure any character with 'questch' set and no alignment gets "neural" automatically.
I think it makes sense for "neutral" to exist anyway.

Excepting all quest characters goes against the original intention of that feature.
Some quest characters are deliberately set to be able to defect. They then revert to a specific location where you could re-hire them.
I reckon that's pretty cool.
 
Have a look at these versions of "Leveling.c" and "quests_common.c". In particular:
"Leveling.c":
Code:
   if (!CheckAttribute(chref,"loyality"))
   {
       if(CheckAttribute(chref,"questchar") chref.loyality = 15
       else chref.loyality = 5+rand(15);
   }
   if (!CheckAttribute(chref,"alignment"))
   {
       if(CheckAttribute(chref,"questchar") chref.alignment = "neutral";
       else
       {
           if(rand(1)==1) chref.alignment = "good";
           else chref.alignment = "bad";
       }
   }
"quests_common.c":
Code:
for (int io = 0; io<GetPassengersQuantity(pchar); io++)
   {
       iPassenger = GetPassenger(pchar, io);
       if(GetAttribute(characters[iPassenger], "alignment") != "neutral")
       {
           if(CheckAttribute(characters[iPassenger], "loyality") && CheckAttribute(characters[iPassenger], "alignment"))
           {
               if (characters[iPassenger].alignment == alignment)
               {
                   characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) + 1;
               }
               else
               {
                   characters[iPassenger].loyality = makeint(characters[iPassenger].loyality) - 1;

                   if(makeint(characters[iPassenger].loyality) < 1)
                   {
                       PlaceCharacter(&characters[iPassenger], "goto");
                       characters[iPassenger].selfdialog.filename = characters[iPassenger].dialog.filename;
                       characters[iPassenger].selfdialog.currentnode = characters[iPassenger].dialog.currentnode;
                       characters[iPassenger].dialog.filename = "anacleto_dialog.c";
                       characters[iPassenger].dialog.currentnode = "remove";
                       LAi_SetActorType(&characters[iPassenger]);
                       LAi_ActorDialog(&characters[iPassenger], pchar, "player_back", 2.0, 1.0);
                       LAi_SetStayType(pchar);
                   }
               }
           }
       }
   }
Excepting all quest characters goes against the original intention of that feature.
Presumably the original intention was not to have storyline characters desert and possibly derail the storyline, so what is the purpose of quest characters deserting?
Some quest characters are deliberately set to be able to defect. They then revert to a specific location where you could re-hire them.
That makes no sense. If they hate you so much that they desert, why would they sign on with you again? If they've already proven themselves disloyal, why would you hire them again?

In reality, I'd imagine that desertion from a pirate, privateer or naval ship would be a hanging offence. If someone deserts from my ship and I see him again, the next conversation is going to involve a sword!
 

Attachments

  • quests_common.c
    231.6 KB · Views: 170
  • Leveling.c
    59.3 KB · Views: 193
Have a look at these versions of "Leveling.c" and "quests_common.c". In particular:
Looks like a good to me. :onya

Presumably the original intention was not to have storyline characters desert and possibly derail the storyline, so what is the purpose of quest characters deserting?
The original intention must have been to allow them to desert, but still allow you to continue their sidequest later on.
This is a feature that was in the original game, but I don't think it was ever fully realised.

That makes no sense. If they hate you so much that they desert, why would they sign on with you again? If they've already proven themselves disloyal, why would you hire them again?
Maybe if you have "changed your ways" first?

In reality, I'd imagine that desertion from a pirate, privateer or naval ship would be a hanging offence. If someone deserts from my ship and I see him again, the next conversation is going to involve a sword!
I suppose in some cases it should be possible to resign in a gentlemanly fashion, no?
 
Maybe if you have "changed your ways" first?
That relies on the player (a) knowing what caused the officer to desert in the first place, (b) wanting to change his game style just to please the disloyal officer, and (c) not caring that this might trigger further desertions by officers of the opposite alignment.

I suppose in some cases it should be possible to resign in a gentlemanly fashion, no?
Yes, or at least give some advance warning. As it is, the officer suddenly deserts for no apparent reason (apparent to the player within the game, that is) and with no warning. That's why I suggested that there should be some indication of officer alignment and loyalty, whether a simple line in the interface or a dialog in which he approves or disapproves of your action. (In complete ignorance of this entire system, I actually did something of the sort very early in "Ardent". If you play as the "action, adventure, romance" hero and you don't kill the prison warden, one of your officers approves your action when you leave the prison and you gain some reputation - this was mainly to balance out the loss of reputation you suffer for stunning and robbing the warden in the first place. If you play the "black-hearted sea robber" villain and you do kill the warden, one of your officers approves and you lose some reputation - if you're trying to be the villain, gaining reputation isn't a reward!)
 
That relies on the player (a) knowing what caused the officer to desert in the first place, (b) wanting to change his game style just to please the disloyal officer, and (c) not caring that this might trigger further desertions by officers of the opposite alignment.
True.
If the officer is part of a Sidequest though, you might have a reason to want to make amends.
If done well, I reckon it could add some spice to regular Free Play.
But in its current form, it isn't done well just yet.

Yes, or at least give some advance warning. As it is, the officer suddenly deserts for no apparent reason (apparent to the player within the game, that is) and with no warning.
Fair point.
My personal idea would be to not make it too obvious though:
If an officer approves of your actions, increase the loyalty and reputation.
If an officer disapproves, decrease the loyalty and don't change the reputation.
A player could then notice by paying attention: officers who follow in the reputation changes are the loyal ones.
The other ones may eventually drop out.

I had envisioned this along with:
- Replacing the manual 'OfficersReaction' with the regular reputation changes so it becomes more common
- Changing the scale of this happening so it isn't TOO common
- Making 'bad' gameplay equally feasible as 'good'
- Distinguishing between small and large reputation-changing actions so that you cannot become a Hero just by taking people their wallets are about to fall out of their pockets
- Have reputation decrease back to neutral over time without any outside influences

I think that would make reputation play a FAR larger role in the game.
But it would require a fair bit of reworking of game files and concepts, so is not something that should be done in a hurry.
This has been on the back burner for several years now and I don't imagine it'll be done any time soon, if at all.
 
My personal idea would be to not make it too obvious though:
If an officer approves of your actions, increase the loyalty and reputation.
If an officer disapproves, decrease the loyalty and don't change the reputation.
A player could then notice by paying attention: officers who follow in the reputation changes are the loyal ones.
The other ones may eventually drop out.
Too slow, unless the percentage reputation change of an officer who approves your action is increased compared to how it is now. Especially if the officer already has a high level reputation ("Dashing" or "Bloody Terror") - it takes ages for the officer's reputation to change to the highest level. For that matter, if the officer's reputation is already at the highest level then you're never going to see any changes whether or not the officer likes your actions.

Reputation and alignment aren't the same. If they were, Two Dogs would never have deserted - his reputation was Hero at the time.

I had envisioned this along with:
- Replacing the manual 'OfficersReaction' with the regular reputation changes so it becomes more common
- Changing the scale of this happening so it isn't TOO common
- Making 'bad' gameplay equally feasible as 'good'
- Distinguishing between small and large reputation-changing actions so that you cannot become a Hero just by taking people their wallets are about to fall out of their pockets
- Have reputation decrease back to neutral over time without any outside influences

Making "bad" gameplay feasible involves someone writing sidequests specifically for villains, the same way that "Strange Things Going On in the Archipelago" is specifically for heroes. (You don't need to be good to play that one, but you won't get far until you complete "Help the Church", and you do need to be good to play that.) You could start by writing an evil counterpart to "Toff Oremans' Daughter", a relatively short quest which gets you a very nice sword and which is only available to good characters. (And it's occurred to me that the "Kapitein of Kralendijk" quest ought to drop your reputation a bit as you're perpetrating a massive swindle.)

Distinguishing between small and large reputation changes is already done. You can't become Hero, or even Dashing, just by warning people about their wallets - that won't get you past Matey. Allowing someone to keep a bit of money after you caught them picking your pocket, in the hope of giving them a start on a new honest life, can get you as far as Dashing (it's a +2 reputation gain, whereas the wallet warning is only +1). Standing guard for someone and then declining the reward can get you up to Hero - it's still only +2 but it's more heroic, as it involves the possibility of risking your life.

I don't like the idea of losing the reputation you worked so hard to gain, unless you do something specific that knocks it down. Especially now that it's harder to earn in the first place.
 
Too slow, unless the percentage reputation change of an officer who approves your action is increased compared to how it is now. Especially if the officer already has a high level reputation ("Dashing" or "Bloody Terror") - it takes ages for the officer's reputation to change to the highest level. For that matter, if the officer's reputation is already at the highest level then you're never going to see any changes whether or not the officer likes your actions.
Getting the highest reputation would be super difficult in my concept anyway.
Because there would be large advantages to having a reputation at the extreme ends of the scale.

Fair point about if the officer is already at the extreme end.
But then the mechanism that makes the reputation drop back down to neutral would kick in.

Reputation and alignment aren't the same. If they were, Two Dogs would never have deserted - his reputation was Hero at the time.
At the moment, indeed the two have no relation to each other.

Making "bad" gameplay feasible involves someone writing sidequests specifically for villains, the same way that "Strange Things Going On in the Archipelago" is specifically for heroes. (You don't need to be good to play that one, but you won't get far until you complete "Help the Church", and you do need to be good to play that.) You could start by writing an evil counterpart to "Toff Oremans' Daughter", a relatively short quest which gets you a very nice sword and which is only available to good characters. (And it's occurred to me that the "Kapitein of Kralendijk" quest ought to drop your reputation a bit as you're perpetrating a massive swindle.)
A lot could be done without adding new sidequests, but I have to agree they would help a lot.
Alternatively, existing quests should have "evil" options added to them here and there.

Distinguishing between small and large reputation changes is already done. You can't become Hero, or even Dashing, just by warning people about their wallets - that won't get you past Matey. Allowing someone to keep a bit of money after you caught them picking your pocket, in the hope of giving them a start on a new honest life, can get you as far as Dashing (it's a +2 reputation gain, whereas the wallet warning is only +1). Standing guard for someone and then declining the reward can get you up to Hero - it's still only +2 but it's more heroic, as it involves the possibility of risking your life.
If I recall, that is now managed in the various specific spots where reputation is changed.
I had imagined working it into the system itself so that it would be handled uniformly throughout all uses in the game.

I don't like the idea of losing the reputation you worked so hard to gain, unless you do something specific that knocks it down. Especially now that it's harder to earn in the first place.
This comes from my idea that reputation and fame would have a link too.
And that fame doesn't just go up, but can go down as well.
If you do nothing heroic, why should people remember you as a Hero after a while?

If being a Hero gives large bonuses and you only need to get there once, then after achieving it, it becomes no longer a valid gameplay element.
On the other hand, if you keep having to work at it, it could continue to create gameplay for much longer.

Likewise, I figure reputation would factor into game, giving reputation a positive effect, but also negative.
After all, high fame in increases your false flag detection chance.
That way, if you'd have to do an infiltration mission, you might deliberately want to take your reputation and thereby fame down a few notches in advance.

This will definitely add some substantial complexity to the game and make things far less black and white than they used to be.
I'm going though that this would also unlock far more varied gameplay potential with more choices with different advantages and disadvantages than ever before.

But as I said, if any of the above ever happens now, I'll be surprised.
 
The Hard Labours of an Assassin side quest drops your reputation on each kill quite a lot - and so it should. A similar thing could be for the Girl won in a card Game and "Toff Oremans' Daughter", or other women is to take them to the brothel on Nevis and sell them - after pretending to save them of course - very villainous - pirate!! I think I might be able to try this when I have some time in the New Year.
 
A lot could be done without adding new sidequests, but I have to agree they would help a lot.
Alternatively, existing quests should have "evil" options added to them here and there.
The point about having new quests is that some quests are only available to good characters. There would need to be one or two only available to evil characters. The ones which don't care about your reputation when you start them aren't a problem.

A few sidequests already drop your reputation - as well as "Hard Labours of an Assassin", there's also "French Pirate in the Tavern".

If I recall, that is now managed in the various specific spots where reputation is changed.
I had imagined working it into the system itself so that it would be handled uniformly throughout all uses in the game.
That won't work. It has to be handled at the point where reputation changes because the size of the change is no guide to whether it should qualify. You get +2 if you catch someone picking your pocket and let them keep some gold to start a new, hopefully honest life. You also get +2 if you stand guard for someone and then decline the reward. Only one of those should be able to get you past Dashing. Worse - saving a woman from rapists gets you different reputation gains depending on your current status, if you're Dashing then you only get +1 - but saving the woman and giving the dirtbags the slicing they deserve certainly ought to be one of the acts which can get you up to Hero.

This comes from my idea that reputation and fame would have a link too.
And that fame doesn't just go up, but can go down as well.
If you do nothing heroic, why should people remember you as a Hero after a while?
I don't know. Nelson, Drake and de Ruyter haven't done anything recently (due to being dead) but for some reason are still remembered as heroes. xD

Meanwhile, slight change of plan to the fix for the original problem. "Leveling.c" doesn't need to assign default values to quest characters - in fact, it shouldn't be doing anything to characters with the "questchar" attribute, that's the point of the attribute. So I've simplified it - it only assigns "alignment" and "loyality" attributes if the character doesn't have them and also doesn't have the "questchar" attribute. 'OfficersReaction' does nothing if a character lacks either the "alignment" or "loyality" attributes. But quest characters can still be made eligible to desert - you just need to put those attributes into the character's definition. In fact, I've done that to some of the officers in "Ardent". The two you get right at the start are probably unique in that you get a different pair depending on whether you told the Inquisitor that you're the action/adventure/romance hero or the black-hearted sea-robber villain, the idea originally being simply to give villain Ardent a more villainous looking pair of associates. And they're not critical to the storyline; their purpose is to give you some backup in the early part of the game. So the good pair get "alignment" set to "good" and the villainous pair get it set to "bad", with all of them getting "loyality" set to 10 - slightly below the average of the '5+rand(15)' assigned to random characters by "Leveling.c". So, if you told the Inquisitor that you're a hero and then consistently do evil things, the pair of them may run off - if you'd wanted to play the villain, you should have said so. :p
 
The Hard Labours of an Assassin side quest drops your reputation on each kill quite a lot - and so it should. A similar thing could be for the Girl won in a card Game and "Toff Oremans' Daughter", or other women is to take them to the brothel on Nevis and sell them - after pretending to save them of course - very villainous - pirate!! I think I might be able to try this when I have some time in the New Year.
Inadvisable - the game has mostly steered away from the issue of slavery. The one exception I can think of is in "Hoist The Colours", where Jack finds out that the cargo which Beckett wants him to collect from Antigua is slaves, and is suitably outraged. This is part of the problem of allowing evil gameplay - what level of evil can we accept for player characters? Double-crossing a ship you're supposed to be protecting is allowed, for example. But selling people into slavery should probably not be.
 
That won't work. It has to be handled at the point where reputation changes because the size of the change is no guide to whether it should qualify.
At the moment, you're right.
But why not change that so that it does?
Would that not make the system a fair bit simpler and less scattered throughout multiple files?

I don't know. Nelson, Drake and de Ruyter haven't done anything recently (due to being dead) but for some reason are still remembered as heroes. xD
Still being a hero at the time of dying might have something to do with that?

Anyway, my point is that if you reach Hero once and then it automatically stays there, it is then no longer a challenge so that effectively ends its gameplay value.
I'm also thinking of Blackbeard, who specifically kept working very hard to groom his terrible reputation.
This is at the moment not replicated in gameplay and seems like a missed opportunity to me.

Inadvisable - the game has mostly steered away from the issue of slavery. The one exception I can think of is in "Hoist The Colours", where Jack finds out that the cargo which Beckett wants him to collect from Antigua is slaves, and is suitably outraged. This is part of the problem of allowing evil gameplay - what level of evil can we accept for player characters? Double-crossing a ship you're supposed to be protecting is allowed, for example. But selling people into slavery should probably not be.
Indeed I would also prefer if the player never engages in slavery and raping.
That really does cross a line for me.

I might think to support it but have the penalty for it be severe.
But that would make the game historically inaccurate, since it used to be quite common back in those days.
So better to leave it out altogether, I reckon.

There are plenty of very evil things you can do anyway.
It is "huge acts of goodness" that might prove a bigger challenge if my concept is ever realised.
Betraying a friendly ship under a false flag and then unhonourably killing the captain and almost all the crew should quickly set you on the path to being recognized as evil.
But what could be a heroic act of the same magnitude?
 
At the moment, you're right.
But why not change that so that it does?
Would that not make the system a fair bit simpler and less scattered throughout multiple files?
Not really. Completing a quest really ought to contribute to reaching Hero/Horror status. If the quest is regarded as sufficiently trivial to not do that, it can be set to give the reputation reward only if you're lower than Dashing or whatever. It means quest and storyline writers aren't constrained on what reputation reward (if any) to give.

Indeed I would also prefer if the player never engages in slavery and raping.
That really does cross a line for me.

I might think to support it but have the penalty for it be severe.
But that would make the game historically inaccurate, since it used to be quite common back in those days.
So better to leave it out altogether,I reckon.
I've no objection to them being in the game so long as you're not the perpetrator. The rapist scenes in the jungle are fine for me for exactly one reason - your job is to wipe them out. Likewise, slavery is mentioned in "Hoist The Colours" and you want no part of it, you help free them instead.

There are plenty of very evil things you can do anyway.
It is "huge acts of goodness" that might prove a bigger challenge of my concept is ever realised.
Betraying a friendly ship under a false flag and then unhonourably killing the captain and almost all the crew should quickly set you on the path to being recognized as evil.
But what could be a heroic act of the same magnitude?
That is indeed the problem, as it would need to be a repeatable general quest like the escort followed by betrayal. Maybe have a further option to the escort quest where you can tell the merchant that due to whatever war is going on at the time, you're expecting serious trouble. That means there will be an enemy ship and it's bigger than the usual quest type. (Of course, as well as the additional reputation boost, what you get as a reward for defeating the ship is the ship, if you defeat it by boarding...)
 
Not really. Completing a quest really ought to contribute to reaching Hero/Horror status. If the quest is regarded as sufficiently trivial to not do that, it can be set to give the reputation reward only if you're lower than Dashing or whatever. It means quest and storyline writers aren't constrained on what reputation reward (if any) to give.
Then quests could give larger changes than regular gameplay, right?
After all, quests aren't repeatable so it makes sense for them to contribute more.

I've no objection to them being in the game so long as you're not the perpetrator. The rapist scenes in the jungle are fine for me for exactly one reason - your job is to wipe them out. Likewise, slavery is mentioned in "Hoist The Colours" and you want
:onya :onya :onya

That is indeed the problem, as it would need to be a repeatable general quest like the escort followed by betrayal. Maybe have a further option to the escort quest where you can tell the merchant that due to whatever war is going on at the time, you're expecting serious trouble. That means there will be an enemy ship and it's bigger than the usual quest type. (Of course, as well as the additional reputation boost, what you get as a reward for defeating the ship is the ship, if you defeat it by boarding...)
I like it. :onya

Another thought that occurred to me would be stuff like "liberating a town" or "protecting a town from invasion".
 
I created a new thread for the spin-off discussion: Fix in Progress - Remove Rapists

If anyone still wants to say something about the original subject, please do so in this original thread.
I do reckon it was an interesting discussion too, so wouldn't mind to see where it goes from here. ;)
 
Perhaps split off the discussion about alignment and reputation in general as well. ;)

The original subject was the specific bug of a quest character deserting due to the alignment system. Preventing the levelling system from automatically assigning the "alignment" and "loyality" attributes to quest characters ought to take care of that, and if you want a quest character to be able to desert then you can always add the attributes into the character's definition.
 
Back
Top