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

High Priority Change way shared XP works

Thinking about this further, I cannot quite think of where those "groups" should be used at all.
When would XP gained by one character NOT have any effect on another character as well if there are any applicable ones?
Likewise: When would XP be gained ONLY by those on a single ship and when for the entire fleet?
Can anyone think of some examples for the various possibilities?
 
The initial proposed change looks good. If that's going into the new release, I look forward to testing it. :onya

The idea that the player only gets 50% instead of 100% is not so good. You did the work so you should get the full reward. Slowing down player progress might be alright for those who like to keep a single freeplay game going on for all eternity but damages the game for those who play a storyline to completion and then move on to something else, or who get bored playing the same character for too long and start over with a new choice. If the problem is that XP gained depends on how many people are in the party then that's what needs to be fixed. Maybe only allow you to get a share of officers' XP if they have the "Shared XP" perk? In fencing, you're probably doing most of the fighting anyway - if you're chickening out, hiding behind your officers and letting them do all the fighting then you deserve not to get much XP :p. So unless they have the perk, you'll get your full 100% for anything you kill, they'll get their 50% / 100% share depending on whether you have the perk; then they'll get their full 100% for anything they kill but you'll get nothing unless they have the perk. Meanwhile, for other skills, they'll be earning 200% for their job-related skills, so those ought to go up higher than yours.

About groups:
To me, it seems the single most important group is Shore Party - distinguishing those who are your immediate companions, who can see everything you do close up and learn from it; and the rest of your officers, who at best watch from a distance, otherwise their only way to learn is when you tell them what you did and how. Beyond that, the question is how do other officers profit from your experience (or each others')? One possible example of single ship XP gain might be gunnery - those on your ship can see how the guns are set and where the shots are falling as a result, those on the next ship along can't see how your guns are set so have no idea why your shots ended up where they did. Sailing is another matter, the other ships can see how your sails are set and what your ship is doing as a result.
 
The initial proposed change looks good. If that's going into the new release, I look forward to testing it. :onya
I cannot make any guarantees on if and when that could be done.
But it does sound doable, so if nobody else does it, I'll tackle it myself at some point.
Maybe this evening (VERY maybe) or maybe next week.

The idea that the player only gets 50% instead of 100% is not so good. You did the work so you should get the full reward.
The reason for that idea is to counter the "player gains XP faster than his officers" issue.
Take, for example, "Repair". I think that is primarily given to the player character and never exclusively to any officers.

Of course I did propose giving the Carpenter 200%(!) of the XP, so the player would then get 100% and the Carpenter would get 200%.
But consider then the officer types that contribute only 50% of their skills. They would get 100% of the XP (as opposed to 200) which is equal to the player.
The player gets XP in ALL skills, while that officer only gains 100% XP in Repair and 200% in some other.
Therefore that officer probably still gets less than the player in total.

If we give the player only 50%, then ANY officer gaining skills at all would do so faster than the player (even the ones that contribute only half their skills).
The end result I would hope for is that officers will always gain XP in their respective fields faster than the player does.
That would give your officers a VERY important use and simulate the behaviour that "you cannot do everything by yourself".

Players who "do not want to play for all eternity" should be covered by the fact that their officers take care of most skill contributions.

Anyway.... that's my reasoning for proposing it. I do think I've got some valid points there, but I'm indeed also not 100% convinced this would be the best solution.
But wouldn't you agree it may be worth a try...? :rolleyes:

If the problem is that XP gained depends on how many people are in the party then that's what needs to be fixed.
I think that would affect primarily Fencing, because other skills are (probably???) assigned to one single character when given.
However, Fencing can be gained by ANY character who does fighting. So when that is shared, it starts stacking up the more characters are involved.

I can think of several solutions:
1. Do as I proposed and give only 50%. That way when fighting by yourself, you gain some XP but not so much. With a full group, you'd get XP much faster (probably 200% per character).
In other words: Clear advantage to taking officers ashore with you to assist.
2. Divide any "Fencing XP sharing" over the number of characters in the shore party.
This would pretty much have the opposite effect: More characters in the group = XP is gained slower.

Personally I think I like the sound of #1 there better than #2 because of the effect it would have on gameplay.
The same effect coud be gained though through having 100% XP gained, but then simply reducing the multiplier on Fencing XP.

If you can think of an alternate approach, I'm all ears.

Maybe only allow you to get a share of officers' XP if they have the "Shared XP" perk?
At the moment the way the "perks" work is that if ANY officer contributes the perk, then it is active.
So you really need only one officer who has it and shouldn't need each officer to have it individually.

If we'd change that for the "Shared XP" skill, that would be the only skill to behave differently compared to the others. That might be confusing and not intuitive.
On the other hand, it also gives one extra "development level" for your individual officers.

Should we want that? Maybe worth as an experiment at some point? Problem with experimenting is that we have already massively run out of time.
The Beta 4 public release date is pretty much set in stone now as far as I'm concerned because I don't want to delay it yet again.
So we have to be selective with what we want to do now to get the game sort-of playable and what we want to experiment with after the public release.

So unless they have the perk, you'll get your full 100% for anything you kill, they'll get their 50% / 100% share depending on whether you have the perk; then they'll get their full 100% for anything they kill but you'll get nothing unless they have the perk. Meanwhile, for other skills, they'll be earning 200% for their job-related skills, so those ought to go up higher than yours.
Would that not mean that your officers get Fencing XP much faster than the player does?
Because the player does share 50% with the officers, but the officers don't share it back?
Or DO they all share it 50% back and forth even without Shared XP?
And WITH Shared XP it increases to 100% but only from those characters who have it?
How would we prevent that from becoming "too much"?

To me, it seems the single most important group is Shore Party - distinguishing those who are your immediate companions, who can see everything you do close up and learn from it; and the rest of your officers, who at best watch from a distance, otherwise their only way to learn is when you tell them what you did and how.
True, that. In my current proposal, that factors in exclusively for Fencing.
This is because the shore party is meant purely as extra support in fights and is deliberately NOT intended to affect anything else to avoid unnecessary micromanaging.

If, for example, Commerce gained would be shared with the Shore Party even without Shared XP, then you'd have to start taking your Quartermaster ashore with you again.
Which also puts him at risk. So that is probably why you'd want him to gain Fencing relatively quickly as well.
Would you consider it OK if you can have the same effect, while leaving your Quartermaster on the ship? That is the way I have always envisioned it, at least.

And then by consequence, the only officers you'd take ashore are your "fighters".
Since they stay with you for a while, they shouldn't need t gain Fencing XP up to 10 too quickly.
Which means the 50% idea may become more feasible. Perhaps?

One possible example of single ship XP gain might be gunnery - those on your ship can see how the guns are set and where the shots are falling as a result, those on the next ship along can't see how your guns are set so have no idea why your shots ended up where they did. Sailing is another matter, the other ships can see how your sails are set and what your ship is doing as a result.
True. I think that can be handled by doing a PROGRAM search to see what groups get called where and changing those if need be.
Maybe you can have a look at that one when the AddXP function has been modified?
 
The reason for that idea is to counter the "player gains XP faster than his officers" issue.
Take, for example, "Repair". I think that is primarily given to the player character and never exclusively to any officers.

Of course I did propose giving the Carpenter 200%(!) of the XP, so the player would then get 100% and the Carpenter would get 200%.
Looking at "init_officertypes.c", the carpenter is already set to Repair at Contribute 2, Importance 10, so yes, if the proposal that skills at Contribute 2 go up by 200% then the carpenter should indeed gain Repair faster than the player.

But consider then the officer types that contribute only 50% of their skills. They would get 100% of the XP (as opposed to 200) which is equal to the player.
The player gets XP in ALL skills, while that officer only gains 100% XP in Repair and 200% in some other.
Therefore that officer probably still gets less than the player in total.
But those Contribute 1 skills are secondary skills, not the officer's primary job skill. Maybe edit "init_officertypes.c" to give out some more Contribute 1 skills so that officers can slowly develop a broad range of skills while going up faster in their primary job skills.

If we give the player only 50%, then ANY officer gaining skills at all would do so faster than the player (even the ones that contribute only half their skills).
The end result I would hope for is that officers will always gain XP in their respective fields faster than the player does.
That would give your officers a VERY important use and simulate the behaviour that "you cannot do everything by yourself".

Players who "do not want to play for all eternity" should be covered by the fact that their officers take care of most skill contributions.
That misses the point that part of the game is watching your own character evolve, which will be damaged by only giving him 50% of what he earns by his own actions.

I think that would affect primarily Fencing, because other skills are (probably???) assigned to one single character when given.
However, Fencing can be gained by ANY character who does fighting. So when that is shared, it starts stacking up the more characters are involved.

I can think of several solutions:
1. Do as I proposed and give only 50%. That way when fighting by yourself, you gain some XP but not so much. With a full group, you'd get XP much faster (probably 200% per character).
In other words: Clear advantage to taking officers ashore with you to assist.
And you're stuffed when you go to dungeons to earn more Fencing skill, or during boardings. Your officers haven't yet gained much Fencing skill so they'll get killed. Worse, you're earning the skill more slowly, which means you're more likely to be killed too. Or you tell them to sit out the next boarding, which keeps them out of harm's way but then you only get the basic 50%.

You're also stuffed early in the game when you don't have three officers. So when you most need to gain Fencing XP to stay alive, that's when you're gaining less of them.

2. Divide any "Fencing XP sharing" over the number of characters in the shore party.
This would pretty much have the opposite effect: More characters in the group = XP is gained slower.
Divide the XP sharing by half the number of characters in the shore party, then? Fix the calculation so that it cancels out but does not exceed the excess amount you get by having more characters in the shore party, so that you earn 100% of XP for what you kill and possibly a lesser amount for what they kill.

At the moment the way the "perks" work is that if ANY officer contributes the perk, then it is active.
So you really need only one officer who has it and shouldn't need each officer to have it individually.

If we'd change that for the "Shared XP" skill, that would be the only skill to behave differently compared to the others. That might be confusing and not intuitive.
On the other hand, it also gives one extra "development level" for your individual officers.

Should we want that? Maybe worth as an experiment at some point? Problem with experimenting is that we have already massively run out of time.
The Beta 4 public release date is pretty much set in stone now as far as I'm concerned because I don't want to delay it yet again.
So we have to be selective with what we want to do now to get the game sort-of playable and what we want to experiment with after the public release.
Depends on how easy it is to set up. If it's going to get messy, leave it until after the release.

Would that not mean that your officers get Fencing XP much faster than the player does?
Because the player does share 50% with the officers, but the officers don't share it back?
Only if the player chickens out, hides behind the officers and lets them do most of the work, in which case they deserve to gain all the Fencing XP. And you'd need them to go up fairly quickly because otherwise your human shield isn't going to stay standing for very long.

More likely, the player does most of the killing, gets his full 100%, and the officers get their 50% share from watching. In due time they'll become more competent and you won't need to rescue them as much, but by that time your Fencing skill is probably pretty high anyway.

True, that. In my current proposal, that factors in exclusively for Fencing.
This is because the shore party is meant purely as extra support in fights and is deliberately NOT intended to affect anything else to avoid unnecessary micromanaging.

If, for example, Commerce gained would be shared with the Shore Party even without Shared XP, then you'd have to start taking your Quartermaster ashore with you again.
Which also puts him at risk. So that is probably why you'd want him to gain Fencing relatively quickly as well.
Would you consider it OK if you can have the same effect, while leaving your Quartermaster on the ship? That is the way I have always envisioned it, at least.
That is why the "Shore Party" group needs to to be distinct, which is what I meant by it being the most important. Fencing needs to be Shore Party, Commerce needs to be everyone. Having said that, yes, you may want the Quartermaster - or for that matter, any other officer you happen to have - ashore with you just to make up numbers. All he needs to do is stay alive and keep an enemy busy long enough for you to kill the enemy standing in front of you, then you turn round and deal with the enemy in front of the Quartermaster. Meanwhile, the Quartermaster is indeed gaining Fencing XP and in due time will be able to fight on his own behalf.

True. I think that can be handled by doing a PROGRAM search to see what groups get called where and changing those if need be.
Maybe you can have a look at that one when the AddXP function has been modified?
You proposed some new groups, asking for examples of when XP would be gained by those on a single ship and when it would be gained by the whole fleet. All I did was suggest those examples. ;)
 
