• 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

This might be a bit experimental, but I think it works. I have made changes to the LAi_fightparams and LAi_events files that make EXP calculation take critical damage into account for both melee and ranged weapons, and make it so one gets EXP from using fists.
I'm getting all sorts of weird error messages now, fighting with the mummies in the Cozumel Temple:
Code:
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 395
Negative func 'sqrt' argument
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 583
Unknown data type
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 583
Unknown data type
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 583
Unknown data type
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 585
string call argument isnt string var
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 585
process event stack error
That first line is referring to the sqrt in this code:
Code:
float exp = damage*((1.0 + erank*0.5)/(1.0 + rank*0.5)) * sqrt(erank);
I haven't the foggiest how an enemy rank can be negative though. :shock

Edit: Reason found. The erank definition only occurred when fighting with fists, but is ALWAYS used.
See attached for proposed fix. :doff
 

Attachments

  • LAi_events.zip
    21.9 KB · Views: 117
So... can we release Beta 2.5 with the modified gun stats or do we need to wait for some more testing and comments?
 
Pieter, can you tell me briefly the impact of the new stats or refer me to place to look.
 
Been playing for a while and have some opinions.

The musket only seems to misfire when the target is close. At distance it seems to fire ok. I'm not really sure yet and will test more.

Most of the pistols are completely useless as their damage is so low that even I hardly notice being shot. The only exception so far is the scrapper pistol.

Clint Eastwood puts up a fight now! It took 3 of us quite a while to whittle him down and he knocked out one of my officers.

Since it looks like the scrapper pistol is the only firearm worth using that is what we will be wearing from now on.
 
Pieter, can you tell me briefly the impact of the new stats or refer me to place to look.
You can see the stats in the file attached to my post here: http://www.piratesahoy.net/threads/rebalancing-the-fighting-system.20547/page-10#post-452329

The musket only seems to misfire when the target is close. At distance it seems to fire ok. I'm not really sure yet and will test more.
Really? That "click" happens when you don't fire at any actual target.
But if the musket somehow REALLY doesn't work up close, isn't that sort-of exactly what we wanted? :shock

Most of the pistols are completely useless as their damage is so low that even I hardly notice being shot. The only exception so far is the scrapper pistol.
When you get up to a higher character level, indeed the earlier pistols become fairly useless.
As I see it, at the end of the game you'll probably be using either a musket, Scrapper Pistol, Quad-Barrel Pistol or a Musketoon.
But you can't make the same weapons useful but not overpowered in the early game and keep them being useful later on.

Do enemies use any of those high-level guns, or do they prefer to stick to the lower level ones?
Things were coded to max out around level 20; after that, nothing new becomes available, so as HP keeps increasing per level, the guns become less and less useful.

Clint Eastwood puts up a fight now! It took 3 of us quite a while to whittle him down and he knocked out one of my officers.
Mwuhahaha! Success! :woot
 
I am at level 8 and they are all useless except for 1 scrapper pistol i looted from a corpse.

The officers wait too long before they start firing so the musket misfires nearly every time for them. It sucks to be surrounded by enemies while your officers go click click click click click click click click.
 
At level 8 already??? And why did you even run into a Scrapper pistol already? They've got minlevel... wha... 16 now? :shock
 
He wuz a tuff guy who killed me a few times with one stroke right through my block. We had to ambush him and all blast away with our guns and swords before he fell. He was carrying that excellent scrapper. The others were carrying grapeshot pistols and 2 barrel guns and a 3 gun set. 4 on 4 and stealth and treachery carried the day.

I do seem to be leveling up pretty fast.........
 
Indeed that sounds more like a cheat on the part of the enemies to me. This is what that works out to:
Code:
        Apprentice    Journeyman    Adventurer    Swashbuckler
Player        1,3            1,15        1            0,85
Enemy        1            1,15        1,3            1,45
So player always has an advantage on Apprentice and fights are evenly matched on Journeyman. On Swashbuckler, enemies have an almost 50% advantage.
Edit: Removing this would therefore make Apprentice harder.
I guess we have to test it and see if it makes things better or worse.

