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

Solved Rebalancing the Fighting System

Don Lasagnetti

The Black Admiral
Storm Modder
Alright, so I've gone through some of the swords again and toned down the Nicolas Sharp Saber. It should still be an excellent blade, but not render you invincible right from the beginning. I left the price and level requirements etc. as they were, as I think otherwise they might start dropping as loot at some point. Attaching the changed file.
By the way, I can confirm now that portuguese soldiers now behave properly with your fix! :doff
What would I enter in console.c to test a few swords I discovered? GiveItem2Player ("blade42"); (that was just my guess) didn't seem to work for me. Maybe I'll find a suitable unique sword for US promotions
 

Attachments

  • initItems.c
    241.4 KB · Views: 168
Please don't mess up the Sabre of Nicholas Sharp too much. The melee system is completely broken and without a super sword early on one ends up with a melee skill of 1. You have seen my save game and know i am not exaggerating.
 
That sword isn't even available in most storylines. Can't rely on that, can we?
Weren't we going to try to use that code I found last week to try to restore the fencing system to working reasonably well again?
 
Pieter, please don't mess up the Sabre of Nicholas Sharp too much. The melee system is completely broken and without a super sword early on one ends up with a melee skill of 1. You have seen my save game and know i am not exaggerating.
Signed.

I perfectly understand that there are some here who consider melee being too easy and some swords being overpowered.

But there are still others who are more than challenged with the melee as it is. I, for example, have not yet seen any sword I would call overpowered since I am playing Buil 14, nor have I encountered any melee situation where I felt overpowered. I always was barely surviving at all, and I still die in the larger number of any melee combats and have to reload. I'm playing in journeymann and adventurer most.

So please, it may be the very swords some here consider overpowered is what keeps melee-noobs like me from just dying everytime.
If someone considers the melee combat being too easy, I suggest he uses a common cutlass and does not wear any armor. :guns:
 
That is my point. I am not playing the standard storyline and with a tattoo I am up to level 2. Now the only way to advance it by finding a teacher.
 
Ah ... so that is known?
I always wondered why melee does not go up. In fact, I observed that I am getting skill in defence, when doing melee, but not in melee.
 
The Sword of Nicholas Sharp is not a fix to the melee problem though. It is a workaround at best.
And even so, a workaround that is only available in two storylines and that many players may not even know or think about.
I'd like to try to tackle the real source of the problem so that we can afford to balance the blades normally.

