In this series of posts, I’m talking about putting together a simulation I’ve built called CHsim. It’s designed to simulate the way Chain Heal will behave in Warlords of Draenor – including interactions with player positioning, talents, incoming damage, Riptide, and Mastery bonuses.
My first post in this series discussed why I’m developing CHsim, and I left off by pointing out some good reasons why I’m not using SimCraft to achieve my goals. The second post talked about raid positioning and how I’ve modelled a “realistic” raid. This post discusses the way I’m making Chain Heal bounce from person to person, and what that means for High Tide modelling.
Chain Heal is and always has been unique in WoW because of its fantastic “bouncing” mechanism; it heals a player and then moves onto another
injured random player within 12.5yds. That’s what makes it such an interesting (and difficult, sometimes) thing to study. With that in mind, it’s crucial to make an accurate and efficient recreation of Chain Heal’s behaviour in a simulation like this one.
So, what does it take to replicated Chain Heal’s behaviour? In essence, you need two things;
- A table of data telling you how far every player is from every other player,
- An algorithm which steps through the players one by one and crosses them off a list.
The second component relies heavily on the first, so let’s cover that first. When player positions are generated, the data is generated in x-y format (which you could literally plot on a graph like the one below.
However, while that’s lovely for looking at it’s not useful until it’s converted into a table of distances between players. To get that, you just have to go to each player and calculate how far away every other player is from them; repeat for all players. Since we’ve got a nice x-y format, you can calculate the total distance using Pythagoras’ Theorem;
Having run the calculation for every player, you make the table; the calculations for Player 1 go in Column 1, for Player 2 in Column 2, and so on. That gives you a table of data where the diagonal elements (Row 1 Column 1, Row 2 Column 2, etc…) are zero! That’s because Player 1 cannot be any distance from themselves, and the same is true for Player 2, and so on.
Observant people might notice that the table I show above is in fact symmetrical – if you reflect the table in the diagonal axis (this is technically known as transposing), the result is the same. This is also true by definition; if Player 1 is 12yds away from Player 3, then if you go from Player 3 to Player 1, you must also get a distance of 12yds!
So, how do we use this?
A rough algorithm for how to use this information might go as follows;
- Start with your target.
- Find all players who are within Chain Heal’s jump range (12.5yds) of the target.
- Eliminate from the list all those who have already been healed by Chain Heal.
- Pick at random another target to heal.
- Jump to the new target, and start from step (1) unless this is the 3rd time you’ve been here.
Of course, you can look in your data table to find everyone in range for Step (2). I coded a method which emulates this algorithm. It does take advantage of some of Matlab’s more satisfying features to make Steps (2) and (3) much faster and simpler, but technical details aren’t exactly important here.
The resulting plots look damn cool;
It looks like I’m running out of room, so to avoid putting you to sleep I’ll leave High Tide interactions until tomorrow’s post. Tune in to see whether it works! (Spoiler: it works).
Have you ever made a simulation? Do you have some cool ideas for features I could implement? Let me know in the comments and I’ll credit you if your idea is implemented!