SRL Archive - OSR Help

Essence Miner - not as simple as I thought.


NickMystre

2012-01-30 02:11:52

Since a public version of an essence miner is a no-no, (and boy, does this evoke a great deal of energy) can anyone perhaps pass me some pointers on how I would tackle these issues to write one myself.

  • As the essence mine is rotated each time you teleport in, there will be 4 map possibilities. How do you identify which map rotation you are in ? Does it really matter ?
  • Clicking on the transportation icon will get you 1 square away from the portal - but how do you know where to click ? Looking for animation perhaps ? I tried using colours - but the portals drift through a whole range of them.
  • Finally, how does one zone in on the mine itself ? All the colours are so similar.

I don't need code (although if you are so inclined) handed to me - but crumbs in the right direction would be most grateful. Thanks!

Er1k

2012-01-30 02:53:52

1. It's the same map actually. Look at the essence mine map in SPS if you want to see for yourself. You keep the compass direction when you go in/out, so it should not matter.
2. Can you try finding multiple colors when the portal animates? AFAIK the range of colors of each portal stays almost the same. I think someone even autocolored it back then in one of the ess miners.
3. A custom object finder with Uptext might be useful. This I'm really not sure, but overall this you shouldn't worry too much.

As they have always said, the problem you should worry about is the door, if you're using aubury in Varrock.

Yanhua

2012-01-30 02:58:41

From: NickMystre

[*]As the essence mine is rotated each time you teleport in, there will be 4 map possibilities. How do you identify which map rotation you are in ? Does it really matter
[*]Clicking on the transportation icon will get you 1 square away from the portal - but how do you know where to click ? Looking for animation perhaps ? I tried using colours - but the portals drift through a whole range of them.
[*]Finally, how does one zone in on the mine itself ? All the colours are so similar.


Okay, I'll try to help you out here :) Tried to create an essence miner a while ago but it became outdated quickly, and never really had spare time to update it again.

1)What I did was I simply tried to identify where I was using SPS_GetMyPos

2)I used ACA for the portals, it worked. But I'm sure there are better methods for that.

3)You don't need to look for anything else apart from portals and essence rocks, which can easily be done through TPAs or FindObj if you're lazy :p

Hope I helped! Feed free to ask more.

Er1k

2012-01-30 03:16:28

From: Yanhua
Hope I helped! Feed free to ask more.


I want to know how did you deal with the door back then? I used to have your script but I didn't backup it last time my PC broke.

NickMystre

2012-01-30 03:23:11

From: nosaj.421
As they have always said, the problem you should worry about is the door, if you're using aubury in Varrock.


I'm going in through the Magic Guild in Yanile. For now, I have a small autocolour hack that targets the yellow door handles, but I want to work out something more robust - perhaps via doorprofiles.simba for this later on.

NickMystre

2012-01-30 03:27:59

From: Yanhua
2)I used ACA for the portals, it worked.


Can you really use ACA for the portals ? They all seem to move through a range of pastel colours - green, blue, pink, yellow. I didn't think that ACA could do this ?

From: nosaj.421
1. It's the same map actually. Look at the essence mine map in SPS if you want to see for yourself. You keep the compass direction when you go in/out, so it should not matter.


I see that the map is fixed (ie central chamber and mine lobes all remain the same - relative to each other), but it rotates every time you teleport in. Are you perhaps suggesting that as each of the essence mine lobes, while having a different outline essentially occupies the same position / space within the map - that if you roughly stick to the middle of each lobe when using SPS that it won't matter which map rotation you use ?

Yanhua

2012-01-30 03:44:31

From: NickMystre
Can you really use ACA for the portals ? They all seem to move through a range of pastel colours - green, blue, pink, yellow. I didn't think that ACA could do this ?

I see that the map is fixed (ie central chamber and mine lobes all remain the same - relative to each other), but it rotates every time you teleport in. Are you perhaps suggesting that as each of the essence mine lobes, while having a different outline essentially occupies the same position / space within the map - that if you roughly stick to the middle of each lobe when using SPS that it won't matter which map rotation you use ?


I spent around 30 mins collecting all the colours :)

NickMystre

2012-01-30 03:46:53

From: Yanhua
I spent around 30 mins collecting all the colours :)


OK, possible daft question alert!!

Did you move around the 4 mining quadrants, or just stay at one when collecting the colours ?

Flight

2012-01-30 03:56:01

From: NickMystre
OK, possible daft question alert!!

Did you move around the 4 mining quadrants, or just stay at one when collecting the colours ?


I think what I would do here is… First, manually go to each of the 4 "essence pillars", and estimate what SPS tile they would be located on. Now, whenever your player enters the essence mines, get your current SPS location, and with a little math compare it to all four of those "essence pillar" locations. Whichever distance (from your player to the pillar point) is the shortest, simply walk to that tile. (I believe Shuttle's WindPath/WindWalk would come in handy here)

Edit:
For the record, I'm really impressed by how much of the SRL library you're explore, Nick. Most people don't even look through some of the older files, but here you are taking them all into consideration. That's really awesome, I have high expectations for you. ;)