This should be the function for Fencing XP in PROGRAM\Loc_ai\LAi_fightparams.c:
Code:
void LAi_ApplyCharacterBladeDamage(aref attack, aref enemy, float attackDmg, float hitDmg, bool isBlocked)
{
    //Åñëè íåóáèâàåìûé, òî íåòðîãàåì åãî
    if(CheckAttribute(enemy, "chr_ai.immortal"))
    {
        if(sti(enemy.chr_ai.immortal) != 0) return;
    }
    //Ïðèìåíÿåì àáèëèòè
    float pBreak = 0.0;
    if(IsCharacterPerkOn(attack, "SwordplayProfessional"))
    {
        pBreak = pBreak + 0.25;
    }
    // Baste - critical hit check moved down
    float kDmg = 1.0;
    if(IsCharacterPerkOn(attack, "Rush"))
    {
        kDmg = 1.5;
        pBreak = pBreak + 0.5;
    }
    if(IsCharacterPerkOn(enemy, "Rush"))
    {
        pBreak = pBreak + 0.9;
    }
    isBlocked = isBlocked && CheckAttribute(enemy,"equip.blade") && GetCharacterEquipByGroup(enemy,BLADE_ITEM_TYPE) != "bladeX4";
    // PB: Disable blocking for enemies with either no sword or their fists equiped
    if(isBlocked)
    {
        //Âåðîÿòíîñòü ïðîáèâêè
        float p = LAi_BladeFindPiercingProbability(attack, enemy, hitDmg);
        p = p + pBreak;

        //Åñëè øàíñîâ ïðîáèòü íåò, òî íåíàíîñèì ïðîâðåæäåíèÿ
//        if(p < 0.0) return;                                        // LDH removed 06Apr09
        //Åñëè øàíñîâ ïðîáèòü íåò, òî íåíàíîñèì ïðîâðåæäåíèÿ
        if(rand(10000) > p*10000)    // if block is NOT pierced
        {
            // LDH rewrite 06Apr09
            if(GetCharacterEquipByGroup(attack, BLADE_ITEM_TYPE) == "bladeX4")    // if attacker uses fists, he gets damaged instead
            {
                if(!LAi_IsImmortal(attack))
                {
                    LAi_ApplyCharacterDamage(attack, 2*rand(makeint(attack.skill.Fencing)));    // LDH 0..20
                    LAi_CheckKillCharacter(attack);
                }
//                return;        // LDH so blocked fists don't damage defender - 11Apr09
            }
            return;
        }
    }
    //Âû÷èñëÿåì ïîâðåæäåíèå
    float dmg = LAi_BladeCalcDamage(attack);
    dmg = dmg*kDmg;
    //Àòòàêà ñâîåé ãðóïïû
    kDmg = 1.0;
    if(IsCharacterPerkOn(enemy, "BasicDefense")) kDmg = 0.9;
    if(IsCharacterPerkOn(enemy, "AdvancedDefense")) kDmg = 0.8;
    if(IsCharacterPerkOn(enemy, "SwordplayProfessional")) kDmg = 0.7; // Baste
    dmg = dmg*kDmg;
    float damage = LAi_BladeApplySkills(attack, enemy, dmg);
    // Baste - critical hit calculation changed -->
    float critical = 0.0;
    if(IsCharacterPerkOn(attack, "SwordplayProfessional"))
    {
        if(rand(100) <= 25)
        {
            critical = damage*2.0;
        }
    }
    else if(IsCharacterPerkOn(attack, "CriticalHit"))
    {
        if(rand(100) <= 10)
        {
            critical = damage*2.0;
        }
    }
    else
    {
        if(rand(100) <= 5)
        {
            critical = damage*2.0;
        }
    }
    if(isBlocked)
    {
        damage = damage*0.3;
        critical = critical*0.3;
    }
    bool noExp = false;
    if(CheckAttribute(attack, "chr_ai.group"))
    {
        if(CheckAttribute(enemy, "chr_ai.group"))
        {
            if(attack.chr_ai.group == enemy.chr_ai.group && !CheckAttribute(GetMainCharacter(),"TrainingFight") && !HasSubStr(attack.id,"TrainingFight_") && !HasSubStr(enemy.id,"TrainingFight_"))//MAXIMUS
            {
            // ccc mar05 REPLOSS tweak added
            //    PB: I don't think we need this; no harm done = no reploss needed
            //    LAi_ChangeReputation(attack, - REPLOSS);    // ccc rephit for attacking friends
            //    if(sti(attack.index) == GetMainCharacterIndex()) traceandlog("CHANGE REP for player: " + -REPLOSS + " - attacking friends");    // LDH 19Dec08
                damage = 0.0; // dmg = 0.0;
                critical = 0.0;
                noExp = true;
            }
        }
    }
    if(critical > 0.0)
    {
        if(sti(attack.index) == GetMainCharacterIndex())
        {
            Log_SetStringToLog(XI_ConvertString("Critical Hit"));
        }
    }
    // Baste <--
    // TIH --> do not show XP messages for other characters, its annoying! Aug24'06
    bool resetshowXP = false;
    if(sti(attack.index) != GetMainCharacterIndex())
    {
        attack.donotshowXP = true;
        resetshowXP = true;
    }
    // TIH <--
    // if(!LAi_IsFightMode(enemy) && attack.equip.blade=="blade5") {damage = damage*(rand(5)+sti(attack.skill.Sneak)+5);}    // ccc sneakmod backstab

    //Íàíîñèì ïîâðåæäåíèå
    // Baste -->
    if(critical > 0.0)
    {
        LAi_ApplyCharacterDamage(enemy, MakeInt(ApplyArmor(enemy, attack, critical, true) + 0.5)); // GreatZen-NK
    }
    else
    {
        LAi_ApplyCharacterDamage(enemy, MakeInt(ApplyArmor(enemy, attack, damage, true) + 0.5)); // GreatZen-NK
    }
    // Baste <--
    //Ïðîâåðèì íà ñìåðòü
    LAi_CheckKillCharacter(enemy);
    //Åñòü ëè îðóæèå ó öåëè
    bool isSetBalde = (SendMessage(enemy, "ls", MSG_CHARACTER_EX_MSG, "IsSetBalde") != 0);
    //Íà÷èñëÿåì îïûòà
    float exp = LAi_BladeCalcExperience(attack, enemy, dmg);
    if(LAi_IsDead(enemy))
    {
        //Íà÷èñëèì çà óáèéñòâî
        exp = exp + LAi_CalcDeadExp(attack, enemy);
        if(!isSetBalde)
        {
            // ccc mar05 REPLOSS tweak added
            if(enemy.chr_ai.group != LAi_monsters_group)
            {
                if(sti(attack.index) == GetMainCharacterIndex()) traceandlog("CHANGE REP for player: " + -REPLOSS*3 + " - undrawn blade 1");     // LDH 19Dec08
                LAi_ChangeReputation(attack, - REPLOSS*3); // NK tempfix for un-drawn blades 04-17
            }
        }
    }
    if(AUTO_SKILL_SYSTEM) { if(!LAi_IsDead(enemy)) { AddCharacterExpChar(enemy, "Defence", MakeInt(stf(exp*0.5 + 0.5))/2); } }// MAXIMUS!
    if(!isSetBalde)
    {
        // ccc mar05 REPLOSS tweak added
        if(enemy.chr_ai.group != LAi_monsters_group)
        {
            if(sti(attack.index) == GetMainCharacterIndex()) traceandlog("CHANGE REP for player: " + -REPLOSS + " - undrawn blade 2");     // LDH 19Dec08
            LAi_ChangeReputation(attack, - REPLOSS); // NK tempfix for un-drawn blades 04-17
        }
        exp = 0.0;
    }

    if(!noExp) { if(AUTO_SKILL_SYSTEM) { AddCharacterExpChar(attack, "Fencing", MakeInt(exp*0.5 + 0.5)); }else{ AddCharacterExp(attack, MakeInt(exp*0.5 + 0.5)); } }
    if ( resetshowXP ) { DeleteAttribute(attack,"donotshowXP"); } // TIH do not show other characters XP increases
}
We can put in some log messages to check if the required lines are being executed properly. And if they are, whether their resulting values are sufficient.
Anyone interested in such an effort?
 
