![]() |
|
Hits to Kill Script - Printable Version +- Southperry.net (https://www.southperry.net) +-- Forum: Maplestory (https://www.southperry.net/forumdisplay.php?fid=15) +--- Forum: Training Center (https://www.southperry.net/forumdisplay.php?fid=32) +--- Thread: Hits to Kill Script (/showthread.php?tid=6058) Pages:
1
2
|
Hits to Kill Script - Russt - 2008-12-07 http://sidequest.awardspace.info/hits.html Finally figured this out. You could call this a "calculator", I suppose, but it's very basic. Put in a damage range and it spits out probabilities. If you want to include skills and defense and whatnot, you have to do it yourself first. Since it (theoretically) doesn't get rid of fractional points of damage, it might return slightly inaccurate results with small damage ranges (max < 50). Otherwise, you should be fine. Also, it tends to return NaN randomly if you average more than about 40 hits, or max over 100. Most likely because some value or other (there's a factorial and a big exponential in there...) starts overflowing and returning screwy results. Oh well. No support for crits and slash/stab and whatnot. Perhaps in the future, but that's even harder to figure out than just basic, same damage range over and over. So yeah, don't count on it. Have fun. Hits to Kill Script - Technolink - 2008-12-08 Amazing. For crits couldn't you just take your average damage with skills taken into consideration? Or would that make screwy results? Hits to Kill Script - Russt - 2008-12-08 That wouldn't be exact, but you can still approximate. Like, if you had 60~100 nocrit, 120~200 crit, 40% rate, your average damage would be 112. But if you just put in 60~200, you'd average 130, so the damage would be off. And if you put in something like 84~140, it would also be off because it'd give you a smaller range than your actual. Edit: Added multi-hit skills, to some extent. Hits to Kill Script - Shidoshi - 2008-12-09 well, you can use this calculator basically for sword warriors, crusher/fury dragon knights, pirates and mages \o/ (since they don't have slash/stab or critical) Hits to Kill Script - Spaz - 2008-12-10 Awesome! I've often wondered how much my average # of hits to kill a monster would be affected if I, say, wore my +5 str, +8 speed boots instead of my +16 speed boots. Or how much the +5 str from leveling up affects it. Now I can find out. (I'd have to look up how much my advanced combo adds to my damage though.) ![]() It would be great if this formula was incorporated into a calculator for all of the known MS formulas so that damage range could be easily determined... Edit: If it's too difficult to work out the math for criticals and such, you could try the simulation approach - simulate, say, 1000 monster kills and use the statistics from that. It would be inexact and you'd get a different answer every time, but it's better than nothing, assuming the number of simulated kills needed to get reasonably good results doesn't take more than a couple seconds to compute. Hits to Kill Script - Russt - 2008-12-11 I've written a script that returns simulated results before. It was alright, but it's nice to actually have an explicit formula. Solving crit -may- be more possible than I originally thought. I haven't attempted it, but it should be relatively simple to work out the numbers up to 4 attacks or so. Once I get there it's a matter of whether a visible pattern emerges or not. Hits to Kill Script - singularity - 2008-12-12 I did something like this for the NL Damage Calculator that banditcom originally made. However, it's still unreleased because there's some issues we need to fix, and we're both extremely lazy to fix them. ![]() Anyway, here's an excerpt of code from the script I wrote. Note that this is written in VBA (for Excel) because I wrote the script to integrate directly with banditcom's spreadsheet. Below is excerpt of code dealing with hits to kill with TT and TT w/ SE:
Spoiler
Also, here is a function to calculate a factorial. I found it easier to write the function myself than try to call Excel's factorial function with VBA.
Spoiler
Hopefully, the variables names I chose to use in the script should be quite evident or easily deducible. Some of the stuff might seem like they're not useful at all, but again.... the above part was an excerpt so it'd find a use outside of the above excerpt. I'll check the thread as often as I can to clear up anything else you may think is confusing.Oh, and a note about the variable Pc in my script. At first, I calculate the probability of NOT killing for each number of hits in question. Then the line: "NHitArray3(h) = Pc" in each iteration builds an array of these values. With that, it's easy to build the array of probabilities of killing in exactly a certain number of hits -- done by that For function at the end. Kind of a roundabout way of getting the results we want, but it works. And I thought it was easier to program it in this way.
Hits to Kill Script - Russt - 2008-12-13 I'm not quite understanding your formula o-o
Hits to Kill Script - singularity - 2008-12-14 Looks like the formatting of the script wasn't preserved when I posted. Anyway, I'll go ahead and break down the algorithm in my script. Oh, I'll say right now that it would be more accurate if I had used "attacks" instead of "hits" in my code. My commentary is enclosed in the spoiler below because it is quite long.
Spoiler
Hits to Kill Script - Technolink - 2008-12-14 Russt Wrote:That wouldn't be exact, but you can still approximate. Yea, adding average crit to your damage on large number of attacks would probably work. Like obviously just attacking once it would be inaccurate, but putting my stats into the calc (with avg crit) it returned a reasonable result for 7-8hit Newts. Hits to Kill Script - Nikkey - 2008-12-14 Well, with binomial distribution at higher rates, the average hits/mob is about equal to ![]() where: M = Monster HP μ=[Average Slash Damage]×n+ [Average Stab Damage] ×(n-k) σ= (([Max Slash Damage]×n+[Max Stab Damage]×(n-k) )- ([Min Slash Damage]×n+[Min Stab Damage]×(n-k) ))/6 when np > 10 and n(1-p)>10. If you know statistics and binomial probability, this shouldn't really surprise you
Hits to Kill Script - Technolink - 2008-12-14 Sap, I know you're on the quest to find a perfect formula, but why not brute force it? It'd be so much easier! =P Hits to Kill Script - Nikkey - 2008-12-14 Technolink Wrote:Sap, I know you're on the quest to find a perfect formula, but why not brute force it? It'd be so much easier! =P It's possible to brute force it, but meh, lol. Say np and n(1-p) over 30 then. It should give calculations quite exact, barely any difference, I assume. Then brute force the rest? Happy?
Hits to Kill Script - Technolink - 2008-12-18 Your browser can brute force quite efficiently. I just made an array of 100k numbers with very little delay (the ok button froze for half a second, then it was fine) Hits to Kill Script - Nikkey - 2008-12-18 Technolink Wrote:Your browser can brute force quite efficiently. I just made an array of 100k numbers with very little delay (the ok button froze for half a second, then it was fine) Try to find the mean hkoing for first Horntail head, and you'll see what I mean.
Hits to Kill Script - Technolink - 2008-12-18 With a for loop to 100000 hits that shouldn't be a problem (once it gets 0% it stops executing, so that wouldn't effect your 8 hit things). And with that many hits, an average damage would probably do the trick =P I feel like making on in java now =P EDIT: Took around 45 minutes. Almost done, but 2x just started >_> EDIT2: Works like a charm, just trying to remember how to do a scrollable output. EDIT3: http://www.mediafire.com/?z0ewq534gin It brute forces the answer, critical and skills included. Its an executable JAR file so you'll need JSE environment to run it (if you have java you should have this). I'll try to get it into an exe, or hosted on the web tomorrow. Sap, this is great for you to use to double check your formula, but in the mean time this can provide quite accurate results ^^ Hits to Kill Script - Russt - 2008-12-22 Sweet victory! I got it to work with criticals, play around with it if you like. I also fixed the glitch with the outputs' precision. Stupid me, didn't know toFixed() existed so I was using Math.floor(x*1000)/1000... >_> And yeah, I know criticals aren't the only thing of this kind, you could also use it for slash/stab etc, but critical is just the most common implementation so yeah. Hmm, now that I have that down, it wouldn't be too difficult to implement Final Attack as well... nah, not worth it. @ Mondays Try to find the mean hkoing for first Horntail head using any method... it's not easy no matter what you do, any formulas will involve summations and factorials that will get very ugly. With anything above 100 hits, HP/meanhit is usually the quickest way to get a meaningful answer. Hits to Kill Script - Nikkey - 2008-12-22 Russt Wrote:@ Mondays Obviously. It's just a matter of precision. First 20 hits should be able through straight binomial, rest should be done with another formula replacing it because the difference between the answers lower. Then finally, use mean. Hits to Kill Script - ZachAttack - 2008-12-28 Of course this doesn't take in account wdef of monsters - and for something like Windraiders that might matter x_x Hits to Kill Script - Russt - 2008-12-28 ZachAttack Wrote:Of course this doesn't take in account wdef of monsters - and for something like Windraiders that might matter x_xThe idea is that you multiply skills and subtract defense yourself . The formula thread in my sig would help with that.Or get some other calculator to help you. This could make a good addition to someone else's damage calculator (-prods JoeTang-) but I've no intention of making one myself just to make my page more usable. |