SRL Archive - SRL Positioning System

[SPS] Help me by running this script!


marpis

2011-11-21 06:40:28

EDIT: Thanks guys!

Flight

2011-11-21 06:46:13

Yeah I'll run it in the background while I work with some PHP crap.

Edit:
What exactly do we use this with? I ran it solo (is this what you wanted?) and not a whole lot happened lol… Or would the results be in the 'runescape_surface' folder?

Having trouble finding the images apparently.
I changed this:

if not FileExists(AreasPath + s) then
Continue;
To this:

if not FileExists(AreasPath + s) then
begin
Writeln('Not found: '+s);
Continue;
end;
Just something short and sweet, and it came back none of the images were found. The image path is correct, I dunno what went wrong.

Kyle Undefined

2011-11-21 07:39:56

All I get is

Compiled successfully in 639 ms.
PROFILING DONE!
Successfully executed.

marpis

2011-11-21 10:30:12

Fixed script:

program SPS_Area_Profiler;
{.include srl/srl.scar}
{.include sps/sps.simba}

const
AreasPath = AppPath + '/Includes/sps/img/runescape_surface/';

function GetProfile(View: T3DIntegerArray): Integer;
var
x, y, i: integer;
ColorSum: Array [0..2] of integer;
ProfileAsArray: Array [0..2] of integer;
begin

for x := 0 to 19 do
for y := 0 to 19 do
begin
ColorSum[0] := ColorSum[0] + View[x][y][0];
ColorSum[1] := ColorSum[1] + View[x][y][1];
ColorSum[2] := ColorSum[2] + View[x][y][2];
end;

for i := 0 to 2 do
case ColorSum[i] of
0..20400:
ProfileAsArray[i] := 0;
20401..40800:
ProfileAsArray[i] := 1;
40801..61200:
ProfileAsArray[i] := 2;
61201..81600:
ProfileAsArray[i] := 3;
81601..102000:
ProfileAsArray[i] := 4;
end;

Result := ProfileAsArray[0] + ProfileAsArray[1]*10 + ProfileAsArray[2]*100;
end;

function CropArea(x, y: integer; Area: T3DIntegerArray): T3DIntegerArray;
var
xx, yy, i: integer;
begin
SetLength(Result, 20);

for xx := 0 to 19 do
begin

SetLength(Result[xx], 20);
for yy := 0 to 19 do
begin
SetLength(Result[xx][yy], 3);
for i := 0 to 2 do
try
Result[xx][yy][i] := Area[x + xx][y + yy][i];
except
Writeln(ExceptionToString(ExceptionType, ExceptionParam));
end;
end;
end;
end;

function GetAreaProfiles(Area: T3DIntegerArray): Array of integer;
var
x, y, n: integer;
View: T3DIntegerArray;

begin
SetLength(Result, 9999999);

for x := 0 to 80 do
for y := 0 to 80 do
begin
View := CropArea(x, y, Area);
Result[n] := GetProfile(View);
Inc(n);
end;

SetLength(Result, n);
ClearSameIntegers(Result);
end;


procedure ProfileArea(Area: string);
var
Profiles: TIntegerArray;
begin
SPS_Areas := [Area];
SPS_Load;
Profiles := GetAreaProfiles(SPS_WorldMap[0]);
Writeln(Area + ' ' + ToStr(Profiles));
end;


procedure ProfileAllAreas;
var
x, y: integer;
s: string;
begin
for x := 0 to 17 do
for y := 0 to 13 do
begin
s := IntToStr(x) + '_' + IntToStr(y);
if not FileExists(AreasPath + s + '.png') then
Continue;
ProfileArea(s);
end;

Writeln('PROFILING DONE!');
end;

begin
ProfileAllAreas;
end.

LSD

2011-11-21 10:35:53

So i just simply run this once. I do not have to be logged into runescape or whatever ?

Nava2

2011-11-21 10:52:51

It's running.. I will update you later. :)

E: Its super intensive to run, just be forewarned.

marpis

2011-11-21 10:58:59

From: LSD
So i just simply run this once. I do not have to be logged into runescape or whatever ?

Yeah, this doesn't use runescape client, you just need to have SPS installed correctly.


From: Nava2
It's running.. I will update you later. :)

E: Its super intensive to run, just be forewarned.

Yup.

Mark

2011-11-21 11:40:39

thought i give it a run also ts till running but i got this error
[SPS] WARNING: SPS_Surface isn't set! Using Runescape Surface as default

marpis

2011-11-21 11:47:09

From: CRU1Z1N
thought i give it a run also ts till running but i got this error
[SPS] WARNING: SPS_Surface isn't set! Using Runescape Surface as default


Yea it gives that but it still does the job.
It won't terminate, see? It seems like it doesn't do anything, but in a while it will start printing numbers.

Mark

2011-11-21 12:02:54

From: marpis
Yea it gives that but it still does the job.
It won't terminate, see? It seems like it doesn't do anything, but in a while it will start printing numbers.



yh so far i have

0_1 [0]
0_2 [0]
0_3 [0]
0_9 [0]
0_10 [0, 333, 233, 400, 232]
0_11 [0, 111, 44]
0_12 [0]

Bobzilla69

2011-11-21 12:17:35

