From what I can see boarding enemies are created by this formula:
Code:
boarding_erank = sti(echr.rank); // used to calculate enemy HP
if (GetDifficulty() < 4 && boarding_erank > 2*sti(mchr.rank)) // LDH 06Sep06 put a limit on this thing to prevent insanely high enemy ranks
{
int new_boarding_erank = sti(mchr.rank) * 2;
SDLogIt("boarding_erank changed from " + boarding_erank + " to " + new_boarding_erank);
boarding_erank = new_boarding_erank;
}
boarding_erank = makeint((2.0*sti(mchr.rank) + boarding_erank)/3.0+0.5);
and in the end this is the rank they get:
Code:
boarding_erank -mchr_rank
Because the genrank is true it will be ported to created officer with an random NPC type. This could also hint to a problem. I think I should add a check there for isFriend, if this is false it should take an officertype instead of an NPC type. Also the create officer is set up for officer encounters, not boarding crew members. SO maybe it would be wise to make a seperate function for this.
In create officer this formula is used to determine the level:
Code:
makeint(sti(PChar.rank)*0.75 + rand(sti(PChar.rank)*(1.1-(GetDifficulty()*0.2))) + rankch);
So let's say you are level 20 and the enemy captain is level 25 on difficulty 3:
Line1: 25
Line2: (3 < 4 && 25 > 40) FALSE
Line8: (2*20 + 25)/3 + 0.5= 65/3 +0.5 = 22
End: 22-20 = 2
Offic: 15 + rand(10) + 2 = between 17 and 27
So this would result in a enemy rank of between 17 and 27
Let's see what happens if the enemy captain is level 45 while you are 20:
Line1: 45
Line2: (3< 4 && 45 > 40) TRUE
Line6: 40
Line8: (2*20 + 40)/3 +0.5 = 27
End: 27-20 = 7
Offic: 15 + rand(10) + 7 = between 32 and 42
So this would result in an enemy rank of between 32 and 42
So there doesn't seem to be so much wrong. But it could be because wrong officer types are assigned the wrong skills and abilities are chosen.
I think the best way would be to add an attribute in the boarding set up to the character so in the fantom creation I know it needs to be either a fighter or an officer etc.
I will look into this. Meanwhile it would be nice if you could figure out which level the enemies actually are.
If you could do this for me that would be nice:
Search for this line in LAi_boarding.c
Code:
chr = LAi_CreateFantomCharacterEx(false, boarding_erank -mchr_rank, true, true, BOARDER_HAS_GUN_PROB, model, ani, "rld", enLocType + locnum);
and place this line under it:
Code:
trace("BOARDING CREW: id= "+chr.id+" level= "+chr.rank+" fencing is= "+chr.skill.Fencing);
And after you had a boarding please post the compile.log file