WoW a lot of food for thought and change here. I only thought shore party (and boarding party) because that's what I thought was being described (mistakenly perhaps) in getting/helping your officers to gain skills and the logic seemed right.

I will leave comment on possible logic changes until I have had a chance to re-read and think about it but one quick comment/situation would be boarding. Your picked party officers are right there getting the most experience (unless you told them to sit it out) and conceptually the officers on your ship are also engaged in the fight somewhere else on board. Companion ships and their officers are not engaged in that boarding action and shouldn't be getting any melee gain on that occasion. I presume that is the ship party group @Pieter Boelen had in mind.

I have difficulty with the concept of fleet gaining XP since your companion captains should be gaining their own experience of sailing and battle although if because of your direct control your character gains such XP skills faster than AI generated events and opponents are then generated based on your level I can see it could easily run out of balance.

In the interim for beta 4 I am trying to looki at how the specific change to melee/fencing to allow shared XP without the perk seems to work out in practice.
 
Looking at "init_officertypes.c", the carpenter is already set to Repair at Contribute 2, Importance 10, so yes, if the proposal that skills at Contribute 2 go up by 200% then the carpenter should indeed gain Repair faster than the player.
I was considering the Quartermaster who has Repair = 1. Might be nice even even such an officer would gain skills faster than the player.
Effectively, ANY officer would gain skills faster than the player. Because they get to focus on 1-2 skills while the player gets ALL of them.

