#Netcode for Entities - Client / Server - Multiple Connection Attempts

1 messages · Page 1 of 1 (latest)

storm hearth
#

Hey guys, Im having a few issues when setting up a project utilizing Netcode for Entities (NfE) for my multiplayer project, using multiple scenes.

This is what I'm trying to achieve.

STEP 1: Landing Page (no network connectivity required) - Home.scene
Login using Google Auth / Steam / other. This is simply to load user profile etc.

STEP 2: World Overview Scene - Connect 😱 (user button) - WorldOverview.scene
Loads persistent world state from JSON file upon connect. No other players visible at this point, this is simply a overview of the world state, building progress, points of interest, and current progress of the world map.

STEP 3: Lobby (lobby / relay) -> PLAY Mini Game - Lobby.scene
Queue player using Lobby Quick Join, using CodeMonkeys LobbyRelay tutorial code, auto generate a random lobby name (not visible to players to join manually) and use Relay to generate the relay connection to connect all players (up to 32). This part works already.

STEP 4: ENTER GAME - Platform Battle (think fall guys) - MainGame.scene
Players now connected via relay, and the world should run in Netcode for Entities. This is the point at which I want the Netcode for Entities world connection etc to exist. Correct?

STEP 5: END GAME - return to WorldOverview.scene
Upon completion of the game, scores are updated to Unity Cloud, game is terminated, Netcode for Entities session should finalize and close. Player should move back to World Overview Scene (STEP 2).

The issue Im having here is that Netcode for Entities is being set up upon application launch. I don't want that to happen. I want to setup Netcode for Entities only in the MainGame.scene and then destroy it when that scene closes. Then setup a new instance (on the same port which should be fine as the old port should've been released upon last game destroy).

Can anyone help me out? I'm super confused. ❤️

Thanks In Advance.