# Sonic and Sega Retro Message Board: Blue Sphere Equations... - Sonic and Sega Retro Message Board

Hey there, Guest!  (Log In · Register) Help
• 2 Pages
• 1
• 2

## Blue Sphere Equations... I didn't want to bump topics anymore...

### #16Angnix  Posted 14 July 2005 - 10:11 PM

• Posts: 12
• Joined: 12-July 05
• Location:Michigan, America's Hand... with no fingers!
• Project:Ummm... random image and FAQs stuff sometimes...
yes, I know of that... I figured that out but... what the heck Arrrgghhh! I've been trying to correct the formula by messing with pretty much everything else but the value 128... ghaw my poor brain for some reason couldn't fathem that...

This is why I wasn't a math major...

### #17LOst  Posted 14 July 2005 - 10:13 PM

• Posts: 4886
• Joined: 10-January 03
• Gender:Male
• Wiki edits:2

Angnix, on Jul 15 2005, 06:11 AM, said:

yes, I know of that... I figured that out but... what the heck Arrrgghhh! I've been trying to correct the formula by messing with pretty much everything else but the value 128... ghaw my poor brain for some reason couldn't fathem that...

This is why I wasn't a math major...

Give us the formula, and tell us exactly where it stops working (using what values will give the error result etc...).

### #18Angnix  Posted 14 July 2005 - 10:59 PM

• Posts: 12
• Joined: 12-July 05
• Location:Michigan, America's Hand... with no fingers!
• Project:Ummm... random image and FAQs stuff sometimes...
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

### #19XFox Prower  Posted 16 July 2005 - 09:34 PM

• Posts: 1196
• Joined: 30-August 03
• Gender:Male
• Project:x86 Assembly, Tails Search Assistant
I'm lost here. Is this about pulling Special Stage maps, colors, & difficulty from Sonic 1 & Knuckles Stage numbers? And where is this javascript that is being referenced? Can't be in the rom. Maybe it's some unlinked work in progress javascript page for doing the decodings? I was thinking of making a password generator anyway. Some visual representation would also work wonders for understanding.

• 2 Pages
• 1
• 2