Author Topic: Any Tutorial to SetUp a Game with Channels?  (Read 2555 times)

Rexima

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 2
  • Posts: 78
    • View Profile
Any Tutorial to SetUp a Game with Channels?
« on: January 19, 2014, 01:12:26 PM »
Hey,

im trying since yesterday to setup TNet, but i dont know... I think im stupid.

So some questions now, maybe you can bring clarity.

If i want to setup a dedicated lobby server, i need to start it as tcpLobby and a tcp gameserver?
And if im connected to the gameserver, i can start creating Channels or join them?

If i create a Channel, how can i instantiate a player prefab?
Whats better to sync player? AutoSync or RFC Commands?

Yeah, if there would be a tutorial for a Channel based game, it would be nice, would be easier to understand TNet.

Katalyst

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: Any Tutorial to SetUp a Game with Channels?
« Reply #1 on: January 19, 2014, 02:13:30 PM »
You instantiate an object across the network by using TNManager.Create and filling in the parameters. RFC commands are more efficient as you can call them only when needed instead of set intervals like AutoSync. If nothing is happening, like the player isn't moving, there is no reason to update his position X times a second.

Use the TNManager.CreateChannel and TNManager.JoinChannel functions to do just that. You'll pass along the id and level to load and TNet takes care of the rest.

I suggest this page if you haven't looked at it already: http://www.tasharen.com/?page_id=4537

Rexima

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 2
  • Posts: 78
    • View Profile
Re: Any Tutorial to SetUp a Game with Channels?
« Reply #2 on: January 19, 2014, 02:23:49 PM »
Okay thank you.

I have a new Question.
What is the difference between creating Channels(rooms?) and creating a Gameserver?

LightSky

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 56
    • View Profile
Re: Any Tutorial to SetUp a Game with Channels?
« Reply #3 on: January 19, 2014, 05:27:48 PM »
Okay thank you.

I have a new Question.
What is the difference between creating Channels(rooms?) and creating a Gameserver?

When you run the TNet.exe, you are starting an actual server.  When people connect to the server they are essentially in the void, if you have them join a channel then they can interact with other players.  (You could think of a channel like a game room)