I play POTC most every day anyway. But it will be some time before I can get back to it regularly. When I get home I have to pull the motherboard out and take pictures of its warped condition. Gigabyte wants me to prove I am not a liar.
 
Once you're ready for it, let me know. Then I can give you some code changes to make so we can see what works and what doesn't. :doff
Probably should move to a different thread then for discussing it to prevent cluttering this one.
 
Hello gentlemen,

The Sword of Nicholas Sharp is not a fix to the melee problem though. It is a workaround at best.
And even so, a workaround that is only available in two storylines and that many players may not even know or think about.
I'd like to try to tackle the real source of the problem so that we can afford to balance the blades normally.

To be honest, for me, even that very good sword is *not* a workaround. Even with that sword, I get killed very quickly.
Now this is not about tactics and equipment. I buy the best available, and I do not speak of tacticyl complicated situations. Just a very simple matter ... me on one side, ONE enemy on the other, is deadly to me.

But before adjusting game mechanics, let's just be sure I am not missing a point of crucial importance. So please someone answer my questions:
- is there actually anything like blocking supposed to work?
- if so, how?

Besides that, going to the real problem is much appreciated.
The problem as I see it is that there is almost no learning cuve (at lkeast for me) in melee combat. Either I kill my opponent immediately with less than 2 hits, or I get killed at similar speed. In neither case I know why this is so. Basically, combat happens too qiickly and dying is too suddenly to get any grip of what I am doing wrong and what I may do better. It feels completely random, with the odds of loosing much bigger than 60%.