i was going to run it to help you out, but for some reason my simba isnt updating to this sps version, i have non of the folder or files refereed to in this script :(

i do have sps in my plugins but thats all

sorry for off topic ness

Edit:
Ignore previous, i didnt have sps updater active for some reason…. will update when i run script

Kyle Undefined

2011-11-21 13:00:45

Running this now, will update when done.

Mark

2011-11-21 17:29:22

well im currently up 10_1 i estimate another 4 hours before complete

Nava2

2011-11-21 17:32:19

[SPS] WARNING: SPS_Surface isn't set! Using Runescape Surface as default
0_1 [0]
0_2 [0]
0_3 [0]
0_9 [0]
0_10 [0, 333, 233, 400, 232]
0_11 [0, 111, 44]
0_12 [0]
0_13 [0, 322, 4, 222, 221, 211, 111, 100, 44, 444, 443, 433, 333]
1_1 [0]
1_2 [0]
1_3 [0]
1_5 [0, 44, 111, 4, 222, 333, 332, 322, 221, 211, 110, 444, 443, 433, 100]
1_7 [0, 11, 21, 22, 122, 32, 31, 123, 133, 143, 144, 204, 104, 103, 1, 234, 244, 240, 200, 300, 400, 134, 132, 10, 243]
1_8 [0, 111, 443, 343, 333, 10, 233, 400, 300, 133, 132, 204, 200, 104, 103, 31]
1_9 [0]
1_10 [0, 400, 232, 304, 132, 122, 204, 300, 244, 243, 121, 233, 111, 344]
1_11 [0, 111, 44]
1_12 [0]
1_13 [0]
2_2 [0]
2_3 [0]
2_4 [0]
2_5 [0, 222, 400, 122, 300, 143, 11, 200, 133, 204]
2_6 [0, 11, 133, 143, 200, 100, 240, 300, 400]
2_7 [0, 10, 132, 204, 300, 400, 200, 11, 22, 104, 133, 123, 144, 240, 140]
2_8 [0]
2_9 [0]
2_10 [0, 344, 233, 111, 400, 122, 121, 222, 444, 4]
2_11 [0, 111, 44, 222, 443, 4]
2_12 [0]
2_13 [0]
3_2 [0]
3_3 [0]
3_4 [0]
3_5 [0]
3_6 [0]
3_7 [0]
3_8 [0]
3_9 [0]
3_10 [0]
3_11 [0]
3_12 [0]
3_13 [0, 4, 44, 443, 444, 433, 333, 332, 322, 222, 211, 111, 400, 343, 100, 300, 244, 122, 200, 144, 22, 21, 104, 103, 133, 234]
4_2 [0]
4_3 [0]
4_4 [0]
4_5 [0]
4_6 [0]
4_7 [0]
4_8 [0]
4_9 [0]
4_10 [0]
4_11 [0]
4_12 [0]
4_13 [0, 400, 234, 244, 222]
5_0 [0]
5_1 [0]
5_2 [0]
5_3 [0]
5_4 [0]
5_5 [0]
5_6 [0]
5_7 [0]
5_8 [0]
5_9 [0]
5_10 [0]
5_11 [0]
5_12 [0]
5_13 [0]
6_0 [0]
6_1 [0]
6_2 [0]
6_3 [0]
6_4 [0]
6_5 [0]
6_6 [0]
6_7 [0]
6_8 [0]
6_9 [0]
6_10 [0]
6_11 [0]
6_12 [0]
6_13 [0]
7_1 [0]
7_2 [0]
7_3 [0]
7_4 [0]
7_5 [0]
7_6 [0]
7_7 [0]
7_8 [0]
7_9 [0]
7_10 [0]
7_11 [0]
7_12 [0]
7_13 [0]
8_1 [0]
8_2 [0]
8_3 [0]
8_4 [0]
8_5 [0]
8_6 [0]
8_7 [0]
8_8 [0]
8_9 [0]
8_10 [0]
8_11 [0]
8_12 [0]
8_13 [0]
9_1 [0]
9_2 [0]
9_3 [0]
9_4 [0]
9_5 [0]
9_6 [0]
9_7 [0]
9_8 [0]
9_9 [0]
9_10 [0]
9_11 [0]
9_12 [0]
10_1 [0]
10_2 [0]
10_3 [0]
10_4 [0]
10_5 [0]
10_6 [0]
10_7 [0]
10_8 [0]
10_9 [0]
10_10 [0]
10_11 [0]
10_12 [0, 332, 322, 222, 400, 122, 300, 123]
11_1 [0]
11_2 [0]
11_3 [0]
11_4 [0]
11_5 [0]
11_6 [0]
11_7 [0]
11_8 [0]
11_9 [0]
11_10 [0]
11_11 [0]
11_12 [0, 300, 123, 400, 122]
11_13 [0, 122, 112, 111, 11, 1, 300, 240, 244, 234, 233, 133, 123, 400, 340]
12_1 [0]
12_2 [0]
12_3 [0]
12_4 [0]
12_5 [0]
12_6 [0]
12_7 [0]
12_8 [0]
12_9 [0]
12_10 [0]
12_11 [0]
12_12 [0]
12_13 [0]
13_1 [0]
13_2 [0]
13_3 [0]
13_4 [0]
13_5 [0]
13_6 [0]
13_7 [0]
13_8 [0]
13_9 [0]
13_10 [0]
13_11 [0]
13_12 [0]
13_13 [0]
14_3 [0, 4, 444, 433, 44, 333, 443, 222, 211, 322, 111, 221, 332, 100]
14_4 [0]
14_5 [0]
14_6 [0]
14_7 [0]
14_8 [0]
14_9 [0]
14_10 [0]
14_11 [0, 400, 300, 244, 123, 11, 340, 344, 111, 333, 433]
14_12 [0, 300, 400, 123, 233, 333, 332, 322, 4, 222, 44, 444, 443, 433, 211, 111, 100, 221]
14_13 [0, 322]
15_5 [0]
15_6 [0, 400, 404, 4, 403, 303]
15_7 [0, 400, 300, 204, 200, 304, 103, 104, 144, 244, 203, 131, 31, 32, 132, 123, 233, 303, 242, 10, 11, 122, 343, 404, 121, 111, 232, 444, 222, 221, 443, 332, 243, 4, 333, 344, 342, 403, 133, 1]
15_8 [0, 400, 404, 444, 333, 343, 233, 232, 222]
15_9 [0, 444, 440, 400, 404, 344, 333, 334, 233, 222, 232, 44]
15_10 [0]
15_11 [0, 333, 322, 222]
15_12 [0, 222]
16_5 [0]
16_6 [0, 404, 303, 400, 304, 203, 202, 302, 403, 4]
16_7 [303, 232, 111, 0, 1, 11, 122, 222, 233, 343, 333, 203, 132, 121, 221, 10, 131, 202, 110, 231, 302, 403, 404, 332, 4, 342, 443, 444, 44, 322]
16_10 [0, 4, 333]
16_11 [0]
16_12 [0]
17_5 [0]
17_6 [0]
17_10 [333, 0]
17_11 [0]
17_12 [0]
17_13 [0]
PROFILING DONE!
Successfully executed.

Does not appear to be that useful…

Mark

2011-11-21 17:34:21

@Nava2

this mean i can stop mine then :D

Sir R. M8gic1an

2011-11-21 17:40:11

I suggest using actual values rather than this

for i := 0 to 2 do
case ColorSum[i] of
0..20400:
ProfileAsArray[i] := 0;
20401..40800:
ProfileAsArray[i] := 1;
40801..61200:
ProfileAsArray[i] := 2;
61201..81600:
ProfileAsArray[i] := 3;
81601..102000:
ProfileAsArray[i] := 4;
end;

As the amount of [0] arrays will surely make it hard when idling… ;)

-RM

Nava2

2011-11-21 17:52:03

One thing I also thought of, we could easily store all of these into a single integer, with less of a speed loss for multiplications. Just use bitwise operators, we always need more speed with SPS.

Coh3n

2011-11-22 02:16:49

Sorry if I missed it somewhere, but could you explain what you're trying to gain out of this? I see that you mention we won't have to be able to set SPS Areas, but we can do that my using some simple math using a given SPS path (Wolygon does this in his PathMaker application). If this will help make SPS overall more accurate, that's awesome! :)

Bobzilla69

2011-11-22 02:44:11

in case you want it more than once

