Help: formula for eco and dps calculations

Falagor

Stalker
Joined
Feb 13, 2008
Posts
2,472
Location
Poland
Society
NBK Rangers
Avatar Name
Falagor Falagor Frostmaster
@edit:
i have the questions answered and i think formula verified ;).
@/edit:

Hello,

i am currently working on tool that will help calculating economy and dps of weapon setups. Here is snapshot of the app:


It is obviously in alpha stage and i am not yet sure if i will make it for public use.

I am fully aware that on Entropedia.info there is weapon compare tool but it lacks few game mechanincs recently added (mostly connected with buffs from rings/scopes/sight/amps/pills). So it can't show full picture of eco and dps and those new mechanincs can raise up eco a lot (something that is worth underlining if you do not know this yet). And since there is no admin at Entropedia.info i doubt there will be any update there that will include necesery changes.

So back on main topic:
i guess most people know basic formula for calculating eco and dps without using all the fancy extra items.
It looks like this (for maxed weapons):
dps = (max_dmg * 0.75 * 0.9 + max_dmg * 0.02) * (att_per_min / 60)
eco = (max_dmg * 0.75 * 0.9 + max_dmg * 0.02) / (total_cost)

There is no magic in here, right?

Now i have already implemented some calulations for all the necesery mechanincs and will describe the whole formula below - so if you are NOT interested or just do not want to parse all the formulas - just skip it to near the end ;)...

...
...
...

Ok - if you are still reading then you are the one of the few geeks that ARE interested. My question to you is: if all the mechanics described below are correct or mayby i missed something and the formula is wrong and needs correction.

Here are my main formulas for eco and dps that include all the fancy mechanics (i am pasting part of the code since i asume people who are still reading have some programming knowledge. I am not changing any value names since i may miss one place and not change it there and it will bring a lot of confusion). I did "split" the code on dps and eco counting so it is easier to read and understand whats going on ;):
Code:
weapon_max_dmg = main_dataset.Weapon.FindByName(comboBox_weapon.Text).Max_damage * (1 + 0.1*my_settings.Ammount_damage);            
weapon_decay = System.Math.Round(main_dataset.Weapon.FindByName(comboBox_weapon.Text).Decay * (1 + 0.1 * my_settings.Ammount_damage) * (1 - 0.01 * my_settings.Ammount_economy), 5);
weapon_amo = System.Math.Round(main_dataset.Weapon.FindByName(comboBox_weapon.Text).Amo * (1 + 0.1 * my_settings.Ammount_damage) * (1 - 0.01 * my_settings.Ammount_economy), 0);
weapon_attack_per_min = main_dataset.Weapon.FindByName(comboBox_weapon.Text).Attack_per_min;
amp_max_dmg = System.Math.Min(main_dataset.Amp.FindByName(comboBox_amp.Text).Max_damage, main_dataset.Weapon.FindByName(comboBox_weapon.Text).Max_damage / 2);
amp_decay = main_dataset.Amp.FindByName(comboBox_amp.Text).Decay;
amp_amo = main_dataset.Amp.FindByName(comboBox_amp.Text).Amo;


            double scope_decay = main_dataset.Scope.FindByName(comboBox_scope.Text).Decay;
            double sight1_decay = main_dataset.Sight.FindByName(comboBox_sight1.Text).Decay;
            double sight2_decay = main_dataset.Sight.FindByName(comboBox_sight2.Text).Decay;
            double pill_avg_cost_per_shot = main_dataset.Pill.FindByName(comboBox_pill.Text).Cost * (60.0 / (main_dataset.Pill.FindByName(comboBox_pill.Text).Time)) /
                (weapon_attack_per_min * (1 + buff_reload_actual/100));
            double accu_avg_cost_per_shot = (1.0 / main_dataset.Weapon.FindByName(comboBox_weapon.Text).Nr_of_shots_to_break_enh)
                * my_settings.Ammount_accuracy * 0.4 * my_settings.Markup_accuracy;
            double dmg_avg_cost_per_shot = (1.0 / main_dataset.Weapon.FindByName(comboBox_weapon.Text).Nr_of_shots_to_break_enh)
                * my_settings.Ammount_damage * 0.4 * my_settings.Markup_damage;
            double eco_avg_cost_per_shot = (1.0 / main_dataset.Weapon.FindByName(comboBox_weapon.Text).Nr_of_shots_to_break_enh)
                * my_settings.Ammount_economy * 0.4 * my_settings.Markup_economy;

            double eco;
            double dps;
            
            dps =
                (
                    (weapon_max_dmg + amp_max_dmg) * 0.75 * 0.9 +
                    (weapon_max_dmg + amp_max_dmg) * (0.02 + (buff_crit_rate_actual/100) + (0.004*my_settings.Ammount_accuracy)) * (1 + buff_crit_damage_actual/100)
                )
                * (weapon_attack_per_min * (1 + buff_reload_actual / 100) / 60);


            eco =
                (
                    (weapon_max_dmg + amp_max_dmg) * 0.75 * 0.9 +
                    (weapon_max_dmg + amp_max_dmg) * (0.02 + (buff_crit_rate_actual / 100) + (0.004 * my_settings.Ammount_accuracy)) * (1 + buff_crit_damage_actual / 100)
                )
                /
                (
                    weapon_decay + (weapon_amo / 100) + amp_decay + (amp_amo / 100) + scope_decay + sight1_decay + sight2_decay + pill_avg_cost_per_shot +
                    accu_avg_cost_per_shot + dmg_avg_cost_per_shot + eco_avg_cost_per_shot
                );
Ok so first things first:
- my_settings.Ammount_accuracy, my_settings.Ammount_damage, my_settings.Ammount_economy - this is the number of accuracy/damage/economy enhancer slot used (from 0 to 10).
- weapon_max_dmg, weapon_decay, weapon_amo and amp_max_dmg, amp_decay, amp_amo - i distinguish those two value sets because damage enhancer only increase dmg and cost of the weapon and not the amp. Also amp_max_dmg is limited by weapon_max_dmg so its secondary reason to not merge those two value sets in one.
- buff_crit_rate_actual - this is value taken from the Min(totals and totals_limit) (see picture). So in case totals will exceed 10% (maximum limit for totals in crit rate buff) - then 10% will be taken. In simple words - its actual buff on the critical rate.
- buff_crit_damage_actual and buff_reload_actual - similar meaning to buff_crit_rate_actual but for critical_damage and reload actual buffs acordingly.

At this point we can analyse the dps formula (more simple than eco in my opinion):
In first brakets there is total damage done per one shot on average. It does include the 90% hit rate, 2% base crit rate and of course crit modifications both on crit damage and crit rate.
In snd brakets (after "*") there is scaling the damge calulated on one shot - to damage done per second. So it is scale by nr of attacks per minute with reload buff modification.

Ok this is rather still simple and i think it is correct formula.

Now lets go to the harder part of calculating eco :):
First braket is exactly same as before - since it is average damage done per one shot.
Second braket - well its total cost.

This is where i am using the "wierd": pill_avg_cost_per_shot, accu_avg_cost_per_shot, dmg_avg_cost_per_shot, eco_avg_cost_per_shot (along with normal decay, amo and scope/sights per shot costs which are obvious to understand).
So for pills - it is scaled cost per one shot considering you will be shooting 100% time (i know it should be somehting mayby like 90% but thats not important atm). Will remind the code part responsible for this:
Code:
double pill_avg_cost_per_shot = main_dataset.Pill.FindByName(comboBox_pill.Text).Cost * (60.0 / (main_dataset.Pill.FindByName(comboBox_pill.Text).Time)) /
                (weapon_attack_per_min * (1 + buff_reload_actual/100));
So it is based on cost of pill, time on the pill, and attack speed of the weapon (with reaload speed modification).

The idea for scaling enhancers cost to one shot is very similar (but of course based on something else). Code reminder:
Code:
double accu_avg_cost_per_shot = (1.0 / main_dataset.Weapon.FindByName(comboBox_weapon.Text).Nr_of_shots_to_break_enh)
                * my_settings.Ammount_accuracy * 0.4 * my_settings.Markup_accuracy;
So its based on the nr of shots to break one enhancer per shot, amount of enh attached and markup of enhancers (notice that nr of shots to break one enhancer per shot is different for EVERY weapon and is not static value like many people think - of course only way to measure this is by doing like 100k shots with the gun - so its part of the database).

I know that rings will decay in future so i will adjust the app when they do (will look similar to including cost of pill).

So now if you are still reading - my main question is:
Is my thinking logic and calulations on including cost to use pills and enhancers correct?
(side question - if everythign else is ok too ;))?)

---------------

If you have other comments about my soft (i.e. whats good and whats bad?) or you feel like discusing eco or dps calulations - feel free to do so :).

