Foal stats (health points, speed and jump strength) doesn't seem to ever exceed all stats of the parental horses.
If you breed two exceptional, high-stat horses, it rarely happens that the foal will have slightly better stats than its parents, so far, in 4 years of breeding tests, this only ever occurs in one single stat, if you take 2 high level stat parents to breed with.
This happens because a third horse with stats varying in range from the lowest to the highest is added into the equation.
While this is very useful for Donkeys and low-stat horses, this makes it apparently close to impossible to breed out a high-stat foal that can surpass its high-stat parents in all categories.
In the comments of this bugpost are many suggestions how to improve on the breeding formula, a comparably simple approach would be to go by real life, where high-stat parental mobs produce also high-stat offspring (e.g. see high-priced bulls/milk cows, but also horses, keyphrase: "selective breeding"/"artificial selection").
If the "ominous third horse" as random factor shall remain in the formula, it could be adjusted in that way that high-stat parents could also have a high-stat "ominous third horse" being used for the equation, basically a higher range that excludes the very lowest stats, but still includes slightly worse/lower stats than the parental horses, to account for the possibility of a negative mutation like in real life.
Similarly then for low stat parental horses, here excluding the highest stats, but the range being still slightly above the parents' stats to account for positive mutations like in real life ("evolutionary/genetical improvement", "natural selection").
As a result of this issue, it's basically not really worth it to breed regular horses.
You are usually better off hunting wild/naturally spawned horses and hope for one with higher stats than those you've already obtained or bred.
—
Old bugpost with additional information:
—
I have noticed after extensive testing that foal stats do not exceed spawned horse stats. As a result the only way to obtain a horse with exceptional stats is for it to be caught in the wild/spawned. After multiple breedings I was not able to reproduce or produce a foal with stats better than the best stat parents, while the foal can be born with stats slightly better than one, it was never able to be as good or better than both parents.
Two horses I had spawned from eggs both had exceeded stats in run speed and hp/jump ability, foals from these parents never matched or exceeded their stats. (on spreadsheet refer to column 17-10, all breedings after 17 involve offspring from these two parents being crossbred with other breeds with favoured stats)
I thought this would be worth noting as a possible bug as many are under the impression that breeding is supposed to have a chance that the foal born is to be as good or better than the parent. This is obviously not the case and may be a cause for review.
Please refer to the attached spreadsheet of breeding results.
Additional notes:
Speed was measured on a Redstone track that is 40 blocks in length which takes a normal player 10 seconds to complete at the current running speed in the latest snapshot.
—
Edit 27/05/2013
As suggested in comments I did another round of tests, this time by breeding horses with identical data, the following data in
[media]reveal there is the possibility of a foal being born with matching stats and on a very rare chance be slightly better, the chance for better stats was higher with jumping ability, speed has a much lower chance to be on par and a higher chance to be worse, and hp is a medium chance to get matching stats, but very low to get better.
It is confirmed that likeliness of stats is increased if two horses match, however this poses the problem that you would need to rely on data-mining in order to ensure you are breeding matching horses to improve horse stats and would be impossible to manage in multiplayer games unless a mod was made to reveal horse statistics. This would still cause the issue that spawned horses may always be better as people would give up breeding due to horse stats not improving when the breeding pair stats do not match.
I removed personal studies within the game due to speed inconsistencies which happen when mounting/dismounting and leading (refer MC-16421) and have left the hard numbers extracted from NBTExplorer on the spreadsheet.
—
Edit 19/07/2013
Attached a new image of breeding results as of 1.6.2 with colour coding to show how the current breeding methodology is working.
Linked issues
is duplicated by 2
Attachments
Comments 179
I will test this theory and upload a second spreadsheet once I have finished.
Can you upload your results to pastebin or something instead of an Excel sheet?
Also, I've double-checked the math and I don't see any errors. The offspring get (Pa+Pb+New)/3 in its attributes. Should be able to produce both higher and lower values than its parents.
I have attached them as jpg for you as pastebin wasn't able to produce the correct formatting I had in excel (I couldn't figure it out) hopefully this will work. The digits are taken from generic.maxHealth generic.movementSpeed and horse.jumpStrength details within each horses entity file.
From the results I produced I found the chance of a horse having better stats (faster horse) was only apparent when breeding extremely slow horses, when you bred fast horses there appeared to be no foals born better or on par with the fastest horse (column 17 breeding1.jpg fastest horse with 0.28 the closest horse was 0.26) If needed I can do another round of testing again and breed the fastest horse with the fastest foal.
If that formula is being rounded to the nearest then that explains the difficulty in getting good horses by breeding. For example if 2 14 heart horses are breed, the maximum hearts the foal could ever have would be 14 ((14+14+15)/3=14.33 which would round to 14). So it is impossible to breed a 15 heart horse without already having one to breed from. Similarly getting higher hearts than the horses you started with gets increasingly less likely when you get higher heart horses. I'm assuming it's intentional for it to be more difficult to get the highest hearts of horses, though I hope the impossibility of breeding the best horses without already having one isn't and will be corrected since it eliminates most of the point of breeding to begin with. This pattern presumably also shows up with the other stats, hearts are just the easiest because they're integers.
No they're stored as floats, and health is rounded up to the nearest full heart in the GUI.
An update on this - I have still been unable to produce a foal with stats matching or exceeding the fastes horse. This is with attempts on breeding from two second fastest horses to get a faster foal and with breeding the fastest horse with the second fastest foal. At this rate it appears rare to the point of impossible to get a foal to be born with matching speed as the fastest possible horse. Is it possible the mechanics are flawed and are not properly generating the speed variables?
Another update - finally got one with slightly better stats. This took me more than 12 stacks of golden apples and carrots to achieve in surivival mode. I can understand adding difficulty to getting better foals, but this seems a bit excessive, especially with the difficulty in obtaining gold. I doubt anyone would be as patient and determined as I am with breeding better horses.
Parent 1
Movement: 0.2861759696540014
Health: 23.884621246761167
Jump: 0.7660536715135388
Parent 2
Movement: 0.2890115841860407
Health: 23.653863740283494
Jump: 0.7637059616547069
Result
Foal
Movement: 0.29452453100491977
Health: 23.84616166234822
Jump: 0.72963024811971
I Agree the formula might be correct but the chance of getting a better horse out of two parents is really really low ingame, takes about (1 to 7)/64 to get a single heart more not taking into account that one might want the other 2 stats to increase at well.
As it is now its easier/cheaper/faster to just go into a plains biome and find the best horse instead of wasting time/resources on breeding
@Kylie While golden apples can be used to breed horses you can also use wheat, which is substantially easier to get. 12+ stacks of wheat would be a drop in the bucket for a large wheat farm, so I think the bigger issue is the massive amount of time it would take.
@Andrew Anthony maybe you didn't notice....you >>> cannot <<< use wheat to breed horses only golden apples, golden carrots
@Andrew Anthony - as nemesit said, you can no longer use wheat to breed. At this present stage it is approximately 1 in every 60 foals will be slightly better than both parents, this is a wild guess and I believe it to be more than 60.
Even more frustrating is that every group (health, speed, jump) will change so even though you may finally get a horse with faster run, its health and jump could be worse than the parent.
This still reinforces the fact that spawned mobs will always be better and easier to obtain. Which negates the whole purpose of breeding. I love the concept but not the current methodology . it would be better to have all stats increase or decrease simultaneously and have a 1 in 10 chance for a better foal.
I Think a better approach would be to make breeding always exceed the parent no matter how small the stat improvement is, even if its 0.0001 or something it would still be better because that way no one would have to use some kind of nbt editor to see the stats, which is currently mandatory.
Without seeing the stats its currently impossible to actually breed really good horses as the improvements cannot be measured in game e.g the difference between 0.82 or 0.83 in jump strength.
@Jeb I think that (Pa+Pb+New)/3 is a bad (and slightly naiive) way to implement stat breeding since if both parents have perfect stats the expected value for the offspring is 5/6 (if perfect is 1 and worst possible is 0) and getting a perfect stat again would be impossible, as others have pointed out.
A better approach wold be to average the parents stats and add a small random deviation (that can be negative or positive).
An even better approach wold be to take a randomly weighted average of the parents stats and add a small random deviation to the result. This way some offspring may take after one parent more than the other (for each stat).
Pseudo code example:
w=randn(); //random number between 0 and 1
r=(randn()-0.5)*some_smallish_number;
Pbaby=Pa*w+Pb*(1-w)+r
Hope that made sense.
I have attached another image of Breeding results as of 1.6.2 - July 19 2013 which was done in creative.
This time I made sure to colour the stats to clearly show the results compared to the parents. As you can see there is a lot of red, which is the amount of times the foal is worse than the parents. in 64 foals there were 10 foals which had stats neither better or worse than both parents with 6 of those have stats better in one area but never all 3, in most cases the foal would be better in one, worse in 2.
This is pretty poor, I am not sure who updates the wiki, but the wiki says the foal can be born better than the parents, but none of these results did the foal ever exceed the parent in all stats, and being better in only 1 attribute is not exceeding.
You could argue that all stats being variable balances out breeding, but all it does is enforce people to just catch one better. I am able to find a horse with 15 hearts and a run speed of 13.97 blocks per second with 4 block jump height before I could even breed a horse to be 1 point better.
I suggest this formula:
children parameter = av + rand(-0.6;1)*(6/(av+5) - 1)
av - average parents' parameter;
parameters here are float of range 0 - 1 (use as factor)
@ Mister Bergensten / "Jeb":
Is this here http://www.minecraftwiki.net/wiki/User:Mgr/Sandbox#Horses still correct for the 1.6.2 release version ?
If so, then no wonder that 2 good Horses are more likely to have a WORSE foal breeding outcome.
Let's take as example Health, for it is easiest to make examples with:
If you have 2 Horses with the maximum amount of 30 Healthpoints, then a bred foal will have a HIGH chance of BEING WORSE than its parents! with the kind of formula Minecraft is currently using:
(30HP Parent 1 + 30HP Parent 2 + Random Value between 15 and 30 HP) / 3
That means that a bred foal could come out as having 25 HP which equals 12 Hearts (Healthpoints always get rounded down to the next full Heart, and NOT rounded UP).
I know Minecraft is not real life, but even then it is unfair if you have 2 good parents but have a random value that ranges from the worst to the best possible amount of an ability.
If we look into real life genetics, a bull that produced cows that give more milk than others, is more likely to produce these kind of calves again, hence why it's so expensive to get these bulls semen.
Although the amount of grandparents of a Pair of parental animals are 8, which can lead to the assumption that a few of them did not have the max'ed out abilities, at least the majority of the grandparents seem to have high or max abilities, or the genes wouldn't have developed that way (without human manipulation).
To somehow make the Breeding Outcome in Minecraft more logical and fair, I'd suggest Parents with high Abilities should have a higher range of a Random Value - just an example: If we have 2 Parents with HP 30, the Random Value could range from 25-35, and in case the sum divided by 3 would exceed 30 HP, it just would be capped at 30 HP, giving again the maximum amount of HP of 30.
Parents with low abilities could range from e.g. 15-25 (for HP).
The really bad thing about Minecraft Breeding is, that, let's say you have 2 parental Horses with bad HP amount, then it is more likely they will have a foal with a HIGH amount of HP - that's the good thing. But the bad thing is, that, in case both have really good Speed (Movement) or Jump Strength, then the foal that will be bred will have very likely a WORSE Jump Strength or Speed than its parents.
That means basically:
It is NOT possible currently to BREED OUT A BEST HORSE which everyone aims at.
It is exhausting enough to find Horses out in the Wild in the first place - so making the Breeding Outcome that UNFAIR is.. well.. unfair.
BREEDING MUST GET CHANGED.
Or Minecrafters will rage as soon as they know the aforementioned facts.
I will attach some Screenshots soon with some calculating examples, all based on the Table I linked in the beginning, from the mcwiki.
Kind regards,
Meri
I hope the graphics are getting enlarged enough so you can read the signs.
You can clearly see that parents with high abilities are more likely to have a WORSE foal, and parents with low abilities are more likely to have a GOOD foal, which is unfair, even more if you take into account that it is nearly impossible to breed out a "Best Horse" that way, because breeding affects all of the 3 abilities.
In case the calculations will get changed (or have already changed from the aforementioned mcwiki link), please comment here, so I can pass this to my Viewers.
Kind regards,
Meri
These images shall just prove that HP get rounded DOWN to the next full Heart and NOT rounded UP.
H on the Tooltips = Amount of Healthpoints.
I'd thought I'd respond (even though this seems inactive). I hunted through mcp to find some details on how the stats are calculated and I found how a foal's stats are created.
When determining an offspring's stats, it takes both parent's stats, generates random stats, then averages all three stats together (the mothers stats, the father's stats, and the random stats).
This has the unfortunate implication that breeding is more likely to create more average children than their parents. A parent's percentile in a stat is also the probability a child has better stats. If the parents are above average, it is more likely a child is weaker than their parents than better. If the parents are in the top 5% (~95% of horses are worse and ~5% are better), their child has only a 5% chance of being better than their parents.
I hope this helps.
@Lewis Fox: That's more or less exactly what I already said - due to the formula Horse 1 Ability Value + Horse 2 Ability Value + Random Value of the WHOLE range (worst to best), the foal is more likely to be WORSE than its parents, if the parents are very good/have high abilities.
The current breeding system enforces breeding out MEDIOCRE horses.
I even uploaded pictures of calculations.
Although some values have been changed somewhere after the 13w17ish Snapshot, which means some calculations are based on (now wrong) old values, the principle of the calculation is still the same (I'll upload the correct values as calculation examples in the next 1-2 weeks).
As I already stated, although it is not real life, even then it is illogical and even unfair if there is no "better" formula for better horses - e.g., if Jeb wants to stick to the current formula, better horses should at least have "raised" values, e.g., if we look at the Health:
Random Value for above-average-Horses shouldn't range from worst to best (15-30 HealthPoints), but e.g. 25-35 HP, and in case the foal exceeds the maximum of 30 HP, that value gets capped at 30 HP.
That's in case Mojang wants to cap the max abilities and not allow the Minecrafters to raise their Horses Abilities above what you can find naturally spawned.
I have alot of complaints of sad or even angry Minecrafters that are discouraged or worse about not being able to breed out a "maxed out" Horse. Actually, I think the fact that breeding usually WORSENS the outcome when you use high-ability-horses makes them more angry than the fact that they cannot really breed out a "maxed out" Horse - only if the 3rd random Value happens to be the highest one, after breeding stackwise Horses... and even then this applies usually only to 1 ability.
They have even lower chances to breed out 2 or even all of the 3 abilities.
The Breeding system really must change.
I know that Jeb and the other Developers might have their eye focusing again on a new / 1.7 Minecraft-version, but fixing or enhancing "old" stuff would be really advised..
Kind regards,
Meri
Yeah, this is pretty ridiculous. If you have two 85th percentile horses, the probability of the foal being worse is 85%. Doh! When the foal does exceed the 85th percentile, it'll be worse than a wild horse of the same percentile because the distribution has less variance. So much for selective breeding. The only consolation is that you can't jump all the way to the other end of the scale, either. Still, a farm producing mediocre offspring when reusing the same high-percentile parents ad infinitum (with a rare chance of finding just slightly better replacements) is the best you could do with that.
The probability of the foal being worse is actually more like 98.5% in your example.
Because the actual random horse the parents are averaged with is not distributed uniformely, rather it is (at least for speed and jump) a sum of 3 uniform numbers, which is way closer to a normal distribution. Furthermore, averaging this gaussian with the parents slightly shifts its central value (average) towards the parents, aswell as lowers its standard deviation (foals are more tightly packed near this new average than they are near the general average in the wild, allowing for less variation).
Overall, while this allows getting better horses through selective breeding, the average amount of generations required is so insane it can just be considered broken (and it's easier to tame wild horse to get a better one, at least while it is possible).
The only useful thing about breeding is, with "good" parents you get a better chance at "decent" babies than in the wild (but lose the possibility of getting super horses), so it can be seen as useful if you want to easily mass produce decent horses (as backup replacements for your mount, to gift decent horses with ease...).
Obviously, all of this becomes worse when you start considering multiple stats at once.
Tweaking the bred horses gaussian to be closer to the parents and/or wider could make things more enjoyable (this is equivalent to adjusting the weights in the average).
Is this still a concern in the current Minecraft version 1.7.2 / Launcher version 1.3.4 ? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.
This ticket is incomplete without the requested information, no response has been received within a reasonable time and we are assuming the issue has been resolved. Should your issue return please submit a new complete ticket with all available information.
Please review the guidelines before reporting issues.
The issue still exists; since this one seems to have a lot of collected data, wouldn't it be easier to reopen this ticket?
Reopened. I changed the automatic response a few hours ago, its badly worded.
Thank you for reopening it, I would have opened a new ticket, if not.
I was researching in this matter alot, and I will try to add as much info as I can to this subject as soon as possible.
The code sniplets I found that refer to the breeding outcome/calculation is not what I'm really overly familiar with, although I can interpret them as for the breeding outcome I suppose, but I'll ask someone that is really good in it, if he would be so kind to join us here, as he was researching in it, too, and knows how to interpret code way better than me (and can explain it better).
My thumbnails in this ticket are not very current ones - they were from before the Horses got nerfed (Speed + Jump Strength), but the principle stays the same: Horse A + Horse B + randomhorsevalue C from min to max value = random foal, with distribution mainly to the middle, which means, even if you have very good parents, mediocracy is what the code goes for, over all.
I used a mod that shows the exact ability values up to 20 digits after the comma, I tested hundreds of breedings, made calculations, showing the "unfairness" and illogical outcome.
You'd need alot of breeding to get a foal that at least equals the parents' abilities, in case the parents are above-average, as for their abilities, but it is very likely that at maximum only one of its abilities are then equal (or even greater, in case the parental Horses don't have maxed out ability values), but not 2 or even all of the 3 abilities, which makes tactical breeding near to impossible, or way too time-intensive.
I'll be back with new screenshots as soon as real life allows it, and I hope I can get this person I have in mind to give us a more mathematical approach, including percentage chances of distribution of ability values, after breeding.
Kind regards,
Meri
Is this still a concern in the current Minecraft version *14w11b / Launcher version 1.3.11 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.
Jar_: There isn't a way to easily tell horse stats without mods in the snapshots, but unless the formula is changed the problem is still there. It's a math problem instead of something that would go away without anyone touching it.
The problem is that (Pa+Pb+New)/3
makes the foal stats tend to average, because of the New part. If you breed two perfect horses with a max stat, say 1.0
, the foal will always be worse than the parents, getting (1.0+1.0+0.5)/3 = 0.83..
on average. The same goes on the other end. Adding the variation as one equal third doesn't make sense. Just with the fact that the formula in another form is 0.66 * average_of_parents + 0.33 * newrandomvalue
it's obvious the foals get kind of average, with excellence nowhere to be seen. The problem is that the expected value of a a foal's stat isn't the average of its parents' stats like one would expect, but 33% from the parents' values toward average.
Instead each attribute should be selected from just one of the parents and sufficiently randomized by e.g. gaussian noise. Java Random has a nextGaussian
method that fits this use perfectly, giving us:
foalStat = selected_parents_stat + standard_deviation * rand.nextGaussian();
This then might need to be kept in range of allowed values, with:
cap(minv, maxv, a) = max(min(a, maxv), minv);
The gaussian noise makes exceptional horses rarer but at the same time there's the tiny possibility for very exceptional values. The resulting distribution has two spikes at the parents' stats' locations and gradually get lower around them, representing the parent the value came from and a little bit of mutation from the gaussian noise. The foal will look like one of it's parents in each stat.
The following are the standard deviations for the current system (assuming it uses uniform random numbers a.k.a. nextDouble()
edited after hunting down the implementation from MCP), which might be good for the suggested system:
Health: 1.149978 1.4433757
Jump strength: 0.033314 0.0577350
Speed: 0.012506 0.0216506Calculated by sqrt((((max-min)/3)^2)/12)
Sample standard deviation from simulated values
(Although I wouldn't recommend it, it's also possible to use both parents directly to calculate the new value if necessary:
foalStat = (parentA+parentB)/2 + standard_deviation*rand.nextGaussian();
Where the standard deviation can be the maximum of sqrt(((parentA-parentB)^2)/12)
and the above mentioned values, which guarantees a minimum variation in case of identical parents and that horses can be better/worse than either parent. In this case the resulting distribution has just one spike at the parents' average, which might not be preferable for maximizing fun.)
Edit: After a quick test I'm quite sure nothing has changed in 14w11b. After breeding summoned perfect horses:
/summon EntityHorse ~ ~+1 ~ {Tame:1,Variant:257,SaddleItem:{id:329,Count:1},Attributes:[{Name:"horse.jumpStrength",Base:1},{Name:"generic.movementSpeed",Base:0.3375},{Name:"generic.maxHealth",Base:30}]})
Unlike their parents, none of the ~20 babies had 15 hearts and just one was able to jump 5 blocks high.
Double post, but just to give perspective: if you have two ok horses that have all stats at 70 out of 100 and want to get a horse that has 75 out of 100 in all stats, i.e. a slightly better horse, the "third horse" has to have at least 85 in all three stats ((70+70+85)/3=75). The chance that all stats are at least 85 is 0.15*0.15*0.15 = 0.003375 or approximately 1 out of 300. That's a lot of gold and useless horses to get rid of, just to get a slightly better horse.
EDIT: It's actually MUCH MUCH worse than that. Apparently jump strength and speed are not calculated by one uniform random number but as a sum of three independent random numbers (health is also calculated as a sum of two random integers, but let's ignore that to simplify things, even though it would lower our chances even more). Because of this, the chance to get above 85% in the random part of one of these stats is in the ballpark of 1.52%. The example is changed to 0.15*0.0152*0.0152=3.4656e-5
or approximately 1 out of 28900. In fact, the chance to get just a baby that's ONLY better in all stats from our example 75%/OK-horses, no matter how small an improvement, is 1 out of 782. Just better speed? 1 in 14 horses. In other words: Don't bother breeding.
@Altti Tammi: I would say your edit doesn't count, because wild horses are equally affected by that distribution. You're as likely to get a foal matching its parents as you were to find one parent in the wild. Don't get me wrong; the breeding system is still a pain for other reasons.
jonathan2520: It counts in the sense that the numbers were wrong and that the chance to get a better horse is lower with breeding than finding in the wild, since in the case of good random values the parents' stats bring the final value down and to compensate that you need a better random value that is much rarer than I previously thought because of the distribution. Think about the 75 / 85 example, in the wild it's enough to find the 75 horse, with breeding you need the 85 random value to get the same results. In just that one case with one stat it's more than four times more difficult to get to the same result with breeding. Your point about a matching foal holds, but my example was mainly to demonstrate that even though you are "able" to produce a foal that has better values than its parents, the odds aren't exactly in your favour (unless the parents were bad, of course, then it's very easy). The main problem is the mediocre expected values and the resulting futileness of breeding.
Affects versions 14w18b, 14w20b
This issue still exists in the latest versions. Breeding is still unrewarding and unless you have a mod to show stats is very tedious and frustrating.
Affects version 14w25a
To my understanding, when you bread any animal to get a very good one in return it takes a long time. You breed the offspring as well. I noticed in your first image that no horse has less than 1 minus the amount of health of the first, so you breed a horse that get more than the healthier horse and continue to breed with the better horse. You do this for each statistic and then start breading the three horses together.
confirmed for 14w31a, but their breeding mechanics should be parallel to anyother mobs
@unknown, no other mobs have the variable statistics that horses do.
Affects version 14w33c. Sebastian MAlton, you have misunderstood. It should work like that, but doesn't.
A simulation of the difficulty of getting a horse that has at least a certain jump strength:
0.4 (lowest jump): find 1 horse or breed 0 times.
0.45 (0.3rd percentile): find 1.00263 horses or breed 5.5e-06 times.
0.5 (2nd percentile): find 1.0213 horses or breed 0.0004618 times.
0.55 (7th percentile): find 1.07556 horses or breed 0.0063696 times.
0.6 (17th percentile): find 1.19997 horses or breed 0.0490144 times.
0.65 (32nd percentile): find 1.46555 horses or breed 0.269576 times.
0.7 (50th percentile): find 1.99963 horses or breed 1.13761 times.
0.75 (68th percentile): find 3.14782 horses or breed 4.07908 times.
0.8 (83rd percentile): find 6.00022 horses or breed 13.643 times.
0.85 (93rd percentile): find 14.2217 horses or breed 46.6923 times.
0.9 (98th percentile): find 47.9811 horses or breed 197.556 times.
0.95 (99.7th percentile): find 383.633 horses or breed 1765.68 times.
1 (highest jump): unattainable and not simulated.
It does and should become harder to get ever better horses (or worse ones for that matter; breeding tends to produce average horses). But breeding your best horses is several times less effective than finding a random horse in the wild! That shouldn't be the case.
The average results of 10 million iterations of these algorithms were used:
Finding horses: Find wild horses until one jumps high enough. Return number of horses. There's actually a simple solution to this, but I simulated it anyway.
Breeding horses: Find two wild horses. Breed the highest-jumping two until a horse jumps high enough. Return number of copulations.
Percentiles are based on wild horses (or foals, before their parents are mixed in).
jonathan2520: And by the time you get one stat to be good enough, the others have diluted to average values. (Btw, your numbers suggest you meant jump strength, not speed. The probabilities are the same for those two, so it doesn't matter.)
Affects version 14w34b
I just made an account to follow/vote on this issue. I hope it gets resolved soon. (I do not know the ranges of horse stats, so I make up numbers to convey concept.)
If horse breeding in fact works as offspring stat=(Pa+Pb+Random)/3, where the random number is from some set distribution like [1,2] (the distribution Pa and Pb came from), then this does make horse breeding relatively worthless. If Pa and Pb are both very good, then the Random will almost never be as good, and so will most likely make the offspring more average. Breeding in this system will "always" bring things to average.
I propose the relatively easy fix of offspring stat=(Pa+Pb+Random)/2, where the random number is from a distribution like [-1,1] (centered around 0). Notice the divisor is 2. With this method the expected value of an offspring will be the average of the two parents, 1/2 of the time the offspring will be better/worse at a given trait, and 1/8 of the time the offspring will be better/worse at all 3 traits. Also, this should be pretty similar to how selective breeding works in real life.
Hope this gets resolved soon.
@unknown: It's worse than that. The random values are approximately normally distributed (sum of three uniform values for speed and jump strength; only two for health), so outliers are very hard to get but just as easy to reduce toward the average.
I've been thinking how you might do this well. One idea I've had is to perform all stat calculations like a random walk, and use a bijection to warp that space to some desirable shape. To put it more concretely:
wildHorse() = wildAverage + normalRandom(wildSpread)
breedHorses(x, y) = (x + y) / 2 + normalRandom(breedingSpread)
logistic(x) = 1 / (1 + exp(-x))
logisticInverse(x) = -log(1 / x - 1)
statValue(x) = minValue + (maxValue - minValue) * logistic(x)
statValueInverse(x) = logisticInverse((x - minValue) / (maxValue - minValue))
statValueExp(x) = exp(log(minValue) + (log(maxValue) - log(minValue)) * logistic(x))
statValueExpInverse(x) = logisticInverse((log(x) - log(minValue)) / (log(maxValue) - log(minValue)))
To get a stat for a wild horse, use statValue(wildHorse()). To breed, use statValue(breedHorses(statValueInverse(x), statValueInverse(y))). You might mix parents in some other way, e.g. statValue(statValueInverse((x + y) / 2) + normalRandom(breedingSpread)) if you want a mix of average and outlier to be less of an outlier. statValue can be changed to adjust the profile, with statValueExp as an example. Lots of room for tweaking.
Note that this example has a restricted domain that can bite you. If you hack in a horse with a stat below minValue or above maxValue, breeding is undefined or at least complex. 🙂 If you approach it naturally (which should take at least hundreds of attempts with reasonable parameters, and becomes impossible to do without reading raw values as changes become imperceptibly small) and minValue/maxValue were chosen wisely, not even rounding error can push you over the edge, so only true cheaters are affected. Leave them in their misery with NaN stats or add some protection.
I'm not entirely happy with all properties of this, but honestly it should be pretty good for the purposes of the game. I've also deliberately crafted it so it works with the current stat system. Any better proposals?
P.S. It's impossible to get more than new Random(97128757896197L).nextGaussian() == 7.995084298635286. I analyzed it because I was wondering if it could theoretically produce extreme results as a fluke. Turns out it can't.
@unknown: Me too. I wrote my suggestion earlier in the thread too, but I'd prefer using just one of the parents for each stat, adding normally distributed noise (magicNumberStandardDeviation*Random.nextGaussian()
) to it and capping it to the limits. It follows the pattern that is used for the colours too, that the foal clearly "looks like" one of its parents. Will the horse be strong like it's father and quick like his mother, or will he be dealt a bad hand in the gene lottery. On average it's the same as using the average, but it's more variable this way. One horse in 64 gets all stats from the better parent and get noise that improves those, and one horse in 64 will be worse than its parents in all aspects.
@unknown: Your example is quite hard to follow without diving further into the mathematics. Would this random walk be able to improve a stat that is already good and what would be the odds?
@unknown: The mapping is a monotonic function, so changes in both directions are always equally likely, like an ordinary random walk. The magnitude of those changes is just gradually compressed to keep the stat within bounds.
In 14w34c
@unknown Your method seems like a very elegant mathematical solution (didn't actually run through the algorithm, but I think I got the intuition), but probably not very appealing from a programming perspective, as well as it is not as readable as code. I think I would prefer something simpler such as:
offspringStat = min( max( (Pa+Pb)/2+random, minimumHorseStat), maximumHorseStat); //random comes from some distribution with expected value of 0. Probably Gaussian-ish.
Your idea nicely addresses and fixes the problems that occur with this method when both parent horses are an extreme case. But I think that practically either one would suffice and that very few players would be able to distinguish between the two, especially not until they had very good horses anyway, which is when the differences between the two methods would manifest themselves. I could be wrong about this, I think the easiest way to find out would be just to implement both and test them seeing if there is any real difference from the players perspective.
@unknown I also thought about your method, and I would be quite satisfied with it as well. My only complaint with it would be that it does not necessarily mean good game progression, but this is really just my preference. To demonstrate this let me give an example.
ParentA is good at running/jumping but has crappy health. ParentB has good health but really bad at running/jumping. The offspring could either be perfect, or flawed in one or more aspects.
In the case of perfect, then the player has achieved the ideal horse after 1 breeding instance, not very rewarding in my mind.
In the case of flawed, the horse will be really bad at one or more of those things, in my mind making the horse not fun, and not really a step up from either parent.
If on the other hand things were averaged, the first case of a perfect offspring is not possible, and the second case would be a more well rounded horse rather than a horse extremely flawed in one or more aspects, which I think makes better for game progression.
But again, I like your method too, and would be quite happy if it was implemented.
Any word from anyone on the Mojang team about this? Is this all moot because they are already working on some fix?
@unknown: There is a significant difference, though. Your method has a hard cut-off with min and max. That means you can breed a bit and simply hit the cap to get a 'perfect' horse. That may be a hoarder's dream, but it doesn't seem quite right.
My method is essentially the same but with a gradual cut-off. Instead of just hitting the cap, you'll only get ever closer (although with an exponential closing rate, eventually you'll be pretty much there). It won't make a huge difference for those casually trying to get a better horse, sure. But it really sets those who take breeding seriously apart.
On the other hand, Minecraft is a game of hard edges and rules that are easy to implement using simple binary logic. But then horses are living things which should perhaps set them apart, and they already have a smooth distribution as a precedent. What would really be best?
Anyway, I'm not the one calling the shots. And so far neither is Mojang. Grrr.
@unknown: There would still be the random variation / noise, which could either increase or decrease the value. If the parents' average would be used, the noise would have to be in proportion of the difference of the parents if the foals should have a chance to exceed either of the parents (see my comment here). It might work, I'm just wary of using averages since the problem at hand is partly caused by averages. If you have two horses that are very good in some stat and bad in others, getting an all-around good horse is hard. Toy example:a: 10,0
b: 0,10
c: 5,5 (a+b)
d: 7.5, 5 (a+c)
e: 3.5, 7.5 (b+d)
And so forth.
@unknown: I think I understand what you are getting at in your example and I think the logistic function and its reverse (logit function) fit perfectly for the capping, compressing the gains near the maximum while still having equal chance for raising or lowering the value. Here's my revised suggestion / pseudocode
private double stddev = 0.088; //magic number that decides how fast value change
private double maxStat, minStat;
private double statDiff = maxStat - minStat;
private double logit(double val){ return (-log(1.0/val-1.0)); }
private double logistic(double val){ return (1.0/(exp(-val)+1.0)); }
double breed(Horse parent_a, Horse parent_b)
{
Horse chosenparent = nextBoolean() ? parent_a : parent_b; //Choose one parent as a starting value and normalize it for the transform function
double normalizedStat = (chosenParent.getStat() - minStat) / statDiff;
double normalCappedStat = max(0.0, min(normalizedStat, 1.0));
double newStat = logistic(stddev * nextGaussian() + logit(normalCappedStat)); //Transform, apply randomness and undo the transform
return newStat * statDiff + minStat; //Undo normalization
}
@unknown: That would almost work. Hint:
logistic(stddev * nextGaussian() + logit(normalCappedStat))
How would other mappings work? These don't approach the edge as fast:
x/sqrt(x^2+1)/2+1/2 (speed in special relativity)
arctan(x)/pi+1/2 (angle)
@unknown: Fixed. I don't think approaching the maximum faster is necessary a bad thing, it's more fun that way. Even the error function might be a natural choice, but it's obviously not a good idea. At least the formula of the logistic function feels natural. The logistic function also has a benefit, at least compared to your first alternative: log and exp behave properly with infinitys, so the transformation works properly at the limits. x/sqrt(x*x+1) and its reverse have a division by zero, giving a NaN.
Affects version 14w34d
@unknown: Good point, playing around with that idea I agree with you now. So I am now completely behind supporting your method of:
offspringStat = randomParentStat+noise.
Are there any other ideas floating around though?
I completely agree with the mathematical niceness of handling the edge cases like you two are considering, but I am not convinced it is necessary. (And worry it is likely to scare away the Mojang Programmers? I do not know how much math they like?)
Consider the example:
Let the scale of stats be 0-10, and choose a bell curve with std dev 0.5, a pretty large standard deviation in my mind. Half the time the stat will change by more than ~0.3. A quarter of the time it will change by more than ~0.6. This seems reasonable to me?
If your horse is 9, then ~2.5% of offspring would be perfect. If we consider all three traits being 9, then the offspring will be perfect ~0.0015%.
If your horse is 9.5, then ~15% perfect. All three traits being 9.5, perfect offspring in all three ~0.3%.
If your horse is 10, then 50% perfect. With three traits 12.5% will come out perfect.
So to get a perfect horse it seems like it would still take a bit of work without limiting gains near the top.
So sure, by not dealing with the edge cut off, a perfect horse is attainable, but depending on the kind of standard deviation that Mojang wants and if they are ok with people getting perfect horses, it may not be necessary? So I am a fan of this approach as a first attempt:
offpsringStat = min( max( randomParentStat + random, minHorseStat), maxHorseStat); //random is from some bell curve type distribution with mean=0, and std deviation of about 1/10th-1/20th of the horseStat range.
If it doesn't work out in testing because it's too easy to get a perfect horse, or they don't want perfect to be attainable, then try the more complicated thing.
I wonder if this thread is so long that everyone from Mojang stopped reading?
@unknown: Well, the math part is already thought out for them, free of charge 🙂 It's not that hard anyway, this picture tells a lot - it just stretches the limited range to an infinite one for adding the noise and then we do the reverse. I like the fact that perfection is unobtainable - there's still competition even at the high end. The normalisation that is done is a bonus - every stat can use the same formula. Otherwise you would have to keep track of the different standard deviations for all the stats.
I too wonder if anyone at Mojang reads these - I can imagine it doesn't help that this bug has been assigned for a long time.
Bonus implementation tips for Mojang: In case you write out the min/max values in the class for the limiter, you can make the stat generation use them instead of the hardcoded different formulas that are used now to make sure they match.
@unknown: I did consider the error function. The roundness is nice. But Java doesn't have it, and its inverse is even harder to get.
x/sqrt(x^2+1) would need some special handling of huge numbers, yes. Its problem is not division by zero but division by infinity (awkwardly producing zero) and eventually division of infinity by infinity (producing NaN). Not hard to fix, though. The most natural expression of its inverse (x/sqrt(1-x^2)) only has a division by zero at the edges, producing a correct infinity.
@unknown: The problem without some kind of tapering is that the same increment has the same cost at every level, even if horses at that level should be rare. You may want to tweak the standard deviations and all so the casual breeder can get a reasonable improvement at a reasonable cost (time, materials). Then a hardcore breeder only needs to invest a small constant factor more to get a coveted ❓ perfect horse. Strong horses should be more valuable than that.
I figure someone at Mojang might eventually read this, if they read as much as they write. This shouldn't be too much math to verify. The complexity is much lower than that of much of the rest of the game, which is somehow only moderately buggy.
I ran some simulations on my latest suggestion to see how fast you reach to a certain percentile from a starting stock of 10 random horses, with different values for the magic number (standard deviation of noise) - the results are here. For comparison, in the breeding formula used now, it takes ~150 breedings to get to 0.7 and ~1000 breedings to get to 0.75.
Affects 1.8-pre1. (I wonder if anyone at Mojang reads these, it's been over a year since @unknown last commented on this issue)
Graphs can't hurt.
[media]Mom is slightly above average, 7/12 into the range or at the 68th wild percentile. Dad is a little stronger at 2/3 of the range but already the 83rd percentile. It turns out that to get something better than their average, you need to exceed the percentile of their average, which is about the 77th. If you do get something better, the amount by which it is better is only 1/3 of what it would have been in the wild with the same probability. The converse is that the stat also can't regress as much, but if you're breeding to maximize a stat you'll discard many weaker horses anyway regardless of how much weaker they are. Someone will have to figure out what this means when you're maximizing multiple stats.
[media]Suppose now that we have horses at 3/4 (93rd) and 5/6 (98th). These were almost certainly found in the wild. What do we have now? A factory of good horses, sure. An average at the 87th wild percentile doesn't sound so bad. But note that you can get that percentile by collecting on average 8 horses from the wild, when it took 34 to select parents that produce such offspring half of the time. This is just trying to produce horses at a level below that of the parents. It's nigh impossible to remain at the current level, let alone to gain.
Would it make sense to presume that a horse population maintains roughly the same distribution as it breeds to sustain itself? Presumably there's some natural selection going on, including sexual selection where strong horses have more mating opportunities. With that being part of the equilibrium, foals should tend to be slightly weak compared to their parents; some bias is really okay! But some selection of any kind (like artificial selection) should easily counter it. In Minecraft there is no such thing as age beyond growing up, though, so it can afford to have a strong bias as parents don't have to be replaced as often. Yet its bias is much stronger than that.
Could someone mark this for 1.8-pre1?
Graphs are great.
Here is a graph showing how fast one can get the average stats of the best horse to increase to a certain level (notice the logarithmic scale) with the current breeding formula:
[media]Here is another fun graph (about the current formula): inspired by @unknown's last comment about maintaining the distribution - results of a simulated life of a group of horses, breeding random horses and killing the oldest to maintain size.
[media]The standard deviation of the average stat of the bred horses drops by 62% compared to the wild horses.
@unknown: How did you make that graph with the logarithmic scale? I just ran a similar simulation and got a much brighter picture. Starting with a pool of 10 wild horses and breeding 550 times (not quite millions!), my average of all percentiles of the best horse exceeds 90%. Starting with 2 horses and breeding 600 times will also do. It confirms my suspicions that maximizing multiple variables is relatively easy. I'm sure my strategy isn't even optimal, but perhaps yours is very suboptimal? I don't think I have a bug; if I use the old univariate strategy in the same framework I get results that agree with everything we've seen so far.
@unknown: It was done using the current thirdHorseAverage generation method, so it's the same numbers you posted here, but considering all stats instead of one.
I like the current ideas but why not take a little leaf from biology's book? Instead of one value for each attribute, why not two and the actual is the average of them (rather crude but it should be fine). With breeding, you take a random one of each parent and those are the two values. For some more variance, we could add in a +1 to -1 range of randomly chosen values to each.
@unknown: A multiple gene system would be nice, but it would be much more of a hassle to e.g. summon horses if instead of 3 variables you need to specify 3*n_of_genes. It also wouldn't be backwards compatible with the variables the horses use now and it wouldn't be as easy to reason about the statistics. Such a system is probably best left for modders to do.
@unknown: Even with a very naïve strategy (one stat at a time, making sure the others don't drop below the goal) it only takes me a few thousand attempts to exceed the 90th percentile in every stat. This is fully simulated breeding based on a live strategy, which is exactly what you'd be doing in the actual game if you were patient enough. No high-level models that might be wrong, no way to rig it. So how did you combine different stats?
I should add that my previous post underestimated the numbers, but only by a few tens. My continuous health percentile based on the discrete version in wild horses was a little biased. Not a big deal.
@unknown: I had thought of that concept. The first objection is that it would be hard to make it work with existing horses. You'll also want to make sure you're happy with your phenotype equation, because you can't change it later.
@unknown: I think I may have found the source of the confusion - I mistakenly spoke about percentiles, even though I meant stat values normalised to the range [0,1].
Also I experimented with different strategies and always taking the two horses with the best average (normalised) stats seems to be faster (albeit a bit different) than taking the two with highest minimum stats, which is faster than optimising one stat at a time.
confirmed for 1.8-pre1, it must to be fixed before the actual release
Mojang reviewed the issue on July 29th, and determined that it's something they'll fix. Given that it's not a simple typo or logic error with a clear solution, it may take them some time to pick what algorithm they'd like to use. I imagine your suggestions and analysis will be useful to them in that regard. It's likely that they haven't decided exactly what their goals are with respect to breeding, but here's a guess:
The algorithm should be simple, both for performance and so they can understand it, and therefore tweak it as desired.
It should be possible for children to be both better and worse than their parents.
But children should probably be similar to their parents, rather than weighted towards average values.
They're probably not expecting players to breed horses hundreds to times to get decent results.
Most players aren't going to have any way of getting hard numbers about their horses' stats, and will have to rely on their perceptions.
I also wouldn't expect this to be prioritized very highly. The base functionality works, it just doesn't produce very nice outcomes on average.
Confirmed for 1.8-pre2. This should not make in to 1.8.
@unknown: It would be nice, but I don't think that's an option anymore at this point in the release cycle..
Affects Minecraft 1.8.1
Still is true, my foals do not get either parents stats, always at least 2 HP less than weakest one.
It takes fun out because a rare color with nice stats is irreplaceable in survival, even in SP creative. I made in creative 1500 horses by spawn to get a grey horse with HP over 10. Grey was hard.
ON forum someone says keep your uber horse safe to breed only. But if they cant breed better then they are horse to use. Weaker horses die to witch splashes , fire , minizombies, supercreepers.
I took ONE out for spin in MP. A server lag made us sink INTO a bridge. I barely escaped and watched the ONLY white horse with stat over 9 an that coat pattern die stuck in rock. And it took a sweep up 3000 blocks in every direction to find "her" and two real time days to bring her to my base and stable to avoid drowning or other bad incident. Teh Admin if they wanted might spawn a jillion horses and get one same color OR same stat. Chances of both? NIL! It is brooken. Id rather they all be able to jump 3 blocks, be fast as boats at least and have a HP equal to mine at least if the formulas are going to be crap. 😞 or at least make breeding cheaper. Just apples. Not like apples can be grown like wheat. That is a lot of gold I wasted to not get even ONE foal better /+ to best parent
@unknown: If cheats are enabled you / an op can use summon commands to spawn a horse with the stats and color you want. Click "view all comments" and search for "summon" for an example. The only way to play it safe is to have two best horses locked up and always use their foals even though they aren't as good as their parents.
Horse breeding seems to be much more functional than as described here. I've bred some 170 horses, starting out with two fairly crappy wild specimens (the best one had 22 HP, 2.5 jump and 8.6 m/s speed). Presently, my best horse has 28 HP, 3.750 jump and 10.4 m/s speed (as measured in vanilla, without third party software). It's far from perfect, but there is definite progress. If the basic formula still averages stats of both parents + random factor, I see nothing wrong with that. It will become progressively harder as the horses get better, as it should. Furthermore, I don't believe that it should be possible to breed the ''perfect horse'' without having to hunt down the exceptional wild specimens in the process. Inbreeding should not be rewarded! That said, if you were to change anything, then consider calculating the jump stat in a similar manner as the health stat. If the jumping stat were expressed in discrete values that make different values actually relevant in the minecraft world, then it would be possible to achieve the maximum of 5.5 through breeding. If, say, the jumping stat were rounded to the nearest 0.125 multiple (the height of a layer of snow), then a ''perfect'' horse would only need a jumping stat larger than 5.43625 (5.375+0.06125). Rounding would only affect the actual jumping height and the un-rounded value would still apply to breeding. This way, your 5.49999999999 horse actually gets to jump that extra half slab. As for speed, it really doesn't affect the horse quality much if a horse is 0.01 m/s slower than maximum.
@Victor Baker: Certainly, if you've got average or even worse than average Horses, then the random factor is usually/can be benefitting - not so on above-average or very good Horses.
Putting aside that some things in Minecraft aren't logical to begin with (so many no-gravity-blocks), it seems illogical to me, not only going by real life, that two Horses with above-average or very good stats will very likely get a foal that is worse than them.
In real life, they take animals with very good stats and use these mainly for breeding.
Genetics.
The sole random factor (coming from real life) would be ancestors like e.g. grandparents that could be taken into account - but a general random factor that is valid for all Horse stats is just not "fair".
As compromise, maybe there could be at least 3 different random factors, for each of the Horses' abilities, dependant on the individual Horse ability value.
[Edit: What I mean by this is: Depending if it's a low, average or good Horse ability stat, each of these 3 have a certain random factor that is being taken for breeding. 3 abilities (Health, Jump Strength, Speed) and 3 random factors for each of these 3 abilities (= in total 9 random factors)]
"Inbreeding should not be rewarded" you say - but it's fine for you for other animals, to breed baby animals with their parents, to get a huge farm, yes?
If we start a discussion now about - more or less - ethics, then it becomes way too "real life" in my opinion, and then other game mechanics would be affected as well, to make it "fair".
And that's exactly what this argumenting here is about, ever since the 1.6 snapshots:
Fair breeding outcome.
@ Meri Diana. Ethics aside, inbreeding limits the gene pool and, consequently, it reduces variety (here: in the three stats). If you breed with only two horses, you rely solely on mutations for improvement. Mutations are very slow to come to expression (especially in an already sophisticated creature). That's what I meant with "inbreeding shouldn't be rewarded''. If, on the other hand, you have a large gene pool to work with, favorable traits are much quicker to come to expression as natural selection/selective breeding weeds out the inferior specimens. The simple formula of averaging the parents stats + random factor (mutations) is an elegant representation of these mechanics. Furthermore, if a parent is superior in something, it is likely that the offspring is also good - but worse - at that thing. This is also nicely captured by the formula. The fact of the matter is, genetics are quite randomly assigned to the individual offspring and not - as you suggest - willfully assigned based on what parent can bring more to the mix. It is only the killing off of the weaker specimens that creates progression over time. I do agree that horse breeding should be rewarding, but honestly: how easy should it be to breed the perfect horse? I've bred horses for a couple of days now, and the stats have increased tremendously. I will keep on trying to breed better horses, but I don't expect I'll ever reach perfection. And that's ok
@unknown: There's nothing new with your results. All of the stats of your horses were below average, so an increase is expected. The bug/misfeature isn't about breeding a perfect horse, it's about wanting any kind of increase in stats for breeding above-average parents. There isn't any point in breeding below-average horses like you did when literally 50% of horses are above-average. This isn't about 0.01m/s increases, you can't get anywhere near the best stats as it is. Breeding isn't fun when your expected outcome is bad horses. (Bad being defined as worse than the parents.)
See these three images for the distribution of the stats. Your breeding results are somewhat good but nothing stellar and likely you aren't going to get anything better. 28 hp is good, but hp has a different distribution and is thus easier to get up.
http://i.imgur.com/M7HpUcJ.png | http://i.imgur.com/ie1n9uR.png | http://i.imgur.com/QoeRpFc.png
Jump strength is relevant in the minecraft world. It is the upwards speed at the base of the jump. The total jump height is then affected by gravity so the relation between them isn't linear.
Since it's buried in the comments now, here's my current suggestion for a more fun mechanism which is compatible with current stats and allows to get an increase in stats while still being competitive in the upper range (you can't get perfect).
@Altti Tammi
As long as the ''random'' factor isn't biased, Then I see no reason why selective breeding couldn't continue to improve stats. Yes, breeding gets harder the higher your stats are, but that's supposed to be the case. What are these distributions representing precisely? The distribution of the random factor?
See Wubbi's Video "Horses and You":
(Added screenshot to this post, http://puu.sh/eOSqx/bd92487699.jpg )
The chances to get a Horse with high stats is low to begin with (see curves), which means it is highly unlikely to find a wild Horse with overall good stats.
Like Altti Tammi says, it isn't about maxing out a Horse - that would be extremely hard, if possible at all, as you'd have to find exceptional Horses in the first place - it's about a more fair, closer approach to better the stats, depending on the Horse parents.
It would be really hard and cost you a lot to breed a Horse with high stats in all 3 areas, but at least it shouldn't be an overall mediocrity that the current breeding code supports.
If the random distribution is truly as such, then I'm inclined to agree with you. However, wouldn't it be easily fixed by fiddling with the distribution of the random factor? For my part, I'd have the probability of each possible value equally distributed. In fact, I assumed this was the case already. Where did the data for those distributions come from?
If equal distribution is too rich for mojang, they could at least soften the bell to rebalance breeding. There is really no need for complicated formulas and selective assignment of genes.
Would you agree that:
Horses breed and die in the wild. Although they never actually do so in the game, it's the most reasonable model one can come up with.
Horses with higher stats have more offspring, owing to whatever types of selection are going on.
The population has reached equilibrium, i.e. the next generation of wild horses would have the same distribution of stats.
By emulating the natural process, one should be able to attain a similar distribution.
If you still think breeding is fine, you must be thinking about a different game. Breeding has a strong bias in favor of average horses. It can't even produce horses at either extreme (only get arbitrarily close with extremely low probability), when they appear quite frequently in the wild. Even ignoring the problems with extremes, it's implied that selection culls tons of average horses. It leaves exceptionally good and exceptionally bad horses alone. It makes no sense.
@unknown: They are the distributions of wild horses and thus also distributions of the random factor (the infamous "third horse"). The problem is that the random noise is centered on the average of all horses instead of the parents' average and the fact that the random noise has the same distribution as the horses, making a drop towards average even more likely.
From this picture showing the expected increase in stats you can check your progression:
[media]Your best horse's stat average is now ~0.68 according to this chart, which makes sense if you bred 170 horses (at a cost of 150 gold). To take you to an average of 0.8 (which would mean 27 hp, a 4.5 high jump and a speed of 12.6 m/s, still far from the maximum) would take you well over 1000 breedings. For most of us that doesn't sound fun.
Then, perhaps, wild horses need to be rebalanced instead? I suggest to randomize three sets of stats per horse and take the average of that. That is much more likely to produce average wild horses. Though, personally, I like the idea of horses with one extremely good stat. They're just as likely to have have horrible ones and they are probably not decent in all three stats That's where breeding comes in handy.
Wubbi took (and takes) such things out of the code, I trust his statements; and also, going by real life, if you take a "wild" population of animals, there are always very few low- as well as high-stats specimen, hence why humans breed out the high-stats-animals in order to get the desired specifics.
Again, to condense the statement very simply:
It is unfair to have the random factor ("infamous third horse") be equal to all Horses, no matter what base stats they've got.
So if they stick to the random factor for the breeding calculation and not make a totally new equation for the Horse breeding code, then at least make the random factor more "fair"/reasonable.
@Victor Baker: That's exactly our point. It is close to unlikely that you'll find a wild Horse with all 3 stats being superb.
Hence why it's still somewhat fair, as you can never get a maxed out Horse - it'd take ages to get a close approach, and you'd have to find above-average Horses first.
Also, don't forget: Horses are quite useless, as you can't attach a chest to them.
Horses just to go from A to B with no further use at all, is - at least for me - boring or makes no sense.
I can also use potions (although that doesn't make me as fast as the fastest Horse, of course), and can explore/get loot while I'm travelling, on my feet.
It'd be more advisable to breed out a high-class mule, and given the fix/stable base stats for donkeys, getting a maxed out Mule is even more a challenge, as you'd have to max out a donkey first (mules can't be bred).
I do get what you're saying. There may be an argument for reducing the random factor altogether. That way, though, breeding below-average horses will be more tedious and you'd pretty much have to search for wild horses with good stats to breed with. I don't think it'd be fair to have it both ways (more influence of random factor when the stats are below average, and less when the stats are above). However, there really is no need for complicated formulas to rebalance the system. Just refactor the impact of the random horse vs. parent horses. Don't remove the randomness of genetics though. So, maybe. a weight of 0.5 for the random horse and 1 for each parent?
To elaborate: reducing the influence of the random horse will allow for more targeted breeding with less ''noise'', while still being essentially random. It will be harder to breed good horses from mediocre ones, but horses with excellent stats can more steadily transfer those stats to their offspring. As the stats get higher, the impact of the noise gradually increases, but you'll be able to get a lot more out of selective breeding. Actually, perhaps a random weight of 0.5 is too low, but there should be a balance somewhere.
@unknown: That would actually make things arguably worse, because it would reduce the variance and getting an increase in stats would be even more difficult. Trust me, it won't be that simple - the whole third horse concept is flawed.
My suggestion isn't complicated - it's just a mapping of an infinite range of "goodness" into the finite stat range with a logistic function and giving an increase or decrease in stat a fair 50% chance. Plus selecting each stats randomly from one parent to get some sort of likeness more apparent.
It's not that fair though. You want a nice and steady increase in stats, but that's not very realistic nor is it challenging. Reducing randomness would make finding horses with one exceptional stat all the more important, but you'd be set if you find all three of them. Even without all three, you could still max out each individual stat through breeding, and breed the results with each other (individual stat breeding is so much easier). Anyway, it quite resembles real breeding if it's set up like this. The current system is also representative, but it is too tedious (as many have complained).
@unknown: I think there is a misunderstanding here. If you take my suggestion to the extreme, giving the random part a multiplier of 0, you would actually always inherit each stat from one of the parents without randomness which is exactly what you describe, making finding a good exceptional stat important. What the mapping would do is give a slight variation to the stat while at the same time making perfection impossible. In your suggestion the foal's stats would still be at the average of the parents' stats, so it wouldn't do any good to breed horses with different exceptional stats.
Edit: This discussion has given me an idea that I tested and I might change my suggestion to as follows:
newStat = (statRandomlyFromEitherParent + 1.65*randomNumber(minStat, maxStat))/2.65
So instead of both parents use one, the "third horse" is uniformly distributed instead of using the wild horse generation (no amount of multipliers can make that give the same distribution). The chosen multiplier seems to do a good job at keeping a randomly breeding populations' stat distribution same as for wild horses
Scratch that, absolutely too much variance. I'll stick to my previous suggestion.
It'd be easier to transfer already good stats to new generations of horses, which is not to say that developing new stats would be any easier. You are completely right on that account. The process of breeding would get more difficult as horses get higher stats, as it should. Anyway, I do think a slightly better edge would be a good thing, but it really shouldn't be too easy to get into the 90 percentile.
I have been thinking about alternatives to the equation and dealing with mutations. Here are some (not necessarily all good) that should provide some food for thought.
Firstly,
let p1, p2 be the names and statistics of the two parents.
let c be the child
1) c = (p1 + p2)/2. This is probably the worst equation because you literally cannot increase past the best horse.
2) c = (p1 + p2 + rand(horse))/3. This is the current one, and makes it extremely hard to get anything good.
3) c = (p1 + p2 + randInt(-range, range))/2. This is getting better but has two problems. The first is that it is still linear and doesn't tend towards an average breading of average horses very well. The second is that all items in the range are possible equally.
4) c = (p1 + p2 + mod(randInt(-1, range+1) range))/2. This is better than the last one in two ways. It always for a varying breeding difficulty and the outcome tends toward the mean more often. It is also non-linear.
5) Let us treat p1, p2 as vectors in R3. let x = p1(dot)p2. If randInt(1, 100) >= x/100 then c = (p1+ p2 + k) /2 where k is some increase to the values of p1, p2. Else c = (p1+p2)/2. This equation naturally makes it harder to get better horses. The v could be based on the world difficulty. This makes having two weak horses breed up decently fast at the beginning.
This bug report and the nagging about mediocre horses affirms my perception, that 99% of the population can't deal with probabilities. At least an above average share of the people in this discussion, know what they are talking about.
Breeding is on average 6 times slower, than finding a new horse, if the time to get a new horse is the same. That's a good thing in my opinion, because it encourages exploring. Right now the odds to find a spawned horse with a certain attribute, that is at least 80% of the maximum, is 1:27 and for 90 % 1:222.
That's alright, the difference between 80 and 90% isn't that big. If somebody really wants a very fast or high jumping horse, he has to work for it.
In my opinion, the system as it is, is almost perfect and resembles real life, where it is extremly unlikely, that a horse is a world class jumper and runner at the same time and the offspring of two very talented individuals, almost never exceeds their parents.
I still think that's it's not realistic to be able to breed your way beyond the 90 percentile without incredible effort / luck. However,I do get the compulsion. I'm not much of a mathematician, but I've been trying to come up with a suitable formula that doesn't over complicate things but still does the trick:
(pA+pB+pR)/3 + F/(2*pMAX - (pA+pB)) where F is a random error with a small interval around 0. The whole second term is random mutation that is likely to be larger as pA and pB approach their maximum values.
Patrick you clearly misunderstand the issue then. my entire gametime at the moment is spent breeding and finding horses and I would not expect people to do the same. I have the best horses on my server, I travelled to every biome in a 50k map to find the best ones, which ended up being 6 horses and not one is cap. it can take between 50-1000 horse breedings to get a foal with the same stats as one of the best parents. the last map I played on my server with two almost cap speed horses (14 blocks) I bred well over 3000 horses before I got a foal with 14 block speed. That is not perfect, this is a game and should be player friendly and progression should not be this slow or expensive. Progression also should not require you to need a mod in order to see progression, which is what is needed to even make breeding semi-effective with horses.
By the time you are able to breed a better horse, your map would be out of gold (The server I am on has a mod shop that sells gold, so that is the only reason I do not), And the time spent to make that one foal that has the same or better stats than the parent can take you 3weeks to 8 months depending on the RNG of the current system. I took 5 months to get that 14 block foal born, and it was still marginly worse than the parents. I don't think it is fair to expect everyone to breed horses all their game time.
Kyile you have it completely. Though I think what food you feed them should also have an effect.
@Kylie Langton
So whats your problem? You did all this work to differentiate yourself from the others, by having the best horse. If it would be easier to have a very good horse, you wouldn't be satisfied either, because everyone can have one. Nobody needs a horse, that is 10% faster, anyway. If someone really wants to put effort into breeding or searching for horses or building a friendly mob farm, why not? If you wanted a horse with at least 14.2 bps, you would have had to breed on average 4 times more horses, and for 14.5 600 times more horses. The effort you put into it, is only definied by your ambition, and the reward is not a straight line. That's exactly what I'm talking about, people have no clue about probabilities and are frustrated by it.
Although it is a game, there can only be one fastest horse on the server, and the owner is either extremely lucky or put the most effort into it.
btw: Gold is replenishable (Pigmen!) and speed progression doesn't need a mod to measure, if you're good with redstone. https://www.youtube.com/watch?v=7KUCvBg9-_M
@victor baker. it is not realistic to breed past 90% of a certain value. On average on the 1000th iteration you would pass that mark, if all improvements are recognized. So what? It's only a number. Why does that nag you? Because your urge for perfection can't be satisfied?
I agree with you that it's not realistic, nor it is of much practical use. Still, some people would like to breed towards perfection. Not being able to see any progress for a couple of thousand of breeds at some point, seems, somehow, kind of mean.
@unknown: I revisited the idea you posted today, about >=three variables per stat and tried it in action. It works very nicely and I like the idea very much. Previously I was against multiple "genes" because of summoning hassle, but it can be avoided if it's okay summoned horses aren't good breeders (Default value of 0.5 for all genes) or if the genes are added in a version where it's allowed to change entities, they can be given three equal genes corresponding to their stat. Genes are from the range (0,1).
Since (most of) the stats are calculated by a sum of three independent uniform variables, those should be remembered and used as additive genes. When a new foal is born, it gets each gene from one of the parents, with a mutation (new uniform random number) happening maybe 10% of the time. Backwards compatible stats can then be calculated from these. Since all the genes, mutated or not are from the same distribution, all foals will have the same distribution as their parents. Using three genes makes the stats have the exactly same distribution they are now (except for health, which will be slightly different). With more genes you would have to relax the min/max limits or have more average values. Example code:
createChild(otherParent){
EntityHorse child = new EntityHorse();
double[] p1 = this.getGenes();
double[] p2 = otherParent.getGenes();
double[] childGenes = double[9];
for (i=0; i<9; i++){
int mutation = this.rand.nextInt(9);
if (mutation == 0) then childGenes[i] = this.rand.nextDouble(); else if (mutation < 5) then childGenes[i] = p1[i]; else childGenes[i] = p2[i];
}
child.setHealth((maxHealth-minHealth)*(childGenes[0]+childGenes[1]+childGenes[2])/3.0+minHealth);
//etc
}
This is the best of both/all worlds - a population won't change its stat distribution over time since the stats are calculated the same way as before, children of good horses won't likely be as good as their parents as the mutations drag the stats towards the average, but it's still possible to get an increase with a reasonable number of breedings! It works so well it's almost magical. I'll have to make a mod out of this if someone at Mojang won't implement this.
@Victor
It doesn't matter, which algorithm is used, you won't see improvements at a certain point, with reasonable effort.
But I think I understand your point a little better, by reading some of the other posts more carefully. The better strategy to get a good horse is definitely getting spawned horses right now. Shifting the ratio to breeding maybe isn't that bad. But I like the fact, that something encourages exploring in this game. On the other hand, I understand the desire of players to sit in their base and breed a good horse. I guess it's up to Mojang to decide.
I don't like Altti Tammi's suggestion, because people already complain, that it's to hard to see speed gains without mods. Successful breading largely relies on recognizing tiny improvements even with the current system.
@unknown: I haven't actually shown any numbers yet, have I? So how can you tell how hard it would be to see speed gains? I can tell you that it depends heavily on the mutation chance, since a mutation replaces a part of the stat with a brand new one, which is the way to get an increase. With a 10% mutation chance you get very good horses with some hundreds of breedings, with a 1% chance it takes thousands. Some examples how long it would take to reach good average stats with 10% mutation per gene (without having information about the genes):
0.50, 1
0.55, 3
0.60, 6
0.65, 11
0.70, 22
0.75, 32
0.80, 46
0.85, 84
0.90, 162
0.95, 345
A perfect score is still unattainable. For the record, this picture
[media]shows the same numbers for regular breeding.
P.S. Making breeding useless is a dumb way to encourage exploring.
That was unfortunate. I haven't updated the page. I was referring to your old suggestion.
It should be just as easy to breed a perfect horse as it is to get a other things in the game e.g. diamonds or horse armor etc. Horses die fast and if a breeder wants to have a perfect horse of every color he is still going to waste a lot of time on breeding. Exploring the map is also far more enjoyable on a fast horse than it would be when traveling in order to find a fast horse.
Quoting @unknown:
This bug report and the nagging about mediocre horses affirms my perception, that 99% of the population can't deal with probabilities. At least an above average share of the people in this discussion, know what they are talking about.
Still way too few to enable productive discourse.
Breeding is on average 6 times slower, than finding a new horse, if the time to get a new horse is the same. That's a good thing in my opinion, because it encourages exploring. Right now the odds to find a spawned horse with a certain attribute, that is at least 80% of the maximum, is 1:27 and for 90 % 1:222.
That's alright, the difference between 80 and 90% isn't that big. If somebody really wants a very fast or high jumping horse, he has to work for it.
You're using linear percentages now, when we've almost exclusively used wild percentiles for comparison. 80% between min and max is around the 97th wild percentile as you even say yourself. That's already nigh on impossible to attain by breeding. I'm not sure why you bring 90% or the >99.5th wild percentile into it. It's too far-fetched to even suggest. Look at the values coming out of breeding.
In my opinion, the system as it is, is almost perfect and resembles real life, where it is extremly unlikely, that a horse is a world class jumper and runner at the same time and the offspring of two very talented individuals, almost never exceeds their parents.
Those world-class horses were still born to parents. Maybe those parents were mediocre and their foal was a lucky accident. Well, that doesn't happen in Minecraft at all. No way to create them even though they are relatively abundant somehow.
Something else I should mention (hi @unknown, who just beat me to it!) is that the player is and should be overpowered in the game. The whole point of the game is to enable the player to change the world as they see fit. You can dig faster with your hands than you can with big machines in real life. You can carry over 2000 cubic meters of material in your pockets, and we still think they fill up too fast. There are only a few things that take an extreme amount of effort, but that are at least doable unlike real life, like building a diamond house. Why should a good horse, of all things, be even more expensive? Sure, make it hard. Just not this impossible and nonsensical grindfest.
I just realized why the current system is wrong and why the 3-gene solution is the only sensible way to combine the stats without skewing the distribution.
The stats are a sum of three uniform random variables (well, health only has two but there's no reason why it shouldn't also have three). They follow a uniform sum / Irwin-Hall distribution. With any kind of formula that combines the two parents' stats the result is not from the same distribution - it's from a sum of at least 6 random variables, which after scaling has a smaller variance (i.e. more average values). The current formula yields foals that have stats that are a sum of 9 random variables (2 parents and the third horse). This picture shows this effect:
[media]The only way to get foals that have stats from the same distribution as their parents is to ensure the formula is a combination of only three uniform random variates. This means using only one parent value without adding random numbers (this doesn't have any randomness besides the choice of parent), making a totally new unrelated stat (foals are essentially wild horses), or choosing three from the original 6 of the random numbers the parents got plus possibly new unrelated random variables a.k.a. mutations (the 3-gene system).
There are a few ways to select the three but the suggested system (select each of the three randomly from either parent and in ~10% of cases use a new random number) is nice because the mutation rate can easily be changed. A 10% chance is nice in the sense that approximately one of the total 9 genes is expected to change.
@jonathan
Why should a good horse, of all things, be even more expensive?
Please explain why a 12bps horse, that is attainable by breeding with moderate effort, isn't a good horse? A 14 bps horse isn't much faster and isn't more OP. If you really think a 12 bps horse isn't a good horse you must be driven by your compulsive perfectionism and can't deal with it properly.
@jonathan
Those world-class horses were still born to parents. Maybe those parents were mediocre and their foal was a lucky accident. Well, that doesn't happen in Minecraft at all. No way to create them even though they are relatively abundant somehow.
World class horses aren't born from average horses, just like in Minecraft. The current system resembles this.
@ Altti Tammi
Your explanation isn't totally correct. The resulting foal is a combination of three random values and two fixed values of the parents. Fixed because the player chooses the horses he breeds with. The graph you showed would be the result of two random horses, that breed a foal. That's not applicable in this case, because the player chooses the horses he breeds with. If the parents have influence on the foal, then the cumulative distribution function must be narrower than of a completely random horse. There's no way around that.
Wouldn't it be the easiest way to give bred horses an uninheritable 10% bonus, if you really want to make breeding more attractive?
@unknown: Could you please refrain from needlessly spamming the comments. The whole point of what is wrong with the formula is that breeding reduces variance, random parents or not.
@Altti Tammi. Are you sure that a completely new system is really necessary? In principle, the current system works, despite the fact that breeding higher quality horses becomes unreasonably difficult at some point. How about leaving the basic system as it is and introduce a small mutation that increases as the parent's stats get higher? That way, things will be kept simple and tweakable for mojang, breeding higher end horses will be doable (by the grace of mojang), and the system would only significantly affect the high end horses. Here's my suggestion for such a sytem:
(pA+pB+pR)/3 + F/(2*pMAX - (pA+pB)) where F is a random error with a small interval around 0. The whole second term is random mutation that is likely to be larger as pA and pB approach their maximum values.
Also, as for being able to track progress in vanilla, I suggest rounding the jump statistic to the nearest 0.125 multiple (a layer of snow). That will enable people to accurately check the horses jump statistic by jumping over obstacles. Speed is already easily recorded with a redstone racing track (the longer the track, the most accurate the statistic) so it really does not need to change. Health also seems pretty straightforward and not in need of a change.
Reducing variance is the whole point of breeding. The formula is fine, the way it is and the breeding system is not bugged. Please stop posting your overcomplicated suggestions and incorrect explanations. That doesn't belong here.
Patrick you may think that the breeding is fine but the devs have already said that the system doesn't work as intended and they plan on changing it. What we are doing here is discussing possible new formulas for them.
@unknown: I know changing the system is necessary. The current system doesn't work even in principle because if you happen to lose high-stat horses you can't overcome your loss. The formula you mentioned won't work for reasons mentioned before. The system I mentioned is actually the exact opposite of a completely new system - it's essentially using the same formula for wild horses and bred horses. The only thing changed is that the values used to generate a horse are kept and inherited instead of discarded.
Jump strength isn't the same as jump height because gravity affects jump height. If you are an op, you can already get the exact stats with the entitydata command.
@Allti
Seems to me that your formula has become measurably more complicated than the ''old'' one, but perhaps I'm just ignorant. Still, don't expect mojang to fix this problem if it can't be done so with just a few lines of code. As for the jumping height/strength difference: then round jump strength statistic to the nearest statistic that corresponds with a 0.125 multiple of jump height. Is that a better resolution?
@unknown: I can't see any point in rounding the stats, the game can handle the numbers and for the player it's precise enough to keep track of the jump height. Anyway, calculating the stat values that correspond to a certain jump heights (simulating gravity) is much more work / code than the suggested breeding formula change. I just can't see any benefit to it. Even health isn't rounded internally.
@unknown Thank you very much for confirming that the slight change works "like a charm" };]
Is more fair, but still remains a challenge.
@all: If Horse Breeding would need no change, Mr. Bergensten wouldn't have assigned himself to this bug.
I sense some negative emotions coming up during the last posts, so please calm down.
I'd like to tell you that I'm testing, breeding and researching the Horses ever since the 1.6 Snapshots.
http://puu.sh/eS0X9/22088a9848.jpg
In April 2015 this will be 2 years realtime already.
In order to figure that Horse breeding is "unfair", maybe one not only needs to be able to read the code and the graphs/distribution properly, but also actually see with their own eyes, or rather handling bajillions of foals with certain stats/abilities, like I do since so long (not the whole time, of course, but often enough).
For me, it's even worse, as I'm aiming for "the perfect Mule" (as you can attach chests to them), which means I've got to have "the perfect donkey" first.
(Don't take the "perfect" too serious - it's more like an approach to very good abilities.)
Wild Donkeys have got (mediocre as for Speed, and quite bad as for Jump Strength) fix abilities/stats, which makes improving them a challenge.
I'd just hope that Mr. Bergensten would briefly explain as of where he stands/how he sees the situation, before this here gets out of hand maybe (I already mentioned the "Bad vibrations").
Mojang has the final say in it anyways, so it would be nice to hear back from them, after soon 2 years, what they think in general, even more after reading through so many comments here.
Kind regards,
Meri
@Altti
Well it's really not though. In vanilla, there's only the jump-over-obstacle method to determine jumping height. The most precise reading involves jumping over snow layers, which are 0.125 in height. If minecraft were to let players have an accurate measurement without having to resort to mods, rounding the jump height would be a way to do it. Also, if calculating the correponding values is too much, then just disconnect the gravity for upward movement all together.
I don't think jump strength should be quantized. It's the breeding system itself that needs changing if you need to know stats with that kind of precision, to make significant but very slow gains slightly faster. Not to mention a primitive but reliable does it make it test isn't limited to multiples of 1/8.
FWIW, here's a table of all testable heights I could conceive of and the jump strengths required to reach them:
1.140625: 0.397402
1.171875: 0.403907
1.187500: 0.407160
1.234375: 0.416877
1.250000: 0.419614
1.265625: 0.422352
1.312500: 0.430564
1.359375: 0.438777
1.375000: 0.441514
1.390625: 0.444251
1.437500: 0.452464
1.484375: 0.460676
1.500000: 0.463414
1.515625: 0.466151
1.562500: 0.474363
1.609375: 0.482576
1.625000: 0.485313
1.640625: 0.488051
1.687500: 0.496263
1.734375: 0.504475
1.750000: 0.506938
1.765625: 0.509307
1.812500: 0.516417
1.828125: 0.518786
1.859375: 0.523526
1.875000: 0.525895
1.890625: 0.528265
1.937500: 0.535374
1.953125: 0.537744
1.984375: 0.542483
2.000000: 0.544853
2.015625: 0.547222
2.046875: 0.551962
2.062500: 0.554331
2.109375: 0.561440
2.125000: 0.563810
2.140625: 0.566180
2.171875: 0.570919
2.187500: 0.573289
2.234375: 0.580398
2.250000: 0.582768
2.265625: 0.585137
2.312500: 0.592246
2.359375: 0.598904
2.375000: 0.600998
2.390625: 0.603092
2.437500: 0.609374
2.484375: 0.615656
2.500000: 0.617750
2.515625: 0.619844
2.562500: 0.626126
2.609375: 0.632408
2.625000: 0.634502
2.640625: 0.636596
2.687500: 0.642878
2.734375: 0.649160
2.750000: 0.651254
2.765625: 0.653348
2.812500: 0.659630
2.828125: 0.661724
2.859375: 0.665911
2.875000: 0.668005
2.890625: 0.670099
2.937500: 0.676381
2.953125: 0.678475
2.984375: 0.682663
3.000000: 0.684757
3.015625: 0.686851
3.046875: 0.690690
3.062500: 0.692570
3.109375: 0.698209
3.125000: 0.700089
3.140625: 0.701968
3.171875: 0.705728
3.187500: 0.707607
3.234375: 0.713246
3.250000: 0.715126
3.265625: 0.717006
3.312500: 0.722645
3.359375: 0.728284
3.375000: 0.730163
3.390625: 0.732043
3.437500: 0.737682
3.484375: 0.743321
3.500000: 0.745201
3.515625: 0.747080
3.562500: 0.752720
3.609375: 0.758359
3.625000: 0.760238
3.640625: 0.762118
3.687500: 0.767757
3.734375: 0.773396
3.750000: 0.775276
3.765625: 0.777155
3.812500: 0.782691
3.828125: 0.784399
3.859375: 0.787816
3.875000: 0.789524
3.890625: 0.791233
3.937500: 0.796358
3.953125: 0.798066
3.984375: 0.801483
4.000000: 0.803191
4.015625: 0.804899
4.046875: 0.808316
4.062500: 0.810024
4.109375: 0.815149
4.125000: 0.816858
4.140625: 0.818566
4.171875: 0.821983
4.187500: 0.823691
4.234375: 0.828816
4.250000: 0.830524
4.265625: 0.832233
4.312500: 0.837358
4.359375: 0.842483
4.375000: 0.844191
4.390625: 0.845899
4.437500: 0.851024
4.484375: 0.856149
4.500000: 0.857858
4.515625: 0.859566
4.562500: 0.864691
4.609375: 0.869816
4.625000: 0.871524
4.640625: 0.873233
4.687500: 0.878297
4.734375: 0.883001
4.750000: 0.884570
4.765625: 0.886138
4.812500: 0.890843
4.828125: 0.892411
4.859375: 0.895547
4.875000: 0.897115
4.890625: 0.898684
4.937500: 0.903388
4.953125: 0.904957
4.984375: 0.908093
5.000000: 0.909661
5.015625: 0.911230
5.046875: 0.914366
5.062500: 0.915934
5.109375: 0.920639
5.125000: 0.922207
5.140625: 0.923775
5.171875: 0.926912
5.187500: 0.928480
5.234375: 0.933185
5.250000: 0.934753
5.265625: 0.936321
5.312500: 0.941026
5.359375: 0.945731
5.375000: 0.947299
5.390625: 0.948867
5.437500: 0.953572
5.484375: 0.958277
5.500000: 0.959845
5.515625: 0.961413
5.562500: 0.966118
5.609375: 0.970822
5.625000: 0.972391
5.640625: 0.973959
5.687500: 0.978430
5.734375: 0.982785
5.750000: 0.984236
5.765625: 0.985688
5.812500: 0.990043
5.828125: 0.991494
5.859375: 0.994397
5.875000: 0.995849
5.890625: 0.997301
5.937500: 1.001655
These values should work as is because I rounded up. There are innumerable ways to test with even more granularity with the same reliability, by the way. Be inventive.
but the devs have already said that the system doesn't work as intended and they plan on changing it. What we are doing here is discussing possible new formulas for them.
I haven't seen the mods post. It's kind of buried. didn't catch it while scanning through the comments. I have seen this discussion under a false aspect.
I can't read java and don't understand Altti's suggestion fully. But I don't think that using the same distribution function for wild and bred horses can be a solution either, because horses won't pass on their traits. The easiest way to broaden the variance when breeding, would be using less variables for the foal. Just use one variable instead of three for the third horse. For example speed: Instead (h1 + h2 + 1/4(0.45+ (0.3 x rnd + 0.3 x rnd +0,3 x rnd)))/3 use (h1 + h2 + 1/4(0.45 + 0,9 x rnd)/3. Even if you have two 90% horses (single category), you would have 10% chance of improving. Expected value after 100 times breeding, starting with average horses, would be 93%. I guess Altti suggests something similar, but more complicated.
In vanilla, there's only the jump-over-obstacle method to determine jumping height. The most precise reading involves jumping over snow layers, which are 0.125 in height
That's not correct. You could use carpets to narrow it down to 0.0625 block margin, or use leaping potions for an even more accurate result.
https://www.youtube.com/watch?v=pfRZ670j8wI
Also I can't see any benefit to rounding as well.
@ Patrick I hadn't thought about potions of leaping, I stand corrected! Oh and carpets only get you so far as they need to be placed on a full block. Anyway, I guess that makes measurements accurate to the point that rounding is not really needed.
@ Jonathan You've inspired me to think of another way to measure jump height, and I think I've come up with something pretty neat.
To accurately measure horse speed, health and jump realtime without any discreptancies I use a mod called http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1291893-zyins-hud I have tested all available speedometers and none ever end up being accurate enough.
@unknown: Horses can and will pass on their stats. Wild and bred horses aren't sampled with the same function but the results have matching mean and variance.
Here's how the stats are essentially generated (excluding scaling and offsetting):
U = random number from 0 to 1
Wildhorse = { speed = U + U + U, health = U + U, jump = U + U + U }
My suggestion is to remember these U values:
Parent_A = { speed = U + U + U, health = U + U + U, jump = U + U + U }
^
| Child gets always one of these randomly. 10% chance to get new value.
v
Parent_B = { speed = U + U + U, health = U + U + U, jump = U + U + U } //added third U to health because why not
I have tried your suggestion before and it won't work for reasons mentioned here, unless you give the uniform random part a multiplier so high it diminishes the parents almost completely. Here's how it would affect a random population: http://i.imgur.com/43Xn6v2.png (I believe the effect on the distribution of a random population is the only viable metric with which to measure how good the breeding is because the formula would have to explain how wild horses breed. Looking at what the player does is irrelevant because the player introduces all sorts of bias.)
P.S. Nice trick with the leaping potions.
I suggested that a population should reach equilibrium when its individuals procreate and die according to a particular pattern. That doesn't require foals to inherit nothing. It just all needs to add up. When you start meddling as a player, it shouldn't be hard to match and exceed wild horses because it can be assumed that you have a better food supply and all that. Your horses can gain costly traits that are useful to you but would be wasteful in the wild, and vice versa. You can also discard the bottom bracket from your local gene pool.
I'm now really tempted to want something simple. Anything to end this. Anything that's somewhat reasonable and above all empowers the player. Allow the player to reach the upper end of wild horses with reasonable effort. With significant effort you could possibly exceed their max by a small amount. Only near the top should it become devilishly difficult, so racers can gain a small edge that might win a race without making anyone else too jealous.
As for my previous post, I missed a few blocks and obviously didn't include those inventive tricks like two levels of Jump Boost and blocks with unique physical properties. But that isn't important. The point was to show that much more precise measurements are possible.
I made a proof of concept mod for Minecraft 1.8 for testing the suggested formula
This naturally keeps the population at the equilibrium, since now bred horses are now calculated in the same way as wild horses, only using information from the parent instead of random numbers.
Here is an "action shot" from a test run, showing the fourth foal of two parents (the first one to show a mutation).
I want to revisit the idea of rounding the statistics. If the statistics were to be rounded (the actual values, that is), then it could benefit the breeding process in two major ways: First, horses are noticeably different from (or equal to) each other. This means we don't need mods to be effective breeders (yes having to resort to mods is a bad thing) and we also don't need to be jumping over enderportals and cacti while splashing our horses with potions. Second, the probability of breeding better offspring increases at every level. Also, the probability of breeding equally good offspring increases.
Breeding example with two identical horses:
with rounding to multiples of 1
80 80 0-100 odds of improving stats --> 0.185^3 + 0.185^2*0.03*3 +0.185*0.03^2*3
80 80 0-100
80 80 0-100
= 0.006331625 + 0.00308025 + 0.0004995 = 0.009911375
Chance of equal stats 0.03^3 = 0.000027
Equal or better= 0.009938375
with rounding to multiples of 2
80 80 0-100 odds of improving stats --> 0.17^3 + 0.17^2*0.06*3 +0.17*0.06^2*3
80 80 0-100
80 80 0-100
= 0.004913 + 0.005202 + 0.001836 = 0.011951
Chance of equal stats 0.06^3 = 0.000216
Equal or better= 0.012167
with rounding to multiples of 10
80 80 0-100 odds of improving stats --> 0.05^3 + 0.05^2*0.3*3 +0.05*0.3^2*3
80 80 0-100
80 80 0-100
= 0.000125 + 0.00225 + 0.0135 = 0.015875
Chance of equal stats = 0.027
Equal or better = 0.027+ 0.015875 = 0.042875
without rounding
80 80 0-100 odds of improving stats --> 0.2^3 + 0.2^2*0.03*3 +0.185*0.03^2*3 = 0.008
80 80 0-100
80 80 0-100
odds of improving any of the stats by at least 1 --> 0.18^3 + 0.18^2*0.02*3 + 0.18*0.02^2*3
= 0.005832 + 0.001944 + 0.000216 = 0.007992
Chance of equal stats: n/a
-
The odds improve as the chance to retain the parent's statistics increases. New horses will be more significantly better or worse compared to the current system. With rounding to multiples of 10 (just for illustration purposes), breeding two 80% horses gives a 1.6% chance of producing a foal that is at least 83.33%. The larger the multiple becomes though, the larger the gap between breedable values and the perfect ones. Perfection can then only be achieved by finding the perfect stats in the wild. Still, breeding should become more rewarding and less tedious if the statistics were rounded.
And for all this, the ''old'' formula does not need to be changed.
@unknown: I think your wanting to quantize the stats because you are bothered by not having perfect information is besides the point of this bug report and perhaps should go to the suggestions subreddit. The method you mention seems completely ad-hoc without any statistical basis.
I might add that if you saw my last post, in the example I gave two horses that jumped 2.64 and 2.81 blocks managed to give birth to a horse that jumps 3.96 blocks. The difference can thus be notable without resorting to quantization, if only the breeding formula wasn't wrong.
@Allti
From a mod post:
"The algorithm should be simple, both for performance and so they can understand it, and therefore tweak it as desired.
It should be possible for children to be both better and worse than their parents.
But children should probably be similar to their parents, rather than weighted towards average values.
They're probably not expecting players to breed horses hundreds to times to get decent results.
Most players aren't going to have any way of getting hard numbers about their horses' stats, and will have to rely on their perceptions."
It seems that being able to notice stat difference is a preferable outcome to changing the formula. Furthermore, since this bug report does not technically describe a bug in the first place, offering suggestions for changing the method is appropriate here. Rounding would be so enormously easy compared to your suggestion, and beneficial to breeders that don't use mods and breeders in general.
Most blocks you don't like can be omitted with minimal impact. You start out with 42 testable heights per full block. You'd lose 4 of them if you omitted the end portal and the cactus (because inconvenient blocks are to blame for your breeding experience). That's still close to 200 heights you can test this way, with more jump strength precision at the upper end where you'd likely need it. That's already a quantized extended phenotype much like you suggested earlier, but more granular. Yet you also said a coarser version was a problem because it's too coarse? Also, contrary to your claims, a quantized genotype would only make it approximately impossible to reach the next quantum.
I like @unknown's proof of concept. It's simple indeed, really just the current system broken into pieces. You can more or less transfer between versions, if you fill in plausible genes while loading and keep storing the phenotype while saving. Overall it behaves much better. Horses at extremes will tend to produce similar foals, at the risk of a mutation most likely pulling them toward the average. Still a reasonable chance of improvements. Most average horses become an interesting gene lottery. Intuitive breeding works. If you're observant enough you can infer some information about the genotype and improve your chances. I'd have to playtest it, but it's promising.
@unknown: I especially like how it still encourages exploring and finding new horses, as once you get the best bits of all your horses aligned in a foal, the way to get an increase is a mutation or finding new horses that have good values (not to mention colour). And like your said, even average horses might be a mixture of very good and bad variables.
I have also submitted a formal proof of the current formula being awful in case someone still gets it into their heads that there's nothing wrong.
[media]A mixture of good and bad is pretty much what it means to be average in a normal-like distribution. It's because there are so many combinations of good and bad that lead to the same thing that the average is common. Is there a law which states that things tend to be more elegant when they cause people to spew truisms?
Nice formal proof. It covers a limited scenario (random breeding), but even so the overall stubbornness of the system is apparent.
Code you might use to retrofit genotypes:
void pheno2geno(double[] geno, double pheno) {
double a, b, c;
boolean mirror = pheno > 1.5; // exploit symmetry
if (mirror)
pheno = 3.0 - pheno;
do {
a = this.rand.nextDouble();
b = this.rand.nextDouble();
if (a + b >= 1.0) { // confine to triangle
a = 1.0 - a;
b = 1.0 - b;
}
a *= pheno; // scale triangle so its vertices are this far from the origin
b *= pheno;
c = pheno - a - b; // there are only two degrees of freedom, so the third coordinate is forced
} while (a > 1.0 || b > 1.0 || c > 1.0); // check against the other triangle; the intersection of both is the hexagon
if (mirror) {
a = 1.0 - a;
b = 1.0 - b;
c = 1.0 - c;
}
geno[0] = a;
geno[1] = b;
geno[2] = c;
}
Obviously, pheno = geno[0] + geno[1] + geno[2]. The phenotype is a plane in genotype space. Additionally, all genes are contained within [0, 1]. That clips the plane to a cube, producing various shapes. When pheno = 0 or pheno = 3, it's a point. When 0 < pheno ≤ 1 or 2 ≤ pheno < 3, it's a triangle. When 1 < pheno < 2, it's a hexagon, equal to the intersection of both would-be triangles. Helpfully, the shape is always equal to that intersection.
To find a plausible genotype given a phenotype, you should sample that shape uniformly. I generate a random point on the nearest and smallest triangle, mirroring the space to put it at the side I want. That works for the points and triangles right away. It also almost works for the hexagon, where rejection sampling against the other triangle kicks in to fix it. Because it starts with a point on the smallest triangle, the worst case (pheno = 1.5) is limited to rejecting a third of the time.
It's a little hard to understand but remarkably concise. It'll make old horses fit right in. Worthy, I'd say.
Breeding arbitrary horses is actually the generalized scenario, not a limited one. It's the only way to measure the breeding formula itself is unbiased. The player naturally adds his own bias when he does any kind of selection. You can't eliminate bias from the formula but you can eliminate bias from the player to check if the formula is biased. While you can calculate the variance if you fix the parents, you have no indication of what the true variance should be.
You sampled the points of a cube intersecting a plane of constant values, but I think here's actually a simpler way to retrofit the gene variables for backwards compability (generate three random numbers with a fixed sum).
//aiming for a sum of k
double[] g = Arrays.sort({0.0, k*this.random.nextDouble(), k*this.random.nextDouble(), k});
result = {g[1]-g[0], g[2]-g[1], g[3]-g[2]};
Edit: Nevermind, this can actually just give the cases where the sum is at most the maximum for a single variable (the triangles in your example). Isn't this equal to the contents of your while loop with some scaling?
Scratch the thing about the proof. Not worth bickering over. It's nice and simple (important!) when you get a stable population sans selection, and can easily create new members out of thin air. The extreme ineffectiveness of selective breeding in the current system was demonstrated earlier. We can agree on that.
Your code just generates points on a triangle. It doesn't ensure genes are ≤ 1. It could replace the contents of the loop but not the whole thing. You'd effectively change this:
a = this.rand.nextDouble();
b = this.rand.nextDouble();
if (a + b >= 1.0) { // confine to triangle
a = 1.0 - a;
b = 1.0 - b;
}
to this:
a = this.rand.nextDouble();
b = this.rand.nextDouble();
if (a > b) { // swap any way you like
c = a;
a = b;
b = c;
}
b -= a;
We both start with a point on the unit square. My version splits it into triangles at a + b = 1, and flips the point over to the other triangle if it's in the wrong one. Your version splits at a = b, and skews either triangle to become the triangle we want. Even though there's no real difference, I prefer yours because of the way it generalizes and spreads the half-open intervals (OCD?).
@Jonathan&Allti
Don't you worry about my breeding experience, everything is going just dandy. All I'm trying to do is help figure out a reasonable solution to this barely significant problem. I'm obviously not as well into the material as you guys, but I can tell you one thing: your solutions are likely to be too complicated for mojang to bother with. Anyway, I've been reading some of the previous posts and I've come across something that I've possibly completely misunderstood: In the breeding formula (Pa+Pb+New)/3 , is the ''New'' variable actually calculated using three random variables (i.e. the same way a wild horse in generated)? If so, what is the logic behind that and wouldn't the strong tendency towards the average be offset if the ''New'' variable were to be calculated using only one random variable?
@unknown: The code might look scary, but conceptually it's the easiest thing one could ever think of and there is already working code for Mojang to copypaste. What we were just talking about is a way to create the values for old horses that have lost the needed information, which would be nice but in the end is optional. Think of it as creating fairly three dice rolls that have a certain sum.
Yes, the New is calculated with three random variables and no, even calculating the "New" with just one variable wouldn't work. It came up before here
I might have to make a picture tutorial of the suggested system to make the concept more clear.
This isn't complicated at all. The complexity of the system remains about the same. It's like you've never seen code that performs a meaningful task. Don't you think the existing system is complicated, when you see the code that makes it tick? It's unfortunate that some extra code is needed to ease the transition, but that's just a few lines to make it seamless. It doesn't get much better.
@Allti. I understand your alternative, Im just not a fan I'm afraid. Introducing your system might be well possible, but far from practical. For example, how would already generated horses be treated after introducing this new system? Are their ''U'' values retrievable, or should they be assigned new ones? Oh and the graph illustrating why it is ineffective to use one random variable for the ''New'' statistic, does not add up for me. As I understand it, your argument is that, either way, the foal is the result from 2*3 (parents) + 1 or 3 (wild horse) random variables, hence reducing variance. Yet, if you breed, the parents' stats don't get recalculated: they are set and (usually) known. Therefore, comparing foals variance for an indefinite number of breeds seems out of place. Do correct me if I'm wrong, but, for any one breed, the variance of the foal's stats should be the same, right?
Edit: seems like I accidentally stumbled upon an emoticon
@unknown: Previously generated horses can be given a default U-value of 0.5 if backwards compability isn't needed, given three equal U values corresponding to their stat or creating new correct values what is what the algorithm @unknown posted today does and is what we have discussed today. Here I have dwelled on the issue of why it's more relevant to look what the formula does on an arbitrary horse rather than check one set of known parents. I just wanted to show the limit but what matters more is the drop from generation 0 to generation 1. The limit is what you get if your horses have regular accidents.
The graph shows that using one random variable loses variance. I can mention that it would work if the one random variable was given a multiplier of 2.5 and the parents 1 both. But this would mean that bred horses are essentially completely generated anew, which would discourage exploration and make foals look a lot less their parents.
I'll just add that if we look at just a fixed breeding, that variance doesn't really matter - it's always the same since it comes from the fixed random part. What matters there is the expected value that is dependent on the chosen parents and whether it is too bad or too good. The problem is that you can't easily tell what that expected value should be because it depends on the chosen parents. Variance is just a mathematical tool that tells the expected (squared) difference from the mean and it's simple to calculate. If the variance after the breeding doesn't match with the variance before the breeding, we can tell that the formula overall gives values that are too near to or far from the mean.
@Altti Using one random variable instead of the weighted average of three is supposed to result in less variance, how exactly? Using one random variable and fixing the parent's stats, you'll find that the variance actually triples vis-à-vis the current formula.
Here's the result of a quick simulation. I fixed the parents average stat at 0.5, but any other fixed value won't affect the distribution one bit, obviously. The first variable resembles wild horses, the second variable are bred horses under the current system, the third are bred horses under the alternative.
Descriptive Statistics
________________ N Min Max Mean Std.Dev. Variance
Wild_generation 10000 .17 .84 .4994 .09451 .009
bred_0.5__prnts 10000 .39 .62 .5005 .03213 .001
0.5_prnts_1_rnd 10000 .34 .66 .5008 .05561 .003
Edit: tried to align the table somewhat better.
@unknown: We can prove it in a similar manner than we can prove the current system doesn't preserve variance.
@Altti. We are making two different points here. I pointed out that, vis-à-vis the current system, using one random variable increases variance. You deduce that, either way, the variance is below that of wild horses. I'd like to ask: so what? It makes perfect sense that the variance would be lower in a system where two-thirds of the weighted average value is fixed. On a different note, I'd like to share my current breeding results to illustrate that breeding, despite popular claims, is rewarding after all. Here are the normalized values of my eight best horses (my entire current stock) after 508 breds:
Normalized Horse*
0.7429
0.7221
0.7221
0.7117
0.7117
0.7155
0.6919
0.7196
*All observed values are rounded down, so these are conservative estimates.
Just to put the breeding mechanics into perspective: You'd have about a one in 150 chance to find a 0.70+ horse in the wild. As for my entire collection, the wild horses you'd have to find would be well over 1000. On my current world, I've explored about 2000 blocks in any direction (excluding a couple of remote locations I've ventured to through nether portals). All in all I've found some 8 horses (two herds, to be exact)... Well, you get the picture.
Edit: I might also mention that my breeding methods are far from efficient horse wise (rather, it's more focused on time/effort efficiency). I usually breed in herds of 4-8 (depending on the quality gap) and about 4 out of 5 horses never make it out of the pen (they fail the health and jump minimum requirements). The other horses get a thorough testing, but everything is done without mods so a certain margin of error remains. The whole process spits out some 20-40 horses per hour.
> I pointed out that, vis-à-vis the current system, using one random variable increases variance.
Yes, I did that too. I also pointed out that it increases it enough if you give it a multiplier of 2.414, but whether that would be good is up for debate.
> It makes perfect sense that the variance would be lower in a system where two-thirds of the weighted average value is fixed.
Variance of a single breeding isn't the same as the variance of the population. There's variance in a single breeding in the suggested system too which comes from the pool of available genes. Variance of the population is the expected difference from the mean, weighted by how likely the parents' stats are.
I can give a million awful, degenerate formulas that would give you a similar chance of improvement, but that doesn't mean one would "work" in any sense. Here's one:
if (random() < chanceToGetEqualWildHorse) then return stat*1.0000001 else return minStatValue
You can't tell if a formula works if you haven't given a proper metric to evaluate one.
@Altti. Again, determining how much variance should be retained is completely subjective.It is fair (also subjective, clearly) to look at individual breeding instead of population breeding, since the debate is about whether the current formula is sufficient to allow for improvements through selective breeding. The question is also whether you should be realistically able to improve along the entire range of qualities (should it be possible to approach a normalized value of 1?) Personally, I think that the formula is already effective (see my own results) and that any improvements in the formula are only warranted if the effort to implemented such improvement is very low. I also think that implementing your alternative system is not an example of such low effort. Anyway, all in all, I think I've made all the points I wanted to make in this thread. Any further back and forth will likely be repetitive, so I'll release you of the burden of replying to my clear nonsense. Still, I hope that you'll keep in mind that there is such a thing as over complicated solutions to minor problems and that any change you suggest should weigh of the costs/benefits from a wider Minecraft perspective.
@unknown: I took the time to add your formula to add backwards compatibility to the proof of concept mod implementing the suggested changes.
Btw, any idea on how to incorporate donkeys too to make donkey breeding make more sense than it does now?
@unknown: Nice.
Donkeys are just weird. They spawn with fixed stats but somehow breed normally. Preserve that behavior for now, I guess. For any stat that should be fixed, set the phenotype and run pheno2geno.
Speaking of pheno2geno, here's a generalized version that can work for different numbers of genes (as long as it doesn't end up rejecting too often):
void pheno2geno(double[] geno, double pheno) {
// Mirroring is the simplest way to bound rejection sampling.
// The way it interacts also obviates the need for range checks.
boolean mirror = pheno > 0.5 * geno.length;
if (mirror)
pheno = geno.length - pheno;
generateAndCheck: while (true) {
// Generate non-negative random numbers that add up to pheno.
for (int i = 0; i < geno.length - 1; ++i)
geno[i] = pheno * this.rand.nextDouble();
geno[geno.length - 1] = pheno;
Arrays.sort(geno);
for (int i = geno.length - 1; i > 0; --i)
geno[i] -= geno[i - 1];
// Make sure each value is in range, as if the loop is:
// do { ... } while (geno[0] > 1.0 || ... || geno[geno.length - 1] > 1.0);
for (int i = 0; i < geno.length; ++i)
if (geno[i] > 1.0)
continue generateAndCheck;
break;
}
if (mirror)
for (int i = 0; i < geno.length; ++i)
geno[i] = 1.0 - geno[i];
}
But above all I changed the description. I think it's a little too hard to visualize for most. It didn't help that I didn't describe it very well. I'd do a better job now, but we'd be talking about simplices and such now that it's been generalized. Not helpful to most of you, I presume.
I'll probably be less active for the time being; sensory overload broke me.
Yes, exactly, that's what I was saying a couple of times, that Donkeys do have fix abilities in Speed and Jump Strength.
Hence why it's so hard to breed out a really good Donkey to be able to create an awesome Mule, with a really good Horse that has to be bred out as well firstly.
I sort of like that I can know all abilities values of wild Donkeys in MC Vanilla though.
Thanks guys by the way for all the effort and thought you put in here!
I hope one of the Mojang devs will say something about it sometime.
So, what do we do about donkeys? In both the current system and the proposed system they start out weaker than most horses, but if you breed to overcome the initial weakness they're equivalent. Eventually, the only difference is that horses can wear armor whereas donkeys can carry cargo.
At that point mules are just sterile donkeys. I guess the mule advantage is that you can get a 'faster donkey' before you get an actual faster donkey. There's no lasting difference once your mules are so good that the donkeys must be equally good.
Shouldn't there be more differentiation? Maybe generate the phenotype differently for each? We need some conscious choices even though this isn't strictly part of the bug. It's such a bizarre thing demanding awkward workarounds.
Right now donkeys have a jump strength of 0.5 from a range of 0.4 to 1.0. It might be sensible to give them a genotype that gives them stats from the range [0.4…0.6] and similarly for speed. Breeding donkeys would give a mix of these and a mutating gene would have a value from the same range. This way donkeys' stats would stay in the same range over time. (I do think all bad breeding mechanisms should go under this bug. Donkeys getting a stat of (donkey+donkey+horse)/3 counts as one.) Mules would then get a random mix of horse and donkey genes, giving them stats between the two. They can't breed so inheritance of their genotype isn't a problem.
(It would be nice if the stats were calculated as a sum of four uniform random variables instead of three, because then we could have pairs of variables from which one could come from each parent, similar to how dna works. This would guarantee that each parent gives the same amount of genes and that mules get two donkey genes and two horse genes. The downside is that the stats would overall be slightly more average if the range isn't changed.)
Still an issue in 1.8.4.
Can anyone confirm this for 15w31a
Some javap output for 15w31c:
324: aload_0
325: getstatic #675 // Field wl.d:Lqk;
328: invokevirtual #578 // Method a:(Lqk;)Lql;
331: invokeinterface #1118, 1 // InterfaceMethod ql.b:()D
336: aload_1
337: getstatic #675 // Field wl.d:Lqk;
340: invokevirtual #1160 // Method po.a:(Lqk;)Lql;
343: invokeinterface #1118, 1 // InterfaceMethod ql.b:()D
348: dadd
349: aload_0
350: invokespecial #1171 // Method dz:()D
353: dadd
354: dstore 11
356: aload_3
357: getstatic #675 // Field wl.d:Lqk;
360: invokevirtual #578 // Method a:(Lqk;)Lql;
363: dload 11
365: ldc2_w #1164 // double 3.0d
368: ddiv
369: invokeinterface #673, 3 // InterfaceMethod ql.a:(D)V
I don't know why I didn't just decompile it. In case it helps you, that would look like this:
double tmp = this.a(wl.d).b() + mate.a(wl.d).b() + this.dz();
child.a(wl.d).a(tmp / 3.0);
This is exactly the old formula we know and hate. ;-P
Affects 15w42a, Also the feeding system should be homogenized with the other mobs (right click with breeding items and will show the green 4-point stars of growth).
Affects 15w47c
Just in case someone will still want to try some new algorithms.
The algorithm should be simple, both for performance and so they can understand it, and therefore tweak it as desired.
You should safely ignore the performance part, unless single execution takes more than 10ms per breed. Players are not going to breed 100's or even 10's of horses per second to make the performance an issue. (And if performance really was an issue, there are tons of more effective places to concentrate fixing code, like monster path finding, which Mojang was happily slacking with, probably still is.) Basically, you could make something as silly as an algorithm that, for each breeding, rolls 10000 horses with a naive algorithm, calculates the (same) distribution of the results (every time again!), modifies that distribution to produce nice skew (which varies depending on the parents), and then rolls the final result with that modified distribution. Yet even a crappy 5 years old mobile phone wouldn't hiccup. Unless you did something stupid with the code, like holding all the 10000 horses in memory at once. Well, the phone would probably handle even that.
Of course, nothing wrong making an efficient algorithm. Who knows, maybe someone makes a redstone breeding machine, churning out 100's every second... (Oh wait, better fix the fence-issue properly first, hint hint.)
But the "understand"-part is definitely important.
Put both together: Should not be a problem to use common statistics/probability/random distribution functions (which can sometimes be a bit hefty) as long as the functions exist as own well documented methods (like java's own Math.sin() etc.) After all, these simplified breeding things are something that would nicely match with (relatively) well known functions, like skewed gaussian or exponentially modified gaussian. (Just look at their shapes in wikipedia, you'll get the idea.) There are other functions I've seen over the years, some especially suited for this case, but too many years and I've forgotten the names of most of them. I leave finding them as an exercise for the more interested parties.
The resulting "end-user code" could then be more like (pseudo-code) "newStat = skewedFunc(averageParents(parent1, parent2), aBalancingConstantFoundByTrialAndError)". Very readable, unless one wants to try and tweak that skewedFunc; I highly recommend against such unless having background both with university level math and coding. (I'm sure the final algorithm version would not be quite that short, but it should be possible to split it into well named steps that tell exactly what each step and value is doing, so that while the algorithm would stay the same, the values can be easily adjusted for balance.)
Sure, trying to use just rnd(), plus, minus, division, etc. can be used to produce good enough results, but the resulting code of the combination of them won't likely be any more understandable, in the way that e.g. what would happen if someone adds a "+1" there, or what needs to be changed to shift the results towards easier, etc. Just consider this bug report and comments; the original code is pretty much simplest choice one could have taken to approach a solution, yet it took a lot thinking and testing and math to figure out that it indeed works badly, how it actually works, and then why it ends up working very badly. And even more thinking to try and change it for better.
Just my half-a-cent, I never liked that subsection of math anyway. But coding and performance I know plenty. So yeah, one can mostly ignore the performance stuff for this case. (Not so for monsters (zombies) and their path finding, hint hint.)
What are you trying to say? We've been over that.
Keep in mind that 'statistics functions' tend to be the limit of a simple process. A normal distribution emerges from a random walk, for instance. To pick something more relevant to the problem, alpha blending is a statistical agglomerate of coverage masks, that becomes quite pathological when said coverage masks are correlated. Using this sort of thing as a primitive isn't always a good idea. It's often better to model an underlying process from which desirable behavior emerges. More so when the discrete nature is desirable.
The anniversary of @unknown's cracking an egg of Columbus and my polishing it is coming up. Is anything ever going to happen?
I think I was quite clear: performance will not likely be an issue. The distribution function examples were just that, examples about what is possible when the ultimate performance is not considered. Properly chosen distribution functions and properly applying them to values derived from the parents should lead to as good result as with any solution, and can lead to either better results or better efficiency in some cases. I don't have enough expertise on them to do it myself (at least with reasonable effort, and this should be the devs' headache anyway, they get paid for it, we don't).
I have personally nothing against the gene-based solution that had been brewed up. Even if some descriptions of statistics has been somewhat incorrect or at least using wrong terms, giving incorrect reasons for choosing the genes solutions. Wrong reasoning aside, results can still be good (sort of wrong proof but correct result). I'd probably have gone the same gene-route myself, since it is somewhat easy to understand and leads to good results (or at least vastly better results than the current algorithm). (Though it might be more difficult to adjust for balance, but again, easier to adjust than current algorithm.) I agree on what you said: "It's often better to model an underlying process from which desirable behavior emerges. More so when the discrete nature is desirable."
But I do not think that it is necessarily the best solution. That is, like I started, "Just in case someone will still want to try some new algorithms"
(I didn't read every single line of comments, but those I did, this performance requirement was not debunked, and I did not notice lots of talk about using existing distribution functions, some of which are derived from and for cases like this. So, if you indeed you have been over that already, link the particular comments, please, I'll happily edit out the unnecessary crap/noise I may have added.)
("The anniversary of Altti Tammi's cracking an egg of Columbus and my polishing it is coming up. Is anything ever going to happen?" I'm watching another issue for which I provided source code fixes first time something like closer to 5 years ago; I'm probably already messing up with the year count, but I had already submitted the fixes on the previous two "official" bug reporting/ignorance sites before this JIRA... And several other issues that are also multi-year old, with fixes provided... I'm not having much hopes on any issue any more.)
A while ago, I thought of an alternative way to adjust the horse breeding mechanic to make it possible to get above-average horses with a fairly simple change: leave the resulting stats as (Pa+Pb+Random)/3, but make Random be based on what food you used to breed the horses.
In particular, golden carrots could retain the same behavior as before, while golden apples could increase Random's minimum value by some amount. Ideally, you'd have to give better food to both parents in order to get the maximum benefit (e.g. 2x golden carrot could give 0.0-1.0, golden carrot + golden apple could give 0.1-1.0, and 2x golden apple could give 0.2-1.0).
Enchanted golden apples could increase it even further, possibly even guaranteeing a "perfect" breed (e.g. Random=1), but that might be unbalanced for worlds imported from 1.8 or earlier (when it was still possible to craft them using 8 gold blocks - expensive, but still farmable) - with enough resources, players could potentially breed a super-horse with all of its stats maxed out, but that would likely require dozens of Notch apples.
I haven't seen this sort of idea suggested here yet (though it's possible I missed it), and I'm sure it has all sorts of flaws (since I haven't done all of the math to fully analyze it), but at the very least it might be possible to incorporate it into some of the other suggestions that have already been posted here.
My suggested fix for the formula of horse breeding.
(pA+pB+pC)/3=Child Stat
(pA+pB)/2*R
pA=Parent A
pB=Parent B
R=Random # between 0.x and 1.x (to limit variability of child scores from parents, I suggest 10%[0.9 to 1.1] or 20%[0.8 to 1.2])
Lets go with Block Jump
Parent A = 3 Blocks
Parent B = 4 Blocks
R = 1.05
(pA+pB)/2*R
(3+4)/2*1.05
Child has Jump of 3.675
Is this still an issue on the latest snapshot 16w44a?
Affects 16w44a. In case people are interested, there was some refactoring. The class called xk handles breeding. Subclasses are horse (xm), skeleton horse (xq) and llama (xo).
Is this still an issue in the most recent versions (currently that is 1.12) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time. If you are the owner/reporter of this ticket, you can modify the affected version(s) yourself.
Confirmed for 1.12.
I just conducted a couple of test series and it's still the same like since the MC 1.6 snapshots:
Abilities Parent A + B + (ominous unknown) C = Foal's abilities
No matter whether the parents had high stats or not, it's rare that the foal can surpass at least one of its parents' abilities (health, speed, jump strength); in my test series only one single foal surpassed both of its parents in one single category (speed), overall there seems to be still a preference for an "averaging" of the foals' abilities between Parent A and B.
I recall there are plenty of suggestions in this thread, some of them very elaborate; but to simplify it from my perspective:
If that "ominous Parent C" could either completely be taken out of the equation, or at the very least have stats that reflect both parents' ability stats, to take also real life breeding into account where certain sought-after abilities are inherited by offsprings, then this could help in having foals that can actually surpass both parents in all abilities, at least in a few of all breeding attempts.
For now you cannot breed out such a better foal, it's still better to not breed at all (with the exception of breeding for mules to have the best of both worlds, chested horse) and instead go hunting wild/new horses with better stats.
I've verified that the threesome routine still exists in 1.12's code. That will be all until it's clear this report isn't just a black hole where our combined efforts disappear.
Confirmed for 1.12.1.
Does this affect 1.13-pre6? If so, update the issue accordingly, because I have not the slightest clue how to reproduce this easily.
Confirmed for 1.13.1.
Confirmed for 19w07a
Confirmed for 1.14.4 and 1.15.2
This Bug is relevant because it makes the horse breeding system useless. Even removing it and just generating the foal like a wild horse, without taking the parents into account, would be more acceptable than how it is now. Having to breed two slightly-above-average horses 200 times to get one that is slightly better is ridiculous.
Another major consequence of this bug is that you can not even breed an equally good replacement horse, if you found a good one.
My proposed solution:
(Disclaimer: i don't care how you change it, every new formula that makes breeding an actual useful thing to do would be a fix.)
1. Change the random third horse to be clearly above average. i.e. make it able to have a jump strength that equals a height of 6 blocks (note that no resulting foal would ever be able to jump 6 blocks, because the parents are always worse)
2. Increase the weight of the parents. i.e. ((pA + pB)*2 + pRandom) / 5
This would make it possible to selectively breed a decent horse. With much effort you might be able to get one that's better than the best possible wild horse, just as it should be. But it still wouldn't be over powered, because 0.5 bps faster or 0.1 block higher wouldn't realistically make a difference in gameplay. And the foal would be closer to it's parents, which makes it possible to breed a replacement if you already own two good horses.
Is there any way to reliably test for the presence of this bug in vanilla Minecraft? I'd like to be able to keep tabs on it
@unknown People likely got different methods, mods to see HorseStats are one way, of course those usually don't work in snapshots.
What you could do is to summon horses with fix specific stats, breed them, and look into the foles' outcomes, e.g. manually via data get entity, or you create/use a datapack which would show you horses' stats.
With that approach, you would amass enough values to be somewhat sure that the Status Quo is still the same as described in the bugpost.
That being said, as long as nothing in the code itself regarding Horses would be changed, the way a fole's stats' outcome is calculated by the game should logically usually always remain the same.
@MacchuPicchu the problem is with the math. A way to keep tabs is to decompile MC source code with e.g. DecompilerMC and open file server/net/minecraft/world/entity/animal/horse/AbstractHorse.java
The problem is this part (this is from 1.18.2, but it's the same it has always been):
protected void setOffspringAttributes(AgeableMob ageableMob, AbstractHorse abstractHorse)
double d = this.getAttributeBaseValue(Attributes.MAX_HEALTH) + ageableMob.getAttributeBaseValue(Attributes.MAX_HEALTH) + (double)this.generateRandomMaxHealth(); abstractHorse.getAttribute(Attributes.MAX_HEALTH).setBaseValue(d / 3.0); double d2 = this.getAttributeBaseValue(Attributes.JUMP_STRENGTH) + ageableMob.getAttributeBaseValue(Attributes.JUMP_STRENGTH) + this.generateRandomJumpStrength(); abstractHorse.getAttribute(Attributes.JUMP_STRENGTH).setBaseValue(d2 / 3.0); double d3 = this.getAttributeBaseValue(Attributes.MOVEMENT_SPEED) + ageableMob.getAttributeBaseValue(Attributes.MOVEMENT_SPEED) + this.generateRandomSpeed(); abstractHorse.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(d3 / 3.0);
this
is parent A, ageableMod
is parent B and generateRandom{_}X{_
} is the infamous third horse.
One way to fix this, I guess, is get the average of both parents, and then add a random value of -X through X (eg -3 through 3), and making sure the total value is capped. This basically makes 2 top horses making a just-a-bit-above-average horse impossible, and vice versa.
We did it, it's fixed
F I N A L L Y
I've always been obsessed with MC horse breeding, and this is the moment I've been waiting for.
Hopefully they will add bedrock parity to donkey stats also, so I can always get the best ass.
Personally, I see this change (in 1.19.4 - 23w07a) as a net negative. Let me explain:
While some have heralded this as a much-needed buff to equines (horses, donkeys, & mules), amidst the broader problem of transportation alternatives to Elytra, this change does not ultimately improve the competitiveness of horses, but rather takes away an important aspect of their intrigue.
Under the old system, getting a max speed horse of 14.229m/s (top 1%, 0.1%,...) was exceedingly difficult. However, if you simply wanted a 14m/s horse, it was very easily doable. This non-linear difficulty-to-reward made collecting horses something which the average player could be satisfied with within a few minutes, but truly dedicated collectors can choose to sink hours into, for 0.0001m/s incr, with each subsequent improvement giving less reward for more effort. There is a reason many games implement such systems, to cater to a specific audience of collectors/grinders (e.g.: Runescape skill leveling, pokemon collecting, ...)
The new system strips that entire complexity, without actually solving any of the fundamental issues that make horses lose out to Elytra. I've always been a huge fan of horses since they were initially (controversially) added, and I want to see them improved and more widely used. I've seen tons of ideas to actually improve horses, I'll link a few cherry-picked FRs:
https://feedback.minecraft.net/hc/en-us/community/posts/360056915492-Netherite-Horse-Armor
https://feedback.minecraft.net/hc/en-us/community/posts/360011285652-Enchantable-Horse-Armor
https://feedback.minecraft.net/hc/en-us/community/posts/360047223571-Frost-Walker-Horse-armour
https://feedback.minecraft.net/hc/en-us/community/posts/360036335091-Horse-speed-determined-by-breeding-vs-spawned-horses
https://feedback.minecraft.net/hc/en-us/community/posts/20132780596109-Discrete-Horse-Stats
https://feedback.minecraft.net/hc/en-us/community/posts/4415682846093-Preventing-suffocating-when-riding-something (by increasing the movement collision box to include the rider)
After breeding several horses for hearts I've gotten new horses with higher stats than both parents, but only in cases where both parents had the same number of hearts. I.e. I've bred two horses with 11 hearts and gotten a foal with 12, but haven't been able to get a foal with 12 hearts by breeding a horse with 10 and one with 11. So I believe at least for hearts (haven't tested speed or jump height yet) it is possible to breed up to a high quality horse from lower quality horses, but you have to get up to having two horses of the same hearts and then advance 1 heart at a time till you get to the maximum.