Advertisement

Looking for some suggestions on how to implement an attack speed system

Started by March 06, 2011 05:45 AM
14 comments, last by CaseyHardman 13 years, 11 months ago

Agility was originally just going to increase attack speed, strength health, wisdom damage dealt with spells, and each class has a primary attribute which will increase it's damage dealt with melee attacks.
So classes with higher agility and primary agility get more damage and less HP, since they'll not only be getting more damage with their primary attribute being agility, they'll also be getting more attack speed (that way strength isn't just flat out better because you get the same damage bonus and extra health).

There's going to be an imbalance this way, which isn't necessarily a bad thing, but it will be imbalanced.

As for your stat issue, I'd recommend using a level based approach. For example at level 1 you require 10 agility per 1% haste and at level 2 your require 11 agility for the same increase in haste. In order to not get weaker every level, your damage gets increased by the added stats gained from the level you earned.
The problem of fast attack speed vs amount of damage per hit has two easy solutions:

1) Number of enemies to Tough enemies
2) Resistance to damage

With (1) if you have lots of weak enemies, then fast attacks become very useful. However, if you have a few really tough enemies, these fast attacks become less useful so long as the amount of damage done by the slower attacks is greater than the total amount of damage done by the fast attacks over the same period of time. However, slower, powerful attacks become less useful against lots of enemies. This creates a natural balance where you can use the toughness vs number of enemies to balance the fights one way or the other, thus solving the problem of fast attacks.

With (2) you need use a damage resistance that takes the same amount of damage off with each hit, rather than as a percentage of the damage done. This way fast attacks end up loosing more damage to damage resistance than a single powerful attack would. However, this is only effective if the fast attacks do more total damage than the slow attacks over a given time.

Note that with (1) the fast attacks have to do less total damage, and with (2) the fast attacks have to do more total damage. At first you might think these two system are incompatible, that you can't combine them in the same game.

It is possible. If you notice that with (2) the damage resistance reduces the damage done by the fast attacks. This effectively makes it do less total damage than the slow attack in certain situations. But, when this occurs it is the exact conditions necessary for (1) to work.

So, if you combine them you can make situations where (1) applies, and situations where (2) applies, nut it is not as simple as just looking at the number of enemies, or the total damage over time. It is a more complex (and interesting) combat system than either alone, and solve the problem of imbalance between fast and slow attacks.

This also gives you a framework with which to judge the amount that a stat increases effects the balance of your game. Thus you can make sure that increasing Strength vs Agility does not make one of them useless to upgrade.
Advertisement
[color=#1C2837][size=2]Your weapon has a set value of attack time and each weapon type has a minimum attack time.[color=#1C2837][size=2]Every 5 points of agility reduces the attack time by 0.03 seconds until the attack time reaches under 81% of its original value. After that, 6 points of agility reduces it by 0.02 seconds until it reaches under 61%. Then every 7 reduces it by 0.01 until it reaches the minimum value.[/quote]
The problem you have is you are trying to take a growing stat and transform it into a bounded value without having a reference value which grows at the same pace than the stat. This creates a situation where a character which is supposed to be quick will not be quick early in the game and a character which is supposed to be slow will not be slow later in the game. One way to fix it would be by using the level or the enemies' Agility in your speed formula. This is the reference value. If you determine that 2 points of agility per level would keep the speed average and a level 1 character has 25 agility, then you have a reference value for an average speed at a given level(25 + 2*level). You could use a simple Agility/AvgLevelAgility formula to determine the speed factor. It's not really realistic since a character may get slower after leveling up, but that's an easy way to balance things.
Developer for Novus Dawn : a [s]Flash[/s] Unity Isometric Tactical RPG - Forums - Facebook - DevLog
to answer the OP's question a little more directly, log functions, root function, and fractional functions will all give you diminishing returns. I'm a little rusty, so there's a lot of other formulas I'm missing. Econ has a lot of established diminishing returns.

I know that LoL uses a simple diminishing returns system for armor and magic resist that isn't technically bounded, but has a relatively bounded value for any realistic input. It's like:

x/(100+x) where x would be the stat and the value would be the percentage of damage you end up taking. In your case you could use X as the players level and the equation will give you your level in the stat at that level. Then you can modify the extra value to give bigger/smaller increases/level.

So you'd have x/(100+x) for non primary skills. Lvl 1 = ~1, Lvl 30 = 23, Lvl 60 = 37 and for primary skills you might have x/(40+x). Lvl 1 = 2, Lvl 30 = 42, Lvl 60 = 60. Or maybe more dramatic x/(20+x), Lvl 1 = 5, Lvl 30 = 60, Lvl 60 = 75.

This particular version of a diminishing returns system gets its major benefit from being computationally simple, but you should still look into others to see if they fit better.
First, figure out your max stats, like 99 AGI, for instance. Then work up a formula, such as 10+(100/AGI) or something like that. Test it with both 99 AGI and 1 AGI (or whatever the minimum is) and modify the algorithm until you're satisfied with the end results. Also look into the possibility of diminishing returns as others have stated. Really, one of the best ways to do this is just to play with it until you're happy.
Thanks for all of the great suggestions!
I've been thinking and with reading most of these posts, it may just be best to scrap the entire idea :(
It just doesn't seem to fit the game's combat system very well.
Maybe I'll make Agility give a higher chance of critical strike and 'penetrating' attacks that pierce through a percentage of armor reduction and give strength give health and a higher chance to give off a hit that has a higher 'stagger' time your regular attacks.
But I am still a bit worried about Wisdom being a bit imbalanced, since it'll be giving the majority of magical damage AND it'll be a primary attribute for mages and priests, giving them more attack damage...
Maybe I'll make wands and staffs have no attack, or a really gimpy attack that hits the enemy away but does minimal damage?

Anyway, I'm leaving for a trip...I'll think about it in the meantime and get back to you.

Thanks so much for all of the help!

[twitter]Casey_Hardman[/twitter]

This topic is closed to new replies.

Advertisement