But those Contribute 1 skills are secondary skills, not the officer's primary job skill. Maybe edit "init_officertypes.c" to give out some more Contribute 1 skills so that officers can slowly develop a broad range of skills while going up faster in their primary job skills.
What meaning do we want "secondary skills" to have?
If secondary skills increase at the same rate as the player does, I fear there is a risk that they become relatively meaningless too.

That misses the point that part of the game is watching your own character evolve, which will be damaged by only giving him 50% of what he earns by his own actions.
But that ADDS the part of the game where you watch your officers' characters evolve.
Your own character still evolves. And in ALL skills too. Just slower than the officers. Which gives an advantage to having EVERY type of officer.
And if you can't find or afford any good ones, then you'll have to make do yourself. As player, you wouldn't be as effective as a dedicated officer.

It is a bit of a balancing act.... do you want your officers to be important or the player character?
Ideally, I'd want it to be BOTH.

One thing I thought of: Maybe DO give the player 100% on Leadership and Sailing (crucial for operating a ship as a captain!), but NOT any of the other skills.
It would be rather silly once EVERY officer has their skills higher than the player so that technically the captain isn't the best at anything.

In the end, we'll need to find out from testing how this works and how it is received by players.
Personally I like the idea of officers being very, very important. Which isn't all that odd, considering I used to BE an officer.
But I know "gamers" are often used to a very "player-centric" situation where they themselves are a "superhero" and anyone else is sort-of "just there".

And you're stuffed when you go to dungeons to earn more Fencing skill, or during boardings. Your officers haven't yet gained much Fencing skill so they'll get killed.
If you get yourself in situations where your officers get killed, the player probably does too, which means you found yourself in the wrong spot.

You're also stuffed early in the game when you don't have three officers. So when you most need to gain Fencing XP to stay alive, that's when you're gaining less of them.
You can promote your crew to officer relatively cheaply. Then at least you've got some characters to join you.

But yes, the points you make are technically true. I don't know if my proposal would make things "too difficult" or would just serve to "slow things down until you get officers".

How about this: I DO actually implement my 50% proposal, BUT try to write the code in such a way that it is relatively easy to customize.
So then we'll try it as I have it in mind and if it turns out not to work, we can change it without too much effort.

Divide the XP sharing by half the number of characters in the shore party, then? Fix the calculation so that it cancels out but does not exceed the excess amount you get by having more characters in the shore party, so that you earn 100% of XP for what you kill and possibly a lesser amount for what they kill.
I think my brain isn't cooperating right now. Can you explain that in some sot of formula-like way? Right now I'm failing to understand it. :oops:

More likely, the player does most of the killing, gets his full 100%, and the officers get their 50% share from watching. In due time they'll become more competent and you won't need to rescue them as much, but by that time your Fencing skill is probably pretty high anyway.
If the game works like that, you might as well not bother taking your officers ashore at all since apparently you can handle yourself. o_O

That is why the "Shore Party" group needs to to be distinct, which is what I meant by it being the most important. Fencing needs to be Shore Party, Commerce needs to be everyone. Having said that, yes, you may want the Quartermaster - or for that matter, any other officer you happen to have - ashore with you just to make up numbers. All he needs to do is stay alive and keep an enemy busy long enough for you to kill the enemy standing in front of you, then you turn round and deal with the enemy in front of the Quartermaster. Meanwhile, the Quartermaster is indeed gaining Fencing XP and in due time will be able to fight on his own behalf.
So that agrees then with my suggestion of "Fencing shared for Shore Party only, but nothing else because that is shared with EVERYONE who contributes that skill".

