PDA

View Full Version : SPS randomly failing to get the correct location.



wutora
03-01-2015, 01:35 AM
I'm currently working on a Elder Tree cutter, but SPS is giving me a headache. It works fine most of the time, but occasionally it just gives me the wrong position. It seems rather random.

I'm currently alternating between the Varrock Tree, Edgeville Bank, Edgeville Tree, Draynor Bank, Draynor Tree.
Sometimes it fails on the first round, but sometimes it runs for hours without any problems at all. Simply restarting the script solves the issue most of the time.

I found a workaround for the issue: I'm currently detecting my position at every station (so at every lodestone, bank and tree) and decide where to go based off the current position. If SPS decides to fail again, the script won't be able to see where I'm at (since SPS thinks I'm actually somewhere in the middle of nowhere). It's just stuck at this point, it won't find the correct location.At the moment I do a simple logout and login as soon as this happens. Everything works fine after that. I don't like random logouts/logins though, so a little help would be appreciated. I use the worldmap of BMWxi if that helps (thanks for the awesome work btw).

Camel
03-01-2015, 01:41 AM
You should post some of the maps you're using.

My guess would be that they're not big enough.

wutora
03-01-2015, 01:46 AM
I don't think thats the problem. I increased it several times but with no success. What bugs me is that it's seemingly random, it sometimes fails at a place where it didn't fail the last time. Anyways, my map:
http://i.imgur.com/z4HNiTN.png I marked the important points (where my character should be when it checks for it's position) to show off my amazing paint skills :D

This is the function that (should) find the current location btw: (based off of KeepBotting's iOak)
http://pastebin.com/uqvpiWvz
So there is quite some room for error. When it fails, it even places me somewhere near Edgeville when I'm actually standing at the Varrock lodestone for example. It's wierd :/

Battousai
03-02-2015, 01:28 AM
I also have this problem, And i can 100% say my map is big enough

http://i.imgur.com/n4JoAij.jpg

Which we appear to be attempting to make the same script :)

Turpinator
03-02-2015, 01:57 AM
I also have this problem, And i can 100% say my map is big enough

http://i.imgur.com/n4JoAij.jpg

Which we appear to be attempting to make the same script :)

1, The map is a jpg.
2, it can also be too big.

3Garrett3
03-02-2015, 02:09 AM
I don't think thats the problem. I increased it several times but with no success. What bugs me is that it's seemingly random, it sometimes fails at a place where it didn't fail the last time. Anyways, my map:
http://i.imgur.com/z4HNiTN.png I marked the important points (where my character should be when it checks for it's position) to show off my amazing paint skills :D

This is the function that (should) find the current location btw: (based off of KeepBotting's iOak)
http://pastebin.com/uqvpiWvz
So there is quite some room for error. When it fails, it even places me somewhere near Edgeville when I'm actually standing at the Varrock lodestone for example. It's wierd :/


I also have this problem, And i can 100% say my map is big enough

http://i.imgur.com/n4JoAij.jpg

Which we appear to be attempting to make the same script :)

Both of you should check this post by Lipcot:

https://villavu.com/forum/showthread.php?t=111292&p=1322409#post1322409

It explains accuracy, tolerance, match%. These settings will help you make your map work properly.

Battousai
03-02-2015, 03:01 AM
It was uploaded as jpg for some reason, but the actual file is a PNG

KeepBotting
03-02-2015, 03:13 AM
It was uploaded as jpg for some reason, but the actual file is a PNG

That's puush's automatic compression, you can turn it off (always upload as .png, I believe the setting is called)

Battousai
03-02-2015, 03:42 AM
That's puush's automatic compression, you can turn it off (always upload as .png, I believe the setting is called)

Don't know but this is irritating me how i cant get it to work :(



Both of you should check this post by Lipcot:

https://villavu.com/forum/showthread.php?t=111292&p=1322409#post1322409

It explains accuracy, tolerance, match%. These settings will help you make your map work properly.

