Update (again):

A power outage has slowed me down, the power is back on... but for how long, lightning still looms in the distance... anyway used the time to find more matematical relationships, but so far have helped me little. The javascript form of these equations instead of making one whole equation has different equations based upon the number range, which ironically make them simpler... anyway first the Q formulas, the question mark shows where a missing part of the equation is, something needs to be added to the general Q equation to be true for all levels. I also made clearer a math relationship in the S equation that is related to level and everything, at least I am pretty sure... anyway:

L = Level number

S = Stage

Q1-Q4 = Floor sections for each level/stage

X,Y are different for Q1-Q4 as follows:

Q1: X=1, Y=0 (these values cancel out in the below equation giving the much simpler Q1 equation)

Q2: X=5, Y=7

Q3: X=7, Y=3

Q4: X=3, Y=1

Q1'-Q4' = used in calculating the Q's if you know the stage number...

C = FLOOR (128/X) (also varies for each Q of course)

Q1 = MOD(L-1/128)

Q2 - Q4 = MOD (X*Q1+Y (?) /128-(Q1/C))

S = 128^3(Q1)+128^1(Q2)+128^0(Q3)+128^2(Q4)

(following have to be done in order, of course.)

Q1' = S/128^3

Q4' = MOD(Q1')/128^2

Q2' = MOD(Q4')/128^1

Q1 = FLOOR(Q1')

Q2 = FLOOR(Q2')

Q3 = MOD(Q2')

Q4 = FLOOR(Q4')

(If any of the Q values above is greater than 128, stage has an undefined level and code, I think... I at least know alot of stage values show a level map on the viewer but have undefined levels and codes... okay, not really sure why...)

Since we almost know how to get Q values from levels and for sure can get them from stage numbers, it should be possible to calculate the formulas that relate Stage number to Level number by solving equations... but it's wierd, it relates to the 128 to certain value numbers I think and I tried solving equations if one number = 0 (the equations are L-1 so that is like using a value of 0) but no use, anyway for your info, When S=0, L=101117697 and all of the Q's=0

When L=1, S=16643 and the Q's are the same as the Y vaules for each Q, Q1=0, Q2=2, Q3=3, Q4=1

The relationship between L and S is simple probably and should be solvable now, I just haven't done it yet... the Q's bridge the gap between the numbers.

It took WAY too long to find these equations out... I really shouldn't be the one doing this, THIS IS CONSUMING MY LIFE!!!!!

This post has been edited by **Angnix**: 15 July 2005 - 10:51 PM