Project 1999

Project 1999 (/forums/index.php)
-   Melee (/forums/forumdisplay.php?f=63)
-   -   I made a P99 DPS calculator for melee classes based on EQEMU code (/forums/showthread.php?t=440003)

DeathsSilkyMist 04-07-2025 01:53 AM

I made a P99 DPS calculator for melee classes based on EQEMU code
 
As the title says, I made a P99 DPS calculator for melee classes using the EQEMU code.

Based on how close the current results seem to be compared to the game parses I have done, it seems pretty clear that P99 mostly uses the EQEMU code as-is for melee combat. They simply ignore all of the out-of-era code that has to deal with AA's, item bonuses, etc.

Right now it has a few small issues, like max damage values sometimes being 1-5 points above what they parse in game. This isn't enough to significantly throw off the DPS calculation, as rolling the max damage is rare anyway. The EQEMU codebase is full of magic numbers, so it is possible P99 has some minor tuning to said magic numbers that isn't in the EQEMU code. For people not familiar with coding, the term "magic number" simply refers to a constant value found in the code. As a simple example, when determining Riposte chance, they take the Riposte Skill, add 100, and then divide the result by 50. These numbers were probably arrived at based on various balancing tests.

The calculator currently doesn't have triple attack in it.

Here is a link to the full code, it is in Javascript. Feel free to look around and see how the calculations are done:

https://drive.google.com/file/d/114b...ew?usp=sharing

Here is a link to the minified code:

https://drive.google.com/file/d/1ks0...ew?usp=sharing

You can run both versions for free in your browser via https://playcode.io/javascript . Just copy/paste the code in, and you can see the results in the console window. There's a little green play button on the web view window if you want to re-run the calculation. It has randomized elements in it, so you'll get slightly different DPS numbers every time it's run. The minified version is better for playcode, as playcode has a 8 code line limit before it starts bothering you to pay.

To use it, there is a struct at the top of the document called "playerStats". Modify the variables in the "playerStats" to adjust the values for your character's level, weapon damage, skill levels, etc. To turn off dual wielding, set the "offHandWeaponDamage" to 0.

You can also modify the mob variables using the struct "mobStats". They are currently set to what a level 50's stats are roughly speaking. Take a look at the non-minified version of the code to see some comments for basic rules of thumb for how to adjust the values.

Let me know what you think, and let me know if it is close to your actual in-game parses! There is always room for improvement.

kjs86z2 04-07-2025 10:13 AM

no

loramin 04-07-2025 12:12 PM

I took the liberty of "wikifying" your calculator: https://wiki.project1999.com/Damage_Calculator. It's still quite rough, but it lets people see your work (and I got the sense that you weren't completely finished, so I didn't want to waste a lot of time on polish).

You can see the wiki code at https://wiki.project1999.com/MediaWi...eCalculator.js. As you can see there, I tried to leave your code as is, and just wrap it with form code (so it'd be easy to update with any new versions you make). However, I did have to modify your main function (RunDPSTest), to make it return an object containing the results, rather than logging them to the console (so I could display them).

P.S. It's also untested, so I make no promises about it being bug free ;)

Snaggles 04-07-2025 02:43 PM

I know p99 is a classic EQ simulator and Gameparse was created in 2007 but that’s a compromise I’m willing to make.

I may borrow or buy a Woodsman if I get bored and mix it in. I have a priceless spear which is probably on par with a SBOZ, or close enough when you consider the lower piercing cap.

Snaggles 04-07-2025 04:07 PM

Sorry DSM. I thought this was in the other thread.

Kudos for making something folks can use :)

DeathsSilkyMist 04-07-2025 04:24 PM

Quote:

Originally Posted by loramin (Post 3732024)
I took the liberty of "wikifying" your calculator: https://wiki.project1999.com/Damage_Calculator. It's still quite rough, but it lets people see your work (and I got the sense that you weren't completely finished, so I didn't want to waste a lot of time on polish).

You can see the wiki code at https://wiki.project1999.com/MediaWi...eCalculator.js. As you can see there, I tried to leave your code as is, and just wrap it with form code (so it'd be easy to update with any new versions you make). However, I did have to modify your main function (RunDPSTest), to make it return an object containing the results, rather than logging them to the console (so I could display them).

P.S. It's also untested, so I make no promises about it being bug free ;)

Thanks a bunch for this Loramin! I'll see if I can polish it up a bit. I can modify this right? This is an awesome starting point. I don't have a ton of knowledge on how to do this sort of thing on the wiki, and a working example is the best way to learn.
Quote:

Originally Posted by Snaggles (Post 3732100)
Sorry DSM. I thought this was in the other thread.

Kudos for making something folks can use :)

No worries!

loramin 04-07-2025 05:37 PM

Quote:

Originally Posted by DeathsSilkyMist (Post 3732110)
I can modify this right?

Unfortunately only wiki admins can edit the Javascript, but if you want to send me a new version I'd be happy to update the wiki with it.

DeathsSilkyMist 04-07-2025 06:19 PM

Quote:

Originally Posted by loramin (Post 3732154)
Unfortunately only wiki admins can edit the Javascript, but if you want to send me a new version I'd be happy to update the wiki with it.

Great! I'd say the main thing that needs improving at the moment is the display of the output arrays.

In playground.io the console.log() function shows the array index and the value. For example:

Index 0: 100,
Index 1: 22,
Index 2: 1,
...

The wiki version just shows the value:

100,
22,
1,
...

The wiki calculator should show the array index and value. For the damage arrays, the index is the damage number, and the value is the number of times the damage number was rolled. For the roll array, the index is the dice roll and the value is the number of times it was rolled.

The array variables I am referring to are:

uniqueMainHandDamageValueCountArray
uniqueOffHandDamageValueCountArray
uniquediceRollCountArray

If they were displayed in tables that would probably be easy to read as well.

loramin 04-08-2025 02:43 PM

Quote:

Originally Posted by DeathsSilkyMist (Post 3732179)
In playground.io the console.log() function shows the array index and the value ...

The wiki version just shows the value:

...

If they were displayed in tables that would probably be easy to read as well.

Those three result fields are now displayed as tables, with a header row of the indices (I assumed you wanted them 1-based and not 0-based).

Again, it's not the most beautiful, so if you want to provide some styling I'll be happy to update ... but at least people can see the indices now.

DeathsSilkyMist 04-08-2025 02:49 PM

Quote:

Originally Posted by loramin (Post 3732383)
Those three result fields are now displayed as tables, with a header row of the indices (I assumed you wanted them 1-based and not 0-based).

Again, it's not the most beautiful, so if you want to provide some styling I'll be happy to update ... but at least people can see the indices now.

The tables are looking good! They are 0 based actually. 0 is misses. So one small fix there.

EDIT: Maybe name the 0 column "misses" so people know.


All times are GMT -4. The time now is 08:20 AM.

Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.