Jump to content
  • Advertisement
Sign in to follow this  

Simple Networking Tutorial: Using SFML and Node to create a high score server using UDP

This topic is 2761 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

Not sure how many of you are interested in such a thing, but I just finished up a brief tutorial series on using SFML ( C++ ) to talk to a NodeJS highscore server. It covers creating a UDP socket, encoding information in JSON, passing it across the network, taking the highscore data and "doing stuff" with it on the server side, returning it back to the client, decoding it from JSON back into usable data then displaying it. I include a full zip of the project ( Visual Studio 2010 ), so you can simply download and compile if wanted.

The code is by no means production ready, but it does demonstrate all the concepts you need. If you are unfamiliar with Node, it is a server side Javascript environment based around Googles fast V8 JS engine. It makes writing highly parallel and scalable servers almost trivially easy and is worth checking out.

Part 1 - Setting up, running a node app, and making a simple network connection
Part 2 - JSON encoding your data in C++, passing in a new high score, decoding JSON in Node
Part 3 - returning high scores from Node back to the client, decoding JSON in C++. Also, a primitive high score webserver, just because.

Each part links to the next, so you can just start here if you want.

Please let me know if you have any comments, questions or if I made any stupid mistakes, as I no doubt have!

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!