My Math Forum  

Go Back   My Math Forum > High School Math Forum > Elementary Math

Elementary Math Fractions, Percentages, Word Problems, Equations, Inequations, Factorization, Expansion


Thanks Tree3Thanks
  • 1 Post By alikim
  • 1 Post By Benit13
  • 1 Post By thomasedillon1520
Reply
 
LinkBack Thread Tools Display Modes
June 8th, 2015, 07:17 AM   #1
Newbie
 
Joined: Jun 2009

Posts: 21
Thanks: 1

How to approach this problem?

A situation from a video game: there are a few buttons on the screen, every button performs certain attack and deals certain amount of damage.

When you press a button, first there is a short attack time during which the chosen attack is being performed and all buttons are locked. Then the damage is dealt followed by a cool down period for this attack during which the button is locked and can not be pressed again.

So based on attack times, cool down times and damage values, which sequence of button presses deals the maximum possible damage per second in a long run?

Considering that some sequences of button presses can lead to a situation when all buttons are on cool down and unavailable.

Also, there might be a choice between pressing a button that deals a smaller amount of damage now vs waiting a bit for another cool down time to finish and dealing heavier damage (apparently depends on how long that "bit" is).

Which section of math could help to find the optimal solution here?

Thank you!
Thanks from CRGreathouse
alikim is offline  
 
June 8th, 2015, 08:43 AM   #2
Senior Member
 
Joined: Apr 2014
From: Glasgow

Posts: 2,156
Thanks: 731

