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

Discussion in 'Client & Site Support' started by Exile, Aug 5, 2014.

  1. @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 (Text):
    1. java.awt.Point[x=309,y=201]
    2. java.awt.Point[x=429,y=299]
    3. java.awt.Point[x=429,y=299]
    4. java.awt.Point[x=429,y=299]
    5. java.awt.Point[x=309,y=201]
    6. java.awt.Point[x=309,y=201]
    7. java.awt.Point[x=429,y=299]
    8. java.awt.Point[x=309,y=201]
    9. java.awt.Point[x=309,y=201]
    10. java.awt.Point[x=429,y=299]
    11. java.awt.Point[x=429,y=299]
    12. java.awt.Point[x=429,y=299]
    13. java.awt.Point[x=429,y=299]
    14. java.awt.Point[x=429,y=299]
    15. java.awt.Point[x=429,y=299]
    16. java.awt.Point[x=429,y=299]
    17. 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..

    Wrong: (bottom of screen)
  2. For the record, this is how pbot does it, I'm trying to use my mathematics-brain to convert this to RuneMate
    Code (Text):
    2. /**
    3. * @param x The absolute x ground position.
    4. * @param y The absolute x ground position.
    5. * @param plane The plane to calculation this tile's position on.
    6. * @param height The height offset.
    7. * @return The <code>Point</code> of the given tile on the screen.
    8. */
    9. public static Point groundToScreen(final int x, final int y, final int plane, final int height) {
    10. if (x < 512 || y < 512 || x > 52224 || y > 52224) {
    11. return new Point(-1, -1);
    12. }
    13. final int z = calculateTileHeight(x, y, plane) - height;
    14. return worldToScreen(x, z, y);
    15. }
    16. /**
    17. * @param x Absolute x position of the calculation.
    18. * @param y Depth of the requested calculation.
    19. * @param z Absolute y position of the calculation.
    20. * @return The <code>Point</code> of the given coordinates on screen.
    21. */
    24. public static Point worldToScreen(final int x, final int y, final int z) {
    25. final Context bot = Context.get();
    26. final Toolkit toolkit = bot.getToolkit();
    27. final Viewport viewport = bot.getViewport();
    28. final float _z = (viewport.zOff + (viewport.zX * x + viewport.zY * y + viewport.zZ * z));
    29. final float _x = (viewport.xOff + (viewport.xX * x + viewport.xY * y + viewport.xZ * z));
    30. final float _y = (viewport.yOff + (viewport.yX * x + viewport.yY * y + viewport.yZ * z));
    31. if (_x >= -_z && _x <= _z && _y >= -_z && _y <= _z) {
    32. return new Point(
    33. Math.round(toolkit.absoluteX + (toolkit.xMultiplier * _x) / _z),
    34. Math.round(toolkit.absoluteY + (toolkit.yMultiplier * _y) / _z)
    35. );
    36. }
    37. return new Point(-1, -1);
    38. }
    #2 Exile, Aug 5, 2014
    Last edited: Aug 5, 2014
  3. 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.
  4. 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 ;)
  5. One thing I cannot understand tho, why the flickering?
    Why are there 2 possible locations?
  6. 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.
  7. I'll read that sticky first ;)

    Anyways do you think you can fix it?
  8. @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.
    #8 Exile, Aug 5, 2014
    Last edited: Aug 5, 2014
  9. Does it happen in both Legacy and EOC? What about RS3 camera vs legacy camera (available in the controls options)
  10. 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
  11. 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.
    Exile likes this.

Share This Page