It never stopped reloading. But it wouldn't show the progress in Build 14. So the blue bar would be completely empty, until the gun is fully reloaded, when it immediately turns to full. :facepalm
That's strange, the progress bar has always moved for me, regardless of build version. :shock I use Arcade Mode, for easier testing, if that makes a difference.

I'm getting all sorts of weird error messages now, fighting with the mummies in the Cozumel Temple:
Code:
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 395
Negative func 'sqrt' argument
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 583
Unknown data type
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 583
Unknown data type
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 583
Unknown data type
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 585
string call argument isnt string var
RUNTIME ERROR - file: Loc_ai\LAi_events.c; line: 585
process event stack error
That first line is referring to the sqrt in this code:
Code:
float exp = damage*((1.0 + erank*0.5)/(1.0 + rank*0.5)) * sqrt(erank);
I haven't the foggiest how an enemy rank can be negative though. :shock

Edit: Reason found. The erank definition only occurred when fighting with fists, but is ALWAYS used.
See attached for proposed fix. :doff
I based it on this code in LAi_fightparams:
Code:
float LAi_BladeCalcExperience(aref attack, aref enemy, float dmg)
{
    //Âû÷èñëÿåì ïîëó÷åíûé îïûò
    float ra = 1.0;
    float re = 1.0;
    if(CheckAttribute(attack, "rank"))
    {
        ra = stf(attack.rank);
    }
    if(CheckAttribute(enemy, "rank"))
    {
        re = stf(enemy.rank);
    }
    if(ra < 1.0) ra = 1.0;
    if(re < 1.0) re = 1.0;
//NK -->
    dmg = dmg*((1.0 + re*0.5)/(1.0 + ra*0.5)) * sqrt(re); //JA 8DEC06 reduced XP at high levels. (was leveling too fast up there)
    //Log_SetStringToLog("" + (dmg * 0.5));
// NK <--
    return dmg;
}
I'm not really sure how moving the line just before the EXP calculation fixes it, but if it does that's good. :)
 
I guess we have to test it and see if it makes things better or worse.
We can always keep it for the Apprentice level, but disable it for difficulty levels that are too hard.

That's strange, the progress bar has always moved for me, regardless of build version. :shock I use Arcade Mode, for easier testing, if that makes a difference.
Strange indeed. Even with "Pistol reload while fighting" ON, I still had no continuous updating until I fixed it a few days ago.
Do you play with the Gunpowder and Ammunition mod OFF by any chance? That was the cause of it and it might be that with that off, it would work like before.

I use Arcade Mode for testing a lot too. Realistic is cool for playing, Iron Man even more so; but who has the time? :confused:

I based it on this code in LAi_fightparams:
[...]
I'm not really sure how moving the line just before the EXP calculation fixes it, but if it does that's good. :)
The problem was that int erank was defined only inside the fists if-statement.
So if you wouldn't be fighting with your fists, erank would not be defined and caused an error message.
I just moved it outside the if-statement. Could've put it above too, but figured it might make more sense being closer to the line where it is used. :shrug
 
Strange indeed. Even with "Pistol reload while fighting" ON, I still had no continuous updating until I fixed it a few days ago.
Do you play with the Gunpowder and Ammunition mod OFF by any chance? That was the cause of it and it might be that with that off, it would work like before.
I do indeed have that mod disabled, again for easier testing, so yes, that must be the reason. :yes

The problem was that int erank was defined only inside the fists if-statement.
So if you wouldn't be fighting with your fists, erank would not be defined and caused an error message.
I just moved it outside the if-statement. Could've put it above too, but figured it might make more sense being closer to the line where it is used. :shrug
Ah, now I get it. Yes, being closer to the line where it is used is better. :)
 
I have tested the new Lai_charachter file for pistols:

And Yes, the blue bar is working as it was a long time ago!

Another improvement is when firing at nothing. Old case didn't recharge unless open inventory or reload to another location.
This is now fixed.

Strange enough pistols didn't recharge at all with ammo left (except after open inv/reload to loc) in the version I was using!!
This is now fixed. Guess this was the same bug as above.

Pistols without any ammo left do not recharge at all not even if open inv/reload to loc. As I remember it it used to recharge without any purpose.

I have tested ordinary pistols, quest pistols and "lefthand items" and give this mod 3 pistols out of 3.
:guns::guns::guns:
 
