23 December 2017

The Guild Wars 2 Achievement Leaderboard Issue

Achievement points. Guild Wars 2 is all about it. At least if you care for achievements and account bonuses and other stuff you get for your achievement points. That's not everything. There's a whole different layer on this. If something has a leaderboard it's kinda like a tournament. It doesn't have to be Player vs Player.

Meaning of Leaderboards

Leaderboards It's a game element. People who have read into Gamification know a little about these. If you sort game elements by the intrinsic needs, leaderboards would be part of Competence. Competence is a category that includes elements, that give people the feeling of having done something, the feeling of having mastered a challenge, the feeling of having gotten better, the feeling of improvement. And how do leaderboards achieve this?

Leaderboards - How They Work

What is a leaderboard? Actually, it's just a list of names - the players or participants - sorted by their rating. Ascending in numbers or places. This means if a person is on the top of the first place, they're logically better than everyone else. If someone would be at the last place they're the worst in the category. If a person is worse than another they may feel bad and give up on this category. However, some people take this as inspiration and motivation to keep on working to get better and climb the leaderboard.

ArenaNet Did It Good

If someone is nearly last it is extremely demotivational. Especially if all people can see and know that said person is near to last. This problem can be solved and ArenaNet did it right. Limiting only the top 1000 to be publicly viewable and showing the people themselves who are not in the top 1000 that they're better than x% of everyone is a good way to keep people motivated. This way you can eliminate the negatives without affecting the positives too much. No one can say who is last and everyone can say they're better than a group of people.

Where ArenaNet Failed

Now, this is not a direct problem in their leaderboard system or a severe mistake that cannot be fixed but still, it's something that should be addressed at some point. Now to have a meaningful leaderboard it should allow people to be able to climb up to the first place. Anything else wouldn't be fair and exactly here lies the problem with the Achievement Point Leaderboard of Guild Wars 2. Overall those 5 years or more Guild Wars 2 has had some special events that gave achievement points. Wintersday, Halloween, New Year, some unique events like the Zephyr Sanctum or the Living World Season 1. All these special events gave achievement points that are no longer available in the game. Same with the abandoned achievements. They still award achievement points to those who have completed them but they were removed from the game. I am missing around 900-1000 achievement points that are now unattainable. Others will require a lot more. This handicap makes it hard to compete with other players.

Well Some Repeat, Right?

Yes, some special events repeat and you get more and more achievement points. The problem here, however, is that the people who've been playing longer might also still play these events. As long those people do that it's a fight for playing and a fight for who started first instead of a fight of competence.

My Solution

I don't like addressing problems without a solution and my first solution got already discarded. The problem in the old one was that the removed achievements that took more work weren't treated fairly.

This new solution does not change the achievement points on people at all. The idea is to change the leaderboard. All achievements that are removed, retired or do not reappear are listed in history except for reoccurring achievements like from the Super Adventure Box for example. The API knows this. If you could flag or move reoccurring achievements into their own category you could calculate how many attainable achievements the player has completed. Then you can sort the players by this descending and get your leaderboard that is fair for everyone and unbiased as well.

If people still want their "I was first". Diablo III has a system where it saves the date when the achievements were done. I guess you could argue to bring in something like this but that's not something I strive for.

The idea is to reward someone who is just as hard-working or works much harder than someone who started earlier but works just as much as they need to keep their spot.

22 December 2017

Damage Calculation In WildStar

What is theorycrafting without on-paper damage calculation? :p
I have no idea, that's why I ask you, L.O.L... Anyways let's jump right in.

The Base Damage

The people who followed the update posts of Carbine Studios over all those years know how the damage on skills is - or might be - calculated and what role Assault Power plays here.

According to balancing patches a percentage of assault power is changed and a value which increases with the level is changed. If we say these are the only values and when experimenting with the last patch values comparing it with the numbers on the tool-tips we can assume the following formula for assault abilities:

baseDamage = assaultPower * skillAssaultPowerMod + levelStatRate * yourLevel

Higher skill tiers increase the skillAssaultPowerMod and the levelStatRate

