Login | Register


All times are UTC - 5 hours


It is currently Thu Mar 28, 2024 6:22 pm




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Exponential Growth Formula for Stand-Alone Skills
PostPosted: Wed Jun 12, 2013 2:25 pm 
User avatar

Joined: Mon Aug 31, 2009 11:28 am
Posts: 1136
Location: Vancouver, BC
While considering how I'd like to modify my HU files last year, I found a nice way of overcoming a balancing problem. I wanted to share this idea since it's useful for balancing one-off skills that stand by themselves (like Valkyrie), especially if there are not a lot of +Skills in your mod design. My explanation will include a fair number of examples and redundancy, so hopefully it will be easily understood, but unfortunately it will seem long winded.

The problem was that exponential growth in D2/HU is accomplished using Masteries and -%EnemyRes, so a skill can never be exponential by itself (after skill level 28 a skill's progression is linear). I wanted very few +Skills before char level 85 (no more than +10), so I needed a summon like RaiseSkeleton to be balanced at char level 1 and char level 85 without huge numbers of +Skills. I accomplished this using the exponential behavior of the 1/x function, which gets very large very quickly when x gets very small (e.g. 1/0.5 = 2, 1/0.05 = 20, 1/0.005 = 200, etc).

To balance RaiseSkeleton, I reduced the x-value by a bit during low levels, and reduced that bit as the levels got higher so that the changes in the result were fairly consistent. For example, if 1/x goes from 1/1 to 1/0.5, then the result goes from 1 to 2 (an improvement of 1 when x changed by -0.5), to make the next improvement only 1, I'd need to reduce x from 0.5 to 0.3333 (so an improvement of 1 when x changed by -0.1667 rather than -0.5). At low skill levels, the changes to the x-value vary by quite a lot, but eventually they will be more consistent and affect the result more. Here's a table to show how the x-value's change becomes more subtle:
Code:
x-Value x-Change Result
1.0000             1
0.5000   0.5000    2
0.3333   0.1667    3
0.2500   0.0833    4
 ...      ...     ...
0.0020            500
0.0019   0.0001   526
0.0018   0.0001   556
0.0017   0.0001   588


The formula you end up with will look something like:
Result = Base / (xValue)
Where Result will be HP or Damage or some other mod. Base is just the first result. If you want to buff you summon's damage by 10% across all levels, just buff the Base by 10%. The xValue is hard to write since it's a number that will be reduced each skill level, and where the reduction is decreased at high skill levels. I've found a nice way of calculating the xValue (but this way will limit your skills to about level 35).

D2/HU already supports Tiers of skill damage, so that at level 1, 2, 9, 17, 23, and 29 you can specify the changes added to a skill. If you ask D2 to calculate the sum of those fields, it will add them in a way we can use for the xValue. For example, consider these fields and values for a skill:
Code:
Min Tier1 Tier2 ...
0.0 0.100 0.020 ...

If we ask D2 to use the "edmn" function, then it will take the starting number (0.0), add Tier1 (0.1) for skill levels from 2 to 8, add Tier2 (0.02) for skill levels from 9 to 16, etc. Now we can write the xValue as:
xValue = 1 - edmn

Now our formula looks like:
Result = Base / (1 - edmn)

Unfortunately, D2 can't use numbers with decimal points, so the Tier fields can't use "0.1" or "0.02". Since 1/0.5 is the same as 100/50, the solution is to just multiply everything (including the Tiers) by a large number, like 1000:
Code:
Min Tier1 Tier2 ...
 0   100   20   ...

Now our formula looks like (the Result won't change):
Result = 1000*Base / (1000 - edmn)

That formula will work, but will cause problems if edmn >= 1000. There are a few ways to fix that, but the solution I chose was to ask D2 to select the maximum of two numbers, so my xValue is actually:
max(1, 1000 - edmn)
Now our formula looks like:
Result = 1000*Base / (max(1, 1000 - edmn))

Another problem is that the Result climbs much too high too quickly for skill levels beyond about 35, so I put a cap on the result by asking D2 to select the minimum of two numbers, so my Result is actually:
min(Cap, Result)

Now our formula looks like:
Result = min(Cap, 1000*Base / (max(1, 1000 - edmn)))

While I don't expect HU to make use of that formula in the near future, I hope it enables some good ideas down the road. One nice benefit of this approach for summons is that it's easier to give them higher base-life and base-damage so that +%HP and +%EDmg have noticeable effects. I used this method for the HP and average Damage of Raise Skelly Knight. His actual damage is just the average -20% and +20%. Although he doesn't gain much from the +HP mod on my version of Prayer, he gains a lot from +%HP from BO. Similarly my version of Golems gain a lot of life from +HP but nearly nothing from +%HP because they already receive a lot of +%HP. It's always nice to have yet another method of differentiating skills.


Top
 Offline Profile  
Reply with quote  
 Post subject: Re: Exponential Growth Formula for Stand-Alone Skills
PostPosted: Mon Jun 24, 2013 5:07 pm 

Joined: Wed Sep 02, 2009 2:41 pm
Posts: 223
I really like this idea. By using the 1/x function it will allow a linear type of growth for the "result" and then by capping the skill levels you are "normalizing" the max function so that it doesn't start getting crazy after levels of 35.

1/x is a great function: here is a screenie of some other modifications of it that might be helpful also:

Image


Top
 Offline Profile  
Reply with quote  
 Post subject: Re: Exponential Growth Formula for Stand-Alone Skills
PostPosted: Mon Jun 24, 2013 10:24 pm 
User avatar

Joined: Mon Aug 31, 2009 11:28 am
Posts: 1136
Location: Vancouver, BC
I'm glad you like the idea, I think it's useful too. In the graph you display, notice that the red line curves very steeply upwards when you travel backwards from 1 to 0. It's that steep curve that we're using in the formula of my original post, but we're not going all the way to zero.

Here is a graph illustrating the damage of my Raise Skeleton skill (the "Actual" damage) compared to the "Target" damage at each skill level 1 to 34. The target damage is not a very smooth curve because it's loosely based on the Open Wounds formula by Blizzard.

Image

Here are the damage-related fields of my Raise Skeleton skill:
Code:
EMax EMaxLev1 EMaxLev2 EMaxLev3 EMaxLev4 EMaxLev5
  0    1370      24       21       7        3

clc2 = "(lvl<11) ? (lvl*5) : (min(600,20000/max(1,10000-edmx)))"
pst2(mindamage) = clc2 *  50/100
pst3(maxdamage) = clc2 * 150/100
I use a similar set of values to give my skeletons a relatively high base life.


Top
 Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron