• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Simple Jass Math Question ^^

Status
Not open for further replies.
Level 18
Joined
Oct 18, 2007
Messages
929
Ok i kinda need some math awnsers fast :P.

The system im making is a system that i like to use called Damage Over Time.

I know there are some systems out there, but i want to make my own.

Ok the simple math is: You are given a real value called "X" and another real value called "Y".

JASS:
X = Damage
JASS:
Y = Time

The last value is a constant value. It is a timer value named "Z".

JASS:
Z = 0.05

What i need to be the end result is a real value "D" that will add up to the Time.

Because every "Z" secconds it will deal "D" amount of damage to the target. In the end when all that damage adds up to the Damage "X" that is given and at the same time "Y" secconds has eclapsed.

So please respond quickly ^^

[RAINBOW]Yes... I know i'm lazy.[/RAINBOW]


Edit: Please, always scroll down to the last comment, stuff may be posted!
 
Last edited:
Damage per Z is (X/(Y/Z)). For every Z deal (X/(Y/Z)) damage.

Example:
X (Damage) = 200
Y (Time) = 2 seconds
Z (Timer) = every 1 second.

For every Z (1 second) you deal (200(2/1)) damage.

^^ Thx Paladon, going to test it. +rep for understanding xD

Edit: But what about values below 1 and higher than 1. if you Divide a number that is lower that 1 you get a higher number.. :P
 
Ok, the formula is obvious, and can be presented as d = x * z / y

1. 0.5 damage over 2 seconds, with period 0.05:
x = 0.5
y = 2.0
z = 0.05

0.5 * 0.05 = 0.025;
0.025 / 2 = 0.0125;
d = 0.0125

How we can check it?
n * z = y, where n is count of damage moments.
n = 2 / 0.05 = 40;
40 * 0.0125 = 0.5; what was required to prove.

2. 50 damage over 0.5 seconds, with period 0.02:
x = 50
y = 0.5
z = 0.02

50 * 0.02 = 1;
1 / 0.5 = 2;
d = 2

Check:
n = 0.5 / 0.02 = 25;
25 * 2 = 50; what was required to prove.

3. 0.5 damage over 0.2 seconds, with period 0.01:
x = 0.5
y = 0.2
z = 0.01

0.5 * 0.01 = 0.005;
0.005 / 0.2 = 0.025;
d = 0.025

Check:
n = 0.2 / 0.01 = 20;
20 * 0.025 = 0.5; what was required to prove.
 
Ok, the formula is obvious, and can be presented as d = x * z / y

1. 0.5 damage over 2 seconds, with period 0.05:
x = 0.5
y = 2.0
z = 0.05

0.5 * 0.05 = 0.025;
0.025 / 2 = 0.0125;
d = 0.0125

How we can check it?
n * z = y, where n is count of damage moments.
n = 2 / 0.05 = 40;
40 * 0.0125 = 0.5; what was required to prove.

2. 50 damage over 0.5 seconds, with period 0.02:
x = 50
y = 0.5
z = 0.02

50 * 0.02 = 1;
1 / 0.5 = 2;
d = 2

Check:
n = 0.5 / 0.02 = 25;
25 * 2 = 50; what was required to prove.

3. 0.5 damage over 0.2 seconds, with period 0.01:
x = 0.5
y = 0.2
z = 0.01

0.5 * 0.01 = 0.005;
0.005 / 0.2 = 0.025;
d = 0.025

Check:
n = 0.2 / 0.01 = 20;
20 * 0.025 = 0.5; what was required to prove.

A bit advanced but il try ^^ thx, btw: what is "n"?

Edit: Instead of showing the vaules could you show it in like: x * y / z = d ( or something, just an example )
 
Damage per Z is (X/(Y/Z)). For every Z deal (X/(Y/Z)) damage.

Example:
X (Damage) = 200
Y (Time) = 2 seconds
Z (Timer) = every 1 second.

For every Z (1 second) you deal (200(2/1)) damage.

Im sure Paladon is right , i would do D = X/(Y/Z) too
Y/Z = Times damage is dealt
X / Times damage is dealt = damage for each interval

I think the misunderstandings appear because of paladons lil mistake in his example :) -> should be "(200/(2/1))"

btw, "d = x * z / y" and "Dmg = x / (Y * (1 / Z))" are exactly the same as above , just remodeled
 
I dont see a point of making Z > or < then 1. Unit will receive dmg every second (if timer is in seconds, witch i sopose it is). If so then Y must not be lesser then 1. Also why would X be lesser then 1. I mean why would it be leser then 100. Its dmg. Whats the point in such a low dmg.

These statments are refearing if your using normal vaules like me.

If your using something other where my 100 is equal tou yours 0.1 (for example), then... well, check previous posts.









Up there^
 
Status
Not open for further replies.
Back
Top