SRL Archive - Research & Development Lounge

The accuracy of MSCX,MSCY


riwu

2012-10-16 05:24:51

EDIT:
My conclusion: (Credit to http://villavu.com/forum/showthread.php?t=72985 for the picture)

The red dot (with a red arrow pointing to it) is the current MSCY.
As it is determined by (MSY1+MSY2) shr 1, it isn't actually the middle of the player tile, since our highest angle is not perfectly vertical (otherwise you would only see your head).

This means that the tiles colored yellow will be considered to be closer to the tiles colored green. Hence when using spiral/sorting functions with (MSCX,MSCY), the points from yellow tiles will be before that of green tiles, even though the practical distance between them is the same (you will spend the same amount of time walking to the yellow tile as walking to the green). To make things worse, the result will be different with a different compass direction. From the picture, if we were to rotate compass by 180, the green tiles will instead be prioritize over yellow.

This is not the case for the actual center of the player tile, as when you rotate the compass, you are in fact rotating the mainscreen about the center of your player tile (and not MSCY), hence it remains constant relative to the mainscreen regardless of compass direction.

If MSCY is indeed intend to just be 'the center of the mainscreen', it will be accurate. However, the way MSCY is being used currently (and probably will always be) in almost all scripts is intended as the practical distance from the player to other points. I can't think of any situation where using MSCY would be preferred over the actual center of the player tile.

Home

2012-10-16 05:26:57

From: riwu
I was trying to find the size of a tile when i decided to check out whether the MSCX,MSCY coordinates are accurate.


TPA bound: (244, 163, 275, 191)
There is a bit of protrusion for the x plane but it's even on both sides so the average should still be consistent.
Given the box, mid point would be (259.5, 177).

Comparing with (259, 170), our MSCX is quite accurate but the MSCY is 7 pixels off?

I guess MSCY is probably determined by (MSY1+MSY2) shr 1, but it seems like the player tile isn't placed at the centre?

Any suggestion on how to more accurately determine the exact pos of the centre of the player?


You need to take Compass angle in MainScreen angle into account.

~Home

riwu

2012-10-16 05:27:53

From: Home
You need to take Compass angle in MainScreen angle into account.

~Home

I took the coordinates at perfect north and highest angle (click north and hold up).
Hmm maybe the terrain at rim mine isn't completely flat? Any good place to test it?

Olly

2012-10-16 06:52:36

Make a box around your player, log out and then log back in a look at the box a few times you will be surprised how much the rs screen changes

riwu

2012-10-16 07:28:38

From: Ollybest
Make a box around your player, log out and then log back in a look at the box a few times you will be surprised how much the rs screen changes

Indeed we are screwed.


Results of 5 logins: (north, highest angle)
(243, 163, 273, 191)
(245, 163, 276, 190)
(244, 161, 274, 188)
(244, 162, 275, 189)
(246, 164, 276, 191)

The average seems to be about:
(244,163,275,190)?
Probably need a bigger sample but it's evident that MSCY is way off.


From: Home
You need to take Compass angle in MainScreen angle into account.

~Home

To think of it now, indeed the highest angle is in fact NOT completely vertical! If it is you will only see your head! Hence (MSY1+MSY2) shr 1 is flawed.

BraK

2012-10-16 08:09:54

But does MSCX and MSCY play into the Players location or the Center of the Main RS Screen ie not in the GUI. If if work off the player then you're correct. If it works how I believe it does it'll get the Center of the Main Screen area. Hince [M]ain creen [C]enter X & y. I used this mainly in sort from the closest to the center of the screen but other could have used it differently.

riwu

2012-10-16 08:27:10

From: BraK
But does MSCX and MSCY play into the Players location or the Center of the Main RS Screen ie not in the GUI. If if work off the player then you're correct. If it works how I believe it does it'll get the Center of the Main Screen area. Hince [M]ain creen [C]enter X & y. I used this mainly in sort from the closest to the center of the screen but other could have used it differently.

The 'center of the main screen' has no significance if that isn't where the player is standing. I'm using the coordinates, together with the size of a tile to determine the coordinates of the 6 tiles around me (which, with the use of RotatePoints, remains relatively constant regardless of compass dir), thereby achieving high accuracy in determining adjacent objects.

In my definition, the center would be the centre of the tile the player is standing at. If it's currently defined as the center of the player model it won't be meaningful, as the tile determines the distance.
i.e. the tile north of you should not be nearer to the tile south of you, (which is what the current MSCY signifies), as the time required to reach them is equal (hence the practical distance is the same too).

Kyle Undefined

2012-10-16 09:32:27

MSCX/Y isn't for the player area, just the center of the screen, like BraK said. It just so happens that the player is near the center of the screen.

riwu

2012-10-16 10:07:00

From: Kyle Undefined
MSCX/Y isn't for the player area, just the center of the screen, like BraK said. It just so happens that the player is near the center of the screen.

Well then spiral functions/commonly used TPA/ATPA sorting shouldn't use MSCY.

Supposed that is the center tile, the red dot is roughly where MSCY is at and the green dot is the actual center. Based on the current MSCY, the tiles near the north will be closer to MSCY than those in the south, even though the no. of tiles (and hence the distance) between them is the same. This means that sorting TPA/ATPA by MSCY will result in a higher tendency to go north (or other directions depending on compass dir).

Also if you want to pick up an object in your current tile, you should again use the center of the tile (allowing higher randomness to be set) rather than MSCY.

In that sense, MSCY has practically no use for RS scripting. I believe the way that MSCY is used in most, if not all scripts, is intended to be the center of the tile. The difference is however quite minute, and in practical the result won't deviate significantly.

litoris

2012-10-16 10:23:37

You are assuming that the purpose of the MSC coordinates is to give the scripter easy access to a point right underneath the player. It is not. It is only there to make things easier with the spiral color finders etc. If you want a point to fit your purposes, find that point and use it, but, it still won't work for lower angles.

BraK

2012-10-16 11:22:20

If your purpose is "to pick up an object in your current tile" why not just expand the PlayerBox?

And yes MSCX, MSCY never had anything to do with the player itself. What your looking for would no longer be the center of the Main screen if your objective is center of the Player Tile. Which move depending on the compass and angle.

Olly

2012-10-16 16:43:17

http://villavu.com/forum/showthread.php?t=72985 should get that working again :P

riwu

2012-10-17 01:41:46

From: Ollybest
http://villavu.com/forum/showthread.php?t=72985 should get that working again :P

Wow that thread has nice picture that i'm going to steal :p

Added my conclusion to the OP.


From: litoris
You are assuming that the purpose of the MSC coordinates is to give the scripter easy access to a point right underneath the player. It is not. It is only there to make things easier with the spiral color finders etc. If you want a point to fit your purposes, find that point and use it, but, it still won't work for lower angles.

You shoudn't use MSCY for spiral functions. Read my OP. Also for lower angles nothing works, we are just comparing them based on the highest angle.

From: BraK
If your purpose is "to pick up an object in your current tile" why not just expand the PlayerBox?

And yes MSCX, MSCY never had anything to do with the player itself. What your looking for would no longer be the center of the Main screen if your objective is center of the Player Tile. Which move depending on the compass and angle.

The center of the player tile is in fact, what that remains constant relative to the mainscreen for different compass direction. Added explanation to OP.

m3gaman3g3nd

2012-10-20 18:13:12

yeah should be set to -22