Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved Interaction once again(I now found the actual bug!)

Joined
Jul 24, 2014
Messages
188
@Cloud

I was playing with the Dev toolbox and found out that if you click on a GameObject, that GameObject's model is highlighted in the screen.

But after about 2 seconds I noticed the location(projection) of that model on screen was switching between 2 locations, while the GameObject itself never moves(it's a fire).

I then tried to System.out.println() the on-screen location using Projection#coordinateToScreen(fire.getPosition());
I put this in my onLoop() void, and guess what, this point actually changes!

The actual correct position is (309,201);
Code:
java.awt.Point[x=309,y=201]
java.awt.Point[x=429,y=299]
java.awt.Point[x=429,y=299]
java.awt.Point[x=429,y=299]
java.awt.Point[x=309,y=201]
java.awt.Point[x=309,y=201]
java.awt.Point[x=429,y=299]
java.awt.Point[x=309,y=201]
java.awt.Point[x=309,y=201]
java.awt.Point[x=429,y=299]
java.awt.Point[x=429,y=299]
java.awt.Point[x=429,y=299]
java.awt.Point[x=429,y=299]
java.awt.Point[x=429,y=299]
java.awt.Point[x=429,y=299]
java.awt.Point[x=429,y=299]
java.awt.Point[x=309,y=201]

I managed to take a screenshot of both locations as well:

I think this might be the explanation for Interaction not working? As the getInteractionPoint() changes every 2 seconds, interaction can't possibly work..

Correct:
315lwl2.jpg

Wrong: (bottom of screen)
hsomrk.jpg
 
Joined
Jul 24, 2014
Messages
188
For the record, this is how pbot does it, I'm trying to use my mathematics-brain to convert this to RuneMate

https://github.com/dunnkers/RSBot-API/blob/master/methods/Calculations.java
Code:
/**
* @param x The absolute x ground position.
* @param y The absolute x ground position.
* @param plane The plane to calculation this tile's position on.
* @param height The height offset.
* @return The <code>Point</code> of the given tile on the screen.
*/
public static Point groundToScreen(final int x, final int y, final int plane, final int height) {
if (x < 512 || y < 512 || x > 52224 || y > 52224) {
return new Point(-1, -1);
}
final int z = calculateTileHeight(x, y, plane) - height;
return worldToScreen(x, z, y);
}
/**
* @param x Absolute x position of the calculation.
* @param y Depth of the requested calculation.
* @param z Absolute y position of the calculation.
* @return The <code>Point</code> of the given coordinates on screen.
*/


public static Point worldToScreen(final int x, final int y, final int z) {
final Context bot = Context.get();
final Toolkit toolkit = bot.getToolkit();
final Viewport viewport = bot.getViewport();
final float _z = (viewport.zOff + (viewport.zX * x + viewport.zY * y + viewport.zZ * z));
final float _x = (viewport.xOff + (viewport.xX * x + viewport.xY * y + viewport.xZ * z));
final float _y = (viewport.yOff + (viewport.yX * x + viewport.yY * y + viewport.yZ * z));
if (_x >= -_z && _x <= _z && _y >= -_z && _y <= _z) {
return new Point(
Math.round(toolkit.absoluteX + (toolkit.xMultiplier * _x) / _z),
Math.round(toolkit.absoluteY + (toolkit.yMultiplier * _y) / _z)
);
}
return new Point(-1, -1);
}
 
Last edited:
Engineer
Joined
Jul 28, 2013
Messages
2,776
The issue itself lies in the matrices that are being calculated to be used in the code you posted. The code we use for projection is similar, however it's more complex because we're a reflection client and we can't simply capture the value of the matrices like powerbot does.

If you want to be helpful, you could try to figure out which interface options/graphics configurations cause it to flicker and from there I might be able to more easily work on a fix. It doesn't happen in all graphics configurations.
 
Joined
Jul 24, 2014
Messages
188
The issue itself lies in the matrices that are being calculated to be used in the code you posted. The code we use for projection is similar, however it's more complex because we're a reflection client and we can't simply capture the value of the matrices like powerbot does.

If you want to be helpful, you could try to figure out which interface options/graphics configurations cause it to flicker and from there I might be able to more easily work on a fix. It doesn't happen in all graphics configurations.
Problem, I can only access Safe Mode in RuneMate, other display options give "RuneScape was unable to enter that display mode."

I'll try to do some research, I was already thinking it had something to do with those matrices you told me about ;)
 
Joined
Jul 24, 2014
Messages
188
The issue itself lies in the matrices that are being calculated to be used in the code you posted. The code we use for projection is similar, however it's more complex because we're a reflection client and we can't simply capture the value of the matrices like powerbot does.

If you want to be helpful, you could try to figure out which interface options/graphics configurations cause it to flicker and from there I might be able to more easily work on a fix. It doesn't happen in all graphics configurations.
One thing I cannot understand tho, why the flickering?
Why are there 2 possible locations?
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
Problem, I can only access Safe Mode in RuneMate, other display options give "RuneScape was unable to enter that display mode."
There's a sticky explaining this in this section
One thing I cannot understand tho, why the flickering?
Why are there 2 possible locations?
Previously it was completely unpredictable because of all the different projections states it would enter. Now it appears that it's typically in one but occasionally enters a second one because of one of the vectors that I use to construct the matrices.
 
Joined
Jul 24, 2014
Messages
188
There's a sticky explaining this in this section

Previously it was completely unpredictable because of all the different projections states it would enter. Now it appears that it's typically in one but occasionally enters a second one because of one of the vectors that I use to construct the matrices.

I'll read that sticky first ;)

Anyways do you think you can fix it?
 
Joined
Jul 24, 2014
Messages
188
@Cloud my report:

Windows 7 x64, JRE 8, RuneMate 42.8

  • Safe Mode + OpenGL + DirectX: flickers every second between 2 locations, after some analysis(turning camera, ...), it seems that the 2nd location is a Homothetic_transformation + a rotation, that always has the same angle.
Every display mode has this bug.
 
Last edited:
Engineer
Joined
Jul 28, 2013
Messages
2,776
@Cloud my report:

Windows 7 x64, JRE 8, RuneMate 42.8

  • Safe Mode + OpenGL + DirectX: flickers every second between 2 locations, after some analysis(turning camera, ...), it seems that the 2nd location is a Homothetic_transformation + a rotation, that always has the same angle.
Every display mode has this bug.
Does it happen in both Legacy and EOC? What about RS3 camera vs legacy camera (available in the controls options)
 
Joined
Jul 24, 2014
Messages
188
Does it happen in both Legacy and EOC? What about RS3 camera vs legacy camera (available in the controls options)

Legacy+EOC yep, you can see it yourself, go to any mining spot in rs and srlect the rock in dev tools, it starts flicketing right away. If not please tell me your settings
 
Joined
Jun 21, 2014
Messages
350
I think I found a possible fix/reason for why this happens.
If you resize the client to anything but the standard it WILL happen to you unless you change max screen size to Any instead of 800x600 or whatever it is as default on min.
 
Top