You proposed some new groups, asking for examples of when XP would be gained by those on a single ship and when it would be gained by the whole fleet. All I did was suggest those examples. ;)
The actual calls to give that XP are scattered all over the place. Maybe they don't call the group you'd like to see called.

I myself intend to edit only the AddXP function to handle the "theoretical sharing situation".
 
I will leave comment on possible logic changes until I have had a chance to re-read and think about it but one quick comment/situation would be boarding. Your picked party officers are right there getting the most experience (unless you told them to sit it out) and conceptually the officers on your ship are also engaged in the fight somewhere else on board. Companion ships and their officers are not engaged in that boarding action and shouldn't be getting any melee gain on that occasion. I presume that is the ship party group @Pieter Boelen had in mind.
As far as I'm concerned, your boarding scenario is just "Fencing" and is therefore shared with only the officers who are with you.
Unless you have SharedXP active. Should be no different from ashore.

I have difficulty with the concept of fleet gaining XP since your companion captains should be gaining their own experience of sailing and battle although if because of your direct control your character gains such XP skills faster than AI generated events and opponents are then generated based on your level I can see it could easily run out of balance.
I think my confusion yesterday was for the very same reason. :cheeky

In the interim for beta 4 I am trying to looki at how the specific change to melee/fencing to allow shared XP without the perk seems to work out in practice.
Are you actually playing around with the code? I was thinking of trying my hand at something as well to hopefully get some progress on this.
But we wouldn't want to do double work there; that would be a bit of a waste....

Maybe I could quickly come up with an initial suggestion of my own tonight and then you can see if you can understand it and/or improve on it?
I won't be doing any modding Friday-Sunday anyway, so I can only do a little bit tonight.
 
Are you actually playing around with the code? I was thinking of trying my hand at something as well to hopefully get some progress on this.
But we wouldn't want to do double work there; that would be a bit of a waste....

Maybe I could quickly come up with an initial suggestion of my own tonight and then you can see if you can understand it and/or improve on it?
I won't be doing any modding Friday-Sunday anyway, so I can only do a little bit tonight.

No I wasn't intending to change code just trace through how it acts with the 50% or 100% fencing (given several officers fighting at once) so feel free to alter what you will.
 
No I wasn't intending to change code just trace through how it acts with the 50% or 100% fencing (given several officers fighting at once) so feel free to alter what you will.
Ah, that's what you meant. Thank ye kindly! :cheers
 
@Grey Roger: If you get the chance to post some final comments, I'm all ears.
With a bit of luck, I'll get started on doing at least something in a few hours or so.
By then, I need to know what I should and shouldn't be doing....
 
If you get yourself in situations where your officers get killed, the player probably does too, which means you found yourself in the wrong spot.
Or you have only found one good weapon so far, plus you've earned a few ability points before you met any officers and have a couple of melee perks which they don't. Or the AI just isn't as good at blocking and attacking at the right time as you are, so you defeat the enemy facing you while the one facing your officer kills him.

I think my brain isn't cooperating right now. Can you explain that in some sot of formula-like way? Right now I'm failing to understand it. :oops:
As I understand the problem:
If everyone shares fencing XP with everyone else, it stacks excessively when there are three officers with you compared to when there are none.
If you divide the XP by the number of people in the party, you get less when there are three officers with you compared to when there are none.

So perhaps you need to divide the XP by a lesser number, e.g. (number of people in party) / 2.

If the game works like that, you might as well not bother taking your officers ashore at all since apparently you can handle yourself. o_O
No you can't, the reason being, if four thugs gang up on you alone then you can't hit one without exposing yourself to being hit by another. If you have three officers with you then each of you takes one thug, so you're only facing one and can kill him easily. All the officers need to do is stay alive long enough for you to turn round and kill the thugs facing them.

So that agrees then with my suggestion of "Fencing shared for Shore Party only, but nothing else because that is shared with EVERYONE who contributes that skill".
Possibly make Sneak work similarly - everyone who is with you gets it, nobody else gets it. The reason being, if you're trying to sneak then everyone with you had better be doing it as well because your walking softly and quietly won't do much good if the officer behind you is stomping around. The officers back on the ship, on the other hand, can make as much noise as they like because they're not with you. This also has the effect that anyone with you when you complete a quest gets a share of the XP, since at the moment most XP rewards are lots of Leadership and a little Sneak.

