DPT and aDPT calculator

Now web-accessible!

I am currently working on a Damage-per-time calculator and accuracy-adjusted damage-per-time calculator for nova. Use ConText to extract the ship and weap resource types, feed them in, and it will provide an easy way to compare ship combat stats.

This isn't a standalone program. Its an FM8 database. When its done (hopefully in a few days), I will publish it here. If you don't have access to a copy of filemaker 8, I can do the calculations for you on my comp, and (possibly) host them temporarily.

Note: I will be calculating all the stock nova values (1.0.10)

Progress updates will be in this log.

I've made it web-accessible through a browser at:
http://smphoto.com:81/fmi/iwp/cgi?-db=DPSc...p;-startsession

This post has been edited by LNSU : 16 May 2008 - 06:10 PM

Cool.

I made a spreadsheet of that a while back. Well, I made one a long time ago but it wasn't right, and I just made a new one a couple months ago that's correct.

Make sure you remember to:

Add 1 to reload before you divide
Multiply by the number of frames a beam stays on screen (including fade out if applicable)

And if you want to be thorough:

BurstCount and BurstReload
Decay (show the DPS at a user-specified range—certainly if you're accounting for accuracy you'll need range anyway)
Submunitions

Couldn't someone just plug your equation into a simple program? I'd really like a DPS calculator.

I'm interested in how you are adjusting for accuracy in your equation(s). Is it simply going to be a function of how many degrees off-axis the weapon may fire? Are you going to account for seeker weapons that may have different levels of jam vulnerability?

If I had known that before I wouldn't have calculated the DPS for all weapons by myself XD
Whatever, DPS haven't found their way into TechnicalData since they were confusing for some of the testers ^^

It will not be a true accuracy-adjusted DPS. Instead it will be an damage rating based on possible DPS of turrets + (possible DPS of homing weapons assuming no jamming devices are present on the enemy) + ((possible DPS of forward-firing weapons)/turn rate)

There will also be options for calculating DPS adjusted for how far away the enemy is, and including various jamming %. PD will not be factored in.

Submunitions will not be factored in at the start, I will account for them later.

@JTH: Its not one equation. Its a series of equations linked to a database. It may be possible to export it to some other format later, but I'm not worrying about that now.

This post has been edited by LNSU : 06 April 2008 - 01:41 PM

Progress update:

It is now possible to view weapons fields through a portal, a join table, and some scripting. Calculations to come soon.

I need suggestions for what to calculate. Make them in this thread.
My list so far:

Damage on first shot
Damage per frame chart and graph for x frames
Total damage for x frames of continuous fire

Note: Decay and proxradius will be taken into account for all calculations. The user will be able to specify the range (in pixels) for which to calculate.
For continuous-fire calculations, burstcount, burstreload, in addition to count and reload will be taken into account. Also, ammunition and energy will be in effect (if you run out of ammo/energy, the weapon won't fire)

Submunitions will not come until later. Accounting for missile jamming will not happen until after submunitions are taken care of.

I believe this formula will work for unguided projectiles, turreted unguided projectiles (including PD), and freeflight rockets.

if( ((speed / 100) * (distance+proxradius)) > proxsafety && ((speed / 100) * (distance-proxradius)) < count)
{
massdmg = massdmg - ( ( (speed / 100) * (distance-proxradius)) / decay) )
energydmg = energydmg - ( ( (speed / 100) * (distance-proxradius)) / decay) )
if (energydmg == 0 || massdmg == 0)
{
energydmg = 0, massdmg = 0;
}
}

Is that the right formula?

Does anyone know the acceleration rate for freeflight rockets? I do not believe they are launched at full speed.

@lnsu, on Apr 10 2008, 01:49 PM, said in DPT and aDPT calculator:

I believe this formula will work for unguided projectiles, turreted unguided projectiles (including PD), and freeflight rockets.

Be aware that unguided projectiles and turrets are fired at Speed relative to the firing ship's speed, so calculations are accurate as long as the distance from launch to target isn't changing.

Quote

Is that the right formula?

No.

Quote

Does anyone know the acceleration rate for freeflight rockets? I do not believe they are launched at full speed.

I don't, but that would be a neat thing to look into. I'd like to hear if you find out.

Anyway, here's the math you want, assuming all calculations are floats, and assuming I didn't typo anything or have too bad of a brain fart:

Range = ProxRad + FLOOR(Count * Speed / 100)	//Max distance weapon can hit
ArmedRange = FLOOR( (1 + ProxSafety) * Speed / 100) - ProxRad	//Min distance weapon can hit
Spd = max(1, Speed)	//In case Speed == 0, to prevent division by 0
FramesToHit = CEIL( max(0, Distance - ProxRad) / (Spd / 100) )	//Actual life of weapon
AmountDecayed = FLOOR(FramesToHit / Decay)

