PDA

View Full Version : DDO Damage Simulator



Ligraph
01-11-2016, 08:25 PM
Information:

This is a tool designed to calculate the damage done over time by almost any non-caster build. Once you enter in all the information for your build, the tool should be able to calculate the damage you will do with a reasonable degree of accuracy. The tool is still a WIP project, but it should be functional. Damage formulas are also a WIP, and I have no way to determine if my math is correct or not. I will update/fix the tool when I can, but once school starts, I may not get much time to work on it.


Download and Installation:


Latest Version: 2.29.0
Version 2.29.0 .rar download (https://drive.google.com/uc?export=download&id=0B0TvdaODes3MS1V2ak9EUjk1MDA)
Version 2.29.0 .zip download (https://drive.google.com/uc?export=download&id=0B0TvdaODes3MSkJQUWxpLXJWN2s)

The download is a .zip or .rar file containing a .jar file, a .exe file, and the presets folder. Either the .jar file or the .exe file can be used to run the tool. If any of the files are moved, my presets will not load, but the tool should run normally (untested).

Naming:
The download file will be named DDODamageSimulatorX.Y.Z. X is the major version, Y is the DDO update it works for, and Z is the minor version. Current version is 2.29.0. For now, the tool should work with any version of ddo, but that will change once I get a few features working.


Changelog:
2.29.0:

Added Feats, Enhancements, and ED Enhancements.
Reworked most of the ui to support this.
Added the Create Effect/Buff/Attack windows
Not all the buttons work yet.
Load Build functionality not yet implemented.

1.29.0:

Basic version working.



Short term todo list:

Make all the buttons work.
Display whether effects/buffs/attacks/feats/enhancements/ed enhancements are active or inactive.
Add feat, enhancement, and ed enhancement presets.


Long term todo list:

Add the "load from build" functionality.
Verify the damage formulas
Add options for ranged damage and spellcasting. These will probably separate tools.


Usage:
Usage is fairly self-explanatory. Specify the attributes of your weapons, create your feats, enhancements, and epic destiny enhancements and add them to their proper tabs. Add any miscellaneous effects, buffs, and attacks that you didn't include in your feats, enhancements, and epic destiny components to the Misic tab, or if you are loading feats, enhancements, and epic destiny components from a pre-made build, the misic tab can be used for effects, buffs, and attacks that were not loaded (like Monk stances). The "Run Damage Calc" button runs the simulation and outputs damage per minute and damage per second. Will post a more detailed guide if requested.



Tips and Tricks:
To add a custom effect/weapon/buff/attack to the presets list, simply save it inside the appropriate preset folder:

Weapons --> presets/weapons
Mainhand only weapons (greatswords, etc.) --> presets/mainhand only weapons
Effects --> presets/effects

You get the idea.


Bugs, things that don't work properly, and things to watch out for
Selecting a Fighting Style grants NO FEATS! The Fighting Style feats must be added seperatly.
*BUG* SWF fighting style gives +30% attack speed and 1.5*ability mult to damage, assumes that the user has gSWF.
There is no way to add a Enhancement bonus from the player side. To get around this, add "damage on hit before crit multipliers" instead (it's calculated the same).

Everything stacks.


Things I need help with:
Feedback of all kinds.

Weapon attack speed formulas. This is the biggest part of the tool where I have no idea what I am doing. Attack speeds for TWF and THF are taken from this post (https://www.ddo.com/forums/showthread.php/275144-Vanshilar-s-Attack-Speed-Index-and-Formulae), but I don't know if it is still accurate.

Attack speeds I need:

SWF
All other weapons (crossbows, bows, quarterstaves, etc.)


Presets. If someone has a particular weapon/effect/buff/attack they would like added to the preset folder (for everyone), PM me with the save file and I'll put it in next update.

Someone (or multiple someones) to check my Damage Formula.
Damage Formula (there are 3 relevant methods, written in Java):



public double getAverageDmgForFS(int mins){

System.out.println("Starting Sim with FS " + f);

double damage = 0;

int totalAttacks = 0;

switch(f){
case SWF:totalAttacks = (int) ( 86.50 * ( 100d + 1*(getStat(null, Atribute.AttackSpeed) + 30) )/100d );
break;
case THF: totalAttacks = (int) ( 86.50 * ( 100d + 1.0327 * getStat(null, Atribute.AttackSpeed) )/100d );
break;
case TWF: totalAttacks = (int)( 86.66 * ( 100d + 1.1965 * getStat(null, Atribute.AttackSpeed) )/100d );
break;
case None: totalAttacks = (int) ( 86.50 * (100d + 1*(getStat(null, Atribute.AttackSpeed)) ) /100d );
default:
break;

}

totalAttacks *= mins;

totalAttacks *= ( (100+getStat(null, Atribute.Doublestrike))/100 );

int basicAttacks = totalAttacks;

// find how many basic attacks are used
for(Attack a : player.attacks){
basicAttacks -= a.getUsesInMins(mins);
}

System.out.println("BasicAttacks: " + basicAttacks);
// adds the damage for that many basic attacks
damage += basicAttacks*getDamageForAttackInFS(Attack.BasicAt tack, f);

System.out.println("Damage for 1 Basic Attack: " + getDamageForAttackInFS(Attack.BasicAttack, f));

for(Attack a : player.attacks){
damage += a.getUsesInMins(mins)*getDamageForAttackInFS(a, f);
}



damage *= 1+Math.max(getStat(mh, Atribute.Vulnerable), getStat(oh, Atribute.Vulnerable));



return damage;

}
public double getDamageForAttackInFS(Attack a, FightingStyle f){
double damage = 0;
if(f == FightingStyle.TWF){

damage += getDamageForAttack(mh, a, AttackStyle.TWFMH);
damage += getDamageForAttack(oh, a, AttackStyle.TWFOH)*( 0.80 + getStat(a, null, Atribute.AddedOffhandAttackRate) )*( (100+getStat(null, Atribute.OffhandDoublestrike))/100d );

} else if (f == FightingStyle.THF){
damage += getDamageForAttack(mh, a, AttackStyle.THF);
} else if (f == FightingStyle.SWF){
damage += getDamageForAttack(mh, a, AttackStyle.SWF);
} else{
damage += getDamageForAttack(mh, a, AttackStyle.None);
}
return damage;
}

public double getDamageForAttack(Weapon w, Attack a, AttackStyle f){

double abilityMult = 1;

switch(f){
case SWF: abilityMult = 1.5;
break;
case THF: abilityMult = 1.5;
break;
case TWFMH: abilityMult = 1;
break;
case TWFOH: abilityMult = 0.5 + getStat(null, Atribute.OffhandAbilityMultiplier);
break;
case None:
break;
default:
break;


}



double dmgNoCrit =
getStat(a, w, Atribute.Dice)
*getStat(a, w, Atribute.Multiplier)
+ getStat(a, w, Atribute.Enhancement)
+ getStat(a, w, Atribute.AbilityModifier)*abilityMult;

double critChance = ((getStat(a, w, Atribute.CritRange))/20d)
*(getStat(a, w, Atribute.Seeker)/20d);

double critMult = getStat(a, w, Atribute.CritMult);

double vorpalChance = (getStat(a, w, Atribute.AddedVorpalRange) + 1)/20;

System.out.println("CritChance: " + critChance + ", CritMult: " + critMult + ", VorpalChance: " + vorpalChance);

double dmg;

dmg = (1d-critChance)*dmgNoCrit +
(critChance-0.1)*critMult*( dmgNoCrit + getStat(a, w, Atribute.DamageBeforeCrit) ) +
(0.1)*(critMult + getStat(a, w, Atribute.CritMult1920))*(dmgNoCrit + getStat(a, w, Atribute.DamageBeforeCrit));

// dmg now equals your base weapon damage, multiplying by Melee Power
double MPMod = (100d + getStat(a, w, Atribute.MeleePower))/100d;
dmg *= MPMod;


dmg += getStat(a, w, Atribute.DamageOnHit);
dmg += critChance*(getStat(a, w, Atribute.DamageOnCrit));
dmg += vorpalChance*(getStat(a, w, Atribute.DamageOnVorpal));

dmg += MPMod*getStat(a, w, Atribute.DamageOnHitMP);
dmg += MPMod*critChance*getStat(a, w, Atribute.DamageOnCritMP);
dmg += MPMod*vorpalChance*getStat(a, w, Atribute.DamageOnVorpalMP);

double SAMod = (100 + 1.5*getStat(a, w, Atribute.MeleePower))/100;
dmg += SAMod*getStat(a, w, Atribute.SneakAttack);

//dmg now includes misc damage effects on weapon and player, and sneak attack

return dmg;

}

Alkusoittow
01-12-2016, 09:28 PM
Information:

This is a tool designed to calculate the damage done over time by almost any non-caster build. Once you enter in all the information for your build, the tool should be able to calculate the damage you will do with a reasonable degree of accuracy. The tool is still a WIP project, but it should be functional. Damage formulas are also a WIP, and I have no way to determine if my math is correct or not. I will update/fix the tool when I can, but once school starts, I may not get much time to work on it.
...
...

Congrats on undertaking a challenging task. For starters, please see the damage simulator I have linked in my signature. That should give you a good baseline of what you'll want to include. You will find there are a LOT of things to take into account, so don't get disheartened when the list is never-ending. Just do your best and your contribution will benefit the community.

Second:
You can create direct links to your shared google drive links here:
https://sites.google.com/site/gdocs2direct/
(this avoids having to see an additional page before downloading)

Third, I recommend using .rar instead of .zip only because it is slightly less likely to cause antivirus flags. Chrome gave me grief about downloading a zip.

Fourth, I recommend digitally signing your programs, and sharing the published version (not the debugging output version). The non-published .exe that comes out of "building" your program (in the case of Visual Studio) will sometimes cause Windows to flag it as potentially a virus (and same for some antivirus programs). Digitally signing further mitigates the issue.

Lastly, good luck and feel free to ask any questions. I will try to offer more advice but hopefully not too much at once.

Ligraph
01-12-2016, 11:41 PM
Congrats on undertaking a challenging task. For starters, please see the damage simulator I have linked in my signature. That should give you a good baseline of what you'll want to include. You will find there are a LOT of things to take into account, so don't get disheartened when the list is never-ending. Just do your best and your contribution will benefit the community.

Second:
You can create direct links to your shared google drive links here:
https://sites.google.com/site/gdocs2direct/
(this avoids having to see an additional page before downloading)

Third, I recommend using .rar instead of .zip only because it is slightly less likely to cause antivirus flags. Chrome gave me grief about downloading a zip.

Fourth, I recommend digitally signing your programs, and sharing the published version (not the debugging output version). The non-published .exe that comes out of "building" your program (in the case of Visual Studio) will sometimes cause Windows to flag it as potentially a virus (and same for some antivirus programs). Digitally signing further mitigates the issue.

Lastly, good luck and feel free to ask any questions. I will try to offer more advice but hopefully not too much at once.

Thanks. Your simulator was definitely an inspiration, I made my own because I wanted a tool that specializes in (semi-easily) comparing builds. Will post direct links and .rar in the next update, but since I'm reworking most of the ui, that might be a few days. As for the digital signature, I'm coding in Java and using launch4j (http://launch4j.sourceforge.net/)to make a .exe, do you have any idea how to sign that?

Alkusoittow
01-13-2016, 09:46 AM
Thanks. Your simulator was definitely an inspiration, I made my own because I wanted a tool that specializes in (semi-easily) comparing builds. Will post direct links and .rar in the next update, but since I'm reworking most of the ui, that might be a few days. As for the digital signature, I'm coding in Java and using launch4j (http://launch4j.sourceforge.net/)to make a .exe, do you have any idea how to sign that?

Yes I will admit my tool became quite complicated looking. I guess I was trying to develop and all-encompassing calculator, and that required so many options that it evolved into the messy GUI you see today... It gave me new respect for the devs and what they have to deal with.

What are you using to create your .jar files? I personally love Visual Studio and have yet to see another IDE that even comes remotely close to its support or functionality (but that probably also comes from having used it professionally for years). I've tried others like Eclipse and found them to be cheap imitations... Anyway, an option would be to use Visual Studio if you're not already and signing it there. It's pretty easy. Also, VS Express is free, and it's a supported tool (unlike open-source).

Alkusoittow
01-13-2016, 09:59 AM
Couple things I noticed in your code:


double vorpalChance = (getStat(a, w, Atribute.AddedVorpalRange) + 1)/20;

That should be 20.0d, or 20d. Also, you should use 1.0d or 1d instead of 1. If, however, "Atribute.AddedVorpalRange" is an int, then you need to cast that sum as a float or double before you divide by 20 or you're likely to get rounding error.

There's a number of examples like this in the code you posted.

Ligraph
01-13-2016, 07:33 PM
Yes I will admit my tool became quite complicated looking. I guess I was trying to develop and all-encompassing calculator, and that required so many options that it evolved into the messy GUI you see today... It gave me new respect for the devs and what they have to deal with.

What are you using to create your .jar files? I personally love Visual Studio and have yet to see another IDE that even comes remotely close to its support or functionality (but that probably also comes from having used it professionally for years). I've tried others like Eclipse and found them to be cheap imitations... Anyway, an option would be to use Visual Studio if you're not already and signing it there. It's pretty easy. Also, VS Express is free, and it's a supported tool (unlike open-source).

Using eclipse atm because of this addon (https://eclipse.org/windowbuilder/). Never tried VS, will download it and try it asap. You're definitely right about the complications, this started as a simple project. And btw, your gui seemed nice and clean when I used it, only reason I made this is I wanted to include special attacks and a "Load Build" feature.


Couple things I noticed in your code:


double vorpalChance = (getStat(a, w, Atribute.AddedVorpalRange) + 1)/20;

That should be 20.0d, or 20d. Also, you should use 1.0d or 1d instead of 1. If, however, "Atribute.AddedVorpalRange" is an int, then you need to cast that sum as a float or double before you divide by 20 or you're likely to get rounding error.

There's a number of examples like this in the code you posted.

getStat returns a double, so if I remember right, 1 and 20 will be promoted to double (docx (https://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.6.2)).

Alkusoittow
01-14-2016, 03:44 PM
Using eclipse atm because of this addon (https://eclipse.org/windowbuilder/). Never tried VS, will download it and try it asap. You're definitely right about the complications, this started as a simple project. And btw, your gui seemed nice and clean when I used it, only reason I made this is I wanted to include special attacks and a "Load Build" feature.



getStat returns a double, so if I remember right, 1 and 20 will be promoted to double (docx (https://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html#jls-5.6.2)).

Once you try VS, you will never go back. There are tons of great videos and tutorials from MS, and I suggest you keep sites like this handy:
https://msdn.microsoft.com/en-us/library/kx37x362(v=vs.120).aspx

I don't think VS supports java natively, so I would suggest you either look for an add-on, or considering using C# which is basically Java on steroids (in my experience). I have a lot more experience in VS with C++ and C# personally, but Visual Basic is also easy and considerably more powerful than the name implies.

Anyway, if you use C# or Basic, you can create a "Windows Form Application" which lets you draw, drag and drop, etc, to create your GUI. Super easy. :)