Compiled successfully in 796 ms.
[SPS] WARNING: SPS_Surface isn't set! Using Runescape Surface as default
0_1 [0]
0_2 [0]
0_3 [0]
0_9 [0]
0_10 [0, 333, 233, 400, 232]
0_11 [0, 111, 44]
0_12 [0]
0_13 [0, 322, 4, 222, 221, 211, 111, 100, 44, 444, 443, 433, 333]
1_1 [0]
1_2 [0]
1_3 [0]
1_5 [0, 44, 111, 4, 222, 333, 332, 322, 221, 211, 110, 444, 443, 433, 100]
1_7 [0, 11, 21, 22, 122, 32, 31, 123, 133, 143, 144, 204, 104, 103, 1, 234, 244, 240, 200, 300, 400, 134, 132, 10, 243]
1_8 [0, 111, 443, 343, 333, 10, 233, 400, 300, 133, 132, 204, 200, 104, 103, 31]
1_9 [0]
1_10 [0, 400, 232, 304, 132, 122, 204, 300, 244, 243, 121, 233, 111, 344]
1_11 [0, 111, 44]
1_12 [0]
1_13 [0]
2_2 [0]
2_3 [0]
2_4 [0]
2_5 [0, 222, 400, 122, 300, 143, 11, 200, 133, 204]
2_6 [0, 11, 133, 143, 200, 100, 240, 300, 400]
2_7 [0, 10, 132, 204, 300, 400, 200, 11, 22, 104, 133, 123, 144, 240, 140]
2_8 [0]
2_9 [0]
2_10 [0, 344, 233, 111, 400, 122, 121, 222, 444, 4]
2_11 [0, 111, 44, 222, 443, 4]
2_12 [0]
2_13 [0]
3_2 [0]
3_3 [0]
3_4 [0]
3_5 [0]
3_6 [0]
3_7 [0]
3_8 [0]
3_9 [0]
3_10 [0]
3_11 [0]
3_12 [0]
3_13 [0, 4, 44, 443, 444, 433, 333, 332, 322, 222, 211, 111, 400, 343, 100, 300, 244, 122, 200, 144, 22, 21, 104, 103, 133, 234]
4_2 [0]
4_3 [0]
4_4 [0]
4_5 [0]
4_6 [0]
4_7 [0]
4_8 [0]
4_9 [0]
4_10 [0]
4_11 [0]
4_12 [0]
4_13 [0, 400, 234, 244, 222]
5_0 [0]
5_1 [0]
5_2 [0]
5_3 [0]
5_4 [0]
5_5 [0]
5_6 [0]
5_7 [0]
5_8 [0]
5_9 [0]
5_10 [0]
5_11 [0]
5_12 [0]
5_13 [0]
6_0 [0]
6_1 [0]
6_2 [0]
6_3 [0]
6_4 [0]
6_5 [0]
6_6 [0]
6_7 [0]
6_8 [0]
6_9 [0]
6_10 [0]
6_11 [0]
6_12 [0]
6_13 [0]
7_1 [0]
7_2 [0]
7_3 [0]
7_4 [0]
7_5 [0]
7_6 [0]
7_7 [0]
7_8 [0]
7_9 [0]
7_10 [0]
7_11 [0]
7_12 [0]
7_13 [0]
8_1 [0]
8_2 [0]
8_3 [0]
8_4 [0]
8_5 [0]
8_6 [0]
8_7 [0]
8_8 [0]
8_9 [0]
8_10 [0]
8_11 [0]
8_12 [0]
8_13 [0]
9_1 [0]
9_2 [0]
9_3 [0]
9_4 [0]
9_5 [0]
9_6 [0]
9_7 [0]
9_8 [0]
9_9 [0]
9_10 [0]
9_11 [0]
9_12 [0]
10_1 [0]
10_2 [0]
10_3 [0]
10_4 [0]
10_5 [0]
10_6 [0]
10_7 [0]
10_8 [0]
10_9 [0]
10_10 [0]
10_11 [0]
10_12 [0, 332, 322, 222, 400, 122, 300, 123]
11_1 [0]
11_2 [0]
11_3 [0]
11_4 [0]
11_5 [0]
11_6 [0]
11_7 [0]
11_8 [0]
11_9 [0]
11_10 [0]
11_11 [0]
11_12 [0, 300, 123, 400, 122]
11_13 [0, 122, 112, 111, 11, 1, 300, 240, 244, 234, 233, 133, 123, 400, 340]
12_1 [0]
12_2 [0]
12_3 [0]
12_4 [0]
12_5 [0]
12_6 [0]
12_7 [0]
12_8 [0]
12_9 [0]
12_10 [0]
12_11 [0]
12_12 [0]
12_13 [0]
13_1 [0]
13_2 [0]
13_3 [0]
13_4 [0]
13_5 [0]
13_6 [0]
13_7 [0]
13_8 [0]
13_9 [0]
13_10 [0]
13_11 [0]
13_12 [0]
13_13 [0]
14_3 [0, 4, 444, 433, 44, 333, 443, 222, 211, 322, 111, 221, 332, 100]
14_4 [0]
14_5 [0]
14_6 [0]
14_7 [0]
14_8 [0]
14_9 [0]
14_10 [0]
14_11 [0, 400, 300, 244, 123, 11, 340, 344, 111, 333, 433]
14_12 [0, 300, 400, 123, 233, 333, 332, 322, 4, 222, 44, 444, 443, 433, 211, 111, 100, 221]
14_13 [0, 322]
15_5 [0]
15_6 [0, 400, 404, 4, 403, 303]
15_7 [0, 400, 300, 204, 200, 304, 103, 104, 144, 244, 203, 131, 31, 32, 132, 123, 233, 303, 242, 10, 11, 122, 343, 404, 121, 111, 232, 444, 222, 221, 443, 332, 243, 4, 333, 344, 342, 403, 133, 1]
15_8 [0, 400, 404, 444, 333, 343, 233, 232, 222]
15_9 [0, 444, 440, 400, 404, 344, 333, 334, 233, 222, 232, 44]
15_10 [0]
15_11 [0, 333, 322, 222]
15_12 [0, 222]
16_5 [0]
16_6 [0, 404, 303, 400, 304, 203, 202, 302, 403, 4]
16_7 [303, 232, 111, 0, 1, 11, 122, 222, 233, 343, 333, 203, 132, 121, 221, 10, 131, 202, 110, 231, 302, 403, 404, 332, 4, 342, 443, 444, 44, 322]
16_10 [0, 4, 333]
16_11 [0]
16_12 [0]
17_5 [0]
17_6 [0]
17_10 [333, 0]
17_11 [0]
17_12 [0]
17_13 [0]
PROFILING DONE!
Successfully executed.

marpis

2011-11-22 04:10:48

From: Nava2

Does not appear to be that useful…

Hmm true. I don't understand why profile 0 appears in almost every area.

From: Coh3n
Sorry if I missed it somewhere, but could you explain what you're trying to gain out of this? I see that you mention we won't have to be able to set SPS Areas, but we can do that my using some simple math using a given SPS path (Wolygon does this in his PathMaker application). If this will help make SPS overall more accurate, that's awesome! :)

I was trying to make it possible to use SPS_GetMyPos() to actually get your location in the world without knowing what area you're on. This was supposed to detect 1-3 of the most probable areas. When we get a fast way to detect what area you're on, SPS will pwn the shit out of everything.

Coh3n

2011-11-22 15:46:39

From: marpis
I was trying to make it possible to use SPS_GetMyPos() to actually get your location in the world without knowing what area you're on. This was supposed to detect 1-3 of the most probable areas. When we get a fast way to detect what area you're on, SPS will pwn the shit out of everything.
Ohh I see. Genius! :) That would be a big step towards a world walker as well.

mika

2011-11-22 18:43:22

do we still need to run it i got a quad core at 2.5 ghz if that helps? So i just run it and thats it no runescape just run it?

weequ

2011-11-22 18:50:10

From: mika
do we still need to run it i got a quad core at 2.5 ghz if that helps? So i just run it and thats it no runescape just run it?

I have quad core at 3.3 ghz and I'd also like to know if we still need to run this.

mika

2011-11-23 16:47:51

