RuneMate / Issues

Client and API Issue tracking. See README for more information.
8 stars 0 forks source link

isVisible() returning false when it shouldnt(?) #12

Open alexfaxe opened 5 years ago

alexfaxe commented 5 years ago

Describe the bug isVisible() is returning false when it should be true(?)

00:05:34 TRACE    [Camera] Camera turn direction: LEFT / DOWN
00:05:35 TRACE    [Camera] Camera turn direction: LEFT / DOWN
00:05:35 TRACE    [Camera] Camera turn direction: LEFT / DOWN
00:05:35 TRACE    [Camera] Camera turn direction: LEFT / DOWN
00:05:36 TRACE    [Camera] Camera turn direction: LEFT / DOWN
(keeps going like this until paused and moved away from the spot manually)

Affected game modes: OSRS

RuneMate version: 2.95.9

To Reproduce

  1. Go to Draynor Village
  2. Stand next to the fence as shown in the pictures
  3. Try running the code included
  4. See error
GameObject bankBooth = Banks.getLoadedBankBooths().nearest();

if (bankBooth != null) {
            System.out.println("bankBooth isn't null");
            if (bankBooth.isVisible()) {
                System.out.println("bankBooth is visible");
                if (Bank.open(bankBooth)) {
                    Execution.delayUntil(Bank::isOpen, () -> Players.getLocal().isMoving(), 1200);
                } else {
                    getLogger().severe("Unable to open bankBooth!");
                }
            } else {
                Camera.concurrentlyTurnTo(bankBooth);
            }
        }
}

Expected behaviour Camera rotating to bank, to then try to open it.

Screenshots https://gmagic.is-terrible.com/ecvAI.png - here isVisible() is returning false https://gmagic.is-terrible.com/R1hOC.png - when in reality it's visible and interactable(?)

https://streamable.com/zuyjn - video of code being ran

Additional context I tried a lot of different things before this to try and resolve it but without any luck. (unfortunate)

ccarpenter04 commented 5 years ago

We typically try to stay on the conservative end of things but if it's really bothering you that it is returning false we could always include a check of the visibility map of tiles into it, although I'm not sure if just because a tile is visible that all of the scene entities on top of it are.

nesu commented 5 years ago

isVisible() bug also sooner or later will break traversing to some destination which requires interaction with obstacles. As far as I remember path builder checks if object of BasicObjectVertex is visible and if it's not next step will be defaulted to CoordinateVertex which results in behaviour like this: https://streamable.com/y1qcl

ccarpenter04 commented 5 years ago

@nesu that is an entirely separate issue, and in my opinion a far more important one. This issue is about how we should transition to using the visibility map (a boolean[][][][] that determines whether or not to render a tile and its contents) instead of the distance to a tile as a fail-fast mechanism when determining visibility and the bounds of scene entities. What you're discussing is likely the incorrect projection of some types of objects and has much worse effects. It's possible however that your issue is just related to an edge case within the logic of BasicObjectVertex. Regardless, please make a new issue for it.