HabitRPG / habitica

A habit tracker app which treats your goals like a Role Playing Game.
https://habitica.com
Other
11.79k stars 4.05k forks source link

potion : egg ratio #1048

Closed octern closed 10 years ago

octern commented 11 years ago

I haven't gotten an egg drop in about a week (not since #988 was resolved), but I get about one hatching potion a day. I currently have 0 eggs and 10 potions of different kinds. Is this intentional? Or at least, is the ratio meant to be skewed in favor of potions strongly enough that my observation is within the realm of possibility?

I'm not complaining, but I wanted to mention this in case it's so unlikely that it's probably a bug.

fawques commented 11 years ago

Same here, I have 17 potions and no eggs

lefnire commented 11 years ago

I don't think it's that specifically that's the problem, I think you were experiencing #901 and getting duplicates of one drop. Some people have too many eggs, others too many potions (aka, it's not just potions) - but usually it's like 10 base potions, typically meaning they triggered the duplicates bug.

fawques commented 11 years ago

I don't think it's the duplicates bug, I've got a notification for each (or almost all, I can't be sure) of them, saying a potion has been dropped, and except 3 or 4, the potions are not together with others of the same kind.

lefnire commented 11 years ago

Hmm, good to know... I'll take a peak when I can

On Sunday, May 26, 2013, Víctor Guzmán wrote:

I don't think it's the duplicates bug, I've got a notification for each (or almost all, I can't be sure) of them, saying a potion has been dropped, and except 3 or 4, the potions are not together with others of the same kind.

— Reply to this email directly or view it on GitHubhttps://github.com/lefnire/habitrpg/issues/1048#issuecomment-18465884 .

octern commented 11 years ago

Same for me. Each potion has had its own notification and they've appeared gradually, over time. It doesn't look like rampant duplication, either. In the order they're listed (which appears to be order of acquisition): desert, shade, base x3, desert, blue, pink, base x2, skeleton.

octern commented 11 years ago

Just got an egg today! This rules out an ongoing no-eggs bug and I guess it increases the posterior probability that my ~7-potion streak was a 1-in-128 fluke rather than an actual imbalance in the ratio.

Shaners commented 11 years ago

The outliers are going to be vocal because no one will complain about getting exactly the same amount of eggs and potions!

octern commented 11 years ago

Of course, but for any individual an unlikely series of events is still unlikely. I figured it was worth reporting in case it was also happening to many more people, each of whom was assuming that they were simply an outlier.

Shaners commented 11 years ago

Definitely, I encourage you to keep it up and thank you for it!

VerbingNouns commented 11 years ago

Just as affirmation, I only encountered the duplicate potion drop once, all other recent drops have been single, random potions (except for my very latest, thank goodness). Although something else I've noticed is that I'm more likely to get eggs when I'm about to disconnect from the server, thus losing the egg when I reconnect... because I have to refresh (the reconnect link doesn't work). I don't know if that's relevant or just my luck...

VerbingNouns commented 11 years ago