Am I right in thinking that at the moment, when you get that Leadership reward, the only officers with you who get any of it are those types who contribute Leadership? If so, time for some more micromanagement - turn all your officers into First Mate, complete the quest, everyone gets a share of the big Leadership reward, then turn them all back to whatever types they were before. :D Meanwhile, I'm inclined to change all the XP rewards in "Ardent" to be some general (type "") and some of whatever type (or types) seem appropriate to the quest just completed.
 
I am working on this now, trying to make some sense of it.
For starters I will make a "first pass" and then @Grey Roger and @pedrwyth can have a look at what I did and suggest changes.

At the moment "Sneak" isn't considered a "personal skill". Characters cannot be individually recognized either.
So I'm inclined to not treat Sneak the same way as Fencing. That isn't the case anywhere else yet either.
If that is to be added, that needs to be changed in a whole bunch of extra places.

Am I right in thinking that at the moment, when you get that Leadership reward, the only officers with you who get any of it are those types who contribute Leadership? If so, time for some more micromanagement - turn all your officers into First Mate, complete the quest, everyone gets a share of the big Leadership reward, then turn them all back to whatever types they were before. :D
You could probably do that, yes. If you know in advance what XP you're going to get and when.
Might be able to do that for quests. But for XP given throughout the normal game, are you really going to swip/swap them all back and forth?
You'll go MENTAL! :shock

Meanwhile, I'm inclined to change all the XP rewards in "Ardent" to be some general (type "") and some of whatever type (or types) seem appropriate to the quest just completed.
Agh, I have to remember to maintain that option as well. Somehow.
This all gets annoyingly complicated far too quickly. :ko
 
@pedrwyth and @Grey Roger:

This is what I have come up with. It seems to be behaving as far as I can tell, but I most definitely did not test this enough:
Code:
  //If we are only doing the player we can return here (for performance reasons)
   if(group == XP_GROUP_PLAYER)
   {
     //Add a difficulty multiplier
     float diffmult = 1.0-((GetDifficulty()-1.0) / 6.0); //Let's make it a bit less dependent on difficulty
     int xp = makeint(makefloat(_exp)*GetXPmult(expName));
     if(AddXPtoChar(chref, expName, makeint(diffmult*xp))) LevelUp = true;
     return LevelUp;
   }

   //Check for shared experience
   bool SharedXP = GetOfficersPerkUsing(chref,"SharedExperience");
   if(DEBUG_EXPERIENCE>1) { if(SharedXP) Trace("XP LOG: SharedXP is active"); }
   
   //Now handle the officers
   if(group == XP_GROUP_OFFIC)
   {
     float skillmult, tempmult;
     capt = GetCharacter(FindCaptainIndex(chref));                         // Get the captain of the ship
     for(i=-1; i < GetPassengersQuantity(capt); i++)                         // Start at -1 to include captain
     {
       if (i == -1)   cn = sti(capt.index);                           // Captain of the group
       else       cn = GetPassenger(capt, i);                         // Passenger of this character
       if (cn < 0)                           continue;           // Skip invalid characters
       chr = GetCharacter(cn);                                   // Reference to the character
       if (CheckAttribute(chr,"prisoned") && sti(chr.prisoned))   continue;           // Filter prisoned characters
       if(DEBUG_EXPERIENCE>1) Trace("XP LOG: Loop "+i+", Checking Officer "+GetMySimpleName(chr)+" with id "+chr.id);

       // Determine Skill Multiplier for this character
       skillmult = 0.0;
       if (cn == sti(chref.index))                       skillmult = 1.0;   // The character who gained the XP gets 100%
       if (expName == "")                           skillmult = 1.0;   // All characters join in "general XP"
       if (expName == SKILL_FENCING)                               // Fencing is a personal skill and should be handled differently
       {
         if (skillmult < 0.5 && IsPlayerParty(chr) && IsOfficer(chr))   skillmult = 0.5;   // Character is in the player shore party
       }
       else                                           // For any non-personal skills
       {
         tempmult = GetOfficerSkillFactor(chr, expName);                     // This means some officers can get 200% XP!
         if (skillmult < tempmult) skillMult = tempmult;                     // The officer who gains the XP will ALWAYS get it
       }
       if (IsMainCharacter(chr))                                 // Special case for the player, because you cannot focus on all skills at the same time
       {
         skillmult = 0.5;                                   // Only 50% of all skills
         if (expName == SKILL_LEADERSHIP)                 skillmult = 1.0;   // But a captain MUST know how to lead a crew
         if (expName == SKILL_SAILING)                   skillmult = 1.0;   // And navigate a ship
       }
       if (skillmult < 0.5 && SharedXP)                   skillmult = 0.5;   // Sharing XP, so everybody gets at least 50%
       if(DEBUG_EXPERIENCE>1) Trace("XP LOG: skillmult = "+skillmult);

       // Add Experience
       if (skillmult > 0.0)                                   // If any XP is to be added to this character
       {
         if(AddXP(chr, expName, makeint(_exp*skillmult), XP_GROUP_PLAYER)) LevelUp = true;   // Add that XP and see if it resulted in a Level-Up
       }
     }
   }
   
   //Now handle the companions
   if(group == XP_GROUP_PARTY)
   {
     capt = GetCharacter(FindCommanderIndex(chref));                         // Get the commander of the fleet
     for (i = 0; i <= GetCompanionQuantity(capt); i++) {
       cn = GetCompanionIndex(capt, i);
       if (cn < 0) continue;
       chr = GetCharacter(cn);                                   // Reference to the character
       if(DEBUG_EXPERIENCE>1) Trace("XP LOG: Loop "+i+", Checking Companion "+GetMySimpleName(chr)+" with id "+chr.id);
       if(AddXP(chr, expName, _exp, XP_GROUP_OFFIC)) LevelUp = true;               // Add the XP to the companion and maybe his officers
     }
   }
