• Advertisement
Sign in to follow this  

Language for Game Server

This topic is 2379 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey Guys,

I'm going to make my game client in C++ for Windows & Mac.

I have never done any networking in C++.

I'd rather do my game's server in Java or python.

Any ideas/suggestions?

cheers

Share this post


Link to post
Share on other sites
Advertisement

I have never done any networking in C++.
I'd rather do my game's server in Java or python.


Why wouldn't you make the client in Java or Python as well, then? Seemed to work for Civ V (Python) and Minecraft (Java).

However, the most important piece of advice would be to use some mechanism that can describe your packets, and be used on both ends. Google Protocol Buffers are one such cross-language data serialization format that I've used, and can recommend.

As long as you describe your entire protocol using an interface definition language of some sort, then you can compile bindings for any supported language. C++, Java and Python are all natively supported for Protocol Buffers; at workwe additionally wrote bindings for PHP and Erlang.

A small amount of additional glue logic is needed to put protocol buffers in a network message (a type-and-length prefix style wrapper), but that's pretty easy!

Share this post


Link to post
Share on other sites
It would be very useful to know what kind of game you're making.

A realtime first-person shooter is going to require a very different kind of server implementation than a matchmaking system for chess, for example.

Share this post


Link to post
Share on other sites
Hey hplus0603,

Why wouldn't you make the client in Java or Python as well, then? Seemed to work for Civ V (Python) and Minecraft (Java).[/quote]

Cheers for the info. I don't want to write my client in Java because it's a 3D game using OpenGL & I don't want to rely on any OpenGL wrapper libraries which might not be maintained in the future. I also don't want people to have to have Java installed on their machines. I've never used Python before so I can't comment on it's suitability for my client but I have seen that python is a popular choice for server programming.


Hey ApochPiQ,

the server I'd make would setup matches between 2 players & the result would be stored in a DB. The 2 clients would communicate directly once the matches are started,

cheers

Share this post


Link to post
Share on other sites

the server I'd make would setup matches between 2 players & the result would be stored in a DB. The 2 clients would communicate directly once the matches are started,


Likely, simple HTTPS queries would be sufficient for client/server communications, unless you need to do UDP NAT punch-through.

Note that if you don't have real-time game rules enforcement on the server, your client results protocol will likely be open to hacking/cheating (even with HTTPS) but sometimes that's not such a big deal.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement