PDA

View Full Version : Mod: Damage calc mod (configurable)


Csimbi
01-09-2009, 10:27 PM
Hi all,
I've created a mod.
Here is the readme (included in the package):

Damage calc mod u0
==================

This mod makes the following changes to the damage calculation:
- it allows 100% resistance (vs. the 95% cap in KB 1.7)
- it provides alternative ways to calculate the damage (more on this below).
NOTE: The AI takes into account the modified values automatically, so you will see the enemy adjusting its tactics according to the new conditions; do not be surprised when you see different battles after installing the mod.

Since some files have been directly modified, there may be conflict(s) with other mods. The modified files are:
- arena.lua
- textgen.lua
Furthermore, the following localization entries from en_hero.lng have been updated (again, there may conflict(s) with other mods):
- btn_hero_attack_hint
- btn_hero_defense_hint

The mod includes alternative ways of calculating the damage:
- Original (the one included in KB 1.7)
- Linear (the one included in KB 1.7 without the limit that would normally kick in above/below 60)
- Power2 (the damage scales non-linearly, by putting the values to the power of two)
- Power3 (the damage scales non-linearly, by putting the values to the power of three)
- Power4 (the damage scales non-linearly, by putting the values to the power of four)
The mod ships with the default setting "Power4". If you are unhappy with said default value, I am happy to report that you can easily select the one that your heart desires.
To change the setting, you need to extract, edit and re-pack the "arena.lua" file. Only one value needs to be changed; I put this to the very beginning of the file so you can find it easily; I left there instructions, too.
The current setting is shown in Attack and Defense hints (move your mouse over Attack and Defense on the hero screen).

Comparison table:
- The first column is the difference in attack+bonuses and the defense. When the Diff is positive, the attack is bigger than the defense. When the Diff is negative, the defense is bigger than the attack. When the Diff is 0, the attack and the defense are equal.
- The rest of the columns are the resulting damage multipliers after the calculation according to KB 1.7 and the different mods herein.

Diff KB 1.7 Linear Power2 Power3 Power4
------------------------------------------------------------
-100 0.3333 0.2309 0.0827 0.02636 0.00806
-80 0.3333 0.2729 0.1235 0.05023 0.01946
-60 0.3333 0.3335 0.2003 0.11140 0.05904
-50 0.3752 0.3752 0.2650 0.17807 0.11513
-40 0.4288 0.4288 0.3604 0.29733 0.24108
-30 0.5002 0.5002 0.5005 0.50075 0.50100
-20 0.6002 0.6002 0.6927 0.77195 0.83560
-10 0.7501 0.7501 0.9001 0.96438 0.98785
-5 0.8572 0.8572 0.9730 0.99540 0.99923
-4 0.8824 0.8824 0.9825 0.99764 0.99968
-3 0.9091 0.9091 0.9901 0.99900 0.99990
-2 0.9375 0.9375 0.9955 0.99970 0.99998
-1 0.9677 0.9677 0.9988 0.99996 0.99999
0 1 1 1 1 1
1 1.0333 1.0333 1.0011 1.00003 1.00000
2 1.0666 1.0666 1.0044 1.00029 1.00001
3 1.0999 1.0999 1.0099 1.00099 1.00009
4 1.1332 1.1332 1.0177 1.00236 1.00031
5 1.1665 1.1665 1.0277 1.00461 1.00076
10 1.333 1.333 1.1108 1.03692 1.01229
20 1.666 1.666 1.4435 1.29540 1.19674
30 1.999 1.999 1.9980 1.99700 1.99600
40 2.332 2.332 2.7742 3.36326 4.14787
50 2.665 2.665 3.7722 5.61575 8.68523
60 3 2.998 4.9920 8.97602 16.9360
80 3 3.664 8.0968 19.90613 51.36593
100 3 4.33 12.0889 37.92603 123.96370

Required game version
=====================
King's Bounty: The Legend; 1.7 English

Updates
=======
u0 - Initial release

Usage
=====
1. Start a new game or load an existing game.
2. Go to battle.
3. Enjoy the changed damage system.

Installation
============
Put the ".kfs" file in the <King's Bounty>\DATA\MODS directory (if the directory does not exist, you need to create it).

Uninstallation
==============
Delete the file(s) you added during the installation.


10th of January, 2009
Csimbi

Comments/suggestions are welcome.

Ryastar
01-09-2009, 11:28 PM
Not even having played this yet, and i can't (i have Atari version, so no 1.7 yet), i can still say one thing: with this mod, and specifically the power4, BLACK DRAGONS WILL PWN! IIRC, their att and def are the highest of anyone. With power4, small "diff" means smaller than usual change in damage, whereas high "diff" means much higher than usual change. So black dragons will be dishing out absolutely obscene amounts of damage!

I'm not sure if that's a bad thing... people need a good reason to use them, and a reason to fear them even more.

Keneth
01-10-2009, 12:08 AM
Version 1.7.0 and 1.6.5 are the same, if it works on one, it works on the other.

Don't really see the point of this mod, it makes strong units stronger and weak units weaker, making the game even more imbalanced than it already is. :mrgreen:

Ryastar
01-10-2009, 01:33 AM
Version 1.7.0 and 1.6.5 are the same, if it works on one, it works on the other.

Really? huh, i was under the impression that they weren't. If that's true, then why bother having 1.7? Why not just have 1.6.5?

Don't really see the point of this mod, it makes strong units stronger and weak units weaker, making the game even more imbalanced than it already is. :mrgreen:

Well, it in some way makes up for the fact that small units in high numbers do more damage than low number of big units, i guess, but that's always been balanced by the bigger units' higher survivability. I think it would be fun, though :)

Csimbi
01-10-2009, 07:51 AM
Don't really see the point of this mod, it makes strong units stronger and weak units weaker, making the game even more imbalanced than it already is. :mrgreen:

Not exactly, because Diff=attack*+attackbonuses-defense. Meaning: when units of the same strength are fighting each other, you won't notice much difference. On the other hand, when the difference is really big (strong hero's strong unit vs. a weak hero's weak unit), the strong one will squash the other like a bug - IMHO, that's the way things should be.
Consider a dragon vs, a peasant: I just can't imagine a peasant with a pitchfork do much damage to a dragon. And vice versa: the dragon does not even need to use its breath attack; it should crash anyone without an armor effortlessly - with just one finger...
But, I think it does not happen very often that you meet an army of peasants with your dragons - usually you meet armies that are on par or more challenging. What I want to say with this is that these mega-damage scenarios are unlikely to happen.
BTW: When you meet more challenging enemies, this mod actually makes the game harder...

Anyway, this mod makes the differences:
- less noticable when the Diff is small,
- more noticable when the Diff is big.

Do you want me to make the Power2 or Power3 the default setting? Then the damage would not become so intense around the high edges.

***Edit:
Black Dragon attack=56, defense=56
Peasant attack=1, defense=1
So, Diff would be - without any bonuses - 55.
The appropriate damage multipliers are:
- Original: 2.8315
- Linear: 2.8315
- Power2: 4.35439
- Power3: 7.14356
- Power4: 12.25194
Power4 does look appropriate to me. It can go higher/lower if you have a strong hero, beneficial spells, etc.

Keneth
01-10-2009, 01:12 PM
Really? huh, i was under the impression that they weren't. If that's true, then why bother having 1.7? Why not just have 1.6.5? Probably just to point out the distinction between EU and US version, if you look at the change log for the patches, you'll notice they are identical.

Consider a dragon vs, a peasant: I just can't imagine a peasant with a pitchfork do much damage to a dragon. And vice versa: the dragon does not even need to use its breath attack; it should crash anyone without an armor effortlessly - with just one finger... But you're missing the point, your statement only holds true when the difference in numbers is small, if one or ten or even hundred peasants attack a dragon, they won't have much effect even by default but that is ballanced out by the fact that you have thousands of peasants with pitchforks. This way, weaker units lose all their effectiveness as soon as the big bads come into play, and don't forget about bosses whose stats are even higher. I stand by my first statement, this mod makes weak units weaker or even useless and strong units stronger, forcing you to use as many high-stat units as possible and only abuse weak units for their abilities.