I use the accuracy and things like that, Mine seems like it is finding points on the map that ain't loaded yet, I make the points really close together and that dont help, i spread them apart more, that dont help, i decrease the time between scans, that dont help, At least in my case anyways

But i am about to give up on attempting to make scripts that use SPS because It don't work at all for me no matter how big the map, how small, how far apart the points are, how close together they are, some areas do an OK job and others it wont work at all

wutora
03-02-2015, 03:05 PM
Both of you should check this post by Lipcot:

https://villavu.com/forum/showthread.php?t=111292&p=1322409#post1322409

It explains accuracy, tolerance, match%. These settings will help you make your map work properly.

I will try that, thanks for the reply. It's hard to reproduce though, so I just have to somehow log the failed attempts.

3Garrett3
03-02-2015, 03:09 PM
I will try that, thanks for the reply. It's hard to reproduce though, so I just have to somehow log the failed attempts.

When I was testing my settings I just had it walk all the paths over and over until one time it walked for an hour with no mistakes. I figured an hour of walking was equivalent to like 12 hours gameplay or something, so it was considered good to go.

Turpinator
03-02-2015, 04:43 PM
So neither of you have yet to post the actual maps so that any of us can test it...

wutora
03-02-2015, 10:10 PM
So neither of you have yet to post the actual maps so that any of us can test it...

My bad, sorry. I thought I uploaded it on my second post, seems like I forgot it :/

Turpinator
03-02-2015, 10:37 PM
Well...
http://turp.us/elder.gif

besides taking 2 sec/search, i saw no major issues with it.
to make it faster, split it into 3 maps and just remember which map youre on. the map isnt continuous, so you have no reason to have it all on one file.

Battousai
03-02-2015, 11:28 PM
Well...
http://turp.us/elder.gif

besides taking 2 sec/search, i saw no major issues with it.
to make it faster, split it into 3 maps and just remember which map youre on. the map isnt continuous, so you have no reason to have it all on one file.

How would you go about doing 3 different map files? Anytime i try it always fails to walk on the second map, is there something i am missing?

3Garrett3
03-02-2015, 11:54 PM
How would you go about doing 3 different map files? Anytime i try it always fails to walk on the second map, is there something i am missing?

For a code example, see Incurable's Lodestone Unlocker. He used multiple maps in there and it should be simple enough to follow how he loaded them.

Edit:

Also look this (https://villavu.com/forum/showthread.php?t=110464&highlight=) thread over where people discussed SPS in a bit more detail

wutora
03-03-2015, 06:54 PM
Well...
http://turp.us/elder.gif

besides taking 2 sec/search, i saw no major issues with it.
to make it faster, split it into 3 maps and just remember which map youre on. the map isnt continuous, so you have no reason to have it all on one file.
Thanks for taking the time to help me, really appreciate it. I had 3 different maps initially, but I thought that the problem might be related to that so I rewrote the script to use one map instead. Are there any major downsides to the high searchtime? I'd have to rewrite major parts of the script to revert back to the 3 map method, if there are no real downsides I'll just leave it (for now).

3Garrett3
03-03-2015, 06:58 PM
Thanks for taking the time to help me, really appreciate it. I had 3 different maps initially, but I thought that the problem might be related to that so I rewrote the script to use one map instead. Are there any major downsides to the high searchtime? I'd have to rewrite major parts of the script to revert back to the 3 map method, if there are no real downsides I'll just leave it (for now).

The only downside is that every time you try to call anything to do with SPS it will take 2 seconds to find the spot. If you don't mind your char sitting there for 2 seconds every step it takes, then it's fine. Personally I would go with 3 smaller maps because I would hate the performance if it was taking that long, but it's entirely up to how you feel.

the bank
03-03-2015, 07:58 PM
SPS is slow period.

Rewrite it to use alpha maps, then profit :)

E:

I know simba doesn't actually handle alpha channels well, btu I'm thinking maybe under the hood it should still be possible to do the math.