Falagor
:bandit:
 
Last edited:

TunerS

Old Alpha
Joined
Feb 1, 2009
Posts
952
Location
Latvia
Avatar Name
Sniper TunerS Eagle
Just a side note, i already created a spreadsheet that calculates all of this - this thread

But good luck with making your tool.
 

Falagor

Stalker
Joined
Feb 13, 2008
Posts
2,472
Location
Poland
Society
NBK Rangers
Avatar Name
Falagor Falagor Frostmaster
Just a side note, i already created a spreadsheet that calculates all of this - this thread

But good luck with making your tool.
Ok great job - thank you ;).

I just did some testing vs my soft and it seems that:
1) calculating for X and X2 has exactly same stats as yours while for some reason A has different result. I will check my code for A and reason why it may be different but seems we use same formula for this (at least for X and X2).
2) calulating accuracy enhancers is a bit off. I am not sure why but when i add amp the difference is even bigger comapred to yours (my shows higher eco on accu enhancers). Just a thought - are you sure you include increased critical rate on both weapon and amp - since accuracy (oposite to damage) actually improve both weapon and amp ;). Of course i am not saying your formula is wrong but trying to understnad why there is a difference.
3) calulating damage enhancers have very similar results both on my app and your sheet (difference is very small - not sure if calulation rounding mayby).

Why i pointed out 2nd - its because i already have long term data tracked (with EL) with accuracy enhancers beeing used and it is very close to what my app is counting.

I will experiment more a little.

Falagor
:bandit:
 

Falagor

Stalker
Joined
Feb 13, 2008
Posts
2,472
Location
Poland
Society
NBK Rangers
Avatar Name
Falagor Falagor Frostmaster
Ok thank you for input TunerS - could you please look at the screenie from your sheet:



I have choosen CalyTrek CR Spirit Mk.II TEN Edition + Dante and filled all enhancers slots with accuracy enhancers (at 320% but not important atm).

Your sheet shows that average damage (per shot) is 70.070.

Here is the difference.

As far as i know the formula for this should be:
average damage = (max_dmg*0.9*0.75) + (max_dmg*(0.02 + 0.004*10))
(each accu enhancer increases crit rat by 0.4% from base 2% to 6% at tier 10 - mayby the difference is here? I am sure of this since i own tier 10 gun ;)).
so
average damage for this setup is: (98*0.9*0.75) + (98*0.06) = 66.15 + 5.88 = 72.03

and of course from this point your sheet differs from my further calulations.

Could you please explain how you get the 70.070 result on the setup i made in the example?

@edit:
i ask becasue calulations are hidden behind script and i am not yet familiar with scripting on google sheets yet.

Falagor
:bandit:


 

Falagor

Stalker
Joined
Feb 13, 2008
Posts
2,472
Location
Poland
Society
NBK Rangers
Avatar Name
Falagor Falagor Frostmaster
I am using formula from entropedia.
Ah now i understand - the formula there is wrong. Since according to it at 30 CHA (so having 10 accu enh) you will have 4% crit ratio which is not true.

I am 99% sure that with 10 accuracy enhancers you have 6% crit ratio - i did some runs in the past to test it and if necesery i can do another run but from my observation its still the same.

And indeed with 4% crit ratio you get 70.07 as in yoru sheet.

You should change it (unless you dont belive me on the "6%" then test it yourself and then change it ;)).

Falagor
:bandit:
 

TunerS

Old Alpha
Joined
Feb 1, 2009
Posts
952
Location
Latvia
Avatar Name
Sniper TunerS Eagle
If someone is interested in testing it then they can confirm or deny this and post their results in my thread, then I will adjust the formulas accordingly. But by the looks of it, there are only few players who are interested in this. Activity is fairly low. Or maybe only a few players understand all this stuff at a level so they can help us :scratch2: and some of them are just not interested in it.
 

Falagor

Stalker
Joined
Feb 13, 2008
Posts
2,472
Location
Poland
Society
NBK Rangers
Avatar Name
Falagor Falagor Frostmaster
If someone is interested in testing it then they can confirm or deny this and post their results in my thread, then I will adjust the formulas accordingly. But by the looks of it, there are only few players who are interested in this. Activity is fairly low. Or maybe only a few players understand all this stuff at a level so they can help us :scratch2: and some of them are just not interested in it.
If noone else will do it - i will do a test run tomorow and post in your thread ;).

