1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

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

  1. Exile

    Joined:
    Jul 24, 2014
    Messages:
    188
    Likes Received:
    23
    @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]
    18.  
    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:
    [​IMG]
    Wrong: (bottom of screen)
    [​IMG]
     
  2. Exile

    Joined:
    Jul 24, 2014
    Messages:
    188
    Likes Received:
    23
    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 (Text):
    1.  
    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. */
    22.  
    23.  
    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. }
    39.  
     
    #2 Exile, Aug 5, 2014
    Last edited: Aug 5, 2014
  3. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    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. Exile

    Joined:
    Jul 24, 2014
    Messages:
    188
    Likes Received:
    23
    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. Exile

    Joined:
    Jul 24, 2014
    Messages:
    188
    Likes Received:
    23
    One thing I cannot understand tho, why the flickering?
    Why are there 2 possible locations?
     
  6. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    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. Exile

    Joined:
    Jul 24, 2014
    Messages:
    188
    Likes Received:
    23
    I'll read that sticky first ;)

    Anyways do you think you can fix it?
     
  8. Exile

    Joined:
    Jul 24, 2014
    Messages:
    188
    Likes Received:
    23
    @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. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Does it happen in both Legacy and EOC? What about RS3 camera vs legacy camera (available in the controls options)
     
  10. Exile

    Joined:
    Jul 24, 2014
    Messages:
    188
    Likes Received:
    23
    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. Fontkodo

    Joined:
    Jun 21, 2014
    Messages:
    350
    Likes Received:
    111
    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.
  12. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
  13. Exile

    Joined:
    Jul 24, 2014
    Messages:
    188
    Likes Received:
    23

Share This Page

Loading...