smurfynet, on 22 January 2013 - 03:12 AM, said:
i'm in the process optimizing it for mobile devices, but its not a priority. i added drag and drop support for mobile with the last update and currenty trying out some layout optimizations based on screensize.
i'm currently actively working on a first version of customizable weapon stats. time to overheat is planned, but i did not research a formula for that yet.
A formula that gives you the ball park number (but not the precise time to overheat, as it doesn't distinguish between dealing 10 heat every 4 seconds or 5 heat every 2 seconds, but this can make a difference):
Time to Shutdown:
t
shutdown = Heat Capacity / (Heat Generated - Heat Dissipation)
I am afraid the math that could describe it more precisely eludes me, but I could probably come up with some kind of algorithm to determine it:
How many shots has a weapon fired after a time
t:
n
shots[weapon](t) = 1 + ROUND_DOWN(t / t
cycle[weapon] )
How much heat has it produced after time t:
h
shots[weapon](t) = n(t) * h
[weapon]
Now, for an algorithm in pseudo-code
DamageTimeValue timeDamageToShutdown(SmurfyNetMechConfiguration mech) {
double minTimeInterval = ARBITRARY_INTERVAL; // Probably something like 0.1 seconds.
double tMaximum = ARBITRARY_HIGH_YET_REASONABLE_CONSTANT; // Probably something like 60.0, if a mech doesn't overheat within 60 seconds, who the frack cares?
double heatMax = mech.heatCapacity();
double heatDissipation = mech.heatDissipation();
double heatTotal = 0;
double damageTotal = 0;
double t;
for(t = 0; heatTotal < heatMax || t < tMaximum; t+=minTimeInterval) {
heatTotal = 0; // Oops, if I don't do this, I'd miscalculate seriously...
damageTotal = 0;
foreach(Weapon weapon in mech.weapons()) {
double shotsSoFar = weaponShots(weapon, t);
heatTotal += shotsSoFar * weaponHeat(weapon);
damageTotal +=shotsSoFar * weaponDamage(weapon);
}
heatTotal -= heatDissipation * t;
}
return new DamageTimeValue(damageTotal, t);
}
Warning, may contain errors. But you get the gist of it. (If you read pseudo-code.)
Edited by MustrumRidcully, 22 January 2013 - 05:18 AM.