Also i have found small bug in my code (generated from copy/paste). I copied 0.40ped TT value cost from accu enh for dmg and eco enh too (they have ofc 0.80 and 1.00) thats why there was small difference in dmg calculation - now its fixed and has same results as yours :).
So thx for posting - experimenting with your sheet definetly led me to finding that bug ;).

About the A-pill difference. I did some more tests to check if everything is alright with my code and it seems it is.

My conclusion is that your sheet considers A-pill either as (1ped and 450sec) or (2ped and 900sec) while its (1ped and 900sec) (when i change stats in my database to those it gives same result on eco as your sheet). I took the stats from: http://www.entropiauniverse.com/classifiedStrongboxes
I might be wrong though and there might be still mistake in my code that i just dont see yet.

Falagor
:bandit:
 

Oleg

Mutated
Joined
Aug 15, 2006
Posts
19,001
Location
Leeds, UK
Society
Rangers
Avatar Name
Oleg Oleg McMullery
Tests I've done using the Entropia Life client to record crit rates with accuracy enhancers back up what Falagor said above - that is, each level of enhancer adds 0.4% to the base crit rate of 2%.
 

skeezer

Old Alpha
Joined
Sep 6, 2008
Posts
910
Location
Bilton Tower 2, 3 B
Society
Irken Invaders
Avatar Name
Szilard Skeezer Aszkenaze
Great stuff guys!

I have nothing meaningful to add other than, good show!

:cool:
 

TunerS

Old Alpha
Joined
Feb 1, 2009
Posts
952
Location
Latvia
Avatar Name
Sniper TunerS Eagle
If noone else will do it - i will do a test run tomorow and post in your thread ;).

Also i have found small bug in my code (generated from copy/paste). I copied 0.40ped TT value cost from accu enh for dmg and eco enh too (they have ofc 0.80 and 1.00) thats why there was small difference in dmg calculation - now its fixed and has same results as yours :).
So thx for posting - experimenting with your sheet definetly led me to finding that bug ;).

About the A-pill difference. I did some more tests to check if everything is alright with my code and it seems it is.

My conclusion is that your sheet considers A-pill either as (1ped and 450sec) or (2ped and 900sec) while its (1ped and 900sec) (when i change stats in my database to those it gives same result on eco as your sheet). I took the stats from: http://www.entropiauniverse.com/classifiedStrongboxes
I might be wrong though and there might be still mistake in my code that i just dont see yet.

Falagor
:bandit:
I fixed accuracy enhancer % and Neurostim-A TT value. Now it should be ok. The rest I posted in my thread.

Thanks
 

M Rufen Power

Marauder
Joined
Feb 23, 2010
Posts
5,725
Location
UK - London
Society
How To Survive
Avatar Name
Mark Rufen Power
When is this tool ready for release my friend?
 

Falagor

Stalker
Joined
Feb 13, 2008
Posts
2,472
Location
Poland
Society
NBK Rangers
Avatar Name
Falagor Falagor Frostmaster
(...)
It is obviously in alpha stage and i am not yet sure if i will make it for public use.
(...)
When is this tool ready for release my friend?
Hehehe ;). Well as mentioned i am not sure if it should be public.

It is currently as "instalable" app since it is easiest to make (and when i was starting it - i planed it for pure personal use. Only later i came to idea it might be good to share this mayby).
So since its instalable - there is always trust involed and i would NOT recomed instaling anyting they can't fully trust ;). Of course i know its no virus but how anyone else can know?

So thing that would solve this problem (and would make access MUCH easier):
1) make simple site with all the calculations.

To be honest i have never done yet a web app so have no experience there yet (it might be good idea to learn on this as a project though ;)).

There is another problem which i would have to pass somehow:
2) Importing database from Entropedia.info (or gather the database from somewhere else - seems TurnerS has a lot of data in his sheet already).
I mean i can't imagine puting all the info by myself - that would take ages :).

If the site was working i could make "add/edit" database wiki style so everyone can add some info if they need. But then i really hate wiki based informations where everyone can edit everything. I mean look at entropedia - so many info out of date or misleading on purpose and there i no way to tell which is true oher than testing yourself.

Another idea is making free "accounts" and every participant could make one and store their private (or semi-public "shareable") database that he/she would fill by himself/herself. This way there is no community based database and if someone is curious about few different setups they can easily fill their own info and have all the calulations made (if he/she fills it badly then its not my fault ;) - ofc small tutorial would be included).