Csimbi
01-10-2009, 03:57 PM
But you're missing the point, your statement only holds true when the difference in numbers is small, if one or ten or even hundred peasants attack a dragon, they won't have much effect even by default but that is ballanced out by the fact that you have thousands of peasants with pitchforks. This way, weaker units lose all their effectiveness as soon as the big bads come into play, and don't forget about bosses whose stats are even higher. I stand by my first statement, this mod makes weak units weaker or even useless and strong units stronger, forcing you to use as many high-stat units as possible and only abuse weak units for their abilities.

Consider a tank and a company of riflemen with machine guns only: do you really think it makes any difference if you're shooting at the tank with 10 machine guns or a 1000? No difference whatsoever, because no matter how many machine guns you use, they cannot even penetrate the armor of the tank. Even armour-piercing bullets have problems finding their way thru.
You need stronger weapon against tanks: bazooka, grenades, mines - then you have a chance.
Back to our question, I think that the same analogy applies to the dragons and a peasant.

BTW: did you try the tutorial with this mod? (At least the first where you beat the dragon?)

Keneth
01-10-2009, 04:16 PM
I think even the dumbest creatures are a little more productive than shooting at a tank with a rifle, if there was even a dozen riflemen I'm pretty sure they'd find a way to enter the tank and shoot the driver with a rifle, just like a thousand peasants would find a way to disable a dragon and slay it with nothing but pitchforks and common sense. I think the original mechanism works just fine where dragons easily slay tens of peasants at a time, even the toughest and strongest of dragons couldn't handle more than that except if they threw themselves at the peasants and rolled on the ground, forfeiting any chance of defense against retaliation. Your analogy lacks depth. :mrgreen:

Csimbi
01-11-2009, 12:21 AM
I think even the dumbest creatures are a little more productive than shooting at a tank with a rifle, if there was even a dozen riflemen I'm pretty sure they'd find a way to enter the tank and shoot the driver with a rifle, just like a thousand peasants would find a way to disable a dragon and slay it with nothing but pitchforks and common sense. I think the original mechanism works just fine where dragons easily slay tens of peasants at a time, even the toughest and strongest of dragons couldn't handle more than that except if they threw themselves at the peasants and rolled on the ground, forfeiting any chance of defense against retaliation. Your analogy lacks depth. :mrgreen:
It is of course, your prerogative to express such opinion, however, I am not sure how to interpret it.
Do you mean that this mod is rubbish and it should not have seen the light of day?
Or, do you have an algorithm that would work better?
Do you mean that the original is the best?

I am open to suggestions here - my mod is an attempt to make it more realistic, and I think that the Power4 version was the right way to go. It is quite natural (since it is an initial release that is rather one-sided) that I might be wrong, but it's up to you to suggest a more realistic solution.

***Edit
Fixed a typo

Keneth
01-11-2009, 04:57 PM
I would never call other people's work rubbish, however small each mod has had time and effort invested in itself, that wasn't the point, no. The point was that the mod is horribly imbalancing the game to the point where some units become completely useless, that shouldn't happen even if it's merely an unwanted consequence of the changes. And from my perspective, it is not realistic in the slightest (as far as realism goes in a fantasy game), the original system is much more convincing.

Csimbi
01-11-2009, 07:55 PM
I would never call other people's work rubbish, however small each mod has had time and effort invested in itself, that wasn't the point, no. The point was that the mod is horribly imbalancing the game to the point where some units become completely useless, that shouldn't happen even if it's merely an unwanted consequence of the changes. And from my perspective, it is not realistic in the slightest (as far as realism goes in a fantasy game), the original system is much more convincing.

So, you are trying to say that all of the Powerx options are a no-go for you. (?)
How about the Linear one? Do you think going over 3x (or below 1/3) damage to too much (low)?
You could still use that part of the mod.

***Edit
I started a new game with the Power4 mod (taking the paladin this time). It does not feel too strong. Well, not yet at least, because the hero is not very strong and so the enemies are nearly on par with my units (so far).
More testing and feedback is required.

***Edit2
What I don't like is the linear scale.
Take a look here:
http://en.wikipedia.org/wiki/Exponentiation
Any algorithm that would work better for you?