SRL Archive - RS3 Help

Priffdinas SPS Map


TomTuff

2014-11-11 16:20:08

Does anyone have an SPS map of priffdinas?

I want to make a thieving script, so I tried making an SPS map. It didn't turn out well. Does anyone have a better one?


Lipcot

2014-11-11 18:09:06

From: TomTuff
Does anyone have an SPS map of priffdinas?

I want to make a thieving script, so I tried making an SPS map. It didn't turn out well. Does anyone have a better one?


you should really improve your SPS abillities m8!

Have you tried enlarging the map to the biggest possible? that will reduce a lot the quantity of images you have to paste

Clarity

2014-11-11 18:15:57

It looks like each square is maximum minimap size. Didn't Brandon or someone have a program that spliced together minimap images perfectly via OGL?

Ashaman88

2014-11-11 18:18:36

I blame the blackness

3Garrett3

2014-11-11 18:22:41

From: Clarity
It looks like each square is maximum minimap size. Didn't Brandon or someone have a program that spliced together minimap images perfectly via OGL?


Brandon and @Frement both used to have one and from conversations with them, both have lost the source code. If anyone else had something like this it would make life so much better though.

Ian

2014-11-11 19:13:12

From: 3Garrett3
Brandon and @Frement both used to have one and from conversations with them, both have lost the source code. If anyone else had something like this it would make life so much better though.


I used something that Brandon made awhile ago when I made a map for all of F2P, I'll see if I stil have it.

TomTuff

2014-11-11 19:13:23

From: Ashaman88
I blame the blackness


That may have something to do with it. However, a big part is that when the new minimap chunks are loaded, some of them just plain didn't line up at all. It seems like Jagex has implemented some variance into minimap rendering.

From: 3Garrett3
Brandon and @Frement both used to have one and from conversations with them, both have lost the source code. If anyone else had something like this it would make life so much better though.


Agreed! Someone go back in time and find the code please!

Lipcot

2014-11-11 19:38:05

From: TomTuff
…


i suppose since you are a SRL member you've done all of this but well, ill just say it anyways:

1)have you tried relogging to make different screenshots of the same minimap? since it changes everytime you log in, you can take 3 or 4 of each part and see which merge better with which one.. hell of a work though! …

2)do you have SPSAnyangle := true; ? i've noticed that this , when you have a low quality SPS map or hard area, breaks sps sometimes, or at least that happens in my toads script. If you do, try using SPS.debug since in my case, it would find my positions but then when i used it on the script it failed finding my position accurately.

3)Have you tried fiddling with the settings ? TOL, ACCURACCY and MIN MATCH PERCENT?

4)Maybe try erasing dots and symbols?

and yeah, blackness tends to screw up sps maps in my experience.

TomTuff

2014-11-11 19:52:02

From: undorak7
i suppose since you are a SRL member you've done all of this but well, ill just say it anyways:

1)have you tried relogging to make different screenshots of the same minimap? since it changes everytime you log in, you can take 3 or 4 of each part and see which merge better with which one.. hell of a work though! …

2)do you have SPSAnyangle := true; ? i've noticed that this , when you have a low quality SPS map or hard area, breaks sps sometimes, or at least that happens in my toads script. If you do, try using SPS.debug since in my case, it would find my positions but then when i used it on the script it failed finding my position accurately.

3)Have you tried fiddling with the settings ? TOL, ACCURACCY and MIN MATCH PERCENT?

4)Maybe try erasing dots and symbols?

and yeah, blackness tends to screw up sps maps in my experience.


I haven't bothered actually doing anything with sps itself, since the map is so bad. I didn't think about relogging several times to try and get good matches, it just seems like too much work.

Anyways, I had another idea. Could I potentially have maybe 4 or 5 sps maps for my script and determine which one I'm in in some other way? Just a thought. sps.getplayerpos returns [-1, -1] if the function doesn't determine a position, so I could use that.

Lipcot

2014-11-11 20:40:58

From: TomTuff
I haven't bothered actually doing anything with sps itself, since the map is so bad. I didn't think about relogging several times to try and get good matches, it just seems like too much work.

Anyways, I had another idea. Could I potentially have maybe 4 or 5 sps maps for my script and determine which one I'm in in some other way? Just a thought. sps.getplayerpos returns [-1, -1] if the function doesn't determine a position, so I could use that.


i suppose its possible.. if sps [-1, -1] then change map.

you could look at incurable's lodestone unlocker (which has multiple sps maps)

Justin

2014-11-11 20:44:55

If I get time tonight when I get home I'll see if I can get a working map for you

