Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

It's so cool that you made a co-located multiplayer experience! There really aren't enough of those, even among commercial apps in the store.

How did you get the "invite a friend" thing to work? I didn't previously notice that in the API - is it the `MetaPlatformSDK.group_presence_*()` functions? I did a co-located multiplayer game once, but I used a room code system to get connected (but still had the users login via the Platform SDK, so they could share spatial anchors).

Anyway, very cool! And a super impressive thing to build in only a week - playtesting co-located experiences is notoriously hard :-)

(+1)

Hey David! Thanks for the kind words. 😊 And thanks for asking about the "invite a friend" feature, I was super excited to get that to work!

Yes, to enable "invite a friend", I use Group Presence functions. When setting up group presence, I use the inviter's local IP address as the lobby and/or match name, so that the invited friend knows what IP to connect to. When launching the app normally, the headset acts as a server, but if joining from an invite or deep link, the headset acts as a client. Here is some more info:

1) I followed the "Getting Started" instructions for Godot Meta Toolkit to get the app set up in the store and get Platform services functioning in Godot.
2) In the Meta Horizon Developer Dashboard, I added the following DUC items: "User ID", "Profile", "Deep Linking", "Friends" and "Invites".
3) Also in the Meta Horizon Developer Dashboard, under "Development" > "All Platform Services", I added the "Destinations" service, and created a single destination. I called it "main". 
4) In Godot, after initializing the Presence Platform, I check the launch details to see if we're launching normally, or launching from an invite or deep link. If launching normally, I create group presence options with my local IP and make it joinable, and start multiplayer as the host. If launching from invite/deep link, I have the headset connect to the host using the local IP in the launch details. You can see my script here: https://github.com/bschoun/aaaaaahhh-the-game/blob/master/meta_platform.gd I think Meta expects the client to also enable group presence, but I didn't get that working for the jam (it does work without it, you might just get a "Something went wrong" notification in the headset).

To be fair, I've worked with colocation before in Unity and used this technique, so I was able to reference my previous Unity project to get this working quickly. Here are a few of my tricks I use for developing/testing colocated apps:

1) I set a single spatial anchor at (0,0,0) that I save to the cloud and share. All visible shared objects are made to be children of this node. I use a MultiplayerSynchronizer to sync the transform values of the children so that everything is aligned between players.
2) I store the UUID of my spatial anchor locally to a file so I can re-use it. Meta seems to get mad if you create and save too many spatial anchors to the cloud in a short period of time and will lock you out. Happened to me during this project. 😅
3) During development/testing, I always have a virtual object at (0,0,0) showing XYZ directions, to compare what I'm seeing in each headset. I sometimes have a physical object that I will place at the (0,0,0) point, and then look at it from multiple headsets.
4) I have 2 headsets with different profiles. For each one, I use Meta Quest Developer Hub to disable the proximity sensor for a few hours to keep the headset from going to sleep.
5) Then I kind of just swap the headsets back and forth - invite from one, accept from the other, compare positions of everything. For things I can't test this way, I often ask another person to help me test it, or I might cast from one headset and wear the other. Maybe there are better ways I don't know about but this is how I do it.

I think that's it! Regarding Shared Spatial Anchors, just FYI, Meta now apparently supports group-based spatial anchor sharing/loading, which has fewer requirements than user-based. I haven't seen support for this in Godot yet, but maybe I didn't look hard enough since I knew I needed Platform anyway for "invite a friend".

(+1)

Thanks for all the details!

> Regarding Shared Spatial Anchors, just FYI, Meta now apparently supports group-based spatial anchor sharing/loading, which has fewer requirements than user-based. I haven't seen support for this in Godot yet, but maybe I didn't look hard enough

No, unfortunately, Godot doesn't support this yet, but it's something I've been wanting to add!