And of course now is the Halloween Mayhem / Ark Gold Rush going on (i am done with HM but i still have about 250-260 of hours to do till end of nov in GR). So no time to develop ;).
Next is MM comming which i have been preparing since january and can't mess it up too (and probably on the way Core event will pop up too).
So i guess i will have time like from jan 2016 to continue on this.

------

So far those were some loose thoughts on this and its obvious i have no clear plan yet.

So i am open on sugestions:
1) should i put this on web site (yes/no)?
2) if yes then - should this be wiki based database or mayby "semi-private" small databases as described before. I could combine those two aproches a little to:
make "wiki-style" edited by only trusted members - that way the database would slowly grow and anyone could make their own account and have their own (even imaginary) setups calulated.
3) other sugestions?

------

Also - if there is anyone who needs to have their eco calulated RIGHT NOW - just hit me with PM and i will ask you for necesery data (like decya, enh break rate etc).

------

Also - the app so far is assuming you will be using maxed gun (again - personal use only talking here: i KNOW using non maxed weapons is stupid so i did not even think about implementing it). No mechanics for counting non maxed or non-sib under lev 100. I have seen that TunerS has implemented this already in his sheets.

Of course at this point - i think anyone who needs the info is way better using TunerS google sheets ;) (yes - i am better than google adds!).

That was a LOOOONG post - sorry ;).

Falagor
:bandit:
 

Doer

Marauder
Joined
Nov 29, 2005
Posts
7,004
Location
Muddlin' Through
Society
Rangers
Avatar Name
David "Doer" Falkayn
Without looking too closely it seems you have an error in your formula (i imagine it's from entropedia, which is wrong as i pointed out in the talk area long ago after analyzing my data). It should be

dmg_max * hit_ratio (damage_ratio + crit_ratio)

In other words, you have to multiply both damage_ratio AND crit_ratio by hit_ratio.

In the case of a maxed weapon without enhancers or junk jewelry, you get

dmg_max * 0.9 ( 0.75 + 0.02 ) = dmg_max * 0.9 * 0.77

ETA i implemented for the elaborate dps and dpp calculator in my Pimp my pewpew spreadsheet.
 

Falagor

Stalker
Joined
Feb 13, 2008
Posts
2,472
Location
Poland
Society
NBK Rangers
Avatar Name
Falagor Falagor Frostmaster
Without looking too closely it seems you have an error in your formula (i imagine it's from entropedia, which is wrong as i pointed out in the talk area long ago after analyzing my data). It should be

dmg_max * hit_ratio (damage_ratio + crit_ratio)

In other words, you have to multiply both damage_ratio AND crit_ratio by hit_ratio.

In the case of a maxed weapon without enhancers or junk jewelry, you get

dmg_max * 0.9 ( 0.75 + 0.02 ) = dmg_max * 0.9 * 0.77

ETA i implemented for the elaborate dps and dpp calculator in my Pimp my pewpew spreadsheet.
Indeed that seems logical: 2% of actual hits - are crits.

so difference is very very small to be honest (but if one wants to get accurate its important):
dmg_max * 0.9 * 0.77 = dmg_max * 0.693
vs
dmg_max * (0.9 * 0.75 + 0.02) = dmg_max * 0.695

so ~0.289% difference.

How big is your data sample (in nr of shots) to confirm the crit rate is EXACTLY 2% and calulated like you descibed?

I am tempted to start colecting this myself but then i am forced to use only one weapon (no arso and no finisher for very long time which is something i would like to avoid :().

Falagor
:bandit:
 

Doer

Marauder
Joined
Nov 29, 2005
Posts
7,004
Location
Muddlin' Through
Society
Rangers
Avatar Name
David "Doer" Falkayn
Indeed that seems logical: 2% of actual hits - are crits.

so difference is very very small to be honest (but if one wants to get accurate its important):
dmg_max * 0.9 * 0.77 = dmg_max * 0.693
vs
dmg_max * (0.9 * 0.75 + 0.02) = dmg_max * 0.695

so ~0.289% difference.

How big is your data sample (in nr of shots) to confirm the crit rate is EXACTLY 2% and calulated like you descibed?

I am tempted to start colecting this myself but then i am forced to use only one weapon (no arso and no finisher for very long time which is something i would like to avoid :().

Falagor
:bandit:
I'm afraid i can't find the point where i started using that formula and the data that supported it but it was most likely the various data using accu enhancers because that makes it more obvious.
 
Top