NickMystre

2012-01-30 04:04:10

From: Flight
I think what I would do here is… First, manually go to each of the 4 "essence pillars", and estimate what SPS tile they would be located on. Now, whenever your player enters the essence mines, get your current SPS location, and with a little math compare it to all four of those "essence pillar" locations. Whichever distance (from your player to the pillar point) is the shortest, simply walk to that tile. (I believe Shuttle's WindPath/WindWalk would come in handy here)


OK - noted.

From: Flight
For the record, I'm really impressed by how much of the SRL library you're explore, Nick. Most people don't even look through some of the older files, but here you are taking them all into consideration. That's really awesome, I have high expectations for you. ;)


I appreciate the compliment - thank you. Although I have to say that at times I feel like a light-fingered (perhaps that should be tentacled) octopus - grabbing whatever I can from anywhere I can. :)

Markus

2012-01-30 04:14:54

Doorprofiles won't work for the Aubury door (it's always the same at minimap regardless of closed/opened).
To answer your questions, this is what I am doing atm:
1. I don't care about which map rotation I am, nor which rotation. It doesn't matter! My script asks two questions: are we in a room? If not, which room is the closest to us?
2. ACA works, as it's just a very different Hue but close Luminance/Saturation. What you could also do is search for everything white on screen (essmine is 90% white or so) and then look for gaps.
3. Again, I used ACA and it finds the large rock flawless without any weird clicks/movements.

NickMystre

2012-01-30 04:23:29

From: Markus
Doorprofiles won't work for the Aubury door (it's always the same at minimap regardless of closed/opened).
To answer your questions, this is what I am doing atm:
1. I don't care about which map rotation I am, nor which rotation. It doesn't matter! My script asks two questions: are we in a room? If not, which room is the closest to us?
2. ACA works, as it's just a very different Hue but close Luminance/Saturation. What you could also do is search for everything white on screen (essmine is 90% white or so) and then look for gaps.
3. Again, I used ACA and it finds the large rock flawless without any weird clicks/movements.


Thank you Markus - I appreciate you passing on what works for you.

As to the door I'm using, I get to the mine via the Magic Guild - would doorprofiles.simba be of use here you think ?

Markus

2012-01-30 04:28:04

I have no idea! Doorprofiles works for doors at the minimap. Try to open/close the door and see if it also closes/opens at the minimap.
Be sure to check if it's not too outdated, doorprofiles was written long ago and I'm not sure if it has even been updated.

NickMystre

2012-01-30 04:43:43

From: Markus
I have no idea! Doorprofiles works for doors at the minimap. Try to open/close the door and see if it also closes/opens at the minimap.
Be sure to check if it's not too outdated, doorprofiles was written long ago and I'm not sure if it has even been updated.


I came across doorprofiles.simba in my meanderings through the Simba folders and wondered if that might be useful. If my ignorance is showing, thats OK - providing it's just that and nothing else. :)

Er1k

2012-01-30 08:12:08

From: Markus
I have no idea! Doorprofiles works for doors at the minimap. Try to open/close the door and see if it also closes/opens at the minimap.
Be sure to check if it's not too outdated, doorprofiles was written long ago and I'm not sure if it has even been updated.


My current understanding of this is - when you enter a location and if a door is opened, then it will show as opened on the minimap. Any changes will only be reflected on the minimap after you leave and reenter the map.

I tested it in Lumby castle on the floor with Duke Horacio.

NickMystre

2012-01-30 09:45:19

What do you make of my intended use of these two functions …

function AnimatingMulti(B: TBoxArray; Time, MinCount: Integer): TBooleanArray;
Finds constant animation in boxes B during time T. If PixelShift in box is smaller than MinCount, it's considered not animating.(marpis)


… AND …

function Animating(B: TBox; Time, MinCount: Integer): Boolean;
Finds constant animation in boxes B during time T. If PixelShift in box is smaller than MinCount, it's considered not animating. (marpis)


Do you think that these could be used to detect the portals in the essence mine ?

E: @nosaj.421 - OK, I think that I had completely misunderstood the intended use / purpose of the doorprofiles.simba include. Thanks for your input.

Home

2012-01-30 09:46:25

From: NickMystre
What do you make of my intended use of these two functions …

function AnimatingMulti(B: TBoxArray; Time, MinCount: Integer): TBooleanArray;


… AND …

function Animating(B: TBox; Time, MinCount: Integer): Boolean;


Do you think that these could be used to detect the portals in the essence mine ?


Yes. I use that for my Essminer.


~Home

NickMystre

2012-01-30 09:53:19

From: Home
Yes. I use that for my Essminer. ~Home


Excellent. Thank you, Home! Nice to know. However, now to do something with them!! :)

My previous leaps of intuitiveness (or so I believed) lead me right down a mine shalf. :)