Oh, and I just disconnected from the server ("Unable to reconnect: reload" error displayed) as I typed my previous comment and lost my brand new base flying pig and its egg, but not the base potion. :(

kevinalai commented 11 years ago

I also have an imbalance. 21 potions to 6 eggs (total). As for Shaners's remark, is it possible to see the aggregate egg:potion ratios for everyone to get an unbiased sample? That may not be necessary if you just want to go in and look for a bug.

Shaners commented 11 years ago

@VerbingNouns post your UID and @lefnire may be able to get you your lost egg or potion back.

@kal2000 that might be a bit misleading since the duplication bug could have created an artificial imbalance in the current database (also people can buy items.) Something though that anyone could do is run a local copy of habit, alter the code so things drop 100% on task completion (remove 2 day limit), and simulate perhaps 1000 drops and see what they get. Actually sounds kind of fun.

Shaners commented 11 years ago

Oh and another thing to consider: even if a slight (a major one would be bad) imbalance does exist that could actually be beneficial. An imbalance in drops can encourage gem purchases (money to run Habit) or people completing more tasks (goal of the whole project.)

Shaners commented 11 years ago

A few others complaining about too many potions in tavern chat: Niandri: I have nearly 20 potions and no eggs :( - efb92: Okay I have the same problem as Niandri, and haven't gotten an egg for the last 2 weeks :( But on a plus side i have more potions than I do hands to carry them Nicole Foster: I have same problem as Niandri too. Lots, and lots of potions, but no eggs. Holly: Same problem! Not even the streaks help me to get any eggs, it's just potion after potion after potion.

And one with too many eggs. Mickael Goubin: Actually, it's the opposite problem for me: eggs but no potion!

octern commented 11 years ago

Even if these are just random variations, I'd like to suggest an adjustment that makes people more likely to get eggs if they have n more potions than eggs in their inventory or vice versa. I had 12 more potions than eggs this morning, and when another potion dropped it actually felt disappointing instead of rewarding.

lefnire commented 11 years ago

Here's the algorithm determining the drop ratio: https://github.com/HabitRPG/habitrpg-shared/blob/master/script/algos.coffee#L95 . I'd encourage people who are very discouraged by the current state to take a look at the algorithm and see if they can't pinpoint any flaws. Reason I say that is I won't have too much time in the near future to dive into this, so if any math or code people out there can spot the problem I can jump in immediately and fix

Shaners commented 11 years ago

could try this out: https://github.com/HabitRPG/habitrpg-shared/issues/10

lefnire commented 11 years ago

merged. let's give it a whirl. not entirely sure it will solve the issue, since it turns eggs=40% pots=60% to 50/50, where it seems most people are experiencing 0/100 - but it's definitely worth a spin

and thanks for jumping in @Shaners! you rockstar, you've done pixel, css, & dev now :)

octern commented 11 years ago

Thanks for pointing to the source. As I expected, there's a little bit of magic going on with drop chances, but that's totally separate from the egg vs. potion roll, which is as simple as can be. Doesn't look like there's any room for unintended biases there.

Unrelatedly, it looks like this method will lead to people getting 2 base potions for every 1 potion of any other type. Those are really going to start piling up once people have their base stables filled, but hopefully some future autosell or discard feature will take care of that.

On Mon, Jun 3, 2013 at 9:23 AM, Tyler Renelle notifications@github.comwrote:

Here's the algorithm determining the drop ratio: https://github.com/HabitRPG/habitrpg-shared/blob/master/script/algos.coffee#L95. I'd encourage people who are very discouraged by the current state to take a look at the algorithm and see if they can't pinpoint any flaws. Reason I say that is I won't have too much time in the near future to dive into this, so if any math or code people out there can spot the problem I can jump in immediately and fix

— Reply to this email directly or view it on GitHubhttps://github.com/lefnire/habitrpg/issues/1048#issuecomment-18852861 .

Shaners commented 11 years ago

The 10% difference could have had a larger effect because of the small sets of drops people are getting so the switch to 50/50 could lessen the effect.

The other issue could be with Math.random() not being as random as you'd think: http://stackoverflow.com/questions/10361466/what-algorithm-does-math-random-use http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf "approximately uniform" "using an implementation dependent algorithm or strategy" Which would mean a move to influencing results based on what the user currently has or drop history.

jepler commented 11 years ago

I've got 11 pets, 3 unhatched eggs of 3 different kinds, and 5 unused hatching potions all of 'base' type.

Of my pets, 6 are base and I have 1 each of white, desert, red, skeleton and cotton candy pink.

So all in all it's not too unfair (after all, I've got nearly a dozen out of 90 pets) but I do have a related worry...

Since I only lack 3 'base' pets, I already have more base hatching potions than I'll ever need—but if there's nothing besides hatching that can remove eggs or potions from my inventory, I'll just be stuck with an ever-increasing inventory.

So what is needed is a way to sell eggs and hatching potions, probably for in-game gold.

Alternately, once it becomes possible to feed pets, permit the use of monster eggs as food.

To let the long-time player take advantage of currently-unusable potions without selling them, consider a crafting interface (e.g., 2_base gives you white, 2_white gives you desert, possibly also requiring an input of in-game gold); now the patient player can convert a few dozen lesser potions into the coveted gold potion.

lefnire commented 11 years ago

Yeah, I think I'll add the ability to sell for gold. We'll add "gifting" later on, but still not sufficient - you'll have to have a lot of friends who want base potions :)

On Tuesday, June 4, 2013, jepler wrote:

I've got 11 pets, 3 unhatched eggs of 3 different kinds, and 5 unused hatching potions all of 'base' type.

Of my pets, 6 are base and I have 1 each of white, desert, red, skeleton and cotton candy pink.

So all in all it's not too unfair (after all, I've got nearly a dozen out of 90 pets) but I do have a related worry...

Since I only lack 3 'base' pets, I already have more base hatching potions than I'll ever need—but if there's nothing besides hatching that can remove eggs or potions from my inventory, I'll just be stuck with an ever-increasing inventory.

So what is needed is a way to sell eggs and hatching potions, probably for in-game gold.

Alternately, once it becomes possible to feed pets, permit the use of monster eggs as food.

