I have an issue that might be either difficult to resolve or easy based on configuration. We have an existing multi-user project that is working as expected. We are in the process of building a companion app (Mobile) where it will be connecting to the network session but only act as an observer. The main application is an XR app and the observer is a mobile app. ANyone who has worked on such a setup / configuration would love to hear your inputs. I would also like to hear from Unity Support Engineer who I can share more of what is going on.
#Networking Between Two Separate Projects
1 messages · Page 1 of 1 (latest)
Why the grok image? But you can link the 2nd project to the same Unity cloud project Id as the main project in the project settings. Both projects would then be able to connect to the Lobby/Sessions, note this might cause problems if you are using Unity Version Control.
If you want to talk to the Support team then you can open a ticket
thanks @floral dagger so that part is done, and it is working. the issue is that the scene is pretty complex and it is dynamically loading a lot of other network objects on the original XR application.
I guess my question is more of the Rig, since the mobile application does not have the XR Rig as the player, and we created a mobile version of the Rig, will this cause a problem?
Regarding Grok image, just to put in some colors 🙂
those networked objects are not being synchronized properly
Both projects will need identical Network Prefabs in order to work properly. Its honestly easier to have 2 build platforms in the same project
that's the challenge in this undertaking how to make the two applications work
even if they are in the same project, the prefabs are going to be different as they are targetting two separate platforms
As long as the network objects have the same network behaviors in the same order, then the platform will not matter
If cross platform builds aren't syncing then you have something else going on. I would open a support ticket because this normally will work out of the box
Yup thanks
@floral dagger Ok i have a very similar issue to the one described here... But as far as i know, merging the projects into one is going to be a suggestion that meets heavy resistance lol. You say at the start to use the same unity cloud project ID in the project settings...
On double checking, both these projects that i am tasked to make talk to each other.. Use unity VCS lol.. So fun times ahead for me i fear.
--excuse me if this is 'bad form' to ask my own question in this thread, but this seemed the only relevant thread to ask in. --if it is better for me to ask this in a seperate thread i will go head and do so.
No problem. But it really depends on what you need to communicate between the projects. It's possible to use the Cloud Services APIs with different service accounts to enable some kind of cross project sharing.
hmm.. yea idk if that's suitable because... Cloud services API seems more suitable for delayed information right?
...you see, one project is a VR cricket game, the other project is a desktop/standalone replay-review 'game'.
Currently, the replay-review part works fine, offline.. But i've been asked to make them connect so a batter can be viewed 'live' -so sending info from the VR project into the viewer project... Obviously, since one is VR, the other is not.. and they are seperate projects... Not a lot of stuff is going to line up, nor does it need to currently...
What does need to be transferred, in realtime, is the batmans movements and the ball positioning, etc... So yea... Seems like cloud services is not really suitable for that (from my understanding)
Someone on mirror discord explained that mirror uses unet as a basis, so that also expects the proejct to be shared..
..but they did point me to... 'riptide'
which also gives an example of networking between 2 seperate projects, i havent looked at it yet.. but im about to, hopefully this will serve my purposes.
But any input is welcomed.
(also thanks for replying at all lol)
For live realtime gameplay, you'll need them to connect to same dedicated server.
If a slight delay is fine then you could have the VR game stream the replay data through something like WebRtc
i am intending on making one half of the situation the host, and the other half the client and using p2p networking as opposed to further complicating it with a 'dedicated server' --if that's what you are suggesting.
-since in my experience having to make a 3rd 'build' specifically for dedicated server app and then having to debug that being built and the communication being routed through that added additional headaches lol..
..and since this is always going to be (afaik) at most 2 things trying to communicate, the whole dedicated server thing seems like overkill / extra complexity.
..also i may use your suggestion of using the cloud-services-api to do a kind of 'match making' between the projects --so that suggestion is actually quite helpful tbh.
thanks again for your input
That is just using your host as a dedicated server. Which is fine but just comes with some security issues regarding needing to send the hosts IP address to the viewing clients. Using the Matchmaking API might solve that though.
ok.. perhaps i misunderstood but when people say 'dedicated server' --personally i assume that to mean a dedicated headless client (or console app) that runs the server operations on its own.. as a standalone piece of software... and what i mean is... one is host, one is client... and they talk to each other over the network... either via a relay initially to setup the connection.. or via a website that does matchmaking... (so yes, one is the server (playing the game), and one is the client.. (viewing the player) but it is not a 'dedicated server' in terms of... it is not a standalone application / extra link in the chain)
..and, although initially i thought the cloud services API might be useful... since that requires your unity project to be 'linked' i'm not actually sure how feasible that is - because it would require a different project, to communicate with cloud save or information stored on unity's backend... and access it... So, that may not be as helpful as i'd hoped...
(so if i host the cloud info on the 'server' project.. the 'client' project still needs access to the cloud info of the server project.. and yea, that stuff is 'project linked' afaik -- same issue with matchmaking sadly.. and relay, afaik )
But still, appreciate the input!
(and also as to your security concerns --that is basically the last thing on my mind right now.. Or at all --First i need to get this to work.. Then security (if it is an issue -which i doubt) can be looked at )
--Also if i've fundamentally misunderstood something (which is not unlikely) please feel free to correct me, as i only have experience making multiplayer games where everything is in the same project... i've got quite far with that too... But i am always happy to be proven wrong if it makes my life easier in the long run lol. 😄
You're not wrong. But the only real difference between a dedicated server and a host is that the host is also running a client. Your main issue here is telling the client how to connect to the host. If you are on a lan then there is no issue. just enter the host's ip address or have the host broadcast it. Over the internet its tricky and usually requires some kind of relay service to facilitate the connection