I have been experimenting trying to figure out the most efficient way to get entity positions using the Spatial OS API. So far I have been using the SpatialOS.GetLocalEntity() function which is light weight, fast, and reliable but with the major limitation that it depends on entities being in very close proximity no more than 100m.
I would like there to be goal entities that could be miles away from the players and I would like all players to equally be able to access these goal positions. At first I made the discovery that I could increase the distance of reading if I did “.AddPositionComponent(initialPosition, CommonRequirementSets.PhysicsOrVisual)” to the goal entity.
At first I thought I had solved all my problems but using PhysicsOrVisual instead of the regular “CommonRequirementSets.SpecificClientOnly(clientWorkerId)” included not having multiple clients be able to read the entity at the same time since SpatialOS.GetLocalEntity() would return Null for the other inquisitive clients. Also the goals were sometimes very unstable and glitchy with their presence, a goal could entirely disappear for a certain client and might recover after some time.
I get the impression that using PhysicsOrVisual for a PostionComponent is a bad strategy because of the experiences mentioned above. I was wondering if there is a way though to increase the range of reading local entities especially for specific entity types that the client might be really interested in? Otherwise is there any suggestions from experienced Spatial Developers of ways to have clients read the position from a goal entity constantly and efficiently, and have that entity be possibly miles away. This technique would also be great for displaying where players are at. Imagine you have a city and just by glancing around you can see where all the other players are located in the city, and in real time just see how how they moving in perspective to the screen coordinates.
Thanks for the help.