Now, this is a little bit old but Mortar Strike on Base Tier the inner AoE (Area of Effect) hits with 29.77 per level and 94.02% of Assault Power.

So let's assume we have 17765 Assault Power Rating and of course we're level 50.
17765 Assault Power Rating equals 17765 / 4 = 4441.25 Assault Power.
So for our base damage calculation:

baseDamage = 4441.25 * 0.9402 + 29.77 * 50

That's about 5664.16 damage.

Critical Hit Chance & Severity

Critical hit chance is, as the name says, the chance to hit harder. Severity is how hard you hit. By default, the severity is 150% (So a 50% damage increase compared to normal hits). The way I figured out how to calculate these both is by trial and error, but I'm gonna explain it a little bit.

No critical hit chance, but a lot of severity. 0% chance vs 300% severity.
If you have no critical hit chance you won't ever hit harder, so you'll have no damage increase here.

All hits are critical, but no severity. 100% chance vs 100% severity.
Even if each of your attacks hits critically if your critical hits don't hit harder your damage doesn't increase.

Okay, if all of our attacks are critical and severity doubles our damage. 100% chance vs 200% severity.
What happens? Our damage is doubled. As simple as it is.

Now if we critically hit every second time and still double the damage on a critical hit. 50% chance vs 200% severity.
Surprise. On average we get a 50% damage increase. So with half the critical hit chance, we deal half the damage increase from severity on average.

It doesn't take much to make the last step here but if you haven't got a feeling for math what happens here is:
criticalHitChance * criticalhitSeverity
 The damage increase occurs critical hit chance of the time and also we do 100% of our damage always. Keeping this in mind we get:
(1 + criticalHitChance * (criticalHitSeverity - 1))
So applying critical hit chance and severity to our damage calculation:

damage = baseDamage * (1 + (criticalHitChance * (criticalHitSeverity - 1))

Example: 
We have a 48% critical hit chance, 268% critical hit severity and the same damage as before.

damage = 5664.16 * (1 + 0.48 * (2.68 - 1))= ~10231.74

Multi-Hit Chance & Severity

WildStar has a stat called multi-hit chance and multi-hit severity. If your multi-hit chance triggers the severity of your previous damage is applied to the enemy a second time. This works exactly like critical hit chance and severity but our multi-hit severity is much lower.

So we have:  
multiHitChance * multiHitSeverity
However, compared to critical hit chance if multi-hit does not occur we don't have multi-hit damage. If the multi-hit chance is zero we don't do any additional damage.
So we keep this and add it to our formula like this:

damage = baseDamage * (1 + criticalHitChance * (criticalHitSeverity - 1)) + baseDamage * (multiHitChance * multiHitSeverity)

With our previous stats of 48% critical hit chance, 268% critical hit severity, 31% multi-hit chance, 48% multi-hit severity and our previous damage we now have:

damage = 5664.16 * (1 + 0.48 * (2.68 - 1)) + 5664.16 * (0.31 * 0.48) = 11074.57

HOLD IT - Synergy

Yep, Multi-Hit and Critical Hit synergizes. How? A multi-hit can be a critical hit too and a critical hit can multi-hit too. However the multi-hit takes the base damage not the critical damage. So we need to apply our critical hit chance and critical hit severity to our multi-hit:

dmg = baseDmg * (1 + CHC * (CHS - 1)) + baseDmg * (MHC * MHS) * (1 + CHC * (CHS - 1))
dmg stands for damage; baseDmg for baseDamage; CHC for critical hit chance; CHS for critical hit severity; MHC for multi-hit chance; MHS for multi-hit severity;

So our actual damage is:

damage = 5664.16 * (1 + 0.48 * (2.68 - 1)) + 5664.16 * (0.31 * 0.48) * (1 + 0.48 * (2.68 - 1)) = 11754.22

Next stat: Vigor

Vigor increases our damage respective to our health. If we have 100% health the whole damage increase of vigor is applied. If we have 50% of our health only 50% is applied:
1 + yourHealth * vigor
To calculate the average damage you can just use your average health.

Adding to the calculation:

dmg = baseDmg * (1 + CHC * (CHS - 1)) * (1 + (yourHP * vigor)) + baseDmg * (MHC * MHS) * (1 + CHC * (CHS - 1)) * (1 + (yourHP * vigor))
yourHP stands for your health points;

If we assume to have 18.2% vigor and 90% health on average we get:

damage = 5664.16 * (1 + 0.48 * (2.68 - 1)) * (1 + (0.9 * 0.182)) + 5664.16 * (0.31 * 0.48) * (1 + 0.48 * (2.68 - 1)) * (1 + (0.9 * 0.182)) = 13679.56

Strikethrough

Next up is strikethrough. So enemies have a deflect chance. There are tables on how much deflect chance the enemies have. You need the same amount of strikethrough as the enemy has deflect. Luckily there are raid buffs that decrease this value additionally. So how does strikethrough calculate?

If an enemy has 12.48% deflect chance and we have 12.48% strikethrough we'll hit 100% of the time. Alternatively we'll miss 12.48% - 12.48% = 0%. So our hit chance is:

100% - (enemyDeflect - strikethrough)

However, keep in mind this formula only counts if strikethrough is not higher than enemy deflect. Even worse strikethrough is supposed to convert to armor pierce however according to information it is bugged and strikethrough instead decreases your critical hit chance if over capped (going over a cap, as in the highest meaningful value).

Well assuming we do not overcap strikethrough:

dmg = baseDmg * (1 + CHC * (CHS - 1)) * (1 + yourHP * vigor) * (1 - (enemyDeflect - strikethrough))
+ baseDmg * (MHC * MHS) * (1 + CHC * (CHS - 1)) * (1 + yourHP * vigor) * (1 - (enemyDeflect - strikethrough))

Doing our damage calculation with 12.48% enemy deflect chance and 10.91% strikethrough results in:

damage = 5664.16 * (1 + 0.48 * (2.68 - 1)) * (1 + 0.9 * 0.182) * (1 - (0.1248 - 0.1091)) + 5664.16 * (0.31 * 0.48) * (1 + 0.48 * (2.68 - 1)) * (1 + 0.9 * 0.182) * (1 - (0.1248 - 0.1091)) = 13464.79

Armor and Resistances

Not done yet. Unfortunately. Armor is converted to resistance. My Spellslinger is currently running around with 39.39% resistance. Bosses have between  47.12% and 50.05% resistance. This means that we only do about 50% of our damage on those bosses. They resist about 50% of our damage.

Don't forget the more resist the enemy has the less damage we do. That means we need the opposite. So instead of enemyResist we use (1 - enemyResist).

So we add this number to our damage calculation:

dmg = baseDmg * (1 + CHC * (CHS - 1)) * (1 + yourHP * vigor) * (1 - (enemyDeflect - strikethrough)) * (1 - enemyResist) + baseDmg * (MHC * MHS) * (1 + CHC * (CHS - 1)) * (1 + yourHP * vigor) * (1 - (enemyDeflect - strikethrough)) * (1 - enemyResist)

If we take the resistance of the enemy of 47.12% into account we get this result:

damage = 5664.16 * (1 + 0.48 * (2.68 - 1)) * (1 + 0.9 * 0.182) * (1 - (0.1248 - 0.1091)) * (1 - 0.4712) + 5664.16 * (0.31 * 0.48) * (1 + 0.48 * (2.68 - 1)) * (1 + 0.9 * 0.182) * (1 - (0.1248 - 0.1091)) * (1 - 0.4712) = 7120.18

That's a drastic change but don't worry.

Your Savior: Armor Pierce

Luckily we have armor pierce in this game. Or unlucky, since our calculation gets even longer and worse. Well, how does armor pierce work?
After our raid buffs decrease the resistance of the boss additive, our armor pierce further decreases the resistance multiplicative.

So if the boss resistance is 47.12% and we decrease it by 10.5% to 36.62%. Now we have 9% armor pierce which further decreases it's resistance to 36.62% * (100% - 9%) = 36.62% * 91% = 33.32%.

So putting armor pierce into our calculation as well:

dmg = baseDmg * (1 + CHC * (CHS - 1) * (1 + yourHP * vigor) * (1 - (enemyDeflect - strikethrough)) * (1 - enemyResist * (1 - ARP)) + baseDmg * (MHC * MHS) * (1 + CHC * (CHS - 1)) * (1 + yourHP * vigor) * (1 - (enemyDeflect - strikethrough)) * (1 - enemyResist * (1 - ARP))
ARP stands for armor pierce ;)

So doing our calculation:

damage = 5664.16 * (1 + 0.48 * (2.68 - 1)) * (1 + 0.9 * 0.182) * (1 - (0.1248 - 0.1091)) * (1 - 0.4712 * (1 - 0.09)) + 5664.16 * (0.31 * 0.48) * (1 + 0.48 * (2.68 - 1)) * (1 + 0.9 * 0.182) * (1 - (0.1248 - 0.1091)) * (1 - 0.4712 * (1 - 0.09)) = 7691.20

Are We Done Yet?

Nope, unfortunately not. There is one more stat. Which one? Thanks to the primal matrix we now have tenacity. Tenacity deals more damage the less health the enemy has. So if we have 10.5% tenacity we deal 5.25% more damage when the enemy is at 50% and 0% more damage if the boss is at 100%.

dmg = baseDmg * (1 + CHC * (CHS - 1)) * (1 + yourHP * vigor) * (1 - (enemyDeflect - strikethrough)) * (1 - enemyResist * (1 - ARP)) * (1 + tenacity * (1 - enemyHP)) + baseDmg * (MHC * MHS) * (1 + CHC * (CHS - 1)) * (1 + yourHP * vigor) * (1 - (enemyDeflect - strikethrough)) * (1 - enemyResist * (1 - ARP)) * (1 + tenacity * (1 - enemyHP))

How much damage do we do then? You could assume 50% health on average so you could calculate with 5.25%. Alternatively, you can give a range. Let's do that.

If the enemy has 100% health:
Nothing changes damage is still 7691.20 as calculated earlier.

Enemy has 0% health
damage = 5664.16 * (1 + 0.48 * (2.68 - 1)) * (1 + 0.9 * 0.182) * (1 - (0.1248 - 0.1091)) * (1 - 0.4712 * (1 - 0.09)) * (1 + 0.105 * (1 - 0)) + 5664.16 * (0.31 * 0.48) * (1 + 0.48 * (2.68 - 1)) * (1 + 0.9 * 0.182) * (1 - (0.1248 - 0.1091)) * (1 - 0.4712 * (1 - 0.09)) * (1 + (0.105 * (1 - 0))) = 8498.77

So we have a range between 7691.20 and 8498.77 damage.

Enemy has 50% health (average).
damage = 5664.16 * (1 + 0.48 * (2.68 - 1)) * (1 + 0.9 * 0.182) * (1 - (0.1248 - 0.1091)) * (1 - 0.4712 * (1 - 0.09)) * (1 + (0.105 * (1 - 0.5))) + 5664.16 * (0.31 * 0.48) * (1 + 0.48 * (2.68 - 1)) * (1 + 0.9 * 0.182) * (1 - (0.1248 - 0.1091)) * (1 - 0.4712 * (1 - 0.09)) * (1 + (0.105 * (1 - 0.5))) = 8094.99

Done Finally?

Yes. Finally done. :)
I was simplifying this calculation prior to the update of the post but noticed that we lose accuracy and some other problems are raised. Treating the initial hit and multi-hit separately and adding them is a better solution. The problems that are raised are:


  • The initial critical hit and the multi-hit have the same critical chance but they might not both critical hit. It is safer to separate these.
  • It is unlikely for your health to change in this short amount of time but the initial hit changes the enemy's health thus the multi-hit damage changes respectively.
  • Very unlikely but the buff uptime may run out before the multi-hit hits resulting in different resistances.
