The Wiki for Tale 6 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.
If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.
Difference between revisions of "McArine/Incense"
m (Created page with "This contains a brief description of what I'm trying to find out, why I think it's right, and other odds and ends regarding my incense work. ==The Theory== In T4(and T5) all inc...") |
m (→The Theory) |
||
Line 1: | Line 1: | ||
This contains a brief description of what I'm trying to find out, why I think it's right, and other odds and ends regarding my incense work. | This contains a brief description of what I'm trying to find out, why I think it's right, and other odds and ends regarding my incense work. | ||
− | ==The Theory== | + | ==The Theory and some Math== |
In T4(and T5) all incense coords was registered as a float like (35.2515, 166.233). <br> | In T4(and T5) all incense coords was registered as a float like (35.2515, 166.233). <br> | ||
I think this is wrong, mainly because Teppy generally likes discrete or integer values. So this is my primary standpoint, that all coordinates for starting points, attribute points and additive points, are located at a discrete value, like (35, 166)<br> | I think this is wrong, mainly because Teppy generally likes discrete or integer values. So this is my primary standpoint, that all coordinates for starting points, attribute points and additive points, are located at a discrete value, like (35, 166)<br> | ||
Line 17: | Line 17: | ||
The distance calculation is like this:<br> | The distance calculation is like this:<br> | ||
− | dResin = floor(sqrt(power( | + | dResin = floor(sqrt(power(Xcur - Xattr, 2) + power(Ycur - Yattr, 2))) |
If Teppy is calculating the distance in some other obscure way, then he didn't pay attention in his geometry classes ;-) <br> | If Teppy is calculating the distance in some other obscure way, then he didn't pay attention in his geometry classes ;-) <br> | ||
+ | Xcur is the X coordinate of the current location, and Xattr is the X coordinate of the closest attribute location. In this case, in the Resin plane.<br> | ||
+ | |||
+ | So far, I believe my guesses in the math are correct. I think it's the right formula for quality, and I don't see why one would use a more complex calculation for distances.<br> | ||
+ | So now to calculate the value of Xcur, Ycur. <br> | ||
+ | I think it is safe to say, that this coordinate set, is also integer. The reason for this assumption is that sometimes we can get quality that gives the following values: 555, 554, 555, 554, 555. Now, if we didn't use some kind of rounding, this could not happen. Because of the way the formula works, moving us in a straight line from the starting point, to the resin point. We would be moving closer and closer to the attribute, and then we'd start moving away from it again. Now if a rounding function is used, we're no longer moving in a straigt line, between the starting point and the resin point. But are able to jump both closer and father away from the attribute point, depending on where the rounding function puts us. Again, I'm going to use a floor function.<br> | ||
+ | |||
+ | The formula for calculating the current location has been determined to be the following. (or at least very near to) | ||
+ | Xn = (Xstart x 7 + Xresin x n) / (7 + n) | ||
+ | Where Xn is equal to the current location for the n'th add of a resin.<br> | ||
+ | But how is it implemented, how's the flooring done, and is it the location calculated between the starting point and the resin point each time, or is it calculated between the last location and the resin point? This gives us 4 different implementation possibilities. With 4 results that differs more the more resin is added.<br> |
Revision as of 16:47, 21 February 2012
This contains a brief description of what I'm trying to find out, why I think it's right, and other odds and ends regarding my incense work.
The Theory and some Math
In T4(and T5) all incense coords was registered as a float like (35.2515, 166.233).
I think this is wrong, mainly because Teppy generally likes discrete or integer values. So this is my primary standpoint, that all coordinates for starting points, attribute points and additive points, are located at a discrete value, like (35, 166)
Now I might be totally wrong regarding this, and if I am, none of my approaches will end up giving the result I want.
Rounding, since all results from the scent lab are integer values, it is safe to assume that some sort of rounding is applied. I'm going to assume Teppy has used a floor function, meaning that 35.677 becomes 35. I think this is a safe bet, again, Teppy has used it in other systems.
Now to look at the starting points, and how distances are calculated. The formula for calculating quality is determined by the distance from the current coordinates in each of the planes, to the closest attribute coordinates. dResin, dHerb and dRose. The final quality is then:
Quality = 1000 - (dResin + dHerb + dRose)
Now this formula has to contain some rounding(flooring), or we would not get an integer value, it could be done like this:
Quality = 1000 - floor(dResin + dHerb + dRose)
Or like this:
Quality = 1000 - (floor(dResin) + floor(dHerb) + floor(dRose))
If the formula is like the first one, we would not be able to calculate all possible starting locations as easily. Because sometimes the decimal part of the distances would sometimes add 1 or 2 extra to the total distance. And that is not the case. So, the formula has to be the second.
The distance calculation is like this:
dResin = floor(sqrt(power(Xcur - Xattr, 2) + power(Ycur - Yattr, 2)))
If Teppy is calculating the distance in some other obscure way, then he didn't pay attention in his geometry classes ;-)
Xcur is the X coordinate of the current location, and Xattr is the X coordinate of the closest attribute location. In this case, in the Resin plane.
So far, I believe my guesses in the math are correct. I think it's the right formula for quality, and I don't see why one would use a more complex calculation for distances.
So now to calculate the value of Xcur, Ycur.
I think it is safe to say, that this coordinate set, is also integer. The reason for this assumption is that sometimes we can get quality that gives the following values: 555, 554, 555, 554, 555. Now, if we didn't use some kind of rounding, this could not happen. Because of the way the formula works, moving us in a straight line from the starting point, to the resin point. We would be moving closer and closer to the attribute, and then we'd start moving away from it again. Now if a rounding function is used, we're no longer moving in a straigt line, between the starting point and the resin point. But are able to jump both closer and father away from the attribute point, depending on where the rounding function puts us. Again, I'm going to use a floor function.
The formula for calculating the current location has been determined to be the following. (or at least very near to)
Xn = (Xstart x 7 + Xresin x n) / (7 + n)
Where Xn is equal to the current location for the n'th add of a resin.
But how is it implemented, how's the flooring done, and is it the location calculated between the starting point and the resin point each time, or is it calculated between the last location and the resin point? This gives us 4 different implementation possibilities. With 4 results that differs more the more resin is added.