So please have a critical look through this to see if there are any MASSIVE lapses of logic.

I'll post this and all other needed files as soon as I can.
 
Above modified system now included in here for testing:
Mod Release - Build 14 Beta 4 Internal WIP For Testing | PiratesAhoy!

It ended up a bit differently than I described earlier, but it gives the impression that it works.
Minor tweaks based on testing can still be made next week, so I'll be VERY curious to hear feedback.

If it works as intended, then you CAN train your officers in Fencing by taking them ashore.
And officers should also gain XP in their respective skills faster than the player does, hopefully making them more important.
 
So please have a critical look through this to see if there are any MASSIVE lapses of logic.

I'll post this and all other needed files as soon as I can.
Not a massive lapse, perhaps, but:
Code:
if (skillmult < 0.5 && IsPlayerParty(chr) && IsOfficer(chr)) skillmult = 0.5; // Character is in the player shore party
'IsPlayerParty' is defined in "MAXIMUS_Functions.c" and is true if 'IsOfficer(chr)' or 'IsCompanion(chr)' are true or if the character is in group "LAI_GROUP_PLAYER" - your shore party officers, your companion ship captains and any NPC's assigned by quest code to the player's group. So if 'IsOfficer(chr)' is true then 'IsPlayerParty(chr)' must be true, and can be removed from that line.