Compiled successfully in 812 ms.
[SPS] WARNING: SPS_Surface isn't set! Using Runescape Surface as default
0_1 [0]
0_2 [0]
0_3 [0]
0_9 [0]
0_10 [0, 333, 233, 400, 232]
0_11 [0, 111, 44]
0_12 [0]
0_13 [0, 322, 4, 222, 221, 211, 111, 100, 44, 444, 443, 433, 333]
1_1 [0]
1_2 [0]
1_3 [0]
1_5 [0, 44, 111, 4, 222, 333, 332, 322, 221, 211, 110, 444, 443, 433, 100]
1_7 [0, 11, 21, 22, 122, 32, 31, 123, 133, 143, 144, 204, 104, 103, 1, 234, 244, 240, 200, 300, 400, 134, 132, 10, 243]
1_8 [0, 111, 443, 343, 333, 10, 233, 400, 300, 133, 132, 204, 200, 104, 103, 31]
1_9 [0]
1_10 [0, 400, 232, 304, 132, 122, 204, 300, 244, 243, 121, 233, 111, 344]
1_11 [0, 111, 44]
1_12 [0]
1_13 [0]
2_2 [0]
2_3 [0]
2_4 [0]
2_5 [0, 222, 400, 122, 300, 143, 11, 200, 133, 204]
2_6 [0, 11, 133, 143, 200, 100, 240, 300, 400]
2_7 [0, 10, 132, 204, 300, 400, 200, 11, 22, 104, 133, 123, 144, 240, 140]
2_8 [0]
2_9 [0]
2_10 [0, 344, 233, 111, 400, 122, 121, 222, 444, 4]
2_11 [0, 111, 44, 222, 443, 4]
2_12 [0]
2_13 [0]
3_2 [0]
3_3 [0]
3_4 [0]
3_5 [0]
3_6 [0]
3_7 [0]
3_8 [0]
3_9 [0]
3_10 [0]
3_11 [0]
3_12 [0]
3_13 [0, 4, 44, 443, 444, 433, 333, 332, 322, 222, 211, 111, 400, 343, 100, 300, 244, 122, 200, 144, 22, 21, 104, 103, 133, 234]
4_2 [0]
4_3 [0]
4_4 [0]
4_5 [0]
4_6 [0]
4_7 [0]
4_8 [0]
4_9 [0]
4_10 [0]
4_11 [0]
4_12 [0]
4_13 [0, 400, 234, 244, 222]
5_0 [0]
5_1 [0]
5_2 [0]
5_3 [0]
5_4 [0]
5_5 [0]
5_6 [0]
5_7 [0]
5_8 [0]
5_9 [0]
5_10 [0]
5_11 [0]
5_12 [0]
5_13 [0]
6_0 [0]
6_1 [0]
You have a new update available for SRL!
SRL Updater: Local Version - "828" | Remote Version = "829"
SRL Updater: Update File - "http://wizzup.org/static/srl/srl.tar.bz2"
SRL Updater: Downloading...
SRL Updater: Decompressing...
SRL Updater: Extracting...
SRL Update Successful!
6_2 [0]
6_3 [0]
6_4 [0]
6_5 [0]
6_6 [0]
6_7 [0]
6_8 [0]
6_9 [0]
6_10 [0]
6_11 [0]
6_12 [0]
6_13 [0]
7_1 [0]
7_2 [0]
7_3 [0]
7_4 [0]
7_5 [0]
7_6 [0]
7_7 [0]
7_8 [0]
7_9 [0]
7_10 [0]
7_11 [0]
7_12 [0]
7_13 [0]
8_1 [0]
8_2 [0]
8_3 [0]
8_4 [0]
8_5 [0]
8_6 [0]
8_7 [0]
8_8 [0]
8_9 [0]
8_10 [0]
8_11 [0]
8_12 [0]
8_13 [0]
9_1 [0]
9_2 [0]
9_3 [0]
9_4 [0]
9_5 [0]
9_6 [0]
9_7 [0]
9_8 [0]
9_9 [0]
9_10 [0]
9_11 [0]
9_12 [0]
10_1 [0]
10_2 [0]
10_3 [0]
10_4 [0]
10_5 [0]
10_6 [0]
10_7 [0]
10_8 [0]
10_9 [0]
10_10 [0]
10_11 [0]
10_12 [0, 332, 322, 222, 400, 122, 300, 123]
11_1 [0]
11_2 [0]
11_3 [0]
11_4 [0]
11_5 [0]
11_6 [0]
11_7 [0]
11_8 [0]
11_9 [0]
11_10 [0]
11_11 [0]
11_12 [0, 300, 123, 400, 122]
11_13 [0, 122, 112, 111, 11, 1, 300, 240, 244, 234, 233, 133, 123, 400, 340]
12_1 [0]
12_2 [0]
12_3 [0]
12_4 [0]
12_5 [0]
12_6 [0]
12_7 [0]
12_8 [0]
12_9 [0]
12_10 [0]
12_11 [0]
12_12 [0]
12_13 [0]
13_1 [0]
13_2 [0]
13_3 [0]
13_4 [0]
13_5 [0]
13_6 [0]
13_7 [0]
13_8 [0]
13_9 [0]
13_10 [0]
13_11 [0]
13_12 [0]
13_13 [0]
14_3 [0, 4, 444, 433, 44, 333, 443, 222, 211, 322, 111, 221, 332, 100]
14_4 [0]
14_5 [0]
14_6 [0]
14_7 [0]
14_8 [0]
14_9 [0]
14_10 [0]
14_11 [0, 400, 300, 244, 123, 11, 340, 344, 111, 333, 433]
14_12 [0, 300, 400, 123, 233, 333, 332, 322, 4, 222, 44, 444, 443, 433, 211, 111, 100, 221]
14_13 [0, 322]
15_5 [0]
15_6 [0, 400, 404, 4, 403, 303]
15_7 [0, 400, 300, 204, 200, 304, 103, 104, 144, 244, 203, 131, 31, 32, 132, 123, 233, 303, 242, 10, 11, 122, 343, 404, 121, 111, 232, 444, 222, 221, 443, 332, 243, 4, 333, 344, 342, 403, 133, 1]
15_8 [0, 400, 404, 444, 333, 343, 233, 232, 222]
15_9 [0, 444, 440, 400, 404, 344, 333, 334, 233, 222, 232, 44]
15_10 [0]
15_11 [0, 333, 322, 222]
15_12 [0, 222]
16_5 [0]
16_6 [0, 404, 303, 400, 304, 203, 202, 302, 403, 4]
16_7 [303, 232, 111, 0, 1, 11, 122, 222, 233, 343, 333, 203, 132, 121, 221, 10, 131, 202, 110, 231, 302, 403, 404, 332, 4, 342, 443, 444, 44, 322]
16_10 [0, 4, 333]
16_11 [0]
16_12 [0]
17_5 [0]
17_6 [0]
17_10 [333, 0]
17_11 [0]
17_12 [0]
17_13 [0]
PROFILING DONE!
Successfully executed.

marpis

2011-11-24 00:55:51

Thanks for your help! :)
This looks like a good start. I'm going to edit the code a bit and ask you to run the script again, and we'll see if we then get good numbers.

matviy

2011-11-24 01:17:08

The fastest way I'd think would be to load the entire surface image into a huge multi dimensional array. Then it should be rather easy and fast to find identical colors and search their adjacent pixels to figure out where you are. The array indexes would represent your coordinates.

Seeing as how the surface map is 7584x6668 big, and you'd need the color information (integer) for each pixel (element of the array) it would require a minimum of 200MB memory, ignoring array structure, without any kind of compression.

marpis

2011-11-24 01:29:24

From: matviy
The fastest way I'd think would be to load the entire surface image into a huge multi dimensional array. Then it should be rather easy and fast to find identical colors and search their adjacent pixels to figure out where you are.


Easy yes, fast no. :)
And also your idea feels kinda like finding DTMs, which is not SPS's principle.
SPS works so that you use 1-3 areas and go through them, not trying to find a place that matches, but a place that is the most matching.

marpis

2011-11-24 06:20:31

Ok, so I figured it would maybe help if I added the number of profiles to 1000. Now both R, G, and B sums get a value from 0-9, making 10^3 possibilities.
It still seems to give "0" as the only profile for most areas, which I just can't understand. Why those areas? Why does it work properly on others?

This is what I get after analyzing 10 areas with the new version:

[0]
[0]
[0]
[0]
[0, 677, 999, 778, 878, 978, 979, 989, 100]
[999, 111, 0]
[0]
[0, 999, 11, 111, 112, 122, 222, 233, 333, 344, 445, 556, 1]
[0]
[0]

So the problem remains.

Please, someone figure out why it keeps telling me most areas only have very dark colours!
I see that when it first starts profiling the areas that have trees, it gives more profiles than just one. The question is, why does it keep telling me that the lunar island is almost completely black when it clearly is not? I tried with paint and got to the conclusion that the avereage color in RGB is somewhere around (70, 70, 70) which is far from profile 0.
EDIT: Hmm, I see this observation fails on 7th area 0_12, which has plenty of woods, but still only gets profile 0.

Here's the updated version:

EDIT: Made slight adjustments:

program SPS_Area_Profiler;
{.include srl/srl.scar}
{.include sps/sps.simba}

const
AreasPath = AppPath + '/Includes/sps/img/runescape_surface/';

var
ProfiledAreas: Array [0..999] of TStringArray;

function GetProfile(View: T3DIntegerArray): Integer;
var
x, y, i, ii: integer;
ColorSum: Array [0..2] of integer;
ProfileAsArray: Array [0..2] of integer;
begin

for x := 0 to 19 do
for y := 0 to 19 do
for i := 0 to 2 do
ColorSum[i] := ColorSum[i] + View[x][y][i];

for i := 0 to 2 do
ColorSum[i] := ColorSum[i] div 400; // this is to get an averegage

