Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: lance on December 01, 2017, 08:51:54 AM

Title: Streaming level with multiple channels
Post by: lance on December 01, 2017, 08:51:54 AM
I have a problem with huge level size and multiple channel.  Each streaming level is assigned to a channel.
If I join the channel after loading the level, in TNObject's Awake, the wrong channel id will be assigned. (TNManager's lastChannelID is not changed to new channel.)
If I join the channel before loading the level, than I got warning "[TNet] Trying to execute a function on TNObject before it has been created."
So how should I handle this situation? Many thanks!
Title: Re: Streaming level with multiple channels
Post by: cmifwdll on December 02, 2017, 08:52:28 PM
Wouldn't TNManager.JoinChannel(levelToBeLoaded.ChannelID, "Path/To/Level") work?
Title: Re: Streaming level with multiple channels
Post by: lance on December 03, 2017, 05:04:27 AM
Wouldn't TNManager.JoinChannel(levelToBeLoaded.ChannelID, "Path/To/Level") work?
The level loading is controlled by another class. So I just call TNManager.JoinChannel(channelID, false);
Is this the cause of the problem? Can I control when saved RFCs will be sent? For example after loading the level?
Title: Re: Streaming level with multiple channels
Post by: cmifwdll on December 03, 2017, 06:07:44 AM
No the server batches them with the JoinChannel / LoadLevel process.

Do you have TNObjects in the scene you're loading? I think this is why your first case fails (joining channel after loading the level).
If that's the case then there might be some useful info here: http://www.tasharen.com/forum/index.php?topic=15449.0

Otherwise, I'd try redesigning the level loading to use TNet's JoinChannel. Oh, TNet doesn't load levels additively by default, so you'll have to override TNManager.onLoadLevel or TNManager.LoadSceneAsync. Could maybe point one of those to your level loader, too, so it all ties together nicely.
Title: Re: Streaming level with multiple channels
Post by: cmifwdll on December 07, 2017, 03:42:04 AM
Did you find a solution?
Title: Re: Streaming level with multiple channels
Post by: lance on February 12, 2018, 02:09:36 AM
I redesigned the code and use TNManager to manage the level loading, and it worked, thanks!