23
$\begingroup$

Imagine we have a wizard that knows a few spells. Each spell has 3 attributes: Damage, cooldown time, and a cast time.

Cooldown time: the amount of time (t) it takes before being able to cast that spell again. A spell goes on "cooldown" the moment it begins casting.

Cast time: the amount of time (t) it takes to use a spell. While the wizard is casting something another spell cannot be cast and it cannot be canceled.

The question is: How would you maximize damage given different sets of spells?

It is easy to calculate the highest damage per cast time. But what about in situations where it is better to wait then to get "stuck" casting a low damage spell when a much higher one is available:

For example,

1) 100 damage, 1 second cast time, 10 second cool down.

2) 10 damage, 4 second cast time, 0 second cool down.

So, in this case you would cast #1, #2, wait. Cast #1

  • 1
    Maybe the [game dev](http://gamedev.stackexchange.com/) section might be more suitable?2010-11-15
  • 1
    Thanks, but it was suggested that I try here first since if you remove the spell casting theme it is a game theory question2010-11-15
  • 16
    @aaronfarr: it's not really a game theory problem, it's an optimization problem. In fact it is really a type of scheduling problem. I don't understand the votes to close since it is far from obvious to me how to maximize damage / time in general. Consider this a vote against closing.2010-11-15
  • 0
    I second that....2010-11-15
  • 0
    @Qiaochu: Thanks, indeed it would be considered a type of scheduling / optimization problem. Hopefully, someone can update the tags as I do not have sufficient privileges.2010-11-15
  • 2
    @aaronfarr: do you want to put any constraints on the numbers here? For example, are they all positive integers? If certain ratios are irrational I think you can arrange it so that an optimal casting schedule is aperiodic.2010-11-15
  • 2
    We would just be dealing with integers >= 0 for all three variables, thanks for pointing that out2010-11-15
  • 0
    With your parameters, you can get two spell 2's in between spell 1's, not just one.2010-11-16
  • 0
    You should link to the dupe at http://gamedev.stackexchange.com/questions/5593/spell-casting-how-to-optimize-damage-per-second2010-11-16

5 Answers 5