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.

McArine/Incense

From ATITD6
Revision as of 16:13, 21 February 2012 by McArine (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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 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(Xact - Xattr, 2) + power(Yact - Yattr, 2)))

If Teppy is calculating the distance in some other obscure way, then he didn't pay attention in his geometry classes ;-)