Math Focus: Physics, mathematical modelling, numerical and computational solutions
This looks like a World of Warcraft problem (maybe applicable to MOBAs too, if there isn't a global cooldown)

A simple solution would be to consider a family of abilities with the highest damage to cooldown ratios and then spam those, but global cooldown, damage over time, damage reduction mechanics (e.g.e armour or magic resistance) complicate things considerably. It's generally an NP problem.

The closest equivalent I can think of is load balancing problems in parallel programming, which is also an NP problem. However, there is a rule of thumb for load balancing, which is to prioritise loads in order of largest to smallest. Imagine filling up a bucket with various sized rocks. Load balancing suggests putting the largest objects in first because you don't want the smaller rocks to impede the placement of the larger rocks and the smaller rocks can fit around the larger ones, so you maximise volume covered inside the bucket.

To bring this into more context, in WoW, if you have a longer engagement (such as a raid) you should prioritise the higher damage/cooldown ratio abilities (which typically have longer cooldowns) over the smaller damage/cooldown ratio abilities. This doesn't necessarily give you the optimal solution in every case, but will give you something close to it in most cases.

If you want more specifics, then there load balancing algorithms available on the internet (which use graph theory). To be honest, you will probably have more success with trial and error; just consider some sensible ability rotations and calculate the totals. If you have a specific class or encounter in mind, I could write a computer program that takes some basic damage calcs and work something out for you.
Thanks from alikim

Last edited by Benit13; June 8th, 2015 at 08:46 AM.
Benit13 is offline  
June 8th, 2015, 09:26 AM   #3
Newbie
 
Joined: Jun 2009

Posts: 21
Thanks: 1

Thank for the reply, yes, in WoW things are more complicated than that because of shared cds and cross buffing between different spells, so the best way is just to write an addon and measure dps for a few sensible rotations.

Here I just wanted to know how to approach such problems theoretically, in the most simple scenario described. So it's called "load balancing"? What's NP you mentioned?

Thanks!
alikim is offline  
June 8th, 2015, 08:01 PM   #4
Newbie
 
Joined: Jun 2015
From: USA

Posts: 6
Thanks: 1

I do not know all of the math behind such a problem, however I have delved into the solution of this on numerous occasions. As a result of my problem solving skills, I have routinely topped parse in every MMORPG I have ever played. Here is the system I use.

First you need to find your base damage you plan on using. This can be either the simple damage expression on the actions ability, or it can be the result of the average of an extremely long parse, say 30 or more minutes. Figure out the average, non critical hit for each ability.

Once you have done that, the difficult part is over.

Each ability will have a time associated with it in which will include cast time and global cool down before you can use any other ability. You need to mark this as the time associated with that ability.

Example, if the global cool down is 1.5 seconds and a particular ability takes 2 seconds to cast, then the ability ties up 2 seconds of your casting time. The global cool down will reset before the ability is completed casting. On the other hand, if an ability takes .5 seconds to cast and the global cool down is 1.5 seconds, then the ability effectively takes up 1.5 seconds of your available cast time because no other abilities can be cast during this time.

After you have the avg hit, and the time frame of the ability, the math for non damage over time abilities is pretty simple. Simply divide the damage output by the time frame.

EXAMPLE:

1238 damage on .5 cast but 1.5 GCD = 1.5 time frame. 1238/1.5 = 825.3 dps
1238 damage on 2.0 cast with 1.5 GCD = 2.0 time frame. 1238/2 = 619 dps

DOTS (Damage over time)

Dots become a bit more difficult. When looking at a there are more factors involved. Some dots have an initial burst and then a smaller tick every few seconds. Other dots have a small tick every few seconds and then a big burst at the end. Still other dots have the initial tick and every subsequent tick as the same. You need to identify each variance of those dots. Then you need to determine how you plan on using the dots. Most dots become available for recast before their ticking has expired, while other dots run their full course before they are able to be recast.

In either case, you have to account for initial burst, all ticks and final burst for each dot.

EXAMPLE
DOT = 300 damage on cast, 150 per tick every 3 seconds for 15 seconds = 750 tick damage. Total damage = 1050 damage. Cast time .5 seconds. GCD = 1.5. Total = 1.5 time frame. 1050/1.5 = 700 dps

Lets say the above dot example becomes available for recast before the 15 seconds expires. Lets say it has an 8 second cooldown for recast and you use it immediately on ability. Now the damage changes to 300 damage on cast, 150 per tick every 3 seconds for 6 seconds. Total damage is now 600. 600/1.5 = 400 dps

Essentially, if you ever recast a dot before it has fully run its course you have depleted yourself a significant amount of dps.

You need to draw a table that runs these equations for every single ability you could possible cast. From that you will be able to easily tell which abilities produce the most dps per cast based on casting time and GCD.

Be warned, if you plan on placing these in a macro, you should not add the dots into the macro. Doing so will make the dots cast before the expire, thus reducing the effective dps of those dots.

Hope this helps some. I have used this for 15 years now.
Thanks from alikim
thomasedillon1520 is offline  
June 8th, 2015, 09:29 PM   #5
Senior Member
 
Joined: May 2015
From: Varanasi

Posts: 110
Thanks: 5

Math Focus: Calculus
I think this questions is of Boolean algebra.You need concept of logic gates to solve them.Tell me if you need further help since you just asked about the section of mathematics so i am not trying this question as per now, assuming that you just need the support and want to solve it yourself.
manishsqrt is offline  
June 10th, 2015, 09:31 AM   #6
Newbie
 
Joined: Jun 2009

Posts: 21
Thanks: 1

Quote:
Originally Posted by thomasedillon1520 View Post
I do not know all of the math behind such a problem, however I have delved into the solution of this on numerous occasions. As a result of my problem solving skills, I have routinely topped parse in every MMORPG I have ever played. Here is the system I use...
Thanks a lot, I'm gonna use this approach where, as was mentioned above, you put the biggest dps stones first and smaller dps stones afterwards.

It's more of a gut-feeling solution though and it neither predicts gaps in your casting sequence where everything is on a cd and there is nothing to cast, so you have to wait, nor does it count for subtleties like cast something smaller now or wait and cast something bigger a bit later.

Basically, you'll be alright if you put biggest stones in the basket first and smaller on top but it doesn't mean there is no better solution where you put in as many stones as possible mixing different sizes to fully utilize given space.
alikim is offline  
June 10th, 2015, 09:35 AM   #7
Newbie
 
Joined: Jun 2009

Posts: 21
Thanks: 1

Quote:
Originally Posted by manishsqrt View Post
I think this questions is of Boolean algebra.You need concept of logic gates to solve them.Tell me if you need further help since you just asked about the section of mathematics so i am not trying this question as per now, assuming that you just need the support and want to solve it yourself.
If there is a theory that handles it, I'll be more than happy to hear it, I don't have any intention to re-invent the wheel.

What I meant is that if it's too much to ask, please at least point me to a general area of math that solves it but I'll be only happy with the exact solution.
alikim is offline  
Reply

  My Math Forum > High School Math Forum > Elementary Math

Tags
approach, problem



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clarity on how I should approach this function problem. mahjk17 Linear Algebra 4 September 20th, 2012 06:16 PM
Did I approach this problem correctly? JohnA Algebra 3 March 10th, 2012 06:31 AM
How to approach this problem JohnA Algebra 2 February 19th, 2012 09:29 AM
How do I approach this? cmmcnamara Advanced Statistics 4 February 10th, 2010 05:49 AM





Copyright © 2019 My Math Forum. All rights reserved.