The 50% penalty on player skill increases has been imposed. :( I'll give it a try since, as I recommended to someone else, I'll need to use the most up to date version for development and testing of my storyline.

In any case, thanks for dealing with this! :onya It has to be better than the levelling system as it was before your recent work.
 
Last edited:
Not a massive lapse, perhaps, but:
Code:
if (skillmult < 0.5 && IsPlayerParty(chr) && IsOfficer(chr)) skillmult = 0.5; // Character is in the player shore party
'IsPlayerParty' is defined in "MAXIMUS_Functions.c" and is true if 'IsOfficer(chr)' or 'IsCompanion(chr)' are true or if the character is in group "LAI_GROUP_PLAYER" - your shore party officers, your companion ship captains and any NPC's assigned by quest code to the player's group. So if 'IsOfficer(chr)' is true then 'IsPlayerParty(chr)' must be true, and can be removed from that line.
I wasn't quite sure if it would be safe to do so, but indeed it probably is.
My concern was that this function can get called on officers, companions, officers of companions and NPCs as well and I didn't want any accidental sharing to occur.

Actually, that 'IsPlayerParty(chr)' should probably be 'IsPlayerParty(chref)' to function as my intended failsafe. :facepalm

The 50% penalty on player skill increases has been imposed. :( I'll give it a try since, as I recommended to someone else, I'll need to use the most up to date version for development and testing of my storyline.
Yup. I figured it MAY be a good idea, but I do not know that for sure. And if I don't actually implement it now, then we'll never find out.

My real main concern though was to rewrite it in such a way that you and @pedrwyth could understand what it does and how it works.
I totally expect further changes to be required based on actual play-testing, but my hope is that after my rewrite, you two can sort that out without me having to it.
In other words: We'll see what happens with this current version and which parts of my thinking are and aren't good ideas.
What happens after that is up to you.

If the 50% penalty for the player is indeed a bad idea, it should be easy enough now to get rid of it.
You already recognized that it IS in there, so I imagine you can figure out just as easily how to kick it back out too. :cheeky

In any case, thanks for dealing with this! :onya It has to be better than the levelling system as it was before your recent work.
I don't know about that. Hopefully, yes.... :ninja
But this was rather a rush-job, so I don't really dare to give any guarantees on it.
 
Last edited:
I wasn't quite sure if it would be safe to do so, but indeed it probably is.
My concern was that this function can get called on officers, companions, officers of companions and NPCs as well and I didn't want any accidental sharing to occur.

Actually, that 'IsPlayerParty(chr)' should probably be 'IsPlayerParty(chref)' to function as my intended failsafe. :facepalm
My point is, that 'IsPlayerParty(chr)' shouldn't be there at all. It checks 'IsOfficer(chr)', among other things. If 'IsOfficer' is true then 'IsPlayerParty' is also true, and if 'IsOfficer' is false then the things which 'IsPlayerParty' also checks are things you don't want checked - companions and NPC's. I wasn't suggesting that 'IsOfficer(chr) be removed - that's the one which does what you need. ;)
 
My point is, that 'IsPlayerParty(chr)' shouldn't be there at all. It checks 'IsOfficer(chr)', among other things. If 'IsOfficer' is true then 'IsPlayerParty' is also true, and if 'IsOfficer' is false then the things which 'IsPlayerParty' also checks are things you don't want checked - companions and NPC's. I wasn't suggesting that 'IsOfficer(chr) be removed - that's the one which does what you need. ;)
What I meant is that you are absolutely right. This is what I probably intended it to be:
Code:
if (skillmult < 0.5 && IsPlayerParty(chref) && IsOfficer(chr)) skillmult = 0.5; // Character is in the player shore party
That way, 'IsPlayerParty(chref)' functions as a fail-safe to ensure the player's shore party won't EVER get XP when an NPC gains XP.
I think that check should indeed be superfluous, but I do not know that for sure as I didn't do enough thorough tests.
 
Done some comparative testing with the latest levelling/XP gain code for fencing.

Basically at easiest game level I just got three officers in the tavern and went to Barbados Canyon to work through the thugs there (still variable depending which end you start and whether you get rabid monkeys or men for some characters).

I put god mode on everyone (they would not have survived without all having "corpse" icons by the end) to see how much XP had been gained once the canyon was clear. Sometimes the main character fought, sometimes I progressed without even drawing sword, Sometimes I took weapons off the officers too to see what they still gained and put shared XP on and off.

XP gain was slow compared to version 3.4 (in which I ran equivalent tests) but the skill levels started higher in the beta 4 versions so would be anyway, officer gains were much slower in beta 4 (but in 3.4 were crazy fast to me particularly once shared XP applied). In Beta 4 It didn't matter much if any particular character fought or not (or shared XP or not) their gains were still much the same. Officers seemed to me to be gaining at a reasonable rate (if one assumed they were actually fighting). So basically whichever character goes through an engagement is going to come out with similar stats no matter how they behave through the engagement (but I think that was probably always true and difficult to code otherwise).

I then added a line to change the main character to 1.0 XP gain for fencing (as per sailing and leadership lines) which improved the main character some but still less than 3.4 - but of course skill rates have changed from linear.

The various results are attached in a speadsheet file. I'm not qualified to say if the gain is too slow or not since I have no real feel for how it had behaved in the past when well balanced (but then again have no"subjective" view either).

It looks to me to have potential to be balanced within this coding structure given the various variables available to play with but it depends on good, consistent, feedback (some hopes).
 

Attachments

  • sharedxp.7z
    9.3 KB · Views: 275
Back
Top