if ( (ArmedRange <= Distance) && (Distance <= Range) ){
	ArmorDmg = MassDmg - AmountDecayed
	ShieldDmg = EnergyDmg - AmountDecayed
	ArmorDmg = max(0, ArmorDmg)
	ShieldDmg = max(0, ShieldDmg)
}else{
	ArmorDmg = 0
	ShieldDmg = 0
}

@lnsu, on Apr 11 2008, 05:49 AM, said in DPT and aDPT calculator:

Does anyone know the acceleration rate for freeflight rockets? I do not believe they are launched at full speed.

I think they take a fixed amount of time (1 second?) to reach top speed, so acceleration is dependent on speed.

@qaanol, on Apr 10 2008, 05:42 PM, said in DPT and aDPT calculator:

<complicated equations>

It's things of that nature that keep me wondering why plug-in developing doesn't make my brain explode.

Thanks qaanol.

BTW: what do CEIL() and FLOOR() do?

I believe I can calculate freeflight rocket speed by using snapz. I can fire one and track how far it travels each frame.

Round up or down to the nearest integer, respectively.

I keep getting the error "List usage is not allowed in this calculation"

Any ideas why, or what to fix? Here is the calculation I am attempting

Let(
(
Range = ProxRadius + FLOOR(Count * Speed / 100) ;
ArmedRange = FLOOR( (1 + ProxSafety) * Speed / 100) - ProxRadius ;
Spd = max(1, Speed) ;
FramesToHit = CEILing( max(0, fighter_ship::Distance - ProxRadius) / (Spd / 100) ) ;
AmountDecayed = FLOOR(FramesToHit / Decay) ;

ArmorDmg = if ( ArmedRange <= fighter_ship::Distance and fighter_ship::Distance <= Range ; if((MassDmg - AmountDecayed) > 0, MassDmg - AmountDecayed, 0)) ;

)
ArmorDmg + 0

)

Well I don't know how 'if' statements work here but there appears to be an inconsistency in your syntax. The nested 'if' makes sense to me: (condition, value-if-true, value-if-false) but the outer 'if' is: (condition ; value)

(edit) Perhaps it should look like this:
ArmorDmg = if ( ArmedRange <= fighter_ship::Distance and fighter_ship::Distance <= Range , max(MassDmg - AmountDecayed, 0) , 0) ;

What's with the ArmorDmg + 0 down the bottom?

This post has been edited by Guy : 13 April 2008 - 05:14 PM

I know nothing about the programming language you're using (so I'm not too sure why I'm trying to help) but here's a couple of thoughts:

- What does that double-colon mean? Something to do with lists, maybe? 🙂
- Are you sure it should be "and" and not "AND" or "&"? Or even "&&" which is required by some languages?
- Why are some of your variable names surrounded by underscores?
- What is the Let for, and why do you have an extra set of brackets inside?
- What's the point of the line "ArmorDmg + 0"?

(Now someone's gonna come with some decisive answer and make all my waffling sound silly. 🙂 )

The double-colon is a reference to a separate table in the database. The variable names are surrounded by underscores because thats how there were imported from context.
and is the proper syntax, not && (I tried it, its confusing).
Let allows me to declare variables within a calculation, not a script. The double brackets are supposed to be there, I don't know what they are for, its just how it works.

Armordmg+0 was to test if it required a real calculation for it to work.

Filemaker scripting is in a class of its own. It was an attempt to make it easy to learn for non-coders while keeping enough functionality to be equivalent, if not superior, to an html/php/sql solution.

I'll try guy's modified line, and I'll also try modifying the script to avoid using variables (messy, but it might work).

Perhaps your language is having issues with those underscores. I know some languages don't like variable names that start with numbers or symbols.

There is no issue with underscore variablenames.

The problem appears to be that I cannot use a let statement inside a calculation.

I can't quite figure it out. Hmm...

Note: I am using this project as a "Learn Filemaker" project.

Edit: It appears to work for homing weapons only. Strange, considering I am not taking weaptypes into account.

This post has been edited by LNSU : 13 April 2008 - 10:56 PM

Fixed. The problem was -1 values in ProxSafety and ProxRadius fields. I made a script to correct them to 0.

There seem to be some issues with turrets, non-damage weapons, and subs, but that is expected. I haven't finished the code for those yet.

Progress Report:
The program can calculate and list damage values for many weapons, and list them all for each weapon in a ship resource. It can account for range (decay and count) for each of the damage calculations.

Next up: Tally up the total damage produced in one frame of fire.

Edit: It cannot yet calculate for backwards-firing weapons (negative speed). I will eventually add an option for to caculate damage for forward-firing weapons, backward-firing weapons, side-firing weapons, or any combination.

This post has been edited by LNSU : 13 April 2008 - 11:21 PM