Jump to content

Multiplayer Game Server Help

AinsleyHarriot539

I have been looking into multiplayer game development and I was wanting to know if anyone on the LTT forum has any experience in making multiplayer games particularly server hosting scripts. If so can you please give me some guidance on what to do and how to go about it. Thank you in advance and any help is greatly appreciated.

Link to comment
Share on other sites

Link to post
Share on other sites

first comes to say that if you need to ask how to make a multiplayer game you're probably getting too much on your fork in one go.

 

that said, here's some general pieces of advice:

- keep the serverside as lightweight and universally compatible as you can

- a reliable connection is more important than server features. people wont care about ranks if they cant even play properly

- dont make your protocol plaintext, that's just a generally horrible idea for so many reasons

- dividing up the workload between client and server is a very touchy topic, everything you offload to the client is a potential for desyncs or exploits, anything you keep on the server is using server resources and a potential for a laggy experience.

- config options for EVERYTHING. the people hosting servers are usually handy folks, they like config settings.

- document EVERYTHING. same reason as before.

- you dont have a "server hosting script", you're essentially creating a whole another version of your game's client, but on the serverside of things. having scripted events in provided gamemodes is just a very small part of that.

(as an example, in the only multiplayer game i've ever created the only scripted event was to set up the map for a new game, which was about 10 lines of code out of the 10K lines needed for a very small game)

Link to comment
Share on other sites

Link to post
Share on other sites

scripts? A good game server has the vast majority of the code in C/C++. You do not allocate cores and threads using a script. It's way too damn slow. If you mean create scripts to elastically scale up/down a cluster, that's a different beast, and honestly it's something I doubt anyone on LTT has the first clue about.

Software Engineer for Suncorp (Australia), Computer Tech Enthusiast, Miami University Graduate, Nerd

Link to comment
Share on other sites

Link to post
Share on other sites

My advice would be to download the source code of some games and study the source code that takes care of multiplayer.

 

Quite a few games were open sourced or had their source code released. I'd recommend checking out OpenTTD , Doom , Duke Nukem 3D, Quake, Quake 2 , Wolfenstein: Enemy Territory...

Here's a list of games with source code published, may want to browse through it and see which games have multiplayer code : https://en.wikipedia.org/wiki/List_of_commercial_video_games_with_available_source_code

 

And yeah I agree with the user above... no reason for exchanging text between server and client, keep it binary. reserve bytes for future use in the packets or make them structure of the packets between server and client flexible so that older clients could parse packets of servers with slightly newer versions of the protocol, don't restrict yourself, make sure you have some kind of versioning system so that server can reject clients that wouldn't understand commands sent by server (old client versions) ... could use some extra fast compression to compress packets (zlib , lzo , minilzo , zstd, brotli)

 

Link to comment
Share on other sites

Link to post
Share on other sites

12 hours ago, manikyath said:

first comes to say that if you need to ask how to make a multiplayer game you're probably getting too much on your fork in one go.

 

that said, here's some general pieces of advice:

- keep the serverside as lightweight and universally compatible as you can

- a reliable connection is more important than server features. people wont care about ranks if they cant even play properly

- dont make your protocol plaintext, that's just a generally horrible idea for so many reasons

- dividing up the workload between client and server is a very touchy topic, everything you offload to the client is a potential for desyncs or exploits, anything you keep on the server is using server resources and a potential for a laggy experience.

- config options for EVERYTHING. the people hosting servers are usually handy folks, they like config settings.

- document EVERYTHING. same reason as before.

- you dont have a "server hosting script", you're essentially creating a whole another version of your game's client, but on the serverside of things. having scripted events in provided gamemodes is just a very small part of that.

(as an example, in the only multiplayer game i've ever created the only scripted event was to set up the map for a new game, which was about 10 lines of code out of the 10K lines needed for a very small game)

Don't forget the Database. This thing can make or break your sever. It decides if you have 20gb worth of data or 200mb. You will spend a huge amount of time, just trying to optimize the database

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×