This is how shared XP is handled now
Let's see if I can translate this for everyone:
This is only the part if it's called for Group Offic, which is used in most cases.
First it will see if this character has a captain. If it has a captain it will run trough all passengers of this captain.
So say your boatswain gets some XP it will detect you (the mainplayer) are the captain so it will now run this function for all of your passengers (and yourself).
The first lines are error prevention incase there are some weird characters or stuff.
These lines tell us when the character is the "original" character who got the XP it will get everything. And if the XP is not for a certain skill it will also give all the XP to the character who is called now.
The next part checks if the skill fencing is called. If this is the case it will check if the character is allies or is officer for the character and if so it will give 50% of the XP.
I find this quite weird because as far as I know bAllies checks if something is a passenger, so this function will always return true already. So just checking of isOfficer should be enough here. - I do think this is sort of right because if an officers is in the fight he should get some XP. but do mind now everytime some officer gets XP all other characters get 50% of it. Maybe this is a bit to much and this mult should be lowered a bit because the characters get XP off them selfs too.
The next part says if the skill isn't Fencing we should look at the skillcontributions and make the multiplier be based on this. This contribution is either 0, 1 or 2. Also remember this is called for all passengers. So if 1 character gets say commerce XP by a trade then all passengers (who contribute this skill) will receiver 200% of this XP. I think this is a bit to much. I do like the fact they get XP only for what the contributing but I would personally suggest to divide it by 2, so you will get 100% if you are fully contributing and you get 50% if you are half contributing.
Here it checks if the character who gets the XP is the maincharacter. And if this is the case all previous stuff is removed and he will only get 50% of the XP unless the skill is leadership or sailing.
I find this very weird, why should we treat the maincharacter different then other characters. Also do note there are a few cases this is bypassed. If the character is getting rewards from the governor, is doing gambling or is trading there is also XP given the the main character seperatly which wont have this divider on it. - I'd say it's better to remove this whole block of code and instead and add something in the block above where the empmult is calculated. You could check for the noncontribute flag for the officer. if this is true (which it is for the mainchar) the tempmult is always 0.5 or add something like a function: GetCaptainSkillMult this will return the multipliers for captains. We can easily check who is the captain because this will always happen at i = -1. So in this case we could just determine the multipliers differently. You could give captains always leadership and sailing bonus. But in this way it would also work for other ships etc and not only for the mainchar.
Here the game checks if sharedXP is enabled, and if it is then it will give this person a 50% skill increase at least.
I think he lies the culprit, we don't want officers to get all skills right?
-----------------
These are my comment on the current SharedXP system. Please leave your comments too.
Code:
//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 && bAllies(chref) && 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
}
}
}
Let's see if I can translate this for everyone:
This is only the part if it's called for Group Offic, which is used in most cases.
First it will see if this character has a captain. If it has a captain it will run trough all passengers of this captain.
So say your boatswain gets some XP it will detect you (the mainplayer) are the captain so it will now run this function for all of your passengers (and yourself).
The first lines are error prevention incase there are some weird characters or stuff.
Code:
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"
Code:
if (expName == SKILL_FENCING) // Fencing is a personal skill and should be handled differently
{
if (skillmult < 0.5 && bAllies(chref) && 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
}
I find this quite weird because as far as I know bAllies checks if something is a passenger, so this function will always return true already. So just checking of isOfficer should be enough here. - I do think this is sort of right because if an officers is in the fight he should get some XP. but do mind now everytime some officer gets XP all other characters get 50% of it. Maybe this is a bit to much and this mult should be lowered a bit because the characters get XP off them selfs too.
The next part says if the skill isn't Fencing we should look at the skillcontributions and make the multiplier be based on this. This contribution is either 0, 1 or 2. Also remember this is called for all passengers. So if 1 character gets say commerce XP by a trade then all passengers (who contribute this skill) will receiver 200% of this XP. I think this is a bit to much. I do like the fact they get XP only for what the contributing but I would personally suggest to divide it by 2, so you will get 100% if you are fully contributing and you get 50% if you are half contributing.
Code:
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
}
I find this very weird, why should we treat the maincharacter different then other characters. Also do note there are a few cases this is bypassed. If the character is getting rewards from the governor, is doing gambling or is trading there is also XP given the the main character seperatly which wont have this divider on it. - I'd say it's better to remove this whole block of code and instead and add something in the block above where the empmult is calculated. You could check for the noncontribute flag for the officer. if this is true (which it is for the mainchar) the tempmult is always 0.5 or add something like a function: GetCaptainSkillMult this will return the multipliers for captains. We can easily check who is the captain because this will always happen at i = -1. So in this case we could just determine the multipliers differently. You could give captains always leadership and sailing bonus. But in this way it would also work for other ships etc and not only for the mainchar.
Code:
if (skillmult < 0.5 && SharedXP) skillmult = 0.5; // Sharing XP, so everybody gets at least 50%
I think he lies the culprit, we don't want officers to get all skills right?
-----------------
These are my comment on the current SharedXP system. Please leave your comments too.
Last edited: