Networking for VectorStorm

I’ve been thinking more and more about adding network classes to the VectorStorm library, and I expect that I’ll do so sometime within the next few days.

However, there’s always a risk involved when doing networked games in an open-source game; it makes it really easy for people to cheat. Just modify your copy of the game to make you faster or invulnerable or whatever, and you can basically do whatever you want. And I’d really rather not have that problem.

Thinking it over, I’ve made a list of things that I want to somehow allow and disallow:

  • I want people to be able to play against each other in networked games.
  • I want people to be able to modify games I’ve written, and play against other people who are also using those modified games, but not to be able to play against people using different modified games.
  • I don’t want anyone who’s using a modified game to be able to access the official Leaderboards.
  • I do absolutely want to stand by my “everyone should be able to see and learn from or improve upon this code if they wish” policy that I’ve been using so far, and so all of the code must be visible in the code repository, under the same GPLv3 license as the rest of VectorStorm.

(If you disagree with any of the above, or have additional policies to suggest, I’d love to hear from you in the comments!)

My initial feeling is that I’ll need to incorporate cryptography into VectorStorm. I’ll probably use libtomcrypt rather than OpenSSL, just because I’ve used libtomcrypt before and found it to be much easier to work with, and very cross-platform. I’ll embed some data into the binary network-enabled games on this site, to make them “blessed” builds, and only allow the “blessed” builds to talk to an eventual leaderboard network server, to dissuade cheaters from corrupting them.

And I’m not completely certain whether using “blessed builds” to lock out access to the leaderboards is actually an allowed thing to do under the GPLv3’s section 6 (often called the “anti-tivoization” clause). I’m pretty certain that it’ll be fine since it won’t actually stop the user from making modifications and playing with them, but I’ll need to consult with the GNU guys to make absolutely sure before I do anything in that direction.