To Craft a Sim – Part 2

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 last 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. Today, I’ll be expanding upon a feature which CHsim does have which SimCraft doesn’t really; player positioning. CHsim simulates the positioning of a raid in 2D space (like a top-down view of the fight) whereas I have it from Theck that SimCraft doesn’t track positions in 2D space.

Give Me Some Space, Bro!

One of the unique things about Chain Heal is that it’s highly local. By this, I mean that the effective healing of the spell is determined by who is nearby and how they are positioned relative to every other player. In order to make any kind of realistic model of Chain Heal, it’s obviously important to take into account how players bunch together (or fail to, as the case may be!). There are two threads to this; one is putting players on the ground to start with, and the next is calculating which players Chain Heal can jump to given the last player it targeted. Today, I’ll only cover the first bit (the second is somewhat more technical).

Now, there are several different ways that you could model how players spread out in a raid. I chose a simple but effective one based around the idea that players tend to form bunches together which gets more packed towards the centre. I settled on a good method for making realistic player layouts; make the probability of a player being found r yards from the centre of their bunch be proportional to 1/r and it looks like this;

Much more players towards the centre!

Much more players towards the centre!

So that’s really awesome because it means that your players will be “loosely stacked” – the kind of situation we usually care about when doing TheoryCraft. It takes quite some fiddling to go from this idea to a program which makes it work, though. One problem is that while you know what it should do, you have to place the players randomly around the space with this probability of being distance r from the center. The real key there is to do it randomly – it requires a bit of skill which I’ve picked up as part of my PhD (people with experience know that it’s harder than it looks to sample from this kind of distribution).

Matlab is an awesome language. You should learn it.

Matlab is an awesome language. You should learn it.

The code above is a bit of what I implemented to make this work, but the details don’t really matter for this discussion (if you do want to talk about it, just ask). In the end, I can easily get it to place 20 players with this kind of radial distribution just like a Mythic raid will (hopefully) look;

The annoying one off to the left is a Hunter.

The annoying one off to the left is a Hunter.

Neat, huh?

So that’s the first building block of a Chain Heal simulation – putting players in the right places! With a bit of fiddling, I have been able to make it so that you can make several different bunches of players – tanks, healers, melee – and I was tweeting about it a while back.

Next time, I’ll talk about the kind of decisions you have to make when setting players’ health bars at the start of a fight and the impact that has upon the simulation.

I decided that showing you pictures of Chain Heal bouncing would be more fun, so I’ll put off health and healing for another time. Tune in next week for cool pictures of Chain Heal bounces and – gasp – GCSE level mathematics!

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!


About stoove

A physicist, researcher, and gamesman. Likes to think about the mathematics and mechanics behind all sorts of different things, and writing up the thoughts for you to read. A competent programmer, enjoys public speaking and mechanical keyboards. Has opinions which might even change from time to time.
This entry was posted in Alpha/Beta News, Maths, World of Warcraft and tagged , , , , , , , , , , , , , , , , . Bookmark the permalink.

3 Responses to To Craft a Sim – Part 2

  1. Pingback: WoDsplosion! | UNconstant

  2. Pingback: To Craft a Sim – Part 5 | UNconstant

  3. Pingback: To cast, perchance to Chain (Heal) | UNconstant

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s