So I managed to fix MORE than I thought without breaking anything new? WOW! :shock
 
I have made a very long adventure where the fights are carefully prepared to be appropriate to the current situation regarding pchar:s weapons, allies etc etc.

When testing now all that is thrown over board.

Enemies suddenly don't die after 1 (one) pistol shot which was the idea in one fight.
In another fight 3 guys all die at once because of multidamage from the mtoon. This causes a stop in the story.
Usually I am a nice guy but now I feel a little 'warm'. :ko

Yes I can work around the mtoon but all the other fencing rebalancing...
 
Of course messing up your storyline is not exactly the intention of this whole rebalancing thing and I do apologize for the inconvenience.
We could make the old values take effect in your storyline instead of the new ones. Does that sound like a good solution to you?
Or can we think of something else?

On the subject of your storyline, I noticed that your code to remove Mr. Gibbs from Tortuga wasn't working right, so I've fixed that now.
Also, I think we can figure out a way to put all your special puzzle coding into an PROGRAM\Storyline\WoodesRogers\SL_utils.c file using extern void functions.
That would clean up the main code nicely and group your own coding together in your storyline folder. Does that sound like a good idea to you?
 
We could make the old values take effect in your storyline instead of the new ones.
Yes that sounds good to me. I can't think of anything better.
Hope it's less work than it would be for me to change all values.

About Mr Gibbs: Thanks a lot. Had no idea.

About cleaning up the code: I have been working on it today and have cleaned up itemlogic, Loginterface so far
and now testing LAi_events so I'll try to fix it...
I have ported all quest specific code (long blocks) to JRH_Functions.c

I found textures missing on wr_ships.
duck.bmp had been changed to duck.tga. It's fixed - comes together with the next pack.
 
Yes that sounds good to me. I can't think of anything better.
Hope it's less work than it would be for me to change all values.
I'll see if I can figure something out to change those values from inside your storyline folder.
Should be possible.

About Mr Gibbs: Thanks a lot. Had no idea.
It was this code that put him there:
Code:
    // PB: Isla de Muerte -->
    PChar.quest.Muerte = "";
    PChar.quest.Muerte_start.win_condition.l1 = "location";
    PChar.quest.Muerte_start.win_condition.l1.character = PChar.id;
    PChar.quest.Muerte_start.win_condition.l1.location = "Tortuga_tavern";
    PChar.quest.Muerte_start.win_condition = "Muerte_start";
    // PB: Isla de Muerte <--
Remove that and you're done. I noticed your difficulty when I noticed a "missing character ID" error on the Storyteller.

About cleaning up the code: I have been working on it today and have cleaned up itemlogic, Loginterface so far
and now testing LAi_events so I'll try to fix it...
I have ported all quest specific code (long blocks) to JRH_Functions.c
Brilliant! Once I've got your latest update then, I'll see if I can move it into the SL_utils.c file instead.
That was Pirate_KK's original intention with stuff like that. I think we can make that work. :yes

I found textures missing on wr_ships.
duck.bmp had been changed to duck.tga. It's fixed - comes together with the next pack.
Oops, sorry about that. :facepalm
 
Extract attached to PROGRAM\Storyline\WoodesRogers to set all items to their Beta 2.3 state for your storyline only. :doff

I had tried to put the code in the initQuestItems.c file, which would have made more sense to me,
but it turns out that when I try to adjust the guns, they haven't been initialized yet. But this works. :shrug

Anyway, I hope this puts everything back to normal for you and relieves you of your frustration at this... :oops:
 

Attachments

  • StartStoryline.zip
    2.5 KB · Views: 111
Thanks Pieter, yes I got a little upset yesterday. :ko

I admit that multidmg for the mtoon makes sense and so may the other changes do as well but:
there are posts here and there complaing about the new difficult level in fights.
Maybe it's best to reset all/do minor finetuning?
 
There has happened something with my enemies too.
It has no effect that they were given only HP14 each, they now are very strong and it takes 3 - 4 shots
with unchanged questpistols to kill them.
Also fists now give very little damage. Maybe realistic but I get problems. Most of the enemies though.
Not frustrated but o_O:confused:
 
Back
Top