We can put in some log messages to check if the required lines are being executed properly. And if they are, whether their resulting values are sufficient.
Anyone interested in such an effort?

I'll gladly get a try, if PotC continues to run here (Pieter knows what 'm talking about). At least, that may give some insight in what's happening at all.
 
True. But not all towns have blacksmiths anyway; only the original game ones do.
The one thing they ARE still missing, I think, is a correct animated flag on the worldmap.
Ah, I see. Pretty sure that this is not doable with my skills though. I'll very likely start looking into the quest copying you requested though! Maybe I'll get a bit of insight to create one or two minor quests myself, who knows :type1

Hello gentlemen,



To be honest, for me, even that very good sword is *not* a workaround. Even with that sword, I get killed very quickly.
Now this is not about tactics and equipment. I buy the best available, and I do not speak of tacticyl complicated situations. Just a very simple matter ... me on one side, ONE enemy on the other, is deadly to me.

But before adjusting game mechanics, let's just be sure I am not missing a point of crucial importance. So please someone answer my questions:
- is there actually anything like blocking supposed to work?
- if so, how?

Besides that, going to the real problem is much appreciated.
The problem as I see it is that there is almost no learning cuve (at lkeast for me) in melee combat. Either I kill my opponent immediately with less than 2 hits, or I get killed at similar speed. In neither case I know why this is so. Basically, combat happens too qiickly and dying is too suddenly to get any grip of what I am doing wrong and what I may do better. It feels completely random, with the odds of loosing much bigger than 60%.

I'll gladly get a try, if PotC continues to run here (Pieter knows what 'm talking about). At least, that may give some insight in what's happening at all.

Yes, blocking works perfectly for me. Especially with the Nicholas Sharp Saber it's nearly impossible to pierce my blocks. I usually block then strike quickly before their next attack comes in. If you fight multiple opponents, it requires much more elaborated tactics though.

Just look through your controls and find the key assigned for blocking! ;)
 
To be honest, for me, even that very good sword is *not* a workaround. Even with that sword, I get killed very quickly.
Now this is not about tactics and equipment. I buy the best available, and I do not speak of tacticyl complicated situations. Just a very simple matter ... me on one side, ONE enemy on the other, is deadly to me.
[...]
Besides that, going to the real problem is much appreciated.
The problem as I see it is that there is almost no learning cuve (at lkeast for me) in melee combat. Either I kill my opponent immediately with less than 2 hits, or I get killed at similar speed. In neither case I know why this is so. Basically, combat happens too qiickly and dying is too suddenly to get any grip of what I am doing wrong and what I may do better. It feels completely random, with the odds of loosing much bigger than 60%.
I understand there is a substantial problem. From what I gather, the main problem is that your Fencing skill does not increase as much as it should. Is that correct?
Also, blocking definitely DOES work. It just doesn't 100% anymore, like it used to.
 
Gentlemen ....

Yes, blocking works perfectly for me. Especially with the Nicholas Sharp Saber it's nearly impossible to pierce my blocks. I usually block then strike quickly before their next attack comes in. If you fight multiple opponents, it requires much more elaborated tactics though.

Just look through your controls and find the key assigned for blocking! ;)

Dear Don Lasagnetti ... I do know that. Perhaps I I made myself not clear.

