Real-time AR space sharing using Wayspot anchor API

Device type & OS version: Android**
Host machine & OS version:Windows**
Issue Environment : Unity**
ARDK version: 2.5.1**
Unity version: 2021.3.14f1**

This is my first question, I am a beginner. Sorry if this question is off the mark.

I would like to share the same AR space between multiple users in real time using Wayspot Anchor Service/Wayspot Anchor API.

The following is the ideal experience. A private VPS is created in advance for a certain point A, and the AR space is formed by reading that point with a camera. Multiple users share that space in real time and place objects such as comments. The information is saved, and when the same location A is loaded several days later, the comment objects and other information left in the past will be reflected.

Is it possible to create such an experience? And if so, which document should I refer to? I would also like to know the procedure. Thank you in advance.

Hi Riku,

That is certainly possible! We have a guide in our manual called Getting Started with Shared AR which covers how multiple users can share the same area in AR space. When it comes to retrieving objects and comments left in a certain location, that side isn’t really Lightship related and is more about storing data on your server that you can associate with either a Wayspot, coordinates, a series of Wayspots, etc. and later retrieving it on the client side. Those implementation details are up to you and how you want to proceed; however, if you have further questions regarding networking using Lightship feel free to send them my way!

Cheers,
Maverick L.

Thank you Maverick L for your reply.

I have three questions. (Forgive me if they are rudimentary questions).
The first is, to create the AR experience I am aiming for, should I refer to “Localizing With a Shared Environment” in “Getting Started with Shared AR”?
Second, should I use HLAPI or LLAPI?
Third, how do I retrieve objects and comments left at a location? How can I store the data associated with a waypoint, coordinates, series of waypoints, etc. on the server?

Thank you in advance.
Riku.

From what you told me you’re trying to achieve, I believe the “Localizing with a Shared Environment” section will be the most useful for your needs. Next, with the networking APIs, I would recommend looking for an alternative solution as Unity is deprecating UNet. One example would be Mirror which is open-source, in active development, and is well documented. Lastly, in an authoritative server setup, I would recommend having the server verify that the comments and objects left by players are acceptable and then submit that data to a SQL database which could contain a table of Wayspots with the primary key being the Wayspot Id. Clients would then request that data from the server and the server would query that data from the SQL database. In most cases, you NEVER want to trust the client. Always validate and sanitize input from the client and have the server in charge of propagating the simulation.

Some resources that you might consider helpful:
https://dev.mysql.com/doc/mysql-getting-started/en/
https://dev.mysql.com/doc/connector-net/en/
https://www.red-gate.com/simple-talk/development/dotnet-development/using-mysql-unity/ (Uses PHP on the server-side, but is a great starting point for database implementation)

Thank you for your suggestions, I have three questions.

  1. I was planning to use Photon for networking and Firestore for the database, but is my experience feasible with the above tools?

  2. Where should I get the Wayspot information from?

  3. How do I return the Wayspot information stored in the database to the client?

We are in the beginning stages of learning Lightship, so we apologize if we have asked similar questions.
Also, is there anything other than “shared AR” documentation that can help me realize the experience? We have done some tutorials.

  1. Both of those solutions have free and paid tiers which is okay but, since you’re learning, I’d recommend something open source so you can see how things work behind the scenes and save money. In addition, I would highly recommend that you spend time reading documentation, watching informative tutorials on the multiplayer solution you choose, and spend some time thinking about exactly how the architecture of your game should work. You could look up open source multiplayer games and read through the code for some real-world examples.
  2. You would get the Wayspot information from our servers using our API. You can learn more on our Using the Wayspot Anchor API guide. Please note that I would highly recommend that only your server application connects to our API as you do not want users of your program to have access to sensitive data.
  3. In most cases, the client requests the data from the server and the server either retrieves the data directly from the SQL database via a connector. The second resource link I sent in my last response has more information on how you can connect to a SQL database using .Net.

Note that Lightship is not currently developed to work with or support other third-party libraries. While you are free to integrate other libraries with it, you are doing them at your own risk as incompatibilities may arise. Always backup your project or use version control software. Support in these forums is limited to questions relevant to ARDK/Lightship.

Best of luck,
Maverick L.

Ok, I’ll try!
Maverick L., thank you very much for your kindness. Sincerely thank.
Also, I may have some questions, but I would appreciate your help at that time.

Riku

I’m glad I could be of assistance! If you have any other questions, please open a new thread in the relevant forum.

Happy Lightshiping!