Ashaman88

2014-11-11 21:37:04

That map has color 0. It von't vork!! Unless someone makes a workaround… @Olly; ? It will get super confused by the 0. With the current state of SPS, you will need to make the map while in OGL mode (so it won't be color 0). And you will need to test it/run it while in OGL mode as well. Go ahead and test a map made in OGL mode. You will see that it debugs fine while you are in OGL mode, but if you switch graphics to DX with the same map, it won't work.

I'm not sure if SPS is just ignoring color 0 or what, but @Brandon; helped me figure out that was the issue with my other script which had black in the MM

Olly

2014-11-11 21:59:18

From: Ashaman88
That map has color 0. It von't vork!! Unless someone makes a workaround… @Olly; ? It will get super confused by the 0. With the current state of SPS, you will need to make the map while in OGL mode (so it won't be color 0). And you will need to test it/run it while in OGL mode as well. Go ahead and test a map made in OGL mode. You will see that it debugs fine while you are in OGL mode, but if you switch graphics to DX with the same map, it won't work.

I'm not sure if SPS is just ignoring color 0 or what, but @Brandon; helped me figure out that was the issue with my other script which had black in the MM


That makes no sense, SPS does not (and have never) ignored any color. What's the color of black on both graphic modes, maybe we calc some super high tolerance between them?

Ashaman88

2014-11-11 22:09:25

From: Olly
That makes no sense, SPS does not (and have never) ignored any color. What's the color of black on both graphic modes, maybe we calc some super high tolerance between them?


DX it's 0. On OGL I think it's a range, but usually never 0 (very rare cases it will be 0). You can go test out my gnome agility script. try debuging your position while upstairs in DX mode, won't work. Switch to OGL mode, works fine.

Edit: @Brandon; showed me a pic debugging that color 0 came up as transparent or something crazy like that. Let me see if i can find, edit2:
found out why it doesn't work in dx
[6/13/2014 10:35:14 PM] Brandon T: http://i.imgur.com/0YYUkV1.png
[6/13/2014 10:35:25 PM] Brandon T: that's what happens if you draw the directx map onto the client

TomTuff

2014-11-11 22:15:09

From: Ashaman88
DX it's 0. On OGL I think it's a range, but usually never 0 (very rare cases it will be 0). You can go test out my gnome agility script. try debuging your position while upstairs in DX mode, won't work. Switch to OGL mode, works fine.

Edit: @Brandon; showed me a pic debugging that color 0 came up as transparent or something crazy like that. Let me see if i can find, edit2:


That's a result of how Simba handles bitmaps. In TMufasaBitmaps, 0 is treated as transparency. SPS uses TMufasaBitmaps.

Also, I just made another crack at the map right before reading what you guys said about not using DX. Could I just convert each pixel of color 0 to like color 1?

Clarity

2014-11-11 22:21:06

From: TomTuff
That's a result of how Simba handles bitmaps. In TMufasaBitmaps, 0 is treated as transparency. SPS uses TMufasaBitmaps.

E: nevermind, ninja'd.

TomTuff

2014-11-11 22:22:57

:ninja:

Brandon

2014-11-11 22:23:42

From: Olly
That makes no sense, SPS does not (and have never) ignored any color. What's the color of black on both graphic modes, maybe we calc some super high tolerance between them?


Makes perfect sense. SPS ignores black as it's the default transparent colour. For example, when we used to make 512x512 maps, we always set parts we wanted to ignore to black. Even the current fonts work like that.. All of TmufasaBitmaps are written with the alpha channel completely removed and black used instead.

In OpenGL, black is 65535 and in Direct-X, it is either 0 or the alpha channel is 0 with the background being black instead.

Olly

2014-11-11 22:28:38

From: Brandon
Makes perfect sense. SPS ignores black as it's the default transparent colour. For example, when we used to make 512x512 maps, we always set parts we wanted to ignore to black. Even the current fonts work like that.. All of TmufasaBitmaps are written with the alpha channel completely removed and black used instead.

In OpenGL, black is 65535 and in Direct-X, it is either 0 or the alpha channel is 0 with the background being black instead.


SPS is creating its matrices….

begin
C := bmp.fastGetPixel(x, y);
ColorToRGB(C, R, G, B);

Res[0] := Res[0] + R;
Res[1] := Res[1] + G;
Res[2] := Res[2] + B;
end;

If (x, y) is the "transparent color" it will return 0.. which is no different if the transparent color was 255.
Try it, this whole bitmap is "transparent"

