
X
Complete Initialization for 10 kreds
15%
Congratulations! You’ve completed your Kongregate account!
Keep exploring Kongregate with more badges and games!
Hide the progress bar forever?
Yes
No

metadata
**EDIT: **The calculator linked in the second post by Jamezu ( http://snip.li/4Sdh) is much better than the one I provide in this post. It's completely automatic and produces either the same or more accurate results for much less effort.
I've developed a method for optimising the distribution of BP in pet upgrades.
You can find the calculator implementing the method by [clicking here](https://docs.google.com/spreadsheets/d/1mXPZ8zUte1c8x5vvJj_fF0x8Ln93aYTIM9BE4QyUhbs/edit?usp=sharing).
I haven't got around to including Block/Reflect yet, since I don't know how they work. If someone could provide an exact description of how they work, and in particular their specific interaction with defence/attack potions, then I'll get around to including them eventually.
Instructions on how to reach the optimum BP distribution:
1. Provide all the inputs necessary (edit the green values), starting with an upgrade level of 0 in all stats.
2. Scroll down to the relevant section regarding which stats you have unlocked (e.g. only Health, Attack, Defence and Lifesteal)
3. Upgrade by 1 whichever stat it says is the best to upgrade and the calculator will update and give a new stat which is the best to upgrade.
4. Repeat step 3 until you can't afford to upgrade the best stat, then just upgrade the best stat that you can afford.
When you run out of BP, all of it should have been distributed optimally.
It's possible to completely automate this, so the calculator just spits out an optimum BP distribution as soon as you've provided the inputs, but I don't have the programming knowledge to do this in Google Docs. I have provided the pseudocode necessary to completely automate the process in case anyone was interested though :) (it's in the sheet labeled "Pseudocode for Automated Optimising").
What does it mean to have an 'optimum BP distribution'?
The calculator produces the BP distribution that results in the highest average damage dealt before your pet dies. The reason I consider this to be the optimum BP distribution is because you only ever care about distributing your BP optimally if you're struggling to beat a monster (if you can beat a monster already, then you don't care about how your BP is distributed). If you're struggling to defeat a monster, this means you are unable to deal enough damage to defeat the monster before your pet dies. The goal then is purely to increase the amount of damage your pet can deal so that it can defeat the monster before your pet dies. If the BP distribution that produces the highest average damage can not defeat a monster, then no other distribution of BP will succeed either.** EDIT: **This last assumption turned out to be wrong. The distribution that produces the highest probability of defeating a monster doesn't necessarily maximise the average damage dealt by the pet before it dies.
The ideal BP distribution should in theory maximise the probability of defeating a monster. My goal focused mainly on maximising a low probability (i.e. below 50%) rather than always trying to maximise the probability of success. The reason being that since you can just keep attempting a fight over and over again without any penalty, there is no need to guarantee success or even to have a high probability of success. If you are trying to beat a boss using as little health potions as possible, or as early as you possibly can beat it, then you will always have a low probability of success. Hence optimising by maximising a low probability of success is the idealised case.
I've checked whether the calculator works through using [Volv's simulator](https://codepen.io/volv/full/BRoVee/) to double check, and from what I've looked at so far, it does seem to produce desirable results. Of course, I would appreciate if other people could check my calculator (by doing their own simulations) and post their findings regarding whether the final BP distributions end up being desirable/optimal.
If you have any questions or are confused about anything, feel free to ask.



metadata
I have also written a pet optimiser, available here: http://rebrand.ly/midas_pet_sim. It should be obvious, but change the five numbers near the top for your current champion/pet/battle, hit the red RUN button, and it will show the best BP distribution to use for different combinations of attack and defense potions. It does this by computing all possible BP distibutions, and then simulating a battle for each one.
* champion_multiplier: Look in your champion screen, it will say e.g. +1700%, which is a multiplier of 18 (i.e. divide by 100 and add 1)
* pet_number: Which pet are you on? Parrot is 1, Boar is 2, Python is 3 etc.
* pet_level: Selfexplanatory  the pet's level number
* pet_battle_points: Total BP available, go to the Pet Upgrades page, hit Reset All and then it will show you the total at the top
* enemy_hp: In the battle screen, it shows the enemy hit points at the start of the battle
I originally wrote this using a montecarlo simulator, but that version won't run online. So, this version just uses exepcted probabilities of the random events instead. However, the results seem to match the montecarlo simulator. At the moment, it doesn't yet simulate block or reflect, because I haven't got that far with my pet yet. I will update it once I get to that stage. **EDIT:** Now supports block.
My own general observations so far:
* In the early days, levelling up to maximise Health and Attack equally seems to be the way to go (or Health one level more than Attack if necessary), the points in Defense and Lifesteal matter less, so do whatever you want with them.
* It is so slow to level up your pet, that you will *always* want to use attack and defense potions for every battle, and then restock potions in between battles while waiting to level up.
If Volv reads this, I'd be happy to work through the logic I used with you to help port it to JS to use on your page, but I wrote this in Rust as I was trying to learn the language.



metadata
Volv reads this :)
Haven't had a chance to go through either properly yet, possibly something to add indeed. So far the gains from optimisation haven't inspired me to try, although it was on the todo list.
InductionDuo I replied in chat about block but don't know if you saw it.
I ran some tests on it as I thought by applying block first (which would make sense) it would fix an issue with the simulator which has a tendency to slightly overestimate success chance in long battles. However both with and without def potions the average damage done to pet after a block was just the average dmg done to pet  block amount. So seems to come off last.
Reflect. 30% chance to do (Reflect dmg) to mob. You still take the same damage



