Project 1999

Go Back   Project 1999 > Class Discussions > Melee

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 11-24-2024, 05:04 PM
DeathsSilkyMist DeathsSilkyMist is offline
Planar Protector

DeathsSilkyMist's Avatar

Join Date: Jan 2014
Posts: 8,247
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
 


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:40 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 - 2026, Jelsoft Enterprises Ltd.