for i := 0 to 2 do
begin
for ii := 10 downto 1 do
if (ColorSum[i]*1.0) <= (255.0 / ii) then
begin
ProfileAsArray[i] := (ii - 1);
Break;
end;
if (ii > 10) then
begin
Writeln('Something is clearly wrong...');
TerminateScript;
end;
end;

Result := ProfileAsArray[0] + ProfileAsArray[1]*10 + ProfileAsArray[2]*100;
end;

function CropArea(x, y: integer; Area: T3DIntegerArray): T3DIntegerArray;
var
xx, yy, i: integer;
begin
SetLength(Result, 20);

for xx := 0 to 19 do
begin

SetLength(Result[xx], 20);
for yy := 0 to 19 do
begin
SetLength(Result[xx][yy], 3);
for i := 0 to 2 do
try
Result[xx][yy][i] := Area[x + xx][y + yy][i];
except
Writeln(ExceptionToString(ExceptionType, ExceptionParam));
end;
end;
end;
end;

function GetAreaProfiles(Area: T3DIntegerArray): Array of integer;
var
x, y, n: integer;
View: T3DIntegerArray;

begin
SetLength(Result, 9999999);

for x := 0 to 80 do
for y := 0 to 80 do
begin
View := CropArea(x, y, Area);
Result[n] := GetProfile(View);
Inc(n);
end;

SetLength(Result, n);
ClearSameIntegers(Result);
writeln(result);
end;


procedure ProfileArea(Area: string);
var
i, L: integer;
Profiles: TIntegerArray;
begin
SPS_Setup(RUNESCAPE_SURFACE, [Area]);
SPS_Load;
Profiles := GetAreaProfiles(SPS_WorldMap[0]);

for i := high(Profiles) downto 0 do
begin
L := Length(ProfiledAreas[Profiles[i]]);
SetLength(ProfiledAreas[Profiles[i]], L + 1);
ProfiledAreas[Profiles[i]][L] := Area;
end;

Writeln(Area + ' == ' +ToStr(Profiles));
end;

function ClearDoubleStrings(TSA: TStringArray): TStringArray;
var
i, N, L: integer;
begin
L := Length(TSA);
SetLength(Result, L);
for i := (L - 1) downto 0 do
if (not InStrArr(TSA[i], Result, True)) then
begin
Result[L] := TSA[i];
Inc(N);
end;

SetLength(Result, N);
end;


procedure ProfileAllAreas;
var
x, y, i: integer;
s: string;
begin
ClearDebug;
Writeln('*** PROFILING ALL SPS AREAS, THIS MAY TAKE UP TO OR MORE THAN AN HOUR ***');
for x := 0 to 17 do
for y := 0 to 13 do
begin
s := IntToStr(x) + '_' + IntToStr(y);
if not FileExists(AreasPath + s + '.png') then
Continue;
ProfileArea(s);
end;

ClearDebug;
Writeln('PROFILING DONE! Printing results...');
Writeln('');
for i := 0 to 999 do
Writeln('SPS_ProfiledAreas['+ToStr(i)+'] := '+ToStr(ProfiledAreas[i])+';');

end;

begin
ProfileAllAreas;
end.program SPS_Area_Profiler;
{.include srl/srl.scar}
{.include sps/sps.simba}

const
AreasPath = AppPath + '/Includes/sps/img/runescape_surface/';

var
ProfiledAreas: Array [0..999] of TStringArray;

function GetProfile(View: T3DIntegerArray): Integer;
var
x, y, i, ii: integer;
ColorSum: Array [0..2] of integer;
ProfileAsArray: Array [0..2] of integer;
begin

for x := 0 to 19 do
for y := 0 to 19 do
for i := 0 to 2 do
ColorSum[i] := ColorSum[i] + View[x][y][i];

for i := 0 to 2 do
ColorSum[i] := ColorSum[i] div 400; // this is to get an averegage

for i := 0 to 2 do
begin
for ii := 10 downto 1 do
if (ColorSum[i]*1.0) <= (255.0 / ii) then
begin
ProfileAsArray[i] := (ii - 1);
Break;
end;
if (ii > 10) then
begin
Writeln('Something is clearly wrong...');
TerminateScript;
end;
end;

Result := ProfileAsArray[0] + ProfileAsArray[1]*10 + ProfileAsArray[2]*100;
end;

function CropArea(x, y: integer; Area: T3DIntegerArray): T3DIntegerArray;
var
xx, yy, i: integer;
begin
SetLength(Result, 20);

for xx := 0 to 19 do
begin

SetLength(Result[xx], 20);
for yy := 0 to 19 do
begin
SetLength(Result[xx][yy], 3);
for i := 0 to 2 do
try
Result[xx][yy][i] := Area[x + xx][y + yy][i];
except
Writeln(ExceptionToString(ExceptionType, ExceptionParam));
end;
end;
end;
end;

function GetAreaProfiles(Area: T3DIntegerArray): Array of integer;
var
x, y, n: integer;
View: T3DIntegerArray;

begin
SetLength(Result, 9999999);

for x := 0 to 80 do
for y := 0 to 80 do
begin
View := CropArea(x, y, Area);
Result[n] := GetProfile(View);
Inc(n);
end;

SetLength(Result, n);
ClearSameIntegers(Result);
writeln(result);
end;


procedure ProfileArea(Area: string);
var
i, L: integer;
Profiles: TIntegerArray;
begin
SPS_Setup(RUNESCAPE_SURFACE, [Area]);
SPS_Load;
Profiles := GetAreaProfiles(SPS_WorldMap[0]);

for i := high(Profiles) downto 0 do
begin
L := Length(ProfiledAreas[Profiles[i]]);
SetLength(ProfiledAreas[Profiles[i]], L + 1);
ProfiledAreas[Profiles[i]][L] := Area;
end;

Writeln(Area + ' == ' +ToStr(Profiles));
end;

function ClearDoubleStrings(TSA: TStringArray): TStringArray;
var
i, N, L: integer;
begin
L := Length(TSA);
SetLength(Result, L);
for i := (L - 1) downto 0 do
if (not InStrArr(TSA[i], Result, True)) then
begin
Result[L] := TSA[i];
Inc(N);
end;

SetLength(Result, N);
end;


procedure ProfileAllAreas;
var
x, y, i: integer;
s: string;
begin
ClearDebug;
Writeln('*** PROFILING ALL SPS AREAS, THIS MAY TAKE UP TO OR MORE THAN AN HOUR ***');
for x := 0 to 17 do
for y := 0 to 13 do
begin
s := IntToStr(x) + '_' + IntToStr(y);
if not FileExists(AreasPath + s + '.png') then
Continue;
ProfileArea(s);
end;

ClearDebug;
Writeln('PROFILING DONE! Printing results...');
Writeln('');
for i := 0 to 999 do
Writeln('SPS_ProfiledAreas['+ToStr(i)+'] := '+ToStr(ProfiledAreas[i])+';');

end;

begin
ProfileAllAreas;
end.

EDIT: I'm running a version to which I added some debug, hopefully I find out something…

Sir R. M8gic1an

2011-11-24 06:52:37

U put the script twice in there..

-RM

marpis

2011-11-24 07:12:44

Ok I think I solved it!

Someone else too try running this:

program SPS_Area_Profiler;
{.include srl/srl.scar}
{.include sps/sps.simba}

const
AreasPath = AppPath + '/Includes/sps/img/runescape_surface/';

var
ProfiledAreas: Array [0..999] of TStringArray;

function GetProfile(View: T3DIntegerArray): Integer;
var
x, y, i, ii: integer;
ColorSum: Array [0..2] of integer;
ProfileAsArray: Array [0..2] of integer;
begin
for x := 0 to 19 do
for y := 0 to 19 do
for i := 0 to 2 do
ColorSum[i] := ColorSum[i] + View[x][y][i];

for i := 0 to 2 do
ColorSum[i] := ColorSum[i] div 400 div 16; // this is to get an averegage of all the pixels

