21 August 2018

Building Rotations in Skill-based Games (Part 1)

If you've ever played a game that features skills you might have heard of rotations. These are known to be skills that should be executed perfectly one after another to reach the highest possible DPS (Damage per Second). It is also used for benchmarking. (which is a topic I'm going over another time). I don't have much experience with them but I had a view on a part of its creation and I think it's not too hard to figure out the basics.

Introduction

First of all, yes this will have multiple parts as it is quite complicated. I'm starting on the basics and I'll continue deeper down the rabbit hole. The procedure is the same for every game, but out of curiosity, I'll use Guild Wars 2. Especially since Guild Wars 2 actually provides a challenge in comparison to other games. So let's go into the basics now.

Creating Build Rotations

Step 1 - Value Skills

We need a way to tell which skills are better and which do not interest us. For our purpose I'm going to start off with the Engineer's attacks on the rifle then I'm gonna extend to other skills. The engineer provides us with five skills on the rifle. What we need to know about these is, how much damage they do in total and how long they take to use as well as how often we can use them. How often depends on the cooldown of abilities. Since using abilities over and over again would be too strong they have a cooldown on them which disables them for a certain time. That means we can only use the skill every few seconds. So we have one cast per cooldown seconds. One cast deals with a certain amount of damage. This means we have an amount of damage per cooldown seconds. Notice it already? We can divide the damage through the cooldown to get the average damage. Cast times are used for abilities that take longer to use or affect over a longer time. This also means we can't do anything else during this time. So the actual time until we can use the skill again is cooldown + cast time.
Our final formula is for the average damage is:
avgDPS = totalDamage / (cooldown + castTime)
Let's check our five skills.

Skill Name Total Damage Cooldown Cast time
Hip Shot739 0s 3/4s
Net Shot 568 9s 0s
Blunderbuss 2001 + 842 9s 1/2s
Overcharged Shot² 113714s 0s
Jump Shot 2614 + 455 18s 1s

²: Overcharged Shot adds a knockback when used without stability adding a global cooldown of 1.75s to 2s which is ignored in this calculation.

Okay so first we will list them from highest to lowest damage:
  • Jump Shot: 2614 + 455 = 3069
  • Blunderbuss: 2001 + 842 = 2843
  • Overcharged Shot: 1137
  • Hip Shot: 739
  • Net Shot: 568
Next let's throw the information into the formula:
  • Hip Shot: 739 / 0.75s = 985.33 dps
  • Net Shot: 568 / 9s = 63.11 dps
  • Blunderbuss: 2843 / (9s + 0.5s) = 299.26 dps
  • Overcharged Shot: 1137 / 14s = 81.21 dps
  • Jump Shot: 3069 / (18s + 1s) = 161.53 dps
What do these results mean now? The average damage per second we calculate gives us a priority list. If we use hip shot repeatedly we do the most damage. Repeatedly using only the other skills will result in lower DPS. Next up we check the damage numbers. Jump Shot, Blunderbuss, and Overcharged Shot deal more damage than Hip Shot does. So assuming we use these three abilities first and then Hip Shot until they are ready again we should have the highest DPS.

Step 2 - Create Draft Rotation

So our rotation should look similar to this:
  1. Jump Shot
  2. Blunderbuss
  3. Overcharged Shot
  4. Hip Shot
  5. .... (repeat until Jump Shot is ready)
  6. Jump Shot
  7. Blunderbuss
  8. Overcharged Shot
  9. Hip Shot
  10. ... (and so on)
There's something off on this rotation though. Overcharged Shot, Blunderbuss, and Jump Shot have different cooldowns. That means one will be ready earlier than the other. We need to keep these three skills on cooldown to get the most DPS out of our five skills.

Each Hip Shot takes 0.75s or 3/4s until the next. The lowest cooldown is on Blunderbuss with only a mere nine seconds. This means we can put 9s / 0.75s = 12 auto attacks until it's ready again. However, each skill takes a different amount of time. Something that helps us a lot is a timeline.

Step 3 - Create a Timeline

Each vertical line corresponds to one of the five skills. Yellow means we're casting or using the ability at this 1/4th of a second or for the time that is shown. Blue means it's on cooldown, white means it's ready.

0s to 6.5s

0s1s2s3s4s5s6s
Hip Shot
Net Shot
Blunderbuss
Overcharged...
Jump Shot

6.5s to 13s

7s8s9s10s11s12s

13s to 19.5s

13s14s15s16s17s18s19s

19.5s to 26s

20s21s22s23s24s25s

Step 4 - Write Down Rotation

If we convert this to a rotation we get:
  1. Jump Shot
  2. Overcharged Shot
  3. Blunderbuss
  4. Hip Shot (12x)
  5. Blunderbuss
  6. Hip Shot (6x)
  7. Overcharged Shot
  8. Hip Shot (3x)
  9. Jump Shot
  10. Hip Shot
  11. Blunderbuss
  12. Hip Shot (7x)
  13. ...

Step 5 - Calculate DPS

This rotation is 26 seconds long and includes 22 Hip Shots, 3 Blunderbuss, 2 Overcharged Shot, 2 Jump Shots. Accumulating the damage we get 22 * 739 + 3 *  2843 + 2 * 1137 + 2 * 3069 = 33199.
Dividing through our seconds we have 33199 / 26  = 1276.88 damage per second.

Step 6 - Test & Compare

From here on out we test the rotation in-game, on the golem. Something we did here was to ignore the human reaction time which can play into the cast-time and cooldown. Another thing we can do is change on when we activate the skills in our timeline. You might have noticed an empty field here and there where we waited for a  cast to finish or for the cooldown to do the last milliseconds.

Next Steps!

We have only looked at the five skills of one weapon. Unfortunately Guild Wars 2 features weapon sets, in most games, you can swap skills and abilities. There are more than five skills as well. Don't forget that there are traits that change certain skills to function differently from others. Also, the skills may apply debuffs on the bosses or buffs on yourself. This makes the whole procedure even more complicated but for now, I think you get the idea.


Liked the post? Noticed an error? Wanna discuss the content or leave a comment*? You can join or check into the discord to do so! (*Note: Comments are disabled to avoid saving user data on this website.)
>> Join Discord

About Me

My photo
I'm a B.Sc. Games Engineer and I created this blog to share my ideas, theorycrafting, thoughts and whatever I'm working on or doing.