Color...
BenLand100
2007-09-06 22:50:23
I have an idea about making color finding in Scar/RS so easy that its almost as if the colors are static. My thoughts go along the lines that there is a rhyme or reason to how rs mangles the colors. IE, Perceptually they are usually all different by the 'same' amount. So, if someone could provide me with (recent, less than two months old) colors of the SAME object in different colors. IE, road colors from server to server, or water color. Not ground color unless it is the same spot as another server, but try to make it something easy like water. My idea is that numerically, at least the variance in the individual color values will be based off of a variable which, if the start color is identified, and the current color of something is identified, then the exact color can be identified for anything within that loading screen. Or at very least, better tolerances can be made then the current 'does this work?' tolerances.
Mathematically, say you have a color based off of RGB values (which IS how the client mangles, them, not HSL or other nonsense like that) with the values r, g, and b. The actual values of that color that never change are found by the formulas:
r = r' + vr * dr
g = g' + vg * dg
b = b' + vb * db
Where the ' are the base color, and v are the variances. It is possible that dr, dg, and db have the same value. It is also possible that the formula is more complex such as:
r = r' + vr^dr
g = g' + vg^dg
b = b' + vb^db
But at any rate, there should be a relation between them. Think about it, the colors aren't random, because they look the 'same'. Also, lightness is a property of modifying all RGB values at the same time, and since that's the major change, it all fits. Anyway, someone get me some colors :) If you still don't follow what I'm doing, think of this, even if a random number is used, how it is applied has to be a function. In that case the 'start' color can be reverse engineered and other colors on the load screen possible calculated without searching for them.
Edit: I just sampled 4 road colors from… I got good numbers for a cubic function of all things. The 1.5 and 0.5 are exact (which usually means I'm on the right track)
r = 1.5*vr^3 + ~2.42*vr^2 + 0.5*vr + r'
Boreas
2007-09-07 00:22:55
Tarajunky had a big sampling of colors for water and road when we first started working on RGB auto coloring….
Edit: Drink up
12029563
10975588
10909796
10909795
10843746
10844002
10909795
The Claw
2007-09-07 02:04:30
Do you think that the base color would be the same every time you loaded the client, or would it change? I mean, would the base color change between loading screens, Logins/logouts or client loads? Also, how do you come up with those formulas?
Wizzup?
2007-09-07 02:50:20
From: The Claw
Do you think that the base color would be the same every time you loaded the client, or would it change? I mean, would the base color change between loading screens, Logins/logouts or client loads? Also, how do you come up with those formulas?
The base color wouldn't change.
Basically, Benland, I like the idea.
Yes. Almost SS but better :p So how would this work? You find the Variation in change. And then…. we have the base colors and then through smart it changed them using fomula?
LordGregGreg
2007-09-07 04:44:41
benland. i have been thinking of this idea for a while and never really understood why we didnt use it. Im really glad you are working into it :D. I see no roadblocks ahead at all.
good luck and an early congrats
Lorax
2007-09-07 06:31:22
I like the idea, and it would be fun to have it working, what we would need would basically be a set of road/water/some last color..
and then we could perhaps calculate a base color..
Or I dunno, do you think that any color could be used as a base color?
hmm I don't know myself yet..
BenLand100
2007-09-07 15:45:15
The base color would be unique and static for each color in the client. What you would do is, since we are good at finding the road color, or water color, compare it to the base color, and with those formulas. and the base color for other objects, you could calculate the current colors.
Sumilion
2007-09-07 15:57:18
Wow so if this works you just predict the color ? I can't say i haven't thought about it, Jagex have to come with the colors somehow, but i had no idea how to start… if you can do this ben you would be an even bigger hero to me :D
Fansite anyone ?
moparisthebest
2007-09-07 16:57:59
Sorry to burst your bubbles, but I don't see any way this could possibly work. Reason being while of course there is this 'base color' you are all referring to, it is modified by a call to Math.random(). We can actually pull the exact formula used to produce the actual color used from the client without any problems, but how are you going to know what Math.random() will return? (you can't)
Now, you can hack some stuff together and make Math.random() return whatever you want every call, therefore making colors static (like ScarScape), I have done this and it brings up an entirely new problem. While it make some colors static (as far as I remember all of the interface is static (buttons, inv colors) and the icons (trees, banks, mines)) however things like ground, water and roads change every time the map loads, the reason for this is that the colors are sent from the server to the client every time the map reloads, and as you could guess there is not anything we can do about this short of editing the client.
If you need any more info I can try to dredge it up, or if you have some genius idea to circumvent all of this and make your idea work anyway, I would be interested in hearing it. :)
The Un-Named
2007-09-08 07:44:45
From: moparisthebest
Now, you can hack some stuff together and make Math.random() return whatever you want every call, therefore making colors static (like ScarScape), I have done this and it brings up an entirely new problem. While it make some colors static (as far as I remember all of the interface is static (buttons, inv colors) and the icons (trees, banks, mines)) however things like ground, water and roads change every time the map loads, the reason for this is that the colors are sent from the server to the client every time the map reloads, and as you could guess there is not anything we can do about this short of editing the client.
I never thought about editing java to actually do this, interesting idea.
However, rather than fretting on if the server randomizes the minimal colour, shouldn't we, if possible, hack a client together to get the road colour(lets say on normal light) and write it to a file, and have that run on several computers for a few days to try and get all possible colours, and try to see if there is any randomness?
Sumilion
2007-09-08 10:13:36
From: moparisthebest
…or if you have some genius idea to circumvent all of this and make your idea work anyway, I would be interested in hearing it. :)
I suppose its way too easy to think you can just force the road to be a certain color on the client?
From: Sumilion
I suppose its way too easy to think you can just force the road to be a certain color on the client?
Yes and its called Scarscape. <3'ed that thing. But there was a debate about its detecability. Considering it changed all the random calls to just return a 0. Thus keeping all the colors a constant color.
tarajunky
2007-09-08 20:17:05
From: Boreas
Tarajunky had a big sampling of colors for water and road when we first started working on RGB auto coloring….
Edit: Drink up
12029563
10975588
10909796
10909795
10843746
10844002
10909795
http://www.srl-forums.com/forum/showpost.php?p=36817&postcount=33Also, here are some of the new Varrock RoadColors
5462364
5527901
5528413
5725281
6054245
6185831
6450029
6778482
7304312
7370361
7567740
7567996
7896706
8226439
8358026
8752015
7435898
6251880
8291721
6712945
8423562
6844531
8752015
5462621
7501947
6778994
8555404
5791585
7436666
5725280
7501691
6185831
7962242
6186600
8028804
BenLand100
2007-09-09 18:40:10
From: moparisthebest
Sorry to burst your bubbles, but I don't see any way this could possibly work. Reason being while of course there is this 'base color' you are all referring to, it is modified by a call to Math.random(). We can actually pull the exact formula used to produce the actual color used from the client without any problems, but how are you going to know what Math.random() will return? (you can't)
Precicely, a call to Math.random() is made which adjusts the color. However, based on the code I've seen, and the way the client looks, this is not a problem because preceptualy, the colors all are modified in a like manner. I'll have more on this later… ;)
Edit: If someone could (or I will when I have time) sample two things from each loading screen (road + water or road + (the same) building) so I can possibly make a graph of what I'm talking about :)
Smartzkid
2007-09-09 21:31:19
Ever heard of Cheat Engine? It has a feature that will replace random functions with 'code that does nothing'. I tested it on RS, and it didn't work, but that's probably because of the way that the JVM works. If you could come up with a way to locate Math.Random's memory address, couldn't you overwrite it with some 'code that does nothing'? Or, even better, replace it with code that allows you to control it, which would keep you safe from possible traps (for(i, i > 100, i++){ if(Math.Random = LastRandom){x++}} if(x > 80){BanEm})?
moparisthebest
2007-09-10 02:21:34
From: BenLand100
Precicely, a call to Math.random() is made which adjusts the color. However, based on the code I've seen, and the way the client looks, this is not a problem because preceptualy, the colors all are modified in a like manner. I'll have more on this later… ;)
You missed some of what I said, certain colors are modified in this way whereas others are modified in the server and then sent to the client, those are the colors you are most interested in as well (road, water, grass etc etc)
BenLand100
2007-09-10 17:19:22
And I assume what you're trying to say is that they are set to random values? The modification of each individual color is uniform, there is also an apparant relationship between colors in the same loading screen. If the code that generates those colors were in the client, i'ed already have it wouldn't I? So far, descrepancy between individual colors is at maximum +/- 1 which would be due to rounding error (ie using round or trunc). As I said, at the very least this will improve accuracy in color searching, or possibly lead to a better searching method (tolerances based on more than three dimensional distance). I'm still fitting data to graphs at this point, and i'm a very busy person, so bear with me.
moparisthebest
2007-09-10 18:39:59
Alright, I hope your method works, I'll keep an eye out for it. Good luck. :)
Special Ed
2007-09-14 17:48:33
Basically I think I know where Ben is going with this, if we can find out the variant that RS uses to control the different colors, and they appear to be uniform for all of the values (I.E. Same changes apply to Water, Road, Trees, ect) then all we'd need to do is run GetWaterColor (or something) and use the color that it returns to developed the Value of the integer which in turn would lead us to develop the values of the RoadColor, Trees, Ground, ect… Am I on the same track as you Ben, or did I literally bring up a whole new concept (which I doubt)?
shaunthasheep
2007-09-17 19:12:46
Will the release of Scarscape help this project? As you can get the base colors easily now because of it… though I haven't used it yet, I could be horribly wrong…
Smartzkid
2007-09-17 20:23:45
There's a new scarscape?
moparisthebest
2007-09-17 23:25:48
There has always been a scarscape, pplsuqbawlz released the code on my forums, it autoupdates as well. (it is also just as detectable as scarscape has ever been)