for i := 0 to 2 do
begin
for ii := 0 to 9 do
if (ColorSum[i]) <= (25.5*ii) then
begin
ProfileAsArray[i] := (ii - 1);
// Writeln('ColorSum['+ToStr(i)+'] = '+ToStr(ColorSum[i])+' -> ProfileAsArray['+ToStr(i)+'] = '+ToStr(ProfileAsArray[i]));
Break;
end;

if (ii > 10) then
begin
Writeln('Something is clearly wrong...');
TerminateScript;
end;
end;

Result := ProfileAsArray[0] + ProfileAsArray[1]*10 + ProfileAsArray[2]*100;
end;

function CropArea(x, y: integer; Area: T3DIntegerArray): T3DIntegerArray;
var
xx, yy, i: integer;
begin
SetLength(Result, 20);

for xx := 0 to 19 do
begin

SetLength(Result[xx], 20);
for yy := 0 to 19 do
begin
SetLength(Result[xx][yy], 3);
for i := 0 to 2 do
try
Result[xx][yy][i] := Area[x + xx][y + yy][i];
except
Writeln(ExceptionToString(ExceptionType, ExceptionParam));
end;
end;
end;
end;

function GetAreaProfiles(Area: T3DIntegerArray): Array of integer;
var
x, y, n: integer;
View: T3DIntegerArray;

begin
SetLength(Result, 9999999);

for x := 0 to 80 do
for y := 0 to 80 do
begin
View := CropArea(x, y, Area);
Result[n] := GetProfile(View);
Inc(n);
end;

SetLength(Result, n);
ClearSameIntegers(Result);
end;


procedure ProfileArea(Area: string);
var
i, L: integer;
Profiles: TIntegerArray;
begin
SPS_Setup(RUNESCAPE_SURFACE, [Area]);
SPS_Load;
Profiles := GetAreaProfiles(SPS_WorldMap[0]);

for i := high(Profiles) downto 0 do
begin
L := Length(ProfiledAreas[Profiles[i]]);
SetLength(ProfiledAreas[Profiles[i]], L + 1);
ProfiledAreas[Profiles[i]][L] := Area;
end;

Writeln(Area + ' == ' +ToStr(Profiles));
end;

function ClearDoubleStrings(TSA: TStringArray): TStringArray;
var
i, N, L: integer;
begin
L := Length(TSA);
SetLength(Result, L);
for i := (L - 1) downto 0 do
if (not InStrArr(TSA[i], Result, True)) then
begin
Result[L] := TSA[i];
Inc(N);
end;

SetLength(Result, N);
end;


procedure ProfileAllAreas;
var
x, y, i: integer;
s: string;
begin
ClearDebug;
Writeln('*** PROFILING ALL SPS AREAS, THIS MAY TAKE UP TO OR MORE THAN AN HOUR ***');
for x := 0 to 17 do
for y := 0 to 13 do
begin
s := IntToStr(x) + '_' + IntToStr(y);
if not FileExists(AreasPath + s + '.png') then
Continue;
ProfileArea(s);
end;

ClearDebug;
Writeln('PROFILING DONE! Printing results...');
Writeln('');
for i := 0 to 999 do
Writeln('SPS_ProfiledAreas['+ToStr(i)+'] := '+ToStr(ProfiledAreas[i])+';');

end;

begin
ProfileAllAreas;
end.

Home

2011-11-24 07:20:57

Running.. :P

~Home

marpis

2011-11-24 09:13:54

From: Home
Running.. :P

~Home


Kiitos! Too bad it will face this:

Error: Out Of Range at line 100
Although the numbers it gave looked very promising.

I will post once again a fixed version in a minute.
Here's a fixed version:

program SPS_Area_Profiler;
{.include srl/srl.scar}
{.include sps/sps.simba}

const
AreasPath = AppPath + '/Includes/sps/img/runescape_surface/';

var
ProfiledAreas: Array [0..999] of TStringArray;

function GetProfile(View: T3DIntegerArray): Integer;
var
x, y, i, ii: integer;
ColorSum: Array [0..2] of integer;
ProfileAsArray: Array [0..2] of integer;
begin
for x := 0 to 19 do
for y := 0 to 19 do
for i := 0 to 2 do
ColorSum[i] := ColorSum[i] + View[x][y][i];

for i := 0 to 2 do
ColorSum[i] := ColorSum[i] div 400 div 16; // this is to get an averegage of all the pixels

for i := 0 to 2 do
begin
for ii := 1 to 10 do
if (ColorSum[i]) <= (25.5*ii) then
begin
ProfileAsArray[i] := ii - 1;
// Writeln('ColorSum['+ToStr(i)+'] = '+ToStr(ColorSum[i])+' -> ProfileAsArray['+ToStr(i)+'] = '+ToStr(ProfileAsArray[i]));
Break;
end;

if (ii > 10) then
begin
Writeln('Something is clearly wrong...');
TerminateScript;
end;
end;

Result := ProfileAsArray[0] + ProfileAsArray[1]*10 + ProfileAsArray[2]*100;
end;

function CropArea(x, y: integer; Area: T3DIntegerArray): T3DIntegerArray;
var
xx, yy, i: integer;
begin
SetLength(Result, 20);

for xx := 0 to 19 do
begin

SetLength(Result[xx], 20);
for yy := 0 to 19 do
begin
SetLength(Result[xx][yy], 3);
for i := 0 to 2 do
try
Result[xx][yy][i] := Area[x + xx][y + yy][i];
except
Writeln(ExceptionToString(ExceptionType, ExceptionParam));
end;
end;
end;
end;

function GetAreaProfiles(Area: T3DIntegerArray): Array of integer;
var
x, y, n: integer;
View: T3DIntegerArray;

begin
SetLength(Result, 9999999);

for x := 0 to 80 do
for y := 0 to 80 do
begin
View := CropArea(x, y, Area);
Result[n] := GetProfile(View);
Inc(n);
end;

SetLength(Result, n);
ClearSameIntegers(Result);
end;


procedure ProfileArea(Area: string);
var
i, L: integer;
Profiles: TIntegerArray;
begin
SPS_Setup(RUNESCAPE_SURFACE, [Area]);
SPS_Load;
Profiles := GetAreaProfiles(SPS_WorldMap[0]);

for i := high(Profiles) downto 0 do
begin
L := Length(ProfiledAreas[Profiles[i]]);
SetLength(ProfiledAreas[Profiles[i]], L + 1);
ProfiledAreas[Profiles[i]][L] := Area;
end;

Writeln(Area + ' == ' +ToStr(Profiles));
end;

function ClearDoubleStrings(TSA: TStringArray): TStringArray;
var
i, N, L: integer;
begin
L := Length(TSA);
SetLength(Result, L);
for i := (L - 1) downto 0 do
if (not InStrArr(TSA[i], Result, True)) then
begin
Result[L] := TSA[i];
Inc(N);
end;

SetLength(Result, N);
end;


procedure ProfileAllAreas;
var
x, y, i: integer;
s: string;
begin
ClearDebug;
Writeln('*** PROFILING ALL SPS AREAS, THIS MAY TAKE UP TO OR MORE THAN AN HOUR ***');
for x := 0 to 17 do
for y := 0 to 13 do
begin
s := IntToStr(x) + '_' + IntToStr(y);
if not FileExists(AreasPath + s + '.png') then
Continue;
ProfileArea(s);
end;

ClearDebug;
Writeln('PROFILING DONE! Printing results...');
Writeln('');
for i := 0 to 999 do
Writeln('SPS_ProfiledAreas['+ToStr(i)+'] := '+ToStr(ProfiledAreas[i])+';');

end;

begin
ProfileAllAreas;
end.

legoace

2011-11-24 10:46:40

Can I not split this up into like 4 scripts so I can fully utilize my processor? I tried and got this in the first one, only 2 other ones were running yet:
*** PROFILING ALL SPS AREAS, THIS MAY TAKE UP TO OR MORE THAN AN HOUR ***
0_1 == [876, 776, 766, 666, 566, 556, 555, 455, 456, 667, 567, 677, 676, 678, 777, 778, 788]
Something is clearly wrong...
Successfully executed.

