Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Zivix

Pages: [1]
TNet 3 Support / Modifying GameServer for an authoritative server
« on: November 07, 2017, 01:49:53 PM »
Hello, I've loaded up the GameServer solution and have gone through the code a bit, though I'm still not sure of the best way to go about modifying the GameServer to my needs.

So I'm aiming to make a competitive 1v1 turn based tactics game with dummy clients and an authoritative server. Upon startup, the client will connect to a master server(potentially connected to a service like GameSparks) for authentication and to retrieve player data (likely level, all obtained units, currency, stored teams, etc). Any menu actions (modifying or creating new teams, purchasing new units, etc) are triggered by the client, checked server side, and then either completed or rejected by the server. When loading into a match, the server will tell each client which map to load and which units + information to display to the player. I'd like for any action taken by the player to send an RFC out to the server, which will then perform validation and calculations before sending out the necessary information to either or both client(s). For example, if player 1 clicks on their unit, the server triggers an OnClick which will return to the client all information and available options, such as all hexes the unit may move to.

Essentially, what I'm aiming for is a completely untrusted client that will send the proper RFC to the server, which will process the packet(s) and then utilize the classes in a GameLogic folder I will have added to the solution. The functions called from the GameLogic classes will return information that will be packaged into a packet and sent to either one or both clients, along with an RFC id that will trigger the functions necessary to display the data to the user. This is at least my understanding or best guess in regards to what kind of solution I will need.

It sounds like the only modifications I need are to adapt the current RFC based structure such that the server processes the packets and then uses the RFC data to call the proper functions located in the GameLogic classes, and then have the server stream the resulting information or changes to the game state to the clients(Is it possible for the server to be sent one RFC id and then send out a different one because the server and clients are performing different functions? And would it even be necessary?).

My question is how I should go about modifying the GameServer solution to work this way? It seems like a very minimal amount of changes need to be made to the GameServer due to my attempts to make it as flexible as possible(potentially being able to reuse the customized executable for another game with a different set of classes in the GameLogic folder). Do you have any advice regarding which classes and methods to change and a general idea of how to go about changing them?

I hope I have included enough information, as other responses in regards to modifying the GameServer executable have only said it's possible and easy, but that it shouldn't be done; I was hoping I might be able to get a more insightful or thorough answer that provides a better idea of how one would actually go about implementing these changes. In regards to the question of why I need an authoritative server, I want to maintain competitive integrity of the game, as there are only going to be 2 clients per channel. I want to build some safety against cheating into the system from the start, and from my understanding, an authoritative server should be one of the best options for doing so (or at least it seems to be the best fit for my game specifically).


I recently purchased Forge Networking for my game, only to discover a number of large issues. I'm working with the community there to try to help fix the asset, but I'd like to keep my options open and look into other potential solutions in the event that the efforts with Forge are either unsuccessful or too slow.

With that said, I'm curious to find out whether TNet could be applied to my game or not. I'm working on a turn based 1v1 (for now) tactics strategy game. From what I understand, TNet is client authoritative with one "host" client. For my game, authoritative logic and anti-cheat is important, as I'm hoping the game will have a strong competitive presence.

With this said, do I need a completely authoritative dedicated server using another solution, or would it be possible to meet my needs with TNet? If using TNet, would I have the clients send function calls to a modified server, which would contain the authoritative code and be responsible for sending the two players the resulting state change? Or would I need to find a way to have a headless linux client serve as the server/host, but set up in such a way that only the two players have objects and the server can perform all of the authoritative logic for those objects?

I hope that my questions aren't too similar to those that you regularly see. I made sure to check the forums and video tutorials for any relevant information, but I couldn't find anything conclusive. I would greatly appreciate it if you could provide feedback regarding my needs and whether or not there is a way to use TNet to meet them while maintaining the competitive integrity of the game.

Pages: [1]