Author Topic: Streaming level with multiple channels  (Read 6077 times)

lance

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Streaming level with multiple channels
« 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!

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: Streaming level with multiple channels
« Reply #1 on: December 02, 2017, 08:52:28 PM »
Wouldn't TNManager.JoinChannel(levelToBeLoaded.ChannelID, "Path/To/Level") work?

lance

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: Streaming level with multiple channels
« Reply #2 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?

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: Streaming level with multiple channels
« Reply #3 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.

cmifwdll

  • Global Moderator
  • Sr. Member
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 149
  • Posts: 285
  • TNet Alchemist
    • View Profile
Re: Streaming level with multiple channels
« Reply #4 on: December 07, 2017, 03:42:04 AM »
Did you find a solution?

lance

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: Streaming level with multiple channels
« Reply #5 on: February 12, 2018, 02:09:36 AM »
I redesigned the code and use TNManager to manage the level loading, and it worked, thanks!