Sign in to follow this  
Cacks

Language for Game Server

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
[quote name='Cacks' timestamp='1313883732' post='4851760']
I have never done any networking in C++.
I'd rather do my game's server in Java or python.
[/quote]

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. [url="http://code.google.com/p/protobuf/"]Google Protocol Buffers[/url] 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 [url="http://imvu.com/"]work[/url]we 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
Hey [url="user/46406-hplus0603/"]hplus0603[/url],

[quote]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 [url="user/33873-apochpiq/"]ApochPiQ[/url],

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
[quote name='Cacks' timestamp='1313974855' post='4852076']
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,
[/quote]

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

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

Sign in to follow this