I know there is a block key.
And I am of course using it.

What I meant is that despite that, it very often seems to have no effect.

I remember blocking being much overpowered until build 13 I think ... it always worked even when surrounded by multiple opponents and was almost impregnable. I am perfectly with you that that was both much too easy and not realistic at all.

But since Build 14 I don't get familiar with melee combat at all.
I do block, but sometimes it seems to have no effect. Enemies blows go straight through my block, dealing damage about more than half my maximum hit points, which means I get killed with 2 hits.
I am not even talking about more than 1 opponent, it happens quite often with only one opponent.

@Pieter:
It may be part of the problem that I get very few to almost no melee skill. I think the highest level I remember is 5 at this, and half of it was from trainers. I am using the automated skill system, so it shall come from melee experience ... but with melees most often happen to be very short, there is no much skill gained.
Also, I noticed that from a certain point, I get "defence" increased while doing melee, instead of "melee".

I just tried something different - starting standard storyline with Malcolms tutorial intro, and was able to get melee up by just sparring with him. I reached melee 5 very quickly. But surely this is not the idea behind our melee combat that it only works if I "cheat" it to maximum level before encountering my first "real" enemy?
 
It may be part of the problem that I get very few to almost no melee skill. I think the highest level I remember is 5 at this, and half of it was from trainers. I am using the automated skill system, so it shall come from melee experience ... but with melees most often happen to be very short, there is no much skill gained.
Also, I noticed that from a certain point, I get "defence" increased while doing melee, instead of "melee".
You're supposed to be getting BOTH. That's why I want to suggest putting some LogIt lines in the relevant code, so that you can see what is going on behind the scenes of the game.
And hopefully allow us to find out what is and isn't working. :facepalm

I just tried something different - starting standard storyline with Malcolms tutorial intro, and was able to get melee up by just sparring with him. I reached melee 5 very quickly. But surely this is not the idea behind our melee combat that it only works if I "cheat" it to maximum level before encountering my first "real" enemy?
Most assuredly not. :no
 
Gnetlemen ....
Dear Don Lasagnetti ... I do know that. Perhaps I I made myself not clear.

I know there is a block key.
And I am of course using it.

What I meant is that despite that, it very often seems to have no effect.

I remember blocking being much overpowered until build 13 I think ... it always worked even when surrounded by multiple opponents and was almost impregnable. I am perfectly with you that that was both much too easy and not realistic at all.

But since Build 14 I don't get familiar with melee combat at all.
I do block, but sometimes it seems to have no effect. Enemies blows go straight through my block, dealing damage about more than half my maximum hit points, which means I get killed with 2 hits.
I am not even talking about more than 1 opponent, it happens quite often with only one opponent.

@Pieter:
It may be part of the problem that I get very few to almost no melee skill. I think the highest level I remember is 5 at this, and half of it was from trainers. I am using the automated skill system, so it shall come from melee experience ... but with melees most often happen to be very short, there is no much skill gained.
Also, I noticed that from a certain point, I get "defence" increased while doing melee, instead of "melee".

I just tried something different - starting standard storyline with Malcolms tutorial intro, and was able to get melee up by just sparring with him. I reached melee 5 very quickly. But surely this is not the idea behind our melee combat that it only works if I "cheat" it to maximum level before encountering my first "real" enemy?

Yes, not sure how it's calculated, but I think if your block fails, the attack does normal damage, unless you wear armor.
Indeed, for me too, at some point during the early levels I stop advancing in melee at all. I think we have very different playstyles though, as I'm usually still getting melee to a fairly good level (around 8) before it stops. With that and always buying the best blades and armor available, I'm getting through the game rather easily though. What I also do is hardly ever use my pistol in the early levels, to maximize the increase in melee.
 
The one thing that I find quite bothersome there is that it stops. It has no business doing that! :whipa
 
Gentlemen,

@Don Lasagnetti:
I fully agree we may have very different playing styles.
I use my pistol quite often, because this is the only way to survive the melee at low levels. Any enemy who is shot is one less that will kill me, is one less that will force me to reload the game, and that's something I do hate.

2nd matter is, I just read your original first post in this thread, I almost never ever get a character beyond level 20-30. In fact, in most my careers I loose interest in the game about level 15-20, and start something new. So I think what I do throughout the entire game, is what you would call "low level".
This may be because I am playing in Iron Man mode and doing all that sailing manually. A lot of time spent without actually gaining experience, but still a lot of time spent. After about 15 level, I am in the mood to try something else.

Personally, I'd be happy if melee combat would do much less damage (both me and the enemies), to actually have some fighting happening instead of just instant killing. That would enable both more melee skilling while doing it, and be more enjoyable, too. What I really hate is being cut down before realizing what's happening. It's that fast, it does not even help to drink potions.
 
I did find that 1-on-1 fights can be quite difficult when I had to fight some duels in the Woodes Rogers storyline.
That is set on Journeyman difficulty instead of Apprentice though. How does the game play if you DO play on Apprentice?

Also, please extract this file to PROGRAM\Characters . I added some log messages to the XP calculations in there.
You should now get an on-screen message for every time you get Fencing or Defence XP in a fight.
If you ARE fencing, but NOT getting any messages, that indicates something is wrong.
Also, if you ARE getting the messages, but your Fencing skill does not seem to be increasing, have a look at that "exp" value the message shows.
That could also be where the problem comes from.
 

Attachments

  • CharacterUtilite.zip
    32.9 KB · Views: 111
Also, please extract this file to PROGRAM\Characters . I added some log messages to the XP calculations in there.
You should now get an on-screen message for every time you get Fencing or Defence XP in a fight.
If you ARE fencing, but NOT getting any messages, that indicates something is wrong.
Also, if you ARE getting the messages, but your Fencing skill does not seem to be increasing, have a look at that "exp" value the message shows.
That could also be where the problem comes from.
This is also included in http://www.piratesahoy.net/threads/...-version-2-available.20513/page-3#post-450747
Hopefully it will help us to get to the bottom here. Of the problem, of course. NOT of the ocean. :cheeky
 
Gentlemen,

@Don Lasagnetti:
I fully agree we may have very different playing styles.
I use my pistol quite often, because this is the only way to survive the melee at low levels. Any enemy who is shot is one less that will kill me, is one less that will force me to reload the game, and that's something I do hate.

2nd matter is, I just read your original first post in this thread, I almost never ever get a character beyond level 20-30. In fact, in most my careers I loose interest in the game about level 15-20, and start something new. So I think what I do throughout the entire game, is what you would call "low level".
This may be because I am playing in Iron Man mode and doing all that sailing manually. A lot of time spent without actually gaining experience, but still a lot of time spent. After about 15 level, I am in the mood to try something else.

Personally, I'd be happy if melee combat would do much less damage (both me and the enemies), to actually have some fighting happening instead of just instant killing. That would enable both more melee skilling while doing it, and be more enjoyable, too. What I really hate is being cut down before realizing what's happening. It's that fast, it does not even help to drink potions.


You are playing the game wrong. Since melee is completely and totally broken there is no point in even attempting anything at all until after level 15. That is why I play as a merchant/smuggler.
Just level up as fast as you can until you get the golden curiass, and then start actually playing the game and doing quests. I don't even try treasure quests until then.
It also helps to get tattoos, grenades, stinkpots, poisoned throwing knives, ether bottles, the kitchen sink and anything else you can find to help keep you alive. I find that the only characters I can beat are the town guards. Since some of them also have pretty good swords, they have a high attrition rate. :dance

About the details of combat, the block only works for a few seconds and if your opponent has a higher skill level than you (and they all do) then he will blow right past your block anyway. So pick them off from a distance and then take off running because you can not fight them.
 
Back
Top