Lets get a server going.

For my Final Major Project (FMP) I've decided to do a complicated thing that is probably a really bad idea but I like the idea of using different technologies in games. it also means I can get back into a bit of web development, which I've come to hate over the last three years but should learn to tolerate again. So here's my ramblings about today's work.

My first instinct was to go with a web socket based server, as I know there is a C# library that can be integrated which allows the use of websockets. Decided to do some research first and various people suggested different things. https://forum.unity.com/threads/what-is-the-best-server-solution-for-real-time-multiplayer-game-for-mobile.502516/

Suggestion: Proton: https://www.photonengine.com/en-US/Server

  • Pros: Really good architecture, free for small projects, looks easy enough to integrate
  • Cons: really expensive if you have more than 100 concurrent connections

Someone further down that same forum post recommended GameSparks. Suggestion: GameSparks: https://www.gamesparks.com/indie-student-programme-faq/

  • Pros: They have an Indie and Student programme, allows for 100,000 monthly active users,
  • Cons: Kinda complicated and a bit overkill for the small functionality I need

Instinct: custom web socket server Pros: allows me to custom build everything, less overhead, free, can self host wherever I want Cons: time consuming to build, C# does not have a native websocket library, web sockets were meant for the web not necessarily for other development though I know it is used in other places (example needed)

I’ve decided to set up an ubuntu box with vectacp installed to handle the web side. VestaCP is a control panel which enables easy setup of apache / nginx, PHP, MySQL and other web stuff.

I choose to use this for all the web servers I operate as it is easy to use, involves very little actual setup and is more than often trouble free. But most importantly, it is free which is fantastic in comparison to other panels such as CPanel. I used ISPConfig for a while but I ran into issues, which they were I cannot remember which put very eloquently by a good friend "ISPConfig would change settings randomly, or autoupdates fucked up or anything of the sort really".

To overcome the issue of not having native websocket support in C#, I will be using a plugin: https://github.com/sta/websocket-sharp this will give me the same websocket connectivity that I would use in JavaScript

I've got two private repositories for my project, one for the Unity project, and the other for the server. The server is in a separate project so that I can simply pull the repo to update the server.

Websocket Service

  • Runs using nodejs
  • requires jsdom
  • requires jquery
  • requires websocket