var
Bitmap: TMufasaBitmap;
begin
Bitmap.Init();
Bitmap.SetSize(5, 5);
Writeln(Bitmap.GetPixel(1, 1));
Bitmap.Free();
end;

I will try SPS though.. since something is clearly wrong.

TomTuff

2014-11-11 22:43:12

Well, for what it's worth, the new map I made and posted above works with the following sps settings

  sps.setup('priff', RUNESCAPE_OTHER, 4, 800.0, 0.15);

This is with directx and the black color on the map being 0 by the way. So yeah.

Thanks for the help everyone, feel free to discuss the inner workings of sps though!

E: Well actually I'm using this image. I had to make it a png.

Olly

2014-11-11 22:47:52

Not sure what the problem is yet… But if anyone wants their maps to work on both graphics just throw this in your script:

function SPS_GatherMinimap(const rotated: boolean; const deg: extended): TMufasaBitmap; override;
begin
Result := inherited(rotated, deg);
Result.ReplaceColor(0, 1);
end;

Olly

2014-11-11 22:51:57

Actually i'm a retard… It DOES ignore 0.. A comment would have been nice marpis. :p

https://github.com/SRL/SPS/blob/master/plugin/source/sps.lpr#L31

Ian

2014-11-11 22:55:04

Here's the map if you want one. Made with Brandon's OGL hook plugin, so it's OGL colours. Also I think the forum layout cuts off the image if it needs to so click open in new tab to see the full one.


TomTuff

2014-11-11 23:00:18

From: Olly
Actually i'm a retard… It DOES ignore 0.. A comment would have been nice marpis. :p

https://github.com/SRL/SPS/blob/master/plugin/source/sps.lpr#L31


Double post! Infraction! Thanks for looking into it Olly. Oddly enough though, my map still works - and it was made with and uses directX, so the black color is 0. It only worked once I lowered the minmatch percentage though.

From: BMWxi
Here's the map if you want one. Made with Brandon's OGL hook plugin, so it's OGL colours. Also I think the forum layout cuts off the image if it needs to so click open in new tab to see the full one.

<snip>


The only reason I'm opposed to using OpenGL is because I always get this bug on runescape where the minimap doesn't load in OpenGL.

Can you post the tool? It would be nice to have.

Ian

2014-11-11 23:04:37

From: TomTuff
Double post! Infraction! Thanks for looking into it Olly. Oddly enough though, my map still works - and it was made with and uses directX, so the black color is 0. It only worked once I lowered the minmatch percentage though.



The only reason I'm opposed to using OpenGL is because I always get this bug on runescape where the minimap doesn't load in OpenGL.

Can you post the tool? It would be nice to have.


This is Brandon's thread where you can get the most recent version of what I used https://villavu.com/forum/showthread.php?t=104932

And the script to save the minimap as an image (Olly or Brandon may have written this, I don't remember)

program new;
{$DEFINE SMART}
{$i GLX\Setup.simba}

var
S : TSmart;

begin
SetupGLX(S, 800, 600);
glDebug(GL_DEBUG_MODE.GL_MODE_Models, 0, 0, 0, 0, 0, 0, 960, 640);
SaveBitmap(GL_MapToImage, 'C:\Users\Owner\Desktop' + '\map' + ToStr(Random(10000000)) + '.bmp');
end.

Brandon

2014-11-11 23:10:00

From: Olly
Actually i'm a retard… It DOES ignore 0.. A comment would have been nice marpis. :p

https://github.com/SRL/SPS/blob/master/plugin/source/sps.lpr#L31


Yup. That's what I meant. It's worse though. You can't just ignore alpha channel (all the time.. Only sometimes/most of the time) due to blending.

For example a colour of 255 (red) with an alpha of 128 would cause the red to blend with whatever is behind it and also be lighter than a red with 255 alpha. Ignoring the alpha channel complete disregards this and treats a half red tone as full red. In this example. Thankfully we haven't seen such a problem yet (because Simba receives already processed images).. But yeah the black colour being treated as transparent is quite annoying at times (0 vs. 65535).

J_R

2014-11-12 21:52:54

From: BMWxi
Here's the map if you want one. Made with Brandon's OGL hook plugin, so it's OGL colours. Also I think the forum layout cuts off the image if it needs to so click open in new tab to see the full one.

<snip>


Thank you for this, definitely going to try to see if this makes my elf thiever work better.

TomTuff

2014-11-13 01:27:09

From: J_R
Thank you for this, definitely going to try to see if this makes my elf thiever work better.


Hey wanna show me what you have for your elf thiever? I'm going to write one and it would be interesting to see how you're doing it. I can not use your code if you want.