SmartZoos / Toolset

Gaming platform for SmartZoos project
MIT License
0 stars 1 forks source link

Indicate direction of activity items outside map view #91

Closed kaimikael closed 7 years ago

kaimikael commented 7 years ago

As a player, it would be helpful to have markers by the borders of the map view, indicating in which direction the other items in the current activity are located. It is admittedly possibly to zoom the view, but arrow markers would require less manipulation of the screen and less risk of losing context.

pjotrsavitski commented 7 years ago

We already have a functionality that changes map view to show all the markers on the game (the icon with multiple markers on it).

Showing something by the border of the map should be doable, the issue is that these should not be the markers themselves. Marker geolocation should not change under any circumstances. Showing some icons near the map edge would be doable.

You have been implementing a solution for that. Have you been able to come up with an algorithm to detect where should the arrows be placed?

I have also commented on a possibility to highlight the edges of the map if there are any markers in that direction. This would still require some logic to detect the direction of these markers.

The solution might be written in a resource-friendly manner, as it would require cycling over all the markers each time the map is changed (map bounds change dues to either zoom level or map centre coordinates).

Might even consider to only applying that to unanswered ones.

kaimikael commented 7 years ago

Yes, players are most likely only interested in the direction to unanswered questions. The client should be able to download the positions of all questions at the outset; these likely would not be more than 10–15. Since we only need to find the closest of the questions, it’s an O(n) operation for a small n, and since questions get answered over time, n becomes smaller. I had no problems looping through such a set at a good frame rate when I played around with my test.
It’s easy to get the direction from our centre point towards the question point. I presume we can locate the edge of the display and draw an arrow with the appropriate angle that ends at the display edge as shown in the attached image.

arrow

pjotrsavitski commented 7 years ago

I will currently go for the simple implementation I have promised in issue #100. We could expand and extend it later on.