I just coded for myself a little web app that sets cookies on dragons you have and then shows you according breeding combos. As for the breeding combos I just copied your info in here but I think it would be better if that could also be hosted on wikia. Not sure if that's possible.
We have a Breeding Calculator here that has two modes, breeding outcomes (select two dragons and see what you can get) and possible parents (select one dragon and see which dragons you can breed to get it). I'm working on fixing the latter mode (it has some bugs and the display format is horrible). Improving the code design in general is a priority, too. I did it in a rushed hacky way with some not-so-optimal algorithms, so I'd like to revise that.
There is a Breeding Results page where people can edit in their results of breeding. The Color Pool Linker on the page lets them input two dragons and pressing the button will jump them straight to the correct section to edit (since the page is quite long and inconvenient to scroll manually).
Your program is a good idea. It would be useful to be able to check the boxes next to which dragons you have and then show which dragons you need to breed a particular dragon.
MediaWiki handles caching very strangely so it would be best not to try to embed the code directly there. A lot of code that works perfectly fine normally will break if you don't feed the appropriate modifications to appease MediaWiki. There is also some functionality that it simply refuses to support.
Aside from that, every time you update a .js file loaded by MediaWiki, it now requires a hard cache refresh client-side (even if you change the name of the file and purge the server) - otherwise it waits many hours to update. Non-js MediaWiki files only require ?action=purge, but MediaWiki hates global evals for functions (it only evals global variables nicely), so you can't use the horrible hack of storing your code on a non-js MediaWiki file and asking it to eval that. The safest bet would be to host the program off-site and link to it externally.
Another caveat is some browsers handle cookies and caching differently. Some browsers have different supported features, too, and some can be a real pain. *cough* Internet Explorer *cough* Is there a particular reason that you are using cookies over something else?
As for the program itself, a few things I noticed:
1) The column titles and the info listed beneath them do not match ;) Rarity and Incubation are swapped.
2) The prices do not differentiate between coin or gold, so the Air Dragon looks just as expensive as the Crusader Dragon, which is not the case.
3) The hover info spaced completely vertically will get cut off in cases where the list is long (such as Aether Dragon), even on huge resolution screens like mine. You may want to separate the list by commas, use some horizontal space, and wrap downwards.
An alternative is to move away from hover info and require the user to press a button for the event trigger. That would allow them to scroll the page as much as they want. It would also bypass the issue that I outline in 6). Using hovers as your event is apparently more fickle than a straight up button click.
4) Instead of "No current breeding possibilities. Get one or more of these:", I think it would be more useful to display the pairs that can generate the dragon without using the dragon itself in the combo.
It doesn't make a lot of sense if I don't have a Life Dragon to list Life Dragon as something that I should obtain to breed one. Mist Dragon does not share any colors with Life, and could only generate a Life Dragon when paired with something else that has red + green in it.
Another reason I think pairs should be displayed is that it is not clear what dragon should be bred with what other dragon. Diamond Dragon will list any two-color dragon and also all pure Diamond color dragons, but pairing Firestorm with Eagle will never generate a Diamond, and neither will pairing Diamond with Fruitful.
5) Related to point 4), it won't do to use the data in the Breeding Chart outcomes section. I haven't implemented it yet, but the data that should be used is the possible parents section, which is reversed and would have different data sometimes. For example, Air Dragon x Air Dragon will always only give Air Dragon. However, you can get an Air Dragon in other ways, such as pairing Air x Diamond, Diamond x Infinity, and Gold x Diamond.
The Breeding Calculator does have a possible parents section, but I would not reccommend using its data yet because I screwed up and have a bug for diamond-related special rules (working on updating that), and also the display format for that is horrible. I am going to rearrange it into color pools to make it much more manageable.
6) Aside from the very first hover upon opening a page, the hover update happens at least one hover late - even if I minimize the tab, hover over white space, and then hover over a new dragon. Sometimes, I'll hover over a dragon above, hover over the dragon directly below, and get hover info for the dragon below that one even though I never hovered over it. If I refresh the page and immediately hover over a dragon, it displays the integer representing its position in the array. So, the hover only behaves as expected on the first hover after manually opening the page (not refreshing).
I've used the calculator to get the breeding pair. Had to copy over the according results for each of the 57 dragons and parse according results. Was a simple script with just a lot of copy'n'paste (almost 18k entries of possible combos).
As for the breeding results: I just though a simple form for 2x input and 1x output dragon and submit button with email verification would be ok. Maybe even record level of the dragons? I'm not sure if the level has any influence. Editing on the wiki requires an account and login. With email verification you just get an email sent. The first time you enter the email it can be stored as cookie and auto-filled later. Lowers the hurdle a bit - or maybe even omit input validation at all and let them jsut add combos.
Your program is a good idea. It would be useful to be able to check the boxes next to which dragons you have and then show which dragons you need to breed a particular dragon.
That's what it does. If you hover a dragon that you don't have all requirements, it shows you a list of dragons that are missing. There is one flaw however. If one combo requires two dragons that you don't have yet, then it shows them both individually. So if you get one of the two dragons, you still might not have a valid combo to bread them.
The cookies are being used so you can check what dragons you already have. Once you set a checkbox it'll store the cookie. Current browsers should have no issues with it. Older MSIE might have. But then it's time to update anyway. Once you have checked a few dragons and reload the page, they'll be backgrounded green (haven't figured out how to alter background yet when you check it). I just though storing in cookies is a lot easier than making user account and store what dragons they have in the DB. As said, by default it should be working just fine.
For your things you noticed:
1) Ups :) will edit that.
2) My mistake :) I should fix that also
3) I made two columns now. It's much better readable. However according to your calculator some dragons have over 500 combos.... that's still a problem to display. In most cases it should be fine though.
I actually wanted to test the new JQueryUI Tooltip - hence why I built it. Info should be readily available that's why I like the hover. However for hover content, you can display any html output. So you could style it accordingly. e.g. http://dragon.sjau.ch/breed.php?id=14
Basically the hover info is made with an ajax request with according id and result page then displayed.
4) I already mentioned above that I currently just return a list of "missing" dragons that are required in combos. Of course the one that should be bread should be extempted. That should be easily fixable.
5) I only use the data from the breeeding calculator. As said, I went through the list of the 57dragons in there and got the combinations it listed. A total of close to 18k.
6) Nah, the problem here is with ajax. If you hover the mouse shortly over a link and then move to the next. The ajax is still doing the first call and displaying that as result. If you don't move over too quickly, it works all fine.
As I mentioned, the possible parents section of the Breeding Calcuator has bugs that I haven't fixed on the wikia version yet. For example, you can get Air from Diamond + Infinity, but it only lists Air as a possible parent. So, the data that you got there is not yet reliable. I have fixed it on my working copy but I'm working on updating the whole section in general, and updating .js files on wikia is very annoying so I like to push as few updates as possible. That whole section is very repetitive and stupidly arranged, so I'm going to redo it entirely (to deal with that over 500 combo issue and to make it easier to read).
It is necessary to display the combos rather than individually because some of the dragons listed would be illogical otherwise. Aether Dragon (Blue, Purple) makes absolutely no sense listed under Life Dragon (Red, Green) by itself because the only way you can get Life with Aether in the combo is by using Aether + Wild, Aether + Forestfire, or Aether + Landworm.
I suggest doing the following for your program:
- List only the combos where both dragons in the pair have at least one color in common with the dragon. (Also include special rules stuff for Magic and Diamond pures/hybrids.)
- Make a note that you can breed any dragon that shares colors with the target dragon (that isn't the target dragon) with any other dragon in order to get the target dragon. For example, to get Life, you can breed Air + Landworm. This note would cover hundreds of combos and allow you to eliminate them from the list.
Alternatively, you could wait till I finish fixing the terrible possible parents section, but no promises on whether I can get that done quickly. What I'm going to do is similar to what I just described, except condensing the list even further using dragon color groups. Also sorting ascending based on color (Red, Green, Yellow, Blue, Purple, White, Diamond). So, for the Magic Dragon for example, I would list:
Fire + Water
Magic + Magic
Magic + Diamond/Infinity
Diamond/Infinity + Diamond/Infinity
... all the other special diamond rules that can generate Magic, not available yet due to no Purple/Diamond hybrid ...
Fire + Coral/Wizard/Aether
Fire + Athletic
... all the other combos containing Red and Blue where each parent contributes at least Red or Blue ...
Note at end: The following dragons can be paired with any other dragon to get the Magic Dragon: Athletic
For point 6), that is not the case. I hover over Aether Dragon and waited 10 seconds with my mouse sitting there. Then I hovered over Air Dragon and it still said "Aether Dragon" and there was an empty list. I minimized the tab, did something else for 30 seconds, went back, hovered over Aether Dragon and it says "Air Dragon" with an empty list. I also just re-opened the whole page, waited a few seconds, then hovered over Aether and got Clown Dragon instead. It's got more problems than hovering slowly.
Users cannot all be expected to act exactly correctly to convince a finicky thing to work... If there is a way to break something, someone out there will definitely break something. Some people cannot not read or follow simple instructions. Trust me, when we were beta testing our game prototypes and had instructions because obviously we didn't have time to make an integrated tutorial yet, we had people struggling through the game and saying they didn't know how to do something... Everything was covered in the instructions, which were readily available, SHORT, and very easy to read. :(
Well, right now the only big list I have availble is the one on here in the calculator. Currently I don't track the colour of the dragons. So I guess I have to wait till you have your list done :)
My DB scheme is very simple at the moment. I have only two tables... one for the dragons with a unique ID and another for breeding. In the breeding table I have as index the dragon ID that I want to breed and another field containing both parent IDs seperated by |. The dragon ID and parentIDs are also unique.
as for point 6: as long as you hover over the link it'll make that ajax request. You have to stop the hover, wait a second and then move to another one. It's not ideal but at the moment it works :)
Yeah, I'm working on that, so I'll let you know when it's done.
For 6) As I said, it does not work for me as you described. I am using Firefox. Maybe it works when you test it, but it is most definitely broken beyond reason for me. Here are a few things that I have had happen:
- I opened your page. My mouse is all the way at the top of the page. I waited a few seconds, then I hover over Aether Dragon and sit there. It gave me Clown Dragon. In no way did I ever hover anywhere near Clown Dragon.
- I closed and reopened again. I waited 10 seconds. I hovered over Aether Dragon. It gave me "1", which is the index of the dragon in the list + 1 for whatever reason. This is the first time that this has happened when I reopened the page, usually it gives me the right data.
- The previous issue happens if I Refresh the page. I can scroll over Pegasus Dragon and see 42 for example. Even if I wait a whole minute before hovering over anything.
- I hovered over Laserlight Dragon, waited a second, then stopped the hover. I left my mouse sitting in white space for 10 seconds. Then I hovered over Mistmoth Dragon, but I got Laserlight Dragon data. I minimized the tab, did something else for 30 seconds, then went back, with my mouse all the way to the right side of the screen. I hovered over Seabreeze Dragon. It gave me Athletic Dragon, which I definitely didn't hover near o_O
If I unhover, wait like 10 seconds, and move my mouse to a different dragon, it gives the previous no matter what. Therefore, the only way I can get it to work is to hover over something, get the wrong data, unhover, then move my mouse back to the same one.
Ah, cool. I haven't checked, but I betcha running the thing in Internet Explorer would be even worse than Firefox. Lol... My Breeding Calculator doesn't even work on IE right now because it doesn't support setting .innerHTML on tables. (That is another thing I'm working on fixing with my new Breeding Calculator code, make a more sensible table generation approach that is less hacky and doesn't require .innerHTML or my magic string split for column delimiters hack).
Not much experience with CSS stylesheets, unfortunately. We probably know the same amount about that :P I really should go look how to set them up, but I've been busy doing other stuff. I find web development a lot more annoying than everything else =/
Okay, the modal box is much more responsive on click now than the misbehaving hover events. I'm guessing that part of the styling issues you're trying to resolve is resizing the box when the list is so long that it spans two columns?
Thanks for working on this btw, it's a great tool idea.
[EDIT]: Agree about IE -_- I wish it would be banned from use, but it pretends that it's Firefox lol.
As far as we have observed, level, dragon rarity, dragon name, etc. do not influence the breeding %. However, we do not have nearly enough data to get close to "proving" the likelihood that our assumptions are true. Unless we hack into the DS servers to look at their code (not gonna, just saying), we cannot prove that the random algorithm does not use any of these factors.
For now, the current assumption according to our observations is that only colors and special breeding rules (diamond and magic stuff) apply.
Aha, very convenient. That's another thing I gotta do, start working with jQuery. I really should read up on it but haven't yet. The DOM alone can get... unwieldy. Eventually my goal is to clean up my code further with jQuery, but that'll have to wait.
As I mentioned earlier, I do not trust MediaWiki to not break js attached to it. If it's okay with you, once we get the correct data sorted out, may I link your program as an external resource on our front page as well as on the Breeding Calculator page? (And if so, what would you like your credited display name to be? The same as your current user name?)
regarding breeding: What are the exacte breeding rules? Instead of listing the combos in the DB it would probably be better to show the breeding combos by applying the rules and set the colours for the dragons.
and also still unanswered: Does the level have any influence on the breeding result? If you breed a lvl 10 and lvl 6 dragon will the lvl 10 'genes' be stronger and more breed towards the lvl 10 colours?
I answered the level question up there but will copy/paste it again :P
As far as we have observed, level, dragon rarity, dragon name, etc. do not influence the breeding %. We can't get 100% proof without seeing their server-side code, but this is the generally accepted assumption atm.
Yeah, my Breeding Calculator builds the list using the rules. Unfortunately I messed up a bit and forgot to include some possibilities involving Diamond types for breeding pures. I'm going to push those bug fixes along with the formatting update.
The rules are:
Single color dragons can be bred in the following ways:
1) Pairing two single color dragons together that share the color of the target offspring.
Ex: Air can be bred from Air + Air
2) Pairing two single color Diamond dragons together. (This pairing can generate any single color dragon.)
Ex: Forest can be bred from Diamond + Infinity
3) Pairing a Diamond hybrid with one of its two colors. (This pairing can only generate the Diamond hybrid or the non-Diamond single color dragon.)
Ex: Fire can be bred from Crusader + Diamond
4*) Single color Purple dragons like Magic can be bred with the presence of Red + Blue in the combo.
Ex: Magic can be bred from Athletic + anything
5*) Single color Diamond dragons like Diamond and Infinity can be bred with the presence of 4 distinct colors in the combo.
Ex: Diamond can be bred from Quetzal + Aether
Multi-color dragons can be bred in the following ways:
1) If all of a multi-color dragon's required colors exist in a color pool (the merged colors of both parents), it is a breeding outcome possibility.
Well, make an image link somehow :) I could also try to tiny up the other non essential thing or generally make fonts a bit smaller and less padding... or maybe I could put the other things into a title hover....
Nice! I think it would make sense if you rearranged what appears in the tooltip hover vs. the columns a tiny bit. Rarity and incubation associated with the hover over dragon name, and cost / earning rate in the columns. What do you think? :)
When I click a dragon (let's use Aether as an example) this is what the title box says:
Aether: 990 Gold / 16 hours
It feels weird to me because when I think of a dragon - what defines that dragon - I think of its colors, how long it takes to breed, how rare it is, etc. I don't think of how much it costs in gold. So it just feels like a weird name association to me.
I can definitely see the argument for placing rarity beside earning so that you can make an interesting comparison with the info (that makes sense). It's just that associating dragon with cost strikes me as weird. If the coin/gold cost didn't appear next to the incubation on the title box when you click a dragon, then it wouldn't seem so weird to me.
Of course this could just be a personal issue with the way I see this, maybe other people won't think it's weird.
well, I'm looking mostly at the full table... what dragons do I have, how rare are they and what can they produce. When I then click the dialog link, I see how I can breed them, what they cost and how long it takes to incubate.... so my emphasis is on the main table, not the breeding detials.
I'm pondering to use those tabs to make the breeding stats form submission. The autosearchable/autocomplete dropdown doesn't work (yet) and submission won't do anything yet. Working on that to get data into the db and pull it out again :)
That looks like it'll work great. When you say you're working on the autosearchable/autocomplete dropdown, do you mean getting the possible breeding results from the two dragons selected in their dropdowns so that the user can click what they got? That sounds handy. Or did I totally misunderstand :P
[EDIT]: Could people submit multiple repeat results at once? (Obviously with a limit, maybe 10). So instead of clicking Quetzal + Diamond = Forest 50 times I could submit only 5 times?
link confirmation is already set. I just wondered since you first have to select two parents to breed... then wait a few hours... then you see what egg it is. At that point you can post your full breed results.
So once you start breeding, you could submit the parents already. And then later - with confirmation link - you can set what egg resulted from the breeding and submit the info to the db.
Over at team lava they really seem to overreact... you can't even post a link to a 3rd party site anymore (my tool) in according context... "Fanlinks" all have to got to a special subforum where nobody reads it....
Btw, when I copied over my testing template, I forgot to add the email sending and db inserting.... so any breeding submitted today didn't get added :( I fixed it now.
How do you think you want to handle bogus results? If there is no code to calculate it, I guess the database would have to store possible offspring for each dragon and remove the reports that are false?
Hmm... If you add the dragon colors to your database, you don't have to implement full breeding rules for that section yet. You could take a shortcut by comparing the dragon colors of the submitted offspring vs. the combined colors of the parents.
If both colors of the offspring are represented in the combined parent colors, for most dragons this means the offspring is valid.
You would have a special case for pure purple dragons like Magic (parents must contribute Red + Blue if the color pool has more than one color, Red + Blue OR Diamond + Purple if the color pool is exactly 2 colors, Purple OR Diamond if there is only one color in the combined pool).
Also Diamond would have a special case (parents must have Diamond color only if there is one color in the combined pool, or combined pool must be >= 4 colors long.)
[EDIT]: Oh, good idea, adding the link to the eggs page :)
It's definitely a good idea to use it in this case, it's just annoying whenever you have to go and enter new data :P If you have all the dragons in one table and columns going across with their info, it wouldn't be so bad though. Cause you could just append new dragons as they come out and eventually write the breeding rules to access the data from the table and make the calculations that you need. How did you set up your table(s)?
well, you already have some stats on wikia here... and I wonder if you still have the parent dragons and off spring for those somewhere. If so, I could use that list to add more breeding combos to my little tool.
Hmm, it appears that you have a basic misunderstanding of the way the breeding rules work. It doesn't matter which parent contributes which color, the game only cares about the merged color pool.
For example, Diamond (Diamond) + Firestorm (Red, Yellow) creates the merged color pool Red, Yellow, Diamond. It is exactly the same thing as Crusader (Red, Diamond) + Eagle (Yellow, Red), which also creates the merged color pool Red, Yellow, Diamond. I suggest eliminating all the duplicate categories as it is an unnecessary separation.
The parents -> offspring logic is very simple (it's the other way around that is more complicated.) I suggest a complete revision of your logic. You can look at the color pools like this:
Combined color pool contains a single color
- Can create any dragon with that same single color as offspring
- If color pool is Diamond, can also create every other single color dragon with no exceptions
Combined color pool contains more than one color
- Can result in any dragon that has any two different colors in that color pool. For example Crusader + Life contribute Red, Green, Diamond to the color pool, so you can get any Red/Green (Life/Wild/Forestfire/Landworm atm), Red/Diamond (Crusader atm), Green/Diamond (Quetzal atm) hybrids.
Watch out for unimplemented hybrid colors, you will want to verify that the color combo has at least one dragon in it (Only Purple/Diamond is missing atm, but I'm pretty sure at least one more color will be added in the future).
- If color pool contains Red and Blue, can result in single color Purple dragons (only Magic atm).
- If color pool contains 4 or more distinct colors, can result in single color Diamond dragons (Diamond and Infinity atm). Any color counts as one of the 4 distinct colors, including Diamond.
If you think of the "more than one color" section the way I laid it out (inclusive, rather than exclusive), it already covers all of the cases for you :)
Step 1: Look at the color pool and add every existing two-color dragon from the colors in that pool.
Step 2: If the color pool has Red + Blue in it, add Purple single color dragons.
Step 3a: If the color pool has 4 or more colors in it, add Diamond single color dragons.
Step 3b: If the color pool has exactly 2 colors in it, and one of them is Diamond, add all dragons of the other single color. (So Crusader + Diamond for example, you would add all single color Red dragons, which atm is only Fire).
Looking at it this way makes much more sense, because you don't have to worry about special case exclusions.
Dragon Story breeding rules (unlike some others, such as My Singing Monsters) go in the inclusive direction. If a condition is true, then add the dragon. It doesn't matter what else may be true.
So, for multi-color pools, if Red + Blue is present (color pool length doesn't matter), you can get a single color Purple. If distinct color pool length >= 4, you can get single color Diamond (doesn't matter which colors as long as they are different). If color pool length is 2 and one of the colors is Diamond, you can get dragons of the other single color.
For single color pools, include dragons of that single color. If that single color is Diamond, also include dragons of every other single color.
No, it is very important to read the rules carefully. Re-read what I posted :)
Eagle (Red + Yellow hybrid) and Crusader (Red + Diamond hybrid) makes Red, Yellow, Diamond. You only add a color once to the pool. This is exactly the same as Fire (Red) and Firestorm (Red + Yellow hybrid), which also makes Red, Yellow, Diamond.
Read the rules carefully, never include a dragon that does not fulfill a condition. Nowhere is there a condition for adding a Fire Dragon to a multi-color pool, except when there are exactly distinct 2 colors in the pool and they are Diamond and Red.
I see, one step there is missing. If only 1 color is in the pool then it can breed a single-color dragon. If there's two colors in the pool, it can't breed single-color anymore - except if one color is diamond or if it's red/blue.
Actually, no step is missing at all from that logic. All of the cases are covered very cleanly in the example. I think that the direction of logic that you are suggesting might be making things more complicated and confusing than it needs to be. You don't need to exclude anything - you just don't include them in the first place. Maybe my explanation is not very clear, I will try to elaborate.
Instead of going through all the dragons and trying to decide whether it can be bred from those parents or not, you should start from the bottom up with a completely empty list. Think additively. That way you do not need to consider ugly edge cases and litter your code with a lot of unnecessary conditions.
For the multi-color-pool rules, you don't think about what you can't breed - you think about what you can breed. First you CAN breed any two-color dragon. Then, you CAN breed all single color purple dragons if red and blue are present. You CAN breed all single color diamond dragons if 4 or more distinct colors are present. You CAN breed the other single color dragon if there are exactly 2 colors in the pool and one of them is diamond.
For single-color-pool rules, you CAN breed the single color dragons of that color. You CAN breed every other single color dragon if the color is diamond.
Let me see if I can illustrate the pseudocode. The logic below covers every single case. You do not have to worry about whether it's two colors and you can't breed single colors except if one color is diamond or if it has red/blue or whatever. That's way complicated and not needed. Observe the logic below:
if (color_pool.length == 1)
// Add all single color dragons of that color
if (color_pool == "diamond")
foreach single color other than diamond
// Add all the other single color dragons
// Find every two color combination that the parent color pool can create
two_color_combinations = FindEachTwoColorCombination(color_pool);
foreach two color combination
// Add all two-color dragons that possess the valid colors that you found
// You can build a lookup map beforehand that groups the dragons conveniently into their color groups
if (color_pool contains red and blue)
// Add all single color purple dragons
if (color_pool.length >= 4)
// Add all single color diamond dragons
else if (color_pool.length == 2 and color_pool contains diamond)
AddDragonsWithSingleColor(the other color that isn't diamond);
As you can see, each dragon is only added as needed. Because only the correct dragons are added, you don't have to worry about what is the "wrong" dragon. You don't have to remove it from consideration because it's never even considered in the first place. So your confusion with the single color dragons, this example just eliminates all of that.
You can have a sorted list of colors for reference (red, green, yellow, blue, purple, white, diamond). You can use that to build a list of color keys that any dragon could possibly have. (Every unique combination of single and double colors out of the color list.) You can then go through all the existing dragons and map them to their specific keys. (Like Firestorm and Eagle would go to redyellow, Forest would go to green, Gold would go to yellowdiamond, etc.) Those could then be used as quick lookup when you're looking for specific color combinations depending on the parents.
(3) Get all diamond dragons and make any combination of them (e.g. Diamond and Infinity, Diamond and Diamond)
(4a) Check if the color us purple. If so, get all dragons that contain blue and/or red. Then make all possible combinations of those dragons containing blue and/or red and then filter out the combinations that do not have both in the combined pool.
(4b) Check if the color is diamond. If so, get all dragons with at least two colors and directly omit a dragon if one of the two colors is also diamond. For the rest get all possbile combinations and filter out those that will not result in 4 colors (red, green, yellow, blue, purple and white)
I think that's all fine for the single-color dragons.
The logic I outlined above is for getting the offspring of two parents, not for finding parents o_o (Finding parents is more complicated because you do have to use ugly edge cases all over the place, and I did not explain that process.) You are finding the parents, not the offspring. I thought that you wanted the offspring rules, not the parent rules, or I would have explained the rules in the other direction.
The behavior for Air Dragon is incorrect. You can also breed it from Gold + Diamond/Infinity and Air + Gold/Infinity. Similarly for all the other colors that have corresponding Diamond hybrids. Red has Crusader, Green has Quetzal, Blue has Mercury, White has Angel. (Purple Diamond hybrid is missing atm.)
So your rules for single-color dragons are mostly complete, good job. You just need to add 3b) Get all diamond color hybrids of with that other single color and make any combination of them.
Let me know when you get the hybrid rules done and I'll take a look :)
Yeah, I just assumed that you were going to find the offspring first because we were recently talking about submitting breeding values :P I would've talked about the finding parents first if I knew you wanted to work on the original part of your app. My mistake.
Erm I'm confused. You already had the two single Diamond parents handled correctly. What you're missing is the Diamond hybrid.
--> SELECT * FROM dragons WHERE color2 IS NOT NULL AND (color1 = "Diamond" OR color2 = "Diamond")
Air + Gold, Diamond + Gold, Infinity + Gold is the correct behavior.
Sylvandyr: So many things to fix there.... this far I used the breeding options supplied by your calculator. Which is nice but everytime a new dragon gets added I need to add more options.... doing it all dynamically works better IMHO :)
Using your supplied query it would also think that: Air + Angel could produce an Air dragon. Air is yellow and Angel is diamond and white. To my understanding that won't produce an Air dragon.
I altered the query now to this:
SELECT * FROM dragons WHERE (color1 = ? OR color1 = "Diamond") AND (color2 IS NULL OR color2 = "Diamond" OR color2 = ?)
(Of course replace the ? with the current color.)
Rationale: If it's a single color dragon in the db, then color2 is NULL. As for color1 and color2 I just sort them alphabetically. Meaning color1 is the first color in the alphabet of the two.
In the case of the air dragon it will only find values that have as color1 'yellow' or 'diamond' and as color2 'yellow', 'diamond' or unset.
But I wonder now: Can two gold dragons also produce air?
Looks correct as far as possible parents goes, only thing is this part is a bit misleading: "All Dragons containing one of the two colors:"
The dragons without those two colors are included because there is nothing wrong with doing Air + Coral to try for Aether for example. However, while that is a perfectly valid combo, I would exclude Air Dragon, Life Dragon etc. from the "Get this dragon to help you breed your desired dragon" section because they don't contain either blue or purple. The Coral Dragon for that combo would be the only relevant one that would help the player towards their goal for the Aether.
Very nice :) I just tested a bunch of random dragons, the "get x dragon" thing seems to be working well. One additional step of complication (it could be a future "wishlist" item) would be: if you are trying to breed a two-color dragon, and you own a dragon with one of the required colors, show only the dragons with the other required color. For example I only own an Air Dragon and I want an Eagle Dragon, I need the other parent to have Red in it. So the list would show Firestorm, Crusader, and so on rather than also showing Fairy or Trickster etc. Not entirely necessary, but would be nice polish in the future if you have the time :)
Hmm is there any way for me to refresh the cookies without refreshing the page? If I uncheck a box or check a new box the cookies don't update without refreshing the page. If I'm supposed to refresh, maybe leave a note that refreshing is required?
[EDIT]: Your tool is coming along, should I link it on our wiki now or do you want to wait till you sort out a few more things? And which link should I use, index2.php?
cookies are set as soon as you check the box. And for the dragon parents, it's a seperate php page that reads out the current cookies. the only thing that doesn't work is that it makes the background green when you check a dragon.
Whoops I edited my post as you were posting lol :P
Hmm well it seems that when I uncheck the box, it doesn't update. Neither does it update when I check a new box after checking the first one. I'm clicking different dragons and it seems to think that I'm using the dragon that I first checked since the last refresh, and nothing else. If I refresh though, it updates everything properly, but not till then. I'm using Firefox.
Anyway should I link your tool now (and which link), or do you prefer me to wait?
if you are trying to breed a two-color dragon, and you own a dragon with one of the required colors, show only the dragons with the other required color. For example I only own an Air Dragon and I want an Eagle Dragon, I need the other parent to have Red in it. So the list would show Firestorm, Crusader, and so on rather than also showing Fairy or Trickster etc. Not entirely necessary, but would be nice polish in the future if you have the time :)
I see you re-uploaded the graphics so that it doesn't take this wiki's bandwidth, that's fine.
It's really annoying how much this site can break perfectly good code :(
Looking really good! I think your changelog is a useful addition too.
One thing I noticed, if I don't have any dragon selected, the possible breeding options show all the combos with the dragon that was clicked. I'm guessing the filter that removes the target dragon (if you don't own it yet) only takes place if you have at least one dragon "owned"?
One missing special case. You cannot get a Diamond dragon from a two-color pool with Diamond. So, Infinity + Fire can only result in Fire or Crusader (no Diamond), Crusader + Crusader can only result in Fire or Crusader (no Diamond), etc.
well, thanks for all your help.... I'm also redoing the current breeding table... made an ugly hack in the beginning and fixing it now. That will mean I also get easy access (without too many db queries) to the total number a certain combo was bread. That way I can then offer % changes e.g.
To get a Boo Dragon you can use for example Charm Dragon & Light Dragon. So if in the database there are 10 breeding results of Charm & Light and 2 of them resulted in a Boo dragon, then you'll have displayed a 20% chance.
So, did it work with saying that you're compiling?
Btw, have a look at the revised stats (again the index2.php) and select Magic Dragon stats.
I did add just some values to the DB. I still ahve to import the correct submitted values.
It shows now all the submitted breeding results that resulted in the selected dragon. It will show you the number of successfull breeds for that selected dragon and the total number the parent combination is in the db (in the () brackets). And then it displays the 100% for that combination.
e.g. magic and magic gives (right now) always magic, so its 12 out of 12 --> 100% success rate
However Diamond and Infinity resulted in 5 magic dragons out of 8 "Diamond/Infinity" combos, so success rate is only 63%
"Added Parent Combo Stats - it'll show you what offspring a given parent combo has prodcued this far"
You have a new tab entry "Parents Stats" and if you click on it, you'll get a list of the submitted parent combos in the list and the amount how often they have been used this far. If you then click on the total number, the popup comes which shows you what offspring and how often it was breeded with that parent combo.
Yup I saw it, I like how it's set up right now. One thing you could make a little clearer in the instructions is maybe tell people to click the number link under "total" :P I didn't notice the links at first and was staring at the parents wondering how I was supposed to click lol.
I'd like to request a dropdown field when you are submitting offspring, maybe go up to 50 or even 1-10 would be nice. Limiting to dropdown would give you more control over input so some malicious user couldn't just submit 999999999999 of some dragon or whatever... I would input more of my results but having to submit one by one is too time consuming, as I enter data in batches. I did a lot of tests with Red/Diamond and Green/Diamond too and since the breeding time is so short, I do a lot of tests before entering any data.
Hmm, up to you. There are advantages to both. The first one grants you more absolute control over whomever you grant access, so that you are much less subject to vandalism. However, this requires you to approve particular accounts. There are some anonymous users that make helpful contributions and I have noticed sometimes that some of them enter data in batches as well. I think that option #2, the dropdown, would ultimately encourage more submissions for you :)
That makes sense. If you do that I would make a note about it so that people who have a bunch to submit know that there will be a dropdown in the future. Otherwise someone with 50 submissions to make up front may just give up if they don't know it's coming.
Wow, that took longer than expected. After it found some bad blocks ddrescue did slow down from 120MB/s to like 25MB/s and I had to do the whole thing twice. Now the original faulty and replaced harddisk runs fine, And the previously bad block one is being synced again into the raid array.
Btw, since I added now a short-add link to the match tab for those with enough submissions, someone told me they made a mistake... accidentally pressed the wrong button (since there's no confirmation).
I added it becuase that person uses only the iphone and switching tabs back and forth between the breeding submission form matches results was a hassle.
So I think I will revert the latest breeding submissions to single column layout again and add a remove / deactivate button so that you can correct yourself wrong submissions.
Also I'm thinking of converting all the layouts back to single column and adding something like that: http://datatables.net/ --> that would enable the user greater flexibility on sorting and stuff.
Got a little bit more work for you btw :P New Goal Dragons (Storm, Scarecrow) cannot be obtained by breeding, just unlocked from goals. However, they can be used as parents. I updated my calculator to note that they can't be bred (sigh, really need time to refactor, the code is awful atm).
Now there is the Ruby Dragon with the craftable gem things... We do not have more info yet because it's not released to 90% of the population yet. Will keep you up to date on that once we get info...
I have seen reports that it can bred. Not wanting to just go by word of mouth I went to several Islands and finally found one with a Ruby and no new buildings. So I asked some questions on her wall. She was very nice and got back to me very quickly saying she did not have access to the new buildings but could see Ruby in her market. She said she bred Fire/Fire over 100 times but did finally get it with that combo....
So either she is lying, it's a bug, or yes we can get it through breeding. I plan on doing this Fire/Fire combo 100+ times once we all get it (click-a-thon >_<) to see what happens. Unless of course the info is given to us by Teamlava :)
slowly I run out of things to do/fix... one more thing.. when click on a get or post link that you first get to an intermediate page that does all the magic and then forwards to the "output" page so that you don't submit things again if you just reload.
Diamond Breeding Optimization - depending on the colors you chose (and whether you're on Android/iOS) you have different breeding color options and possible other matches.
With iOS you have Pink which also adds Red and White to the pool... so I asked myself, what combination gives the best chance to breed a diamond. If I say the best chance is the combination (or rather permutation) that will have the least amount of other possible breeding results then I can calculate that with a script.
Basically I will make a script that just runs through all possibilities of 4 colors (and with Pink maybe more....) and checks how many dragons can be bred with that color pool.
The entry with the least amount of possible dragons would be the "winner".
I think the Diamond breeding optimization is a good idea.
DragonVale has a filter that considers special dragons before normal ones, so the optimization for a Rainbow Dragon there is based upon the possible failure times for the normal dragons. The only dragons that interfere with its breeding chance are the ones in the same filter (Gold, Silver, Seasonal, etc.)
I do not know what the paradigm is for Dragon Story, but I personally think that it makes much more sense to have the filters like DV. Otherwise how would Fire + Diamond, which only has two possibilities, yield Fire so many times while you get Crusader only very rarely. I do not have proof, but I think the way that it works is this:
Diamond types are placed in the top level filter. If they are a possibility, they are rolled for first. Once that fails, then the other dragons are considered. So the probability of getting a Diamond is the same no matter which combo you use, but the chances of getting a Zombie are higher if you use only Green + Purple as opposed to trying for Zombie and Boo at the same time with Green + Purple + White.
I have absolutely no proof of this except personal experience.
It means more work, and you don't have to do it, but I suggest the following:
1) List all of the possibilities in a table. I think this is relevant because "best" for breeding Diamond is relative. Some people might want the lowest failure times, some might want combos with less breeding results, and some might want something in between due to targetting some missing color dragons.
2) Use two different calculations. One sorts by least number of breeding results (show all possibilities, listing the lowest first). One sorts by average failure times (this won't be as accurate because you have to take the rarity % chances for the weights by faith). I don't know how you want to achieve this UI-wise, but a button or a dropdown or something to switch between the sort modes could work.
You could show the actual values side-by-side, with the # of results in one column and the avg. fail times in another column. Maybe you can add a link to the color pool listed and it could pop up the resulting dragon names as well as their incubation times. That would help to put the # of results and avg. fail times into context.
Also: For the breeding LE dragons will be disregarded in general. Otherwise I would need to keep track with LE dragon could be bread when - and most of the time LE dragons aren't available or only a few... so they are neglectable IMHO. Furthermore I will also disregard any diamond or diamond hybrid dragons.
Regarding the filters: In order to make use of them I would need to know if there are such filters and how much effect they have... since I don't know I can't put anything in there. However, you might want to have a look at the "By Rarity" tab on my tool. Currently with over 1500 submissions we have this outcome based on rarity:
~ 67 %
~ 21 %
~ 10 %
~ 2 %
TL just might have assigned a percentage and roll a dice. E.g. you have four colors in the pool that enables you to get any of the rarity types. TL just rolls a dice and when it's result is 1 or 2, then it will be an Ultra Rare... next they trow a dice to see which Ultra Rare (if there's more than one). It's also just an assumption but that's how I would do it (playing too much (A)D&D - hence my love for dice ;)
Regarding your two tables:
I don't understand what you mean with lowest failure times? The only thing we can assume is that if there are less possible outcomes in the pool then the chance to get a Diamond is higher... however if you apply method like I described above, then it would depend to eliminate the rariy groups and not total amount of dragons.
Could you explain more what you mean by failure times? Would that be the average failure time of all possible dragons in the pool (- diamond and infinity) divided by their number?
For example, back when I bred Crusader + Fruitful to get my three Diamonds back then, these were the non-Diamond outcomes possible:
Life (3 hrs)
Wild (6 hrs)
Forestfire (7 hrs)
Fruitful (10 hrs)
Fairy (8 hrs)
So taking those percentages above and removing the Ultra Rare from the equation (since that will be success), you re-weight the percentages to fit into 100%. I am super lazy so I am gonna skip that part and just use the percentages straight in the example but dumping the extra Ultra Rare % into the Common % to make 100%... Assume Common = 69%, Rare = 21%, Super Rare = 10%.
So to get avg fail time of this set you would have done (.69 * ((3 + 10) / 2)) + (.21 * ((6 + 8)/2)) + (.1 * 7). Doing this you get an avg fail time of 7.285 hrs, which is really low. However if you were to try for Diamond using Green + Purple + Blue + Red, that would introduce really long avg. fail times due to the possibility of Poison, Familiar, Magic, Island, Serpent, Atlantis, Charm, Titan, Planet, etc...
Higher avg fail time = less time spent trying for Diamond, which means less overall chance of getting it (due to not putting in enough attempts).
Hmm I'm confused about the weighted time, how is that being calculated? It looks super low, I don't know of any color pools that have such low times, something seems off.
How are you calculating average time? Shouldn't that be the one with the rarity weights multiplied by the average time within that rarity group? Ie: percent chance of commons * average time of commons + percent chance of rares * average time of rares etc.
I just noticed that Red, Blue, White, Pink produces 11 non-Diamond results rather than 9, and Red, Purple, White, Pink produces 10 non-Diamond rather than 9. So either our algorithm does not match or maybe you're missing dragons? Hm.
Hmm. I don't understand the point of that calculation. It's modifying the numbers in a very weird way beyond recognition. Is there a reason you're calculating that? Also, this looks weird if I understand what your intention was:
Red Green White Pink 01:27:16 h
Lowest time in that combo is 3 hours while Pink introduces some long breed time Pink hybrids and Red/White hybrids, it's mathematically impossible to reduce to 1 hour 27 mins 16 seconds isn't it?
You may want to update the notes section for the diamond now:
"The most economic breeding pair for the Diamond Dragon is the Charm & Fruitful combo, due to the minimal coin loss involved (between 382 and 895 coins per hour lost due to being in the breeding den). It has an average time for its common dragon results of 11 and 2/3 hours."
Something's not right there. Adding Pink to Red and Green adds a lot of long breed time hybrids. Even without weights, the avg. time I'm getting for Red, Green, White, Pink with 13 results is 14.2308 hrs. The tool says 7 hrs 46 min without weights.
I did now Red Green White Pink. There it doesn't do it right. I have to find out the reason why.
I call always the same function.... hmmmm.... the total time in seconds in the array is wrong for the rare ones - it is however correct for the common and super rare ones. I have to find out why there is this difference.
Expired Limited dragons now have a * before or after the name. I will put that all into the same at some point but for sorting issues it's now in front or after the name right now. Problem is, I need to keep tap when dragons expire ;)