To let the long-time player take advantage of currently-unusable potions without selling them, consider a crafting interface (e.g., 2_base gives you white, 2_white gives you desert, possibly also requiring an input of in-game gold); now the patient player can convert a few dozen lesser potions into the coveted gold potion.

— Reply to this email directly or view it on GitHubhttps://github.com/lefnire/habitrpg/issues/1048#issuecomment-18905058 .

Shaners commented 11 years ago

@lefnire the crafting idea is kind of neat, I think it's come up before, maybe combining 10 of one tier gets you randomly one of the next tier up. E.g. 10 base potions = 1 desert or 1 white potion.

lefnire commented 11 years ago

that's possible. we could create a drupal poll for "how to get rid of pots", i def. don't want to implement it all since it can add quite some scope creep for little benefit, so i'll just choose the simple and popular choice

Shaners commented 11 years ago

Has anyone that experienced poor egg to potion drop ratios in the past seen any improvements? Have things gotten worse? Stayed the same? All quiet might mean people are happier but that is a pretty dangerous assumption!

@lefnire convert to gold is the simplest / best idea in my opinion then! Plus the method can be used for "vendoring" other stuff in the future.

octern commented 11 years ago

I've gotten a couple of eggs since the change.

My personal preference would be an alchemy system. I love alchemy systems! And that way a pet-related reward remains in the pet domain, instead of just converting to plain gold.

svemir commented 11 years ago

How about a rule to not ever drop a potion you cant use because you already have all the pets of that type? Unless of course there are other uses for potions. Maybe make your own armor or weapons by applying potions to some new type of a drop? In combination with skill points you earn by completing taks of certain type?

Silverai commented 11 years ago

I would find what svemir said (about not dropping potions if you already have all the pets) useful. I ended up with 8 or so base potions back when the duplication issue was happening, and slowly started using them to finish off the last of my base pets. Since completing my base pet collection, I have still been getting base potions. I currently have 13 useless base potions. It can be very demotivating to get yet another base potion instead of something useful. I've also gotten two desert potions after I've already completed my desert pets.
Recently, the random mix seems more random again, which is good because I don't get useless drops as often now. They still happen occasionally though.

octern commented 11 years ago

Getting rid of duplicate potion drops would make the Beast Master achievement radically easier, and I'm not sure if that's what they want. The main ideas being discussed right now are gifting, sale, and/or alchemy.

On Fri, Aug 2, 2013 at 7:17 AM, Silverai notifications@github.com wrote:

I would find what svemir said (about not dropping potions if you already have all the pets) useful. I ended up with 8 or so base potions back when the duplication issue was happening, and slowly started using them to finish off the last of my base pets. Since completing my base pet collection, I have still been getting base potions. I currently have 13 useless base potions. It can be very demotivating to get yet another base potion instead of something useful. I've also gotten two desert potions after I've already completed my desert pets.

Recently, the random mix seems more random again, which is good because I don't get useless drops as often now. They still happen occasionally though.

— Reply to this email directly or view it on GitHubhttps://github.com/lefnire/habitrpg/issues/1048#issuecomment-22008353 .

b4silio commented 11 years ago

After hitting the 100 days mark, I decided to do some empirical drop-rate statistics on the different types of potions and eggs i dropped...

empirical-droprates

