• 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 Leveling: Sudden Huge Amounts of XP Gained

So.... they're missing a whole bunch of those "personal abilities", by the looks of it?

Also, their HP does seem quite low. Should it not be 40 + 10*(level-1) ???
By that reasoning, that third citizen should have an HP of 170 rather than 68.

But that might affect only citizens as you say that enemies DO have their normal HPs; they just lose it faster.
That could be explained by them not having their personal Defence abilities.
 
Also, figure out that they have different classes: The first one is a normal citizen, the second is a Boatswain (?) , and the third one is a shop merchant (???)
 
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
 
This is now very strange. I did what you say, @Pieter Boelen, and... well, it's better to show you the screenshots and let the images talk for themselves.
I have selected three random citizens with all of them equipped with swords. Here it is the first one:

View attachment 22798

View attachment 22799

This is a normal citizen, they are set up to be a generic character and therefore will have most of the personal skill pretty quick because the system defaults to them.

Looking at this, you would think that here there is no problem. I thought what the hell? Nothing bizarre? Then I moved onto a woman citizen, and... surprise! She was not normal.

View attachment 22800

View attachment 22801

This is a boatswain, these can walk in towns also. I've noticed I made a typo in the boatswain setup and thats why the fencing is so low. this should be a bit higher. if thats the case probably the personal skills will get a bit higher also.
But a boatswain also had:
Code:
if(isPerkExisting("LongRangeGrappling")) {OfficerTypes.(type).perks.LongRangeGrappling = 1};
    if(isPerkExisting("GrapplingProfessional")) {OfficerTypes.(type).perks.GrapplingProfessional = 1};
    if(isPerkExisting("InstantBoarding")) {OfficerTypes.(type).perks.InstantBoarding = 1};
    if(isPerkExisting("HighStakes")) {OfficerTypes.(type).perks.HighStakes = 1};
    if(isPerkExisting("ImproveSmuggling")) {OfficerTypes.(type).perks.ImproveSmuggling = 1};
    if(isPerkExisting("MusketsShoot")) {OfficerTypes.(type).perks.MusketsShoot = 1};
And the grappling perks will be chosen quite soon, this is because if you hire this officer you want them to be a bit unique. If all officer you hired just had the personal perks there wouldn't be any use for them. Now they will first try to get the more special perks.

This doesn't explain why even if they have normal health in those enemy sailors, they still have bad level of fencing. Anyway, I moved onto a final citizen and it had the same isues as the second one.

View attachment 22802

View attachment 22803

I hope this can help you.
This one is set up to be a merchant, so no wonder he can't fight that well ;).

Like I said the problem seems to be in the assignment of the officertype.
Besides that there seems to be something still wrong with the HP assignment so I will look into that too...
 
Also, figure out that they have different classes: The first one is a normal citizen, the second is a Boatswain (?) , and the third one is a shop merchant (???)
Good point. Seems that their "officer types" aren't assigned correctly.
The "random officer type" should apply only to actual officers, shouldn't it?

If ALL characters are to get an officer type, should there be one such type that is just "generic character that has to fight"?
Or possibly make all random enemies "Tough/Fighter" and set all citizens to the "Citizen" type?
 
Random officer type should only apply to actual officers, yes.
Maybe I would choose second.

I have done the test @Levis told me. I had a boarding and here it is the compile.log.

Also @Pieter Boelen , I have found omething interesting for you. While I had the boarding, I took a quick screenshot fighting against an enemy British soldier. It seems that the HP goes crazy after receiving a hit and then drops down a lot, meaning that it is needed only a hit to kill them too. Here it is:

Vida bajando raramente.jpg
 

Attachments

  • compile.log
    15.8 KB · Views: 132
Good point. Seems that their "officer types" aren't assigned correctly.
The "random officer type" should apply only to actual officers, shouldn't it?

If ALL characters are to get an officer type, should there be one such type that is just "generic character that has to fight"?
Or possibly make all random enemies "Tough/Fighter" and set all citizens to the "Citizen" type?
People walking in cities use the RandomNPC type.
But I suspected for the boarding etc there was an other system in place but it seems there isn't so I will make sure enemies now get a good officertype.
 
I think this should fix the problem.
Please test :).
 

Attachments

  • LEVIS_FIXED_FOR_SEPT_21.zip
    129.4 KB · Views: 100
Ok, it shouldn't conflict with the new update but going to do a winmerge now to be sure of it. so before you test tomorrow please see if there is a new version.

Just checked, everything is okay
 
Last edited:
Just tested the new version of Beta 4 WIP. I have something new to talk about.

About the abilities of fencing and that... at least here, in the dungeons, it seems now to be fixed. Now the enemies doesn't die too quickly. Or that's what I thought... They still die with two hits or so. The problem now is that the HP the enemy gets are way too low. Let me show you a screenshot.

Here I am fighting against a guy of the dungeons. He blocked my sword in an attack and he got little damage. But then I looked onto his HP bar, and he showed that he had in total 62 HP (That was my first hit to him). What?? I was at level 16 by the way, so I had almost 200 HP, and my fencing level was around 6.

Sin título.jpg

Here you have also the compile.log if that helps you. I have no error logs for now.
 

Attachments

  • compile.log
    60.7 KB · Views: 116
Good news! The problem of enemy boarders getting no abilities of fencing / low skill on fencing OR low HP is now fixed! Here you have a screenshot.

I went to board a pirate brigantine and decided to test this new fixes. In the screenshot, you can see that I hit an enemy and he blocked me, receiving minor damage. Also, their HP was very similar to what I have. So this seems to be fixed :D

HP working good.jpg
 
I need to look trough the compile log but I think you might just have been lucky with the bandit in the cave.
 
Also, their HP does seem quite low. Should it not be 40 + 10*(level-1) ???
By that reasoning, that third citizen should have an HP of 170 rather than 68.
@Levis: What about HP for NPCs? I think some might be handled substantially differently than the player.
But should they be?

Is anything more about experience that needs to be tested? Any bug we left?
Keep an eye out for anything that "seems wrong" with it.
Hopefully it'll be pretty much OK by now, but we need you and the other players to confirm that. ;)
 
There is something weird still to look at which I posted today @Pieter Boelen :

Just tested the new version of Beta 4 WIP. I have something new to talk about.

About the abilities of fencing and that... at least here, in the dungeons, it seems now to be fixed. Now the enemies doesn't die too quickly. Or that's what I thought... They still die with two hits or so. The problem now is that the HP the enemy gets are way too low. Let me show you a screenshot.

Here I am fighting against a guy of the dungeons. He blocked my sword in an attack and he got little damage. But then I looked onto his HP bar, and he showed that he had in total 62 HP (That was my first hit to him). What?? I was at level 16 by the way, so I had almost 200 HP, and my fencing level was around 6.

View attachment 22818

Here you have also the compile.log if that helps you. I have no error logs for now.
 
@Levis: What about HP for NPCs? I think some might be handled substantially differently than the player.
But should they be?

Should be fixed as of yesterday. "Monsters" where not processed right.
 
Back
Top