I am about to start a project with Tnet.
I am wondering if I am moving on the right track using TNET... If I understand the high concept of it.It is a "simple" (Quotes, because I have never done network code before) quiz game.
Long story short, every player "races" answering quizz questions, and the host is a display of the players´ information (like top 5 racers, race time, a display of the track, etc);
it is only played on LAN.
So, my question are...
First step would be, everyone joining the same Address, right?TNManager.Connect(ent.internalAddress, ent.internalAddress);
And then, if there were to be many simultaneous races, each race would be a separate channel, right?Because I need one host per race, because, at least in the logic I have been thinking... The host would have the display, and the clients would "play". That is what I did for my prototype using unity´s standard networking.Edit: The answer is, yes, every race would be a separate channel.
The first person to join a channel is designated as that channel's host. Think "Operator" in IRC. Same concept. Only one player can be a channel's "host" and when the host player leaves, another one is automatically chosen.
But then... I have a problem... I was reading the thread "Using a Smartphone as a gamepad via TNet ?", and it states that two different scenes cannot have the same channel.No. Same channel means same scene. You can still send RFCs via private messages to players elsewhere, however.
Also, Aren does not recommend (in that case, the joypads and the "view screen") sharing scenes.I don't recommend you having them share a scene. You don't need the whole scene to send data. tno.Send with Target.Broadcast will send it to everyone. tno.Send with a player target will send a private message to that player. Either way, no need to be inside the same channel to send data. Just make sure that both places have the same TNObject ID / script.
So, I am kind of confused on how to proceed here.(In my prototype, I really have a class in the hosts that handles the data, whom is in a separate scene, and each player plays the questionnaire scene, but they never meet each other.)
Other than that, I feel like syncing the data and displaying it should be easy, because all the data I need to send to the clients are the questions, and the clients send back their answers... based on those answers, the host processes the data and displays at the main screen.
I will also attach some pics of the prototype, so you get an Idea of what I am doing.
Main screen
Host Screen
Client Screen