Project 1999

Go Back   Project 1999 > Class Discussions > Melee

Reply
 
Thread Tools Display Modes
  #441  
Old 11-24-2024, 05:04 PM
DeathsSilkyMist DeathsSilkyMist is offline
Planar Protector

DeathsSilkyMist's Avatar

Join Date: Jan 2014
Posts: 8,149
Default

Quote:
Originally Posted by Jimjam [You must be logged in to view images. Log in or Register.]
Really interesting code there. Thanks for posting it. What is the source? If I understand correctly it creates a loaded d20 dice where the weighting of the faces is derived from a complex comparison of offense and mitigation.

It seems mitigation gets scaled to the attacker's offense by subtracting the average between the attacker's offence and the defender's mitigation from the mob's mitigation, producing the adjusted scaled mitigation. I supose this is to make it so that while it is possible to squelch a weaker' mob's mitigation to some degree, they always have at least some chance to mitigate?

The code then does some comparisons of the adjusted mitigation value to offence to create a multiplier based on offense.

The next bit I'm not sure of, but the presence of a mean and standard deviation along with other values suggests a normal distribution is created, the mean for which is set based on the offence mitigation comparisons.

This explains why we have spikes counts of the lower and highest hit values. As a normal distribution has been generated, theoretically there are no limits to the highest and lowest values of d generated, so the values which are out of bounds are getting lumped into the dice as rolls of 1 or 20 (i.e. min or max damage).

Can stats/code fans verify I'm understanding this snippet of code correctly? Are there any details where you can provide deeper understanding either? My interpretation seems to match my previously reported understanding, but I admit my interpretation was likely coloured by my existing beliefs.

Edit: Here is the code DSM kindly shared, which I interpret as creating a loaded d20 damage roll with the faces weighted by a complex comparison of offence and mitigation transformed into a normal distribution.
 

function RollD20(offense, mitigation)
local diff, mult1, mult2;

mitigation = mitigation - (mitigation - offense) / 2;
diff = offense - mitigation;
if ( offense > 30 ) then
mult1 = offense / 200 + 25.75;
if ( mitigation / offense < 0.35 ) then
mult1 = mult1 + 1;
elseif ( mitigation / offense > 0.65 ) then
mult1 = mult1 - 1;
end
else
mult1 = 11.5 + offense / 2;
end
if ( offense > 30 ) then
mult2 = offense / 140 + 18.5;
else
mult2 = 14 + offense / 6;
end

local mean = 0;

if ( offense > mitigation ) then
mean = diff / offense * mult1;
elseif ( mitigation > offense ) then
mean = diff / mitigation * mult2;
end

local stddev = 8.8;
local theta = 2 * math.pi * math.random();
local rho = math.sqrt(-2 * math.log(1 - math.random()));
local d = mean + stddev * rho * math.cos(theta);

if ( d < -9.5 ) then
d = -9.5;
elseif ( d > 9.5 ) then
d = 9.5;
end
d = d + 11;
d = math.floor(d);
return d;
end
The source is from you[You must be logged in to view images. Log in or Register.]

Quote:
Originally Posted by Jimjam [You must be logged in to view images. Log in or Register.]
If anyone is interested, here is a link which produces some of Torcen’s work on eqemu regarding mitigation. Again I don’t know how well it aligns with p99, but for anyone interested in classic eq statistics / emulation / modelling they are pretty interesting reads.

https://www.eqemulator.org/forums/se...rchid=20679267
More specifically, this post: https://www.eqemulator.org/forums/sh...58&postcount=3. For some reason your link doesn't work anymore. It was coming up with three searched threads from Torven.
Last edited by DeathsSilkyMist; 11-24-2024 at 05:23 PM..
Reply With Quote
  #442  
Old 11-24-2024, 05:17 PM
Troxx Troxx is offline
Planar Protector

Troxx's Avatar

Join Date: Jun 2014
Location: The sands of DSM’s vagina
Posts: 4,285
Default

None of my level 60s that I play regularly on raids are in primary dps roles.

There's some nuance that I do not understand but I do know that for the following classes the best dps possible is found with the BiS (or same/close tier) 2handers:

Monk
Ranger
War
Sk
Pal

.... so yeah pretty much every melee dps class but rog.
__________________
Quote:
Originally Posted by DeathsSilkyMist View Post
There is no fail message for FD.
https://www.project1999.com/forums/s...43&postcount=2



.
Reply With Quote
  #443  
Old 11-24-2024, 05:30 PM
Jimjam Jimjam is offline
Planar Protector


Join Date: Jul 2013
Posts: 12,721
Default

Reposting as I added a lot of text.
Quote:
Originally Posted by DeathsSilkyMist [You must be logged in to view images. Log in or Register.]
The source is from you[You must be logged in to view images. Log in or Register.]



