Rebuilding in Updated Unity6.2.5f1 and new VR MP sample

I finally installed the new version of Unity and decided to just start fresh. Got it up and running on my UGS very easily. New project, vr mp sample, once it finally opens, Get pkg for dedicated server, then go to edit, project settings, uncheck openxr and check oculus, then file, build settings, create a linux server build. That’s for uploading to the multiplay hosting cloud service, go to unity cloud and set up your multiplay hosting, go through all their steps, tada.

Once your test allocation is complete, cloud automatically offers you to set up matchmaker integration, which i had running on tictactoe and cs, so i went through that as well for this project, but at this point my script doesn’t call it…working on this part…

Now in the project go make a android build, and use sidequest to load that apk into headset, helps if you have a buddy setup to do mp. And there we go, blank room, connected.

Now to the scene i like, and save as, rename it. Replace environment with my own. Set mesh colliders on my lil arena. Next is to add the endzones and colliders back, the networked objects including the center object, and add the scoreboards. Script it and we should be good for another test.

On a side note, this updated vr mp sample room is different, and it has an option to go lan only, which i have been messing with attempting in the old one, and read multitudes of reddit posts and whatnot on other’s interest in this. So unity did it, built in, lovely. Good job guys 😉 Also the bonus prefabs, some of those are going to come in handy… so many ideas.

Ok on with it, once i got that up to speed, now i’ve been working on breaking out of the sample a bit. They have it set for a main lobby with lil connected minigames in the same scene. Somehow that doesn’t feel satisfying enough for me, i want to be able to change scenes. I may still do the minigame way but… so switching networked scenes, hmmm, tricky. Lobby, Arena, ArenaLevel2. So far the lobby scene just connected canvas there, connect and it autoswitches you to the arena scene. So that was a tricky bit, and i still hvae to test if it actually brings both player4s into the same room when it goes to arena….

So from memory and i’ll touch up later, the big key was deactivating the big 3 prefabs in the arena scene and load it in additively OnNetworkSpawn from the bootstrapper scene, and the script has to use network scene manager not just scene manager. There’s a checkbox in the inspector of the netwk vr mp var prefab in the bootstrapper scene thats for Enable Scene Management. That has to be checked. You have to add a persistent object script onto the top one, the network mgr vr mp var, or you get duplicates which makes you have nested hands. Where I’m stuck is when it calls the isserver, nada. But if i comment out that line, works and second room appears networked. So does it auto use server when i call it using netwkscene singleton and all that…. and to note, i’ve only checked the isserver failure part by using the ui in the editor play mode not in the headset, would that make a difference… Another note is the level changing i’m trying to do, you only want to unload the arenalevel1 scene but leave the bootstrapper in place, then load additively the arenalevel2, but it goes crazycrazy so that’s not quite right yet…. my hunch is that if i were calling the server to do this and synchronizing events properly then i’ve got it, but there’s a lack of depth to my understanding as of yet…. and to be fair, i haven’t networked anything in not vr so yeah. Ok to the test, two headsets, do we get into the same arena when we log in… and of course the other headset is dead…

Few notes, but overall seemed functional. The ball clones don’t unload with the scene so that’s interesting, (I looked into this and you have to go into the prefab ball and uncheck the scene migration on the network object in the inspector) they come back to the bootstrapper with you but you’re still connected. and the client win is different it doesn’t push you back to bootstrapper scene and you get to see the explosions…on mine it goes back to bs scene, on davids it goes fireworky and you’re just stuck in the arena with the fireworks going. If i the host goes on to get points and win, then it brings us both back into the bootstrapper scene together, and i the host can press the play again and it brings us back into the arena together. So kind of mostly success, because we did get into the same arena, so really that’s pretty huge. and when the one headset timed out and left, i could just quit and relaunch the game and connect, goes rt back, snappy.

So for further testing, both headset changed settings to give me 15 minutes of no activity before it logs me out, that will be easier lol. So i can see what happens is when points tip you into the win sequence, it becomes unsynced, doesn’t show same point numbers. Client is experiencing fireworks, host is stuck at one to one, if you the host score another, it goes to bootscene. So now to investigate that area of the code. And i’d rather it throws you both into level 2 or just refresh the scene you’re in, but back to bootloader is all i could really get since it’s the original scene. Maybe if there was more of a structure, like boot, lobby, gamelevel1, gamelevel2, etc. then you can unload back to lobby but not to boot. yes that sounds promising.

Tags:

Comments are closed