The egg:potion ratio seems to be fairly okish (although it truly feels like only getting potions after a while. However I'm having a hard time understanding why I'm getting all those dragons and no wolves, but the other eggs seem to be fairly evenly distributed (minor differences due to empirical fate). As for the potions, There seems to be a shrinking drop rate fairly consistent with the supposed 'rarity' of the potions...

Shaners commented 11 years ago

36 eggs is probably too low to find a trend but this is very helpful @b4silio, thank you! I'm going to simulate 1,000 drops tonight to see what comes out.

b4silio commented 11 years ago

ehehe yeah, 36 is definitely too low for real statistics. Plus, this does not take into account any changes that have been made to the site in the past 3 months, so it really isn't the most reliable data... It was more of a "let's see what we come up with" experiment! I'll be curious to see what the 1000 drops from heaven will give out!

Shaners commented 11 years ago

Broke things trying to get 1,000 drops in a couple minutes... but did get some data on potion drops! potiondrops Seems to be working correctly. Will try to get egg data tonight.

b4silio commented 11 years ago

Very nice! It is interesting to compare that with the gem prices the potions currently go for at the Market. Would look like some are overpriced (e.g. whites) while others are definitely underpriced (e.g. reds and shades!)

lefnire commented 11 years ago

This is amazing. Can I say, in a sick way I feel honored y'all are crunching charts and graphs around my possible bugs?

b4silio commented 11 years ago

Mmmh dumb question, has anyone tried to see what the numbers coming out of https://github.com/HabitRPG/habitrpg-shared/blob/master/script/algos.coffee#L134 look like? Is that really a ]0,1[ interval? Is it using a normal distribution centred on zero? (does it change, as suggested, on the browser/os being used?) I can't test it myself but it would seem to be at the source of the issues at least concerning the egg to potions rate

btw, looking at the code the drop rate for potions should be Base, White, Desert: 20.8% Red, Shade, Skeleton: 7.4% Zombie, CottonCandyP/B: 4.2% Golden: 2.0%

Which seems pretty consistent with what you've been getting @Shaners, so I guess that at least to that extent Math.random() is working properly!

However, I've never had 2 drops in one day, only ever a single one. Is it possible that there are drops that are being lost somewhere? For example if they were eggs they might mess up the system somewhere down the line and so that's why people are not dropping them that much? I know it does not sound plausible, but just trying to think what could cause the problem if indeed it's not the random generator, which is quite straightforward...

Shaners commented 11 years ago

Actually through some testing I've noticed eggs getting deleted, though this is on a modified algos.coffee. I'll have to play with this more to narrow things down. It would make sense though, with no notifications happening people wouldn't notice eggs being wiped.

baimeeker commented 11 years ago

I have also never had more than one drop in a day, although I've heard it's possible.

paglias commented 11 years ago

We could add statistics server side, every time a drop is logged log the type and the user.

Shaners commented 11 years ago

We can probably close this now.

paglias commented 11 years ago

I think I'm affected by this, I got 4 potions and 0 eggs, this is not impossible but strange considering that no one has ever reported getting more eggs than potions

Shaners commented 11 years ago

In the past(derby) people have reporting having more eggs than potions after I adjusted the algorithm. It was around the rewrite that eggs seemed to be getting deleted.

Sent from my iPhone

On Sep 15, 2013, at 2:47 AM, Matteo Pagliazzi notifications@github.com wrote:

I think I'm affected by this, I got 4 potions and 0 eggs, this is not impossible but strange considering that no one has ever reported getting more eggs than potions

— Reply to this email directly or view it on GitHub.

Shaners commented 10 years ago

Got my local working again. Here is the data for 1,000 drops! https://f.cloud.github.com/assets/2374703/1192228/77a28674-245f-11e3-9b31-e38fbf5bbc77.png

Potions v.s. Eggs

potionsvseggs So the ratio between potions and eggs seems fine.

Egg Drop Distribution

eggdistribution This looks fine too. Dragon drops look a little low but it's close enough to 11%. Did not lose any egg drops.

Potion Drop Distribution

potiondistribution This looks good as well. Lines up with previous data and code.

So current state, I don't think we have any drop issues.

therufs commented 10 years ago

Today I got (what appears to be) my ~9th consecutive potion. :/ Is the egg deletion issue still ... um, an issue?

Shaners commented 10 years ago

@therufs as far as I have seen it isn't an issue any longer.

lefnire commented 10 years ago

Bravo @Shaners! I'm going to put this in our YC application, "as you can see here (laser pointer)". The egg/potion conspiracy theories look sufficiently debunked, I'm closing this ticket.

@therufs the egg-deletion issue has been fixed, and many people have found plenty of eggs. Do you not have any eggs whatsoever? Keep an eye out for any chrome errors, see the bottom of submitting bugs. Feel free to leave your UUID here so I can investigate, but I'm probably not going to be able to get to it for a pretty long time (huge backlog right now).

lefnire commented 10 years ago

I need to write up a detailed self-service account diagnosis. But for the technically-inclined, what you can do is GET /api/v1/user (curled with your credentials), save it as a json file locally, import as a record in mongodb, setup the local server, then run the server and sign in with your account. You can then view server errors.

For the semi-technically-inclined, just keep an eye on chrome console errors. Any client errors will be obvious. Any server errors will actually come down as a 501 json response, so you can view them in the networking tab (or they should just show up in chrome console). For this particular case, if there are any errors they're likely to happen within the first few clicks of the day - so just open chrome console for your first 1-10 clicks, if nothing happens there's probably not an error and you're just having bad luck.

Shaners commented 10 years ago

@lefnire Whoa, awesome! I should have looked into the API sooner...

lefnire commented 10 years ago

So from the results, [base,white,desert] are set to statistics too high, and [gold,blue,pink,zombie] far too low (1% of 50% of ~5% chance just won't happen). We should take a second pass at algos.coffee to make them more viable. What are people's thoughts on simply evening it out? Complete randomness? My thought there is that the closer you get to completing a set, the less likely it is for you to get that final piece anyway - so items will still be "rare" for individual cases.