Author Topic: Is Tnet suitable for a FPS game?  (Read 3584 times)

BrainEaterGames

  • Guest
Is Tnet suitable for a FPS game?
« on: February 26, 2013, 12:06:08 AM »
Hi, I'd like to know which kind of game architecture can Tnet be used for, I mean authoritative server, semi authoritative, p 2 p, etc, I'm interesting in creating a fps game with a dedicated server, so the user input has to be responsive locally, meaning probably semi auth. server, if it is, do you have any general usage tips? thanks in advance

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Is Tnet suitable for a FPS game?
« Reply #1 on: February 26, 2013, 07:11:12 AM »
It's really up to you how you use it. The examples show how to use it in an authoritative client environment by checking TNManager.isHosting flag (only the authoritative player will have it set to 'true'). The idea is that the authoritative player is the one running the AI and game logic, and others simply receive the result. The best way to go about this is to have the players create their own avatar and control their own avatar (TNObject.isMine). This way the game will always feel responsive on their end.

BrainEaterGames

  • Guest
Re: Is Tnet suitable for a FPS game?
« Reply #2 on: February 26, 2013, 07:37:08 AM »
Thanks for the quick response, so if I want the server to be a standalone program I can create two clients,  one which is the only one who can host and maybe show a console here to handle server side functionality. Then the others, regular clients can only join, am I right?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Is Tnet suitable for a FPS game?
« Reply #3 on: February 26, 2013, 07:21:27 PM »
Clients never connect to other clients. Clients always connect to the server. The server is either a stand-alone executable you run (~50 kb), or something you instantiate from within Unity using TNServerInstance.Start.

follower46

  • Guest
Re: Is Tnet suitable for a FPS game?
« Reply #4 on: April 21, 2013, 08:30:43 PM »
I know this is an older thread but I haven't found a good example of this yet (I have done some searching on the forums and watched the youtube tutorial).
For an FPS you obviously want the avatar for the client to only be visible for the other players (and have a specialized controller for handling key inputs).

With TNET would it be better to have all the clients instantiate the same avatars (only hidden if it's your own) and use the camera controller to modify the camera location and the avatar location or find a way to instantiate the controller if you're the owner and an avatar if it's another player?

I hope I explained my problem correctly, I'm just hoping to get a simple prototype off the ground for my friends.

Thanks!

follower46

  • Guest
Re: Is Tnet suitable for a FPS game?
« Reply #5 on: April 22, 2013, 12:23:11 AM »
As a quick update, I have decided to use the first approach where the avatar is always the same but not rendered if it's your own (hoping that's best).
Currently using UDP with 20 updates a second the multiplayer fps is working great! I have to manage some client-side prediction/easing between the updates, but that's to be expected.
Thanks!