More specifically, this post: https://www.eqemulator.org/forums/sh...58&postcount=3. For some reason your link doesn't work anymore. It was coming up with three searched threads from Torcen.
Me, a highly credible source [You must be logged in to view images. Log in or Register.] … Torven really. Seems it is a model of his or her creation, at least I seem to have interpreted it ok (I think…). The work they have put into simulating eq is incredible! Of course this uses post classic data, so of course we can’t be sure how well it matches true classic. Also 2014 is after the split of p99 from base emu so damage rolls here could be handled very differently? This may explain why we see a centralish spike at only the mode value instead of a peak including the neighbouring ones?

In my defence I’ve not fully delved all the threads yet, some are pretty intense!

Ah, well that is disappointing the link expired. To recreate it the advanced search term was just ‘mitigation’ with author of ‘Torven’.
Reply With Quote
  #444  
Old 11-24-2024, 05:34 PM
bcbrown bcbrown is offline
Fire Giant


Join Date: Jul 2022
Location: Kedge Keep
Posts: 748
Default

Quote:
Originally Posted by Jimjam [You must be logged in to view images. Log in or Register.]
The next bit I'm not sure of, but the presence of a mean and standard deviation along with other values suggests a normal distribution is created, the mean for which is set based on the offence mitigation comparisons.

This explains why we have spikes counts of the lower and highest hit values. As a normal distribution has been generated, theoretically there are no limits to the highest and lowest values of d generated, so the values which are out of bounds are getting lumped into the dice as rolls of 1 or 20 (i.e. min or max damage).

Can stats/code fans verify I'm understanding this snippet of code correctly? Are there any details where you can provide deeper understanding either?
First off, the presence of a mean and standard deviation doesn't necessarily mean there's a normal distribution. A distribution is just a curve on a chart that shows the frequency with which the various values can occur if you draw a random value from the distribution.

A normal distribution looks the standard bell curve: values near the mean are more common than values near the tails. But there's other curves. For example, a flat line straight across the chart means every value is equally likely. This would correspond to rolling a single d10, for example: all integers from 1 to 10 are equally likely.

The standard deviation (or variance) is a number that describes how "compressed" the curve looks. It's a measure of how close to the mean you can expect a random value to be. A rule of thumb is that about two thirds of the time, you should get a value that's within one standard deviation of the mean. So if you have a mean of 50 and a standard deviation of 5, you should get a value between 45 and 55 two thirds of the time. But a mean of 50 and a standard deviation of 20 would mean you'd get a value between 30 and 70 two thirds of the time - you'd see a lot more variation.

[You must be logged in to view images. Log in or Register.]

Here's a chart that shows means and variance for a bunch of common distributions. We've already discussed normal and uniform distributions. The distribution for flipping a single coin is a Bernoulli. Flipping n coins all together is a Binomial. Nuclear radiation is described by a Poisson; note that it's characterized by lambda, the "half life". If you had a kilogram of Plutonium-238, after 87.7 you'd have only 500 grams, with the rest having undergone radioactive decay into something else.

What's special about normal distributions is the central limit theorem. What it says is that if you draw a large number of samples from any distribution, the distribution that describes the average of all your samples will be normally distributed. That's a really hard thing to understand and explain - I don't feel like I fully understand it.

The simplest way to put it is that although normal distributions describe lots and lots of things, there's other distributions as well, and a mean and standard deviation isn't just about normal distributions.

However, your intuition that "the values which are out of bounds are getting lumped into the dice as rolls of 1 or 20 (i.e. min or max damage)" as an explanation for why we see spikes at the min or max values seems reasonable. That's what I've been assuming, too. It doesn't explain the spike in frequency at the ~average, though.
Reply With Quote
  #445  
Old 11-24-2024, 05:40 PM
Troxx Troxx is offline
Planar Protector

Troxx's Avatar

Join Date: Jun 2014
Location: The sands of DSM’s vagina
Posts: 4,285
Default

you and your damned math textbooks ...

I'm fairly smart but that shit gives me a headache [You must be logged in to view images. Log in or Register.]
__________________
Quote:
Originally Posted by DeathsSilkyMist View Post
There is no fail message for FD.
https://www.project1999.com/forums/s...43&postcount=2



.
Reply With Quote
  #446  
Old 11-24-2024, 05:50 PM
bcbrown bcbrown is offline
Fire Giant


Join Date: Jul 2022
Location: Kedge Keep
Posts: 748
Default

Quote:
Originally Posted by Troxx [You must be logged in to view images. Log in or Register.]
you and your damned math textbooks ...

I'm fairly smart but that shit gives me a headache [You must be logged in to view images. Log in or Register.]
I'm putting this one in a spoiler tag because I don't want to give anyone a jump scare.
 
[You must be logged in to view images. Log in or Register.]
Reply With Quote
  #447  
Old 11-24-2024, 06:05 PM
DeathsSilkyMist DeathsSilkyMist is offline
Planar Protector

DeathsSilkyMist's Avatar

Join Date: Jan 2014
Posts: 8,149
Default

