The Wiki for Tale 4 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.

Guilds/Bastet/Our Two Scents Worth/Energy Graph

From A Tale in the Desert
Revision as of 04:49, 18 September 2010 by Akiiki Bastet (talk | contribs) (New page: == Solving the Resin Map == === Introduction === A number of fellow programmer-types have expressed interested in the domain problem of solving the incense resin map. This is a problem ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Solving the Resin Map

Introduction

A number of fellow programmer-types have expressed interested in the domain problem of solving the incense resin map. This is a problem primer and some data to aid in that goal.

I'm inclined to solve the Resin map using a spring graph solving algorithm. This is complicated by the nature of the data we have and the the problem we're solving, so it's not as cut-and-dried as solving a normal graph. However, given the data I have collected and some initial discoveries to provide seed values, I think it can be solved best this way.

The Nature of the Problem

The graph we're trying to solve is the map of the Resin Plane of incense in Tale 4 Bastet. So there is an ideal solution, barring small numerical errors due to the rounding.

There are three types of points in the map. There are "start points", "resin points" and "stat points". When a batch of incense is started, it is randomly assigned one of the 12 start points on the plane as a working point. The user is then given a resin quality measurement and told which stat point (of 17) is closest. The quality measurement is (Q-D) where Q is some arbitrary base quality and D is the distance from the working point (which begins as a "Start point") to the named stat point.

As a resin is added, the working point moves in a straight line from the start point to the resin point in decreasing steps. (We ignore multiple resin types as an unnecessary complication right now) At each step the user is given a quality measurement which uses the same base Q value and reflects the distance to the nearest stat point, and the identity of that stat point.

A considerable amount of data has been collected using different starts and resins. We'll use this to regenerate the map.

How the Problem Deviates From a Traditional Spring Graph

Normally we use damped springs to solve graphs with dimensionless nodes connected by weighted edges of known value. This problem has a few differences:

There are effectively two entities in the graph we're solving: "Sticks" which are a series of nodes beginning at a "start point" and ending at a "resin point"; and "atoms" which are more traditional dimensionless nodes representing the "Stat points" we get measurements to. We can constrain the problem to keep these nodes collinear and regularly spaced according to a known formula.

Furthermore, the nature of the data means that any resin runs we do from a common start point will share the starting point, so these "sticks" share their zeroth node. Also, any data runs using the same resin will begin at different start points, but terminate in a common "resin point".

The values we have recorded are not distances to the atoms, but are arithmetically related to those distances. All the data from a single run uses the same Q value, so we need to relate these to determine actual distances.

Finally, the length of the stick is not known but needs to be determined. Luckily, the nodes are regularly spaced, so they will all compress or expand together.

Nitty-Gritty

I will designate the stat points - the atoms - as A1 A2 etc. I'll provide a legend to convert them to the stats for those of us not only looking at the pure math side of the problem. :) These are graph nodes in the traditional sense. There are no atom-atom edges. There are atom-stick edges.

I will designate sticks as SS1R1 as a code for which start point and resin they represent. Any sticks which share the "S#" designation, such as SS3R4, SS3R12 and SS3R7, all start from the same point; that is their zeroth node is the same. Similarly, any sticks which share the "R#" designation share their endpoint, which I refer to as the Rth node, or node R.

Nodes are regularly distributed along a stick. Node0 is one endpoint, and NodeR is the other. Nodek is at position

( 7 x Node0 + k x NodeR ) / ( 7 + k )

Each node on a stick will have a single edge connected to an atom. For sanity-checking purposes, it will always be the closest atom. The data for a stick will name the atom and give a value. The value is equal to (Q-D) where Q is an arbitrary value which is constant for this stick only and D is the distance from the node to the atom. To reiterate, for nodes 0, 1, 2, ... we will have values X0, X1, X2, ... where Xk = Q - Dk where Dk is the distance from Nodek of this stick to the atom.