metadata
It also appears that Lifesteal doesn't actually "steal" health from the enemy, it just heals the pet.



metadata
@Volv
Thanks, I think I did miss what you said (I went to sleep a couple of hours after I asked).
So, just to clarify:
Block is a 30% chance to reduce damage taken. Appied after the defence potion. So say we have a defence potion active, 10 Defence, 10 Block and the monster deals 100 damage. Defence would reduce the damage to 90. The defence potion would reduce that damage to 45. Then Block would reduce this to 35.
Reflect is a 30% chance to deal extra damage equal to its value. Unaffected by the attack potion?
@Jamezu
Interesting. I used your calculator for my current pet/monster configuration (Felix, level 7 Bone Breaker Python versus a 7.2e6 health monster) and the ended up getting (H:9, A:11, D:1, L:3, B:0, R:0) while my calculator would end up with (H:10, A:10, D:2, L:3, B:0, R:0). I checked using Volv's simulator and your BP distribution did indeed end up being more optimal.
With your calculator results (H:9, A:11, D:1, L:3, B:0, R:0):
18 potions yielded ~34% success chance
19 potions yielded ~98% success chance
With my calculator results (H:10, A:10, D:2, L:3, B:0, R:0)
18 potions yielded ~7% success chance
19 potions yielded ~78% success chance
That's a fairly big difference in success probabilities, which could have been the difference between guaranteed failure (0% success) versus a small chance of success (which, given the infinite amount of attempts we have, would effectively mean guaranteed success).
The interesting thing is that my calculator is physically incapable of producing different upgrade levels for Attack and Health (unless there isn't enough BP to equalise them). In my equation, the average total damage dealt is directly proportional to both attack and health, so they will always be judged to be of equal value; if one gets increased, the other one becomes more valuable.
After thinking for a bit about what could be wrong with my method, I've concluded that, firstly, it should still be true that my calculator does produce the BP distribution that results in the highest average damage done by the pet by the time it dies. But the problem is that this doesn't always translate to having the highest probability of success. Using my method, we'd also be trying to optimise the damage done by the pet even in attempts where the monster survives, which we aren't really interested in. What we're interested in is maximising the number of attempts where the monster dies, even if this means doing less damage in the attempts where the monster survives. I guess simulation is necessary in order to capture these intricacies.
Having said that, I notice that you said that you only simulated 'a' battle (as opposed to thousands, as in Volv's simulator). And looking at the code (please correct me if I'm wrong, since I've never used Rust before), it looks to be completely deterministic: Lifesteal heals the pet for 0.25 its value on every single round, rather than only having a 25% chance to heal its full value; the monster always deals 1.05/8 its health in damage every single round, rather than randomly between 1/8 and 1.1/8 ; etc. If this is the case, then every battle will last exactly the same amount of rounds and it should theoretically be possible to simply use an equation to calculate how many rounds each fight will last based on the inputs. This is what I did with my calculator. In other words, our methods, at their core, are basically exactly the same. The difference is that you've effectively rounded up the amount of rounds (hence attacks) that the pet makes to the nearest whole number, whereas I did not. This would explain where the disconnect between Attack/Health appears from in your calculator (whereas mine always gives Attack and Health the same value).
There is a reason I didn't simply round up to the nearest whole number when I calculated how many rounds a fight would last: If I did, I would no longer be calculating the average amount of damage that the pet deals before it dies. The number would become a fairly arbitrary value, which doesn't have very much meaning.
To give an example: Using the inputs that I gave earlier (and using 18 health potions), my method calculates that on average, the fight would last 26.65 rounds, hence the pet would attack 26.65 times on average. In your calculator, you'd find that the pet would attack 27 times, since on the 26th round, the pet would still have 0.65 rounds worth of health, which allows it to attack one more time to make 27 attacks. In reality, using Volv's calculator, the situation is this:
0.2% chance to last 25 rounds
33.8% chance to last 26 rounds
60.3% chance to last 27 rounds
5.7% chance to last 28 rounds
So the average amount of rounds that the pet survives is 26.7 (hence attacks 26.7 times on average). However, we're not really interested in this average quantity. We're interested in how often the monster dies, and this only happens when the pet survives 28 rounds, which gives the 5.7% chance of success.
Neither of our calculators properly model this behaviour in determining the optimal BP distribution (again, correct me if I read your code incorrectly). So in the end, I'm actually not sure whether your calculator produced the better distribution purely because of coincidence, or if there really is some physical reason why rounding up to the nearest whole number produces a more accurate result.



metadata
Yes, you are right, the method I published just applies the expected probability outcome of each action as you said.
In the method I use offline, I used a montecarlo simulation (i.e. running the battle for each pet upgrade configuration ~1000 times) and taking the average health potions used, and average hitpoints left on the pet at the end of the battle. This then pretty accurately returns the correct result, including maximizing the probability of battle success when health potion usage is equivalent between two pet configurations. Unfortunately that version doesn't run online (neither the random number generator nor the multithreading libraries I used are available on the rust playpen). However, I've never seen a significant difference in my montecarlo method and my averaging method; so, I conclude that the one I've provided here is 'good enough'. If that changes as my pet progresses, I will report back (I run both versions in my offline runs).



metadata
The calculator seems good so far, but is incomplete in the Block and Reflect sections at the bottom.



metadata
I find the whole pet system lame, the mechanics of combat even more so. But what can you expect from someone who has never played DnD or even a real RPG ever? twisted the definitions of defence or block, lifesteal is a dark art, why not change it and call it self heals so you dont have to go against someone's religious beliefs of Thou Shall Not Steal? ;p



metadata
I have updated my [simulator](http://rebrand.ly/midas_pet_sim) to include the BLOCK pet stat.
I have now progressed far enough that I am on Lake Lizard, so I can see how block works! Still no support for reflect yet, will add then when I get to it. This averaging version still seems to track my moreaccurate montecarlo version well enough.
My advice is: max out health and attack (health one more than attack if necessary), then distribute the rest of the points on defence, lifesteal and block as you see fit. Won't go too far wrong by doing this. Always use attack and defence potions (once the battles aren't totally trivial), as this will be the most efficient use of potions in the long run.



metadata
wanted to give your calc a try jamezu but alas.. after putting in my numbers, all it tells me are the stats of my pet and that "Timeout triggered" when i run the simulation.
@ pet 12 and e15 health enemies... if it has anything to do with high numbers.. if not.. i probably just did something wrong xD



metadata
That's a shame. The problem is that it scales exponentially with the number of battle points you have, so it will have millions of pets to check. I guess the rust playground I am using to run it on doesn't allow people to run longrunning code. Let me have a think and I will see if I can come up with some way to optimize it.



metadata
Small suggestion, Jamezu. As far as I know, BP is directly linked to the monsters you've beat, so you'll always have the same amount of BP when you have to attack the next monster. That means there's space to be a little more userfriendly, by finding a way to just note how many BP you've got and automatically calculate for the monster you're against, or do the opposite, just noting the monster's HP and have the calculator assume your BP. Other than that, it's a nice tool, for which I'm thankful. Keep up the good work.



metadata
i dont know how to use this, what is champion_multiplier? why 40.6 if i enter anything else it doesnt work



metadata
> *Originally posted by **[sl33pyguy](/forums/30674/topics/751336?page=1#11261870)**:*
> i dont know how to use this, what is champion_multiplier? why 40.6 if i enter anything else it doesnt work
try 1.0



metadata
From my original post:
> champion_multiplier: Look in your champion screen, it will say e.g. +1700%, which is a multiplier of 18 (i.e. divide by 100 and add 1)
So, with my current champion (Tempestus) it says +3980% which is a multiplier of 40.8 (again, divide by 100 and add 1). Always enter it with a decimal point (e.g. 18.0 not 18). Hope that helps!
**Merika**: Yes, this is a problem, I ran this on the final pet (having got all the stats off the wiki, and it took a few minutes)  I am working on a few ideas to improve the performance by taking some shortcuts.
**goticBlake**: OK, yes, I was going to allow you to enter the arena/division/battle, but was lazy, the wiki has all the stats of the enemies and BP progression, so I can add that.
**UPDATE:** I have now updated the [simulator](http://rebrand.ly/midas_pet_sim) to address **goticBlake**'s request  you can now just enter the league/division/battle and it will automatically calculate the BPs available, and the enemy you are facing. I have made a small improvement to the performance by not calculating the result for all combinations of ATK and DEF potions, it will just compute the combinations which are most useful for the battle (will reduce computation by a factor of 4 usually). Also, I suggest you hit the "Release" button at the top, before hitting the red "Run" button, as this will be faster. I will do some more work later on performance to take some drastic shortcuts which is the only way it will work online for the later battles.



metadata
Like Volv, I feel that this is a lot of effort for marginal gains, but since you seem to be proceeding, here's a few thoughts (I read through much of the chatter here but I may have missed some things due to length)
1) The mechanics for all three abilities are completely charted out. Block is obvious. Reflect is just straightup extra damage. Life Steal is a straightup heal. The percentages and formulas are also known  you can pull them from Volv's calculator, as well as any other mechanics you need  afaik, it's opensource. If you can't get the numbers there, shoot me a line and I'll send them over from the original spreadsheet we had set up for this purpose.
2) You can cut down the number of combinations drastically by requiring ATK and HP to be at least N% of the total BP investment  settle on a value you are comfortable with, but I'd recommend around 60%  and require they be roughly equal (call it within 3 points of each other). You can also make life easier by assuming ATK/DEF potions are always on (because if you're not at the point where you are using those, you don't have enough BP to care about optimization). If you're patient enough, it should be moderately easy to write up a "learning" script that prunes off option branches when they clearly become less optimal without having to try the entire branch  way more investment than I'd put into this sort of project, but hey, if we're optimizing...
3) When discussing this with Volv, one of the issues we both thought would be impractical for optimization is determining what constitutes the "best" result. Is it a 50% chance of winning? 20%? 100%? 5%? Depending on how patient you are, any of those values could work, and in a long fight the variance between those could be somewhat significant. If you are not calculating chancefactors into this and using straightup "average round" values instead, the result can wind up pretty far off  that's why a monte carlo simulator is necessary in the first place. Not sure what you settled on here for determining "optimum".
4) If at any point you stop having fun with this, just stop  it isn't a very significant difference between optimum and "adequate" distribution. I often enjoy this sort of undertaking myself, but given the meager potential gains, I would suggest only pursuing it as long as you are enjoying the process, rather than grinding through it because you want to wind up with a result.
Good luck  I'll probably poke in at a later date and see what you ended up with.
C