So there we have it:

baseDmg= assaultPower * skillAssaultPowerMod + levelStatRate * yourLevel

initialDamage = baseDmg * (1 + CHC * (CHS - 1)) * (1 + yourHP * vigor) * (1 - (enemyDeflect - strikethrough)) * (1 - enemyResist * (1 - ARP)) * (1 + tenacity * (1 - enemyHP))

multiHitDamage = baseDmg * (MHC * MHS) * (1 + CHC * (CHS - 1)) * (1 + yourHP * vigor) * (1 - (enemyDeflect - strikethrough)) * (1 - enemyResist * (1 - ARP)) * (1 + tenacity * (1 - enemyHP))

totalDmg = initialDamage + multiHitDamage

Full formula:


totalDamage = (AP * skillAPMod + lvlStatRate * yourLvl) * (1 + CHC * (CHS - 1)) * (1 + yourHP * vigor) * (1 - (enemyDeflect - strikethrough)) * (1 - enemyResist * (1 - ARP)) * (1 + tenacity * (1 - enemyHP)) + baseDmg * (MHC * MHS) * (1 + CHC * (CHS - 1)) * (1 + yourHP * vigor) * (1 - (enemyDeflect - strikethrough)) * (1 - enemyResist * (1 - ARP)) * (1 + tenacity * (1 - enemyHP))
AP stands for Assault Power; skillAPMod for skillAssaultPowerModifier; lvlStatRate stands for level stat rate; yourLvl stands for your Level;

