Attack chains, math, and stuff
I've got a fairly basic implementation pretty much complete of a Brute Forcer.
As you can see from the times listed, the execution time grows drastically the longer you let the chain possibly be (or more powers). The optimizations Arcanaville mentioned earlier could greatly reduce the runtime for longer chains. For less bang, could also split it over multiple threads which'd be an improvement on dual/quad/etc core machines... but not enough to make longer chains suddenly reasonable.
Sample output:
Best tree is (in reverse, offset by 1): 122123 DPS 50.140404 Brute Force (6d) completed in 0 seconds Best tree is (in reverse, offset by 1): 122123 DPS 50.140404 Brute Force (8d) completed in 0 seconds Best tree is (in reverse, offset by 1): 3121321212 DPS 50.580837 Brute Force (10d) completed in 1 seconds Best tree is (in reverse, offset by 1): 12123121232 DPS 51.00001 Brute Force (12d) completed in 4 seconds Best tree is (in reverse, offset by 1): 12123121232 DPS 51.00001 Brute Force (14d) completed in 54 seconds
- The output starts counting powers at 1, instead of 0 like the array used to enter them.
- The output is also in reverse order, you'd execute them in right-to-left order
It's also currently limited to 9 powers (if you have a 10th, it'll screw with the in64 I use to store each path). None of these things would be too hard to fix, though. At this point I'd want to make it work before making it pretty.
Also, 14-deep trees take long enough that the golang website will kill it before it gets that far (it'll print out to 12, though).
Originally Posted by ShadowNate
;_; ?!?! What the heck is wrong with you, my god, I have never been so confused in my life!
|
I do think that we may be looking at the same issue on two different levels of complexity, though. I'm going back to a program code from my C++ courses' second week. Input four equations with different values for all eight integers, solve each, and output the data based on highest to lowest. Albeit this is questioning some additional steps (recharge markers and the like), but I don't see that ultimately taking a .5/s process and making it move up to more than 15-20 seconds, maybe 40 at best, 60 seconds at absolute worst (post timer end, for data compiling).
|
I will note that I believe the optimal attack chain problem to be NP-complete, because it appears to be a variation of the Knapsack Problem. That means as a practical matter there is no solution to the problem of finding the optimal attack chain whose running time doesn't rise more or less exponentially (mathematicians will correctly nit-pick this as only requiring super-polynomial time). If it is essentially a knapsack variation as I suspect (if I'm not writing another searcher, I'm not proving its NP-complete either) brute force search with some heuristic modifications is likely to be the best we can do.
Your algorithm essentially generates a chain based on a heuristic guess: it presumes that heuristic actually generates the optimal chain which it is not guaranteed to do. Heuristic guesses are usually in the ballpark, but are often suboptimal which is why some people have thought about doing it the hard way: actually searching the entire attack chain space for the best of all possible attack chains.
[Guide to Defense] [Scrapper Secondaries Comparison] [Archetype Popularity Analysis]
In one little corner of the universe, there's nothing more irritating than a misfile...
(Please support the best webcomic about a cosmic universal realignment by impaired angelic interference resulting in identity crisis angst. Or I release the pigmy water thieves.)
I did a brute force search of attack chains of 3. More than 3 took too long. Then took the first element and added it to my attack chain, increment time and recharge, repeat until 120 seconds of attack chain executes. There were interesting exceptions generated for more than one set. But in the end, picking the highest DPA attack worked at leas 9 out of 10 times. At which point I decided it wasn't worth coding anything else or even finishing the project.
Your algorithm essentially generates a chain based on a heuristic guess: it presumes that heuristic actually generates the optimal chain which it is not guaranteed to do. Heuristic guesses are usually in the ballpark, but are often suboptimal which is why some people have thought about doing it the hard way: actually searching the entire attack chain space for the best of all possible attack chains.
|
Honestly, something simple like this would be a boon to the community, I think, perfect or not. If it was something that could be pre-stored with all the attack sets for each AT so you could just select the set, input a recharge expectation, and see a result? That'd be pretty awesome, optimal or not.
Of course, after years of fiddling with builds and having access to Mid's, I personally can often flip through a set and see the chain in a few seconds, so obviously the easiest way to develop this program is to just hard-wire the interwebz into your brain Arcana, so we can dump these process trees somewhere awesome enough to handle the work load
Originally Posted by Arcanaville
Warning: crazy space limit reached. Please delete some crazy and try again. |
Originally Posted by John_Printemps
If it was something that could be pre-stored with all the attack sets for each AT so you could just select the set, input a recharge expectation, and see a result? That'd be pretty awesome, optimal or not.
|
My current implementation has a lot of room for enhancements (split over multiple threads, optimize the recursive function/the path DPS calculator, use some sort of heuristics, stop it from executing the same path multiple times, etc), I'm hoping I can get it to support a reasonably large number of powers, with a reasonably long chain (say, 6 powers, at least 10 long) without taking all night.
Originally Posted by ShadowNate
;_; ?!?! What the heck is wrong with you, my god, I have never been so confused in my life!
|
Very nice.
I did basically the same thing in Excel when I was analyzing my Kinetic Melee build, but this is much cleaner.