I appreciate the conversation has become civil again. Thank you to Troxx, BcBrown, and Jimjam.

To Bcbrown. With respect, my hunch is you are a little too pre-occupied in the theory of statistics, to the detriment of applying statistics practically.

Using the normal distribution in this post:

https://www.project1999.com/forums/s...&postcount=440

I was close enough to the parse data to support my position. My explanation is much better than any other explanation that has been given thus far. This is especially true considering the resistant nature of posters to supply data. My explanation shows how you come to the conclusion of "trivial" mobs, and why "non-trivial" mobs start to parse differently. As a bonus, it is friendly to both the formula and the programming code when looking at Torven's work.

Any contrarian could always proclaim that my data was insufficient, and thus it isn't valuable. But you should understand that the probability of getting the same pattern of results across multiple 10 minute parses, and a single 3 minute parse, on different mobs, is improbable if you want to claim my data is just random. Especially when the data matches my formula quite well.
Last edited by DeathsSilkyMist; 11-24-2024 at 06:08 PM..
Reply With Quote
  #448  
Old 11-24-2024, 06:09 PM
Jimjam Jimjam is offline
Planar Protector


Join Date: Jul 2013
Posts: 12,721
Default

Quote:
Originally Posted by bcbrown [You must be logged in to view images. Log in or Register.]
I'm putting this one in a spoiler tag because I don't want to give anyone a jump scare.
 
[You must be logged in to view images. Log in or Register.]
Thank you for reviewing my post, I appreciate that. It turns out the distribution which Torven claims to have created created was "For TAKP, I have replicated this curve by employing the Box-Muller Transform to generate a gaussian distribution". Do you have any further info on what defines that (yes I know I could google search it, but you deliver so eloquently, and you seem to enjoy explaining and posting textbook jumpscares)?

Edit: I thought this would be an interesting extra point, according to a quick search, p99 branched from eqemu in 2009. Now obviously, Torven may have written the code before making the post (2014) but I'd say there is a good chance p99 is using either a more rudimentary damage roll OR on of the p99 devs may have either copied Torven's work or created their own die. I'd love to know which it may be.

Edit edit: DSM I'm gonna dig further into that post you made which included the code now I feel I have a rough estimation of what was posted there and it's potential relevance (or maybe not!) to p99.
Last edited by Jimjam; 11-24-2024 at 06:19 PM..
Reply With Quote
  #449  
Old 11-24-2024, 06:26 PM
bcbrown bcbrown is offline
Fire Giant


Join Date: Jul 2022
Location: Kedge Keep
Posts: 748
Default

Quote:
Originally Posted by Jimjam [You must be logged in to view images. Log in or Register.]
Edit edit: DSM I'm gonna dig further into that post you made which included the code now I feel I have a rough estimation of what was posted there and it's potential relevance (or maybe not!) to p99.
While I watch some football and come up with a good answer to your initial question, I thought i'd point to another eqemu implementation of this same method: https://github.com/EQEmu/Server/blob...cpp#L999-L1020

This is probably what you were thinking of when you described it as a roll-off.
Reply With Quote
  #450  
Old 11-24-2024, 06:38 PM
bcbrown bcbrown is offline
Fire Giant


Join Date: Jul 2022
Location: Kedge Keep
Posts: 748
Default

Quote:
Originally Posted by Jimjam [You must be logged in to view images. Log in or Register.]
Thank you for reviewing my post, I appreciate that. It turns out the distribution which Torven claims to have created created was "For TAKP, I have replicated this curve by employing the Box-Muller Transform to generate a gaussian distribution". Do you have any further info on what defines that (yes I know I could google search it, but you deliver so eloquently, and you seem to enjoy explaining and posting textbook jumpscares)?
I know nothing other than what I read on Wikipedia and Torven's post, but I think I can explain. The Box–Muller transform is a way to build a normal distribution from a random number generator. You start with two random numbers between 0 and 1, and you end up with two samples from a normal distribution. This is stuff that is deep in the bowels of scientific computing - most normal people should use a library that implements it for you.

If you compare the code to the wiki page, you can see what Torven did. First, there's some futzing around to come up with some multiplier values, and then they're used to modify some value calculated for the mean. Then, the Box-Muller transform is used to draw a random sample from a normal distribution with the mean calculated earlier, and standard deviation of 8.8. So two thirds of the time it'll be within +/- 8.8 of whatever that mean value is. Then the tails are clipped so any values outside [-9.5, 9.5] are set to -9.5 or 9.5. Then you add 11 and round down, so now it'll be between 1 and 20.

It's doing essentially the same thing as the other implementation I posted, just using a slightly different distribution to pick which DI from 1 to 20 to use.
Last edited by bcbrown; 11-24-2024 at 06:40 PM..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:05 PM.


Everquest is a registered trademark of Daybreak Game Company LLC.
Project 1999 is not associated or affiliated in any way with Daybreak Game Company LLC.
Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.