21 December 2017

All About Yule

Whelp, I've never been too good at summarizing stuff and I'll probably summarize it too much but hey. I need to do some tribute to participate my way in today's yule.

What Is Yule?

I know you could just look it up on Wikipedia but here you go: Yule is an old traditional Celtic celebration matching the winter solstice. It is said to have somewhere between November and February through nowadays witches and magicians celebrate it on the 21st December, hence the topic of the post. The goal was to celebrate the end of the dark season and welcome the lighter time of the year, as well as the rebirth of the sun. It was most likely replaced with Christmas by the Christian church even though the topic and celebration differ strongly.

How To Celebrate?

On my search for information, I found different ways to celebrate it. Some historians connected Yule with the wild hunt. There is information on a lot of boozing also. And some information on gathering huge logs and light them, surround the huge fire, dance, sing, eat and drink.

And Nowadays?

Most magic-oriented people celebrate Yule and the winter solstice by performing rituals. 

The most simple ritual would be to kindle candles and other fires throughout the night until sunrise.
The goal here is to celebrate the end of the dark time and welcoming the light and the lighter part of the year. The sunrise represents the result of the successful ritual.

A more traditional way would be to prepare the celebration by extinguishing all light sources. Then once the celebration begins lit all candles, torches, fireplaces available. Once all the light sources are lit the feast will be started with a toast.

Seems Oddly Familiar

Jul took the saying "the festival of warmth and love" more literal, I guess. Contrary to Christmas or other similar celebrations, depending on the people who celebrate it the focus on rituals is higher or lower. At the same time, the meaning of the rebirth of the sun can be used for other rituals with a similar concept as well. For once, as a person who currently does not enjoy the ice-cold temperature, I don't mind a festival to celebrate it to get warmer.

'Tis The Season To Be Kindling Fa la la la la...

Imagining a festivity which consists of simply lighting things on fire sounds a bit weird if you take away the ritual meaning and everything. Additionally, if I would've known that certain rituals done on Yule take until sunrise I would've prepared earlier to make sure not to stand up like 6:15am. Oh well. I've informed myself to read a lot, way too much about this and tried my best to summarize it for you. So I guess, I've done my part? Oh and before I forget it. Maybe it's a good idea to celebrate the rebirth of the sun. I mean... we should be thankful for it still existing and not going imploding on us yet or something.

Happy Yule to you all!

Burn the halls with boughs of holly
Fa-la-la-la-la, la-la-la-la
'Tis the season to be kindling
Fa-la-la-la-la, la-la-la-la 
Don we now gaze the fire
Fa-la-la, la-la-la, la-la-la.
Troll the ancient Yule-tide carol
Fa-la-la-la-la, la-la-la-la.
See the blazing Yule before us.
Fa-la-la-la-la, la-la-la-la
Strike the harp and join the chorus.
Fa-la-la-la-la, la-la-la-la
Follow me in merry measure.
Fa-la-la-la-la, la-la-la-la
While I tell of Yule-tide treasure.
Fa-la-la-la-la, la-la-la-la

About Me

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