EDIT: 2nd thread quit before it gave any data, third just gave this:
10_1 == [554, 655, 665, 766, 776, 876, 555, 544, 444, 333, 666, 433, 443, 223, 323, 222, 233, 334, 434, 545, 344, 234, 123, 122, 133]

Bobzilla69

2011-11-24 10:51:39

got same as above for first one, might need to tweak script than i will run it for you again.

*** PROFILING ALL SPS AREAS, THIS MAY TAKE UP TO OR MORE THAN AN HOUR ***
0_1 == [876, 776, 766, 666, 566, 556, 555, 455, 456, 667, 567, 677, 676, 678, 777, 778, 788]
Something is clearly wrong...
Successfully executed.

marpis

2011-11-24 11:01:13

Damn… Let's try this, although it might just screw the whole thing:

program SPS_Area_Profiler;
{.include srl/srl.scar}
{.include sps/sps.simba}

const
AreasPath = AppPath + '/Includes/sps/img/runescape_surface/';

var
ProfiledAreas: Array [0..999] of TStringArray;

function GetProfile(View: T3DIntegerArray): Integer;
var
x, y, i, ii: integer;
ColorSum: Array [0..2] of integer;
ProfileAsArray: Array [0..2] of integer;
begin
for x := 0 to 19 do
for y := 0 to 19 do
for i := 0 to 2 do
ColorSum[i] := ColorSum[i] + View[x][y][i];

for i := 0 to 2 do
ColorSum[i] := ColorSum[i] div 400 div 16; // this is to get an averegage of all the pixels

for i := 0 to 2 do
for ii := 1 to 10 do
if (ColorSum[i]) <= (25.5*ii) then
begin
ProfileAsArray[i] := ii - 1;
// Writeln('ColorSum['+ToStr(i)+'] = '+ToStr(ColorSum[i])+' -> ProfileAsArray['+ToStr(i)+'] = '+ToStr(ProfileAsArray[i]));
Break;
end;

Result := ProfileAsArray[0] + ProfileAsArray[1]*10 + ProfileAsArray[2]*100;
end;

function CropArea(x, y: integer; Area: T3DIntegerArray): T3DIntegerArray;
var
xx, yy, i: integer;
begin
SetLength(Result, 20);

for xx := 0 to 19 do
begin

SetLength(Result[xx], 20);
for yy := 0 to 19 do
begin
SetLength(Result[xx][yy], 3);
for i := 0 to 2 do
try
Result[xx][yy][i] := Area[x + xx][y + yy][i];
except
Writeln(ExceptionToString(ExceptionType, ExceptionParam));
end;
end;
end;
end;

function GetAreaProfiles(Area: T3DIntegerArray): Array of integer;
var
x, y, n: integer;
View: T3DIntegerArray;

begin
SetLength(Result, 9999999);

for x := 0 to 80 do
for y := 0 to 80 do
begin
View := CropArea(x, y, Area);
Result[n] := GetProfile(View);
Inc(n);
end;

SetLength(Result, n);
ClearSameIntegers(Result);
end;


procedure ProfileArea(Area: string);
var
i, L: integer;
Profiles: TIntegerArray;
begin
SPS_Setup(RUNESCAPE_SURFACE, [Area]);
SPS_Load;
Profiles := GetAreaProfiles(SPS_WorldMap[0]);

for i := high(Profiles) downto 0 do
begin
L := Length(ProfiledAreas[Profiles[i]]);
SetLength(ProfiledAreas[Profiles[i]], L + 1);
ProfiledAreas[Profiles[i]][L] := Area;
end;

Writeln(Area + ' == ' +ToStr(Profiles));
end;

function ClearDoubleStrings(TSA: TStringArray): TStringArray;
var
i, N, L: integer;
begin
L := Length(TSA);
SetLength(Result, L);
for i := (L - 1) downto 0 do
if (not InStrArr(TSA[i], Result, True)) then
begin
Result[L] := TSA[i];
Inc(N);
end;

SetLength(Result, N);
end;


procedure ProfileAllAreas;
var
x, y, i: integer;
s: string;
begin
ClearDebug;
Writeln('*** PROFILING ALL SPS AREAS, THIS MAY TAKE UP TO OR MORE THAN AN HOUR ***');
for x := 0 to 17 do
for y := 0 to 13 do
begin
s := IntToStr(x) + '_' + IntToStr(y);
if not FileExists(AreasPath + s + '.png') then
Continue;
ProfileArea(s);
end;

ClearDebug;
Writeln('PROFILING DONE! Printing results...');
Writeln('');
for i := 0 to 999 do
Writeln('SPS_ProfiledAreas['+ToStr(i)+'] := '+ToStr(ProfiledAreas[i])+';');

end;

begin
ProfileAllAreas;
end.

Bobzilla69

2011-11-24 11:09:26

running it now, will check when i get home ~50min

Edit: 164 areas to go……. going to bed so will update in the morning.

p.s. add a timer so we can see how long it takes, would be interesting.

legoace

2011-11-24 13:54:58

Here are the results I got. I split it up into 4 pieces without realizing how you were going to print the results and clear the debug before you did so… Hope it's still useful.

Just kidding the post is way to long for the forum. Attached instead.

Coh3n

2011-11-24 15:59:40

Marpis, I created new map pieces a while ago (wrote a program to automatically create, then slice the map), and ever since, SPS works well for 1-3 loads I find, then it fails for some reason. It seems to be only in certain locations, though.

I've remade the paths and checked the SPS areas many times, but still, the same thing happens. Is there anywhere that uses the size of the world map (because it has changed in the new one), or is there anything you can think of that would be relevant?

I'd like to be able to release the new SPS and MSI, but I'm not satisfied with some of my testing runs. I've talked on IRC, and other people have had similar issues. For example, if you run GetMyPos in the same spot over and over again (or maybe move your player one or two tiles), it will return different values, values that are no where near each other.

But like I said, it only seems to be happening in certain areas. For me, between RM Mine and PS Dbox, PS Dbox and PS Yews, AlKharid bank to LSE Mine, and Guild Mine.

I'm not sure if you'll be able to help, but you know much more about how it works than I do.

E: It's just I don't understand why it would work perfectly for a load or two, then all of the sudden fail.

legoace

2011-11-24 20:05:38

Used MATLab to get my results into the form they would've been in without splitting up the script, file's attached.

Nava2

2011-11-24 23:00:13

cat ./sps_areas.txt | grep -e 'SPS_Pro.*,\s*$' | sed -r 's/([0-9]{1,3})_([0-9]{1,3})/'\''\1_\2'\''/g ; s/=\ /&\[/g ; s/'\'',\ $/\];/g'

Array declaration attached. :)

marpis

2011-11-25 01:25:12

From: Nava2
cat ./sps_areas.txt | grep -e 'SPS_Pro.*,\s*$' | sed -r 's/([0-9]{1,3})_([0-9]{1,3})/'\''\1_\2'\''/g ; s/=\ /&\[/g ; s/'\'',\ $/\];/g'

Array declaration attached. :)


Thanks!

Hm… I'm kind of disappointed. There are like dozens of areas for most profiles.
Not good.

I see this can't be done solely on RGB. I'm thinking we also check trees, rocks, and stuff like that around us and see which areas have similar items.

The next step:
1) Get areas that have same profiles from the huge array
2) Are there too many areas to run the regular SPS search?
-> No: Run regular SPS search, the results are final
-> Yes: Recognize objects around: RoadColor, trees, rocks, what else?
3) Get areas that have these objects too
4) Now we have 2 arrays of areas: one with areas of matching profile, one with areas of matching surroundings. Pick areas that appear on both arrays.
5) Are there still too many areas to run the regular SPS search?
-> No: Win!
-> Yes: Out of luck. What now?


This would mean SPS locates us in 3 different ways:
1) Avereage color content to find our possibly current area
2) Info of trees and rocks surrounding us to help recognize our current area
3) Intense RGB matching, the real heart of SPS, which gives us the real position with nearly tile accuracy.

—

What comes to these new problems Coh3, I really have no idea.
When did the errors start to pop up? What changed?
There could be some errors with maths, somehow getting confused due to overlap. This is just a guess though, and not very probable.

Coh3n

2011-11-25 01:50:01

From: marpis

3) Intense RGB matching, the real heart of SPS, which gives us the real position with nearly tile accuracy.
How difficult would this be?

From: marpis

What comes to these new problems Coh3, I really have no idea.
When did the errors start to pop up? What changed?
There could be some errors with maths, somehow getting confused due to overlap. This is just a guess though, and not very probable.
Well, for me since I updated the maps. The only difference is that the world map is a different size. All the map pieces are still 500x500.

marpis

2011-11-25 02:11:29

From: Coh3n
How difficult would this be?

Haha :D That's what SPS does. FindMapInMapExx!
The point was, we don't use that technique before we have narrowed our location possibilities to 1-4 areas.

From: Coh3n

Well, for me since I updated the maps. The only difference is that the world map is a different size. All the map pieces are still 500x500.

Does it always mess up at the overlaps of areas, or also in the centers of areas?

Coh3n

2011-11-25 02:15:19

From: marpis
Haha :D That's what SPS does. FindMapInMapExx!
The point was, we don't use that technique before we have narrowed our location possibilities to 1-4 areas.
Oh, I see :p The only thing about comparing minimap colours to the world map ones are that there are some areas on the map that are completely different then those on the minimap, which may be part of the problem I'm having.

From: marpis

Does it always mess up at the overlaps of areas, or also in the centers of areas?
Overlapping areas seem to mess up a lot more, but that's usually fixed if I just have both the overlapping areas in the SPS_Areas array. However, since the new maps, I've had it happen in the middle of areas as well. Both the areas are 90% forest or desert area as well, if that matters.

marpis

2011-11-25 06:05:08

From: Coh3n
Oh, I see :p The only thing about comparing minimap colours to the world map ones are that there are some areas on the map that are completely different then those on the minimap, which may be part of the problem I'm having.

Overlapping areas seem to mess up a lot more, but that's usually fixed if I just have both the overlapping areas in the SPS_Areas array. However, since the new maps, I've had it happen in the middle of areas as well. Both the areas are 90% forest or desert area as well, if that matters.


Hmm… What areas are completely different? Most places are almost identical.
What tolerance are you using? Has the original 0.3 caused problems? Have you tried increasing tolerance?

Nava2

2011-11-25 08:41:08

Why not implement HSL in the same way that we have RGB?

Yes, it will be SLOWER, but I think Accuracy >> speed at the moment.

DaWu

2011-11-25 08:41:35

From: marpis
Hmm… What areas are completely different? Most places are almost identical.
What tolerance are you using? Has the original 0.3 caused problems? Have you tried increasing tolerance?



I for one have this problem when at this one area, inside 10x10 tile box, the x axis value seems to be nearly the same for every tile, while Y axis changes.

marpis

2011-11-25 09:23:57

From: Nava2
Why not implement HSL in the same way that we have RGB?

Yes, it will be SLOWER, but I think Accuracy >> speed at the moment.


I thought about this, but came to the conclusion that it wouldn't really help.
The areas for profiles would be the same, because the colors don't change, so of course they also get same HSL values. Every area that has and only those which have the RGB profile "x" would also have the HSL profile "y", thus not eliminating any areas from our most-probable-areas-list.

But yes, accuracy > speed, always. At the moment we need to figure out the new, weird bugs that Coh3n and some others have found. Something must have changed, because we didn't use to have this kind of inaccuracy. At the moment Coh3n knows the simba-side of SPS best, I only know the plugin and the big idea, not the little details anymore.
Meanwhile, I'm slowly working on the current area recognizer.

From: DaWu
I for one have this problem when at this one area, inside 10x10 tile box, the x axis value seems to be nearly the same for every tile, while Y axis changes.


How much does it change? Is it almost static, like +400 pixels?

DaWu

2011-11-25 10:00:29

From: marpis
I thought about this, but came to the conclusion that it wouldn't really help.
The areas for profiles would be the same, because the colors don't change, so of course they also get same HSL values. Every area that has and only those which have the RGB profile "x" would also have the HSL profile "y", thus not eliminating any areas from our most-probable-areas-list.

But yes, accuracy > speed, always. At the moment we need to figure out the new, weird bugs that Coh3n and some others have found. Something must have changed, because we didn't use to have this kind of inaccuracy. At the moment Coh3n knows the simba-side of SPS best, I only know the plugin and the big idea, not the little details anymore.
Meanwhile, I'm slowly working on the current area recognizer.



How much does it change? Is it almost static, like +400 pixels?



Y axis seems pretty much correct, not off by much atleast, but say the X axis kinda gets locked inside 10 pxl range inside that area, AND the X axis value is wrong to begin with, by ~15 pxls.
Anyway -> SPS manages to walk to that "bugged" area just fine, but when it reaches there, getmypos starts returning wrong

What I find intresting tho is, even while you sit on area where getmypos returns wrong position, PosOnMM still appears to work correctly for the nonbugged area on the minimap, aint absolutely sure about this either.

Coh3n

2011-11-25 12:23:16

From: marpis
Hmm… What areas are completely different? Most places are almost identical.
What tolerance are you using? Has the original 0.3 caused problems? Have you tried increasing tolerance?
Rimmington mine on the minimap has completely different shading then on the world map, same with Al Kharid.

It could just be because the minimap has much more detail in general. It never used to.

Nava2

2011-11-25 17:02:25

Fixed the arrays, that was my bad.

$ cat ./sps_areas.txt | grep -e 'SPS_Pro.*,\s*$' | sed -r 's/([0-9]{1,3})_([0-9]{1,3})/'\''\1_\2'\''/g ; s/=\ /&\[/g ; s/'\'',\s*$/\'\''];/g'

mormonman

2011-11-25 17:42:26

From: Coh3n
Rimmington mine on the minimap has completely different shading then on the world map, same with Al Kharid.

It could just be because the minimap has much more detail in general. It never used to.


With OpenGL you can get chunks of the map that is loaded to the minimap. I think you can even get the whole map from the cache with java(ask Method).

pyroryan

2011-11-25 17:53:52

From: mormonman
With OpenGL you can get chunks of the map that is loaded to the minimap. I think you can even get the whole map from the cache with java(ask Method).


You would need XTEA keys and with the current status of legal issues from AES encryption, its not likely that there will be a massive attempt to collect most/all XTEA keys.

Coh3n

2011-11-25 17:59:29

From: mormonman
With OpenGL you can get chunks of the map that is loaded to the minimap. I think you can even get the whole map from the cache with java(ask Method).
Also, (I forget who it was) someone actually posted a chuck that they got from OpenGL, and it was much much more detailed. The current method we use is definitely closer. Now, if the same thing could be done in the safe/software mode, then we'd be good to go.

mormonman

2011-11-25 18:03:32

From: Coh3n
Also, (I forget who it was) someone actually posted a chuck that they got from OpenGL, and it was much much more detailed. The current method we use is definitely closer. Now, if the same thing could be done in the safe/software mode, then we'd be good to go.


Then cache dumping is the way to go. I wasn't sure if the minimap detail changed from safe to opengl modes.

Coh3n

2011-11-25 18:05:51

From: mormonman
Then cache dumping is the way to go. I wasn't sure if the minimap detail changed from safe to opengl modes.
I'm only assuming it does because the image that was posted was definitely different from the minimap in Safe/Software mode.

So, who's the best candidate to talk to about dumping the images (or better yet, the entire map) if possible?

mormonman

2011-11-25 18:12:07

From: Coh3n
I'm only assuming it does because the image that was posted was definitely different from the minimap in Safe/Software mode.

So, who's the best candidate to talk to about dumping the images (or better yet, the entire map) if possible?


Method.