so, let's talk multiplayer


At first, I want to thank everyone that supported me in the last months. It means a lot for me. I am freaking happy that there are people actually interested in the project!

In this post, I want to adress something, I was thinking about basically since I started developement.


When I started, I wanted to finally create the game I was planning out since a few years. It just felt like the right moment to me.

Because I wanted to create the game for a few friends and me to play, I decided to learn Photon for Unity (the Engine I am working with). I felt like it was the most suiting solution for the project, since I don't really have the energy or the knowlegde to write high-performant low level networking code.

The Problem

For the people who don't know Photon: It's easy to implement, but it get's extremly expensive compared to writing a solution on my own or using a open source one like mirror.

So last week I decided to completly rewrite my networking code to work with my own solution (and to write my own solution). I found a few good reasons for that:

  1. Aton is in a pretty low scale regarding of what it needs. I don't need stuff that a AAA-Game would in a game server. My server software won't be huge.
  2. I want to handle some operations server side. That's completly impossible with photon. Photon is more like Peer2Peer but complicated. The big upside of handling stuff server side (and most of it that is) lies in performance improvements for clients and more snapieness overall. Changes don't need to go from client to server to client but just from server to client if they happen on the server in the first place. That also saves on packages sent.
  3. I wanted better match-making. Again: since Photon is Client-authorized I won't be able to really create a good match-making system with things like private lobbies with passwords and so on.
  4. Better security against cheating: If things happen on the server not the client, cheaters have a harder time manipulating stuff. It will never be impossible, I am developing this thing solo after all, but I will be able to defeat most of those Cheat-Engine-Kids.
  5. Money. I want to offer (at least a basic version) of aton for free. I never planned making money with this project in the first place, now I will put a system in place that may cover my costs in the best case, wich is good enough for me. With my custom server software I will be able to do with 10€ what photon offered me for a 100 and maybe more, a pretty big difference. Reason for that - again - lies in the scope of Aton compared with photon. Photon can drive your MMO and i belive it could be great for that, but Aton is no MMO.
  6. It may come in handy to be able to host multiple instances of the server with different versions and configurations in the future. It will make things like Tournaments with a dedicated server to ensure performance possible. If some people enjoy aton and want to play it even if I would drop it at some point (wich I don't plan on, I dreamed of this game since a few years and I don't plan on stopping with that :D) it will be easy to setup a personal server to play on indefinitely.
  7. Spectators. It would be possible with Photon, but will be way more performant with my own solution.

As you can see, there is a lot of reason to go this step, even though it is a hard one. I am a student with a lecture about networking right now, so i learned a lot about it in the last weeks and even more when starting on this exact pice of server software. I decided to support UDP and TCP simultaniously since there are a lot of use cases where either of them would be optimal inside aton. I got the basic stuff setup, matchmaking allready works and I got my own version of PunRPC to work, even though I will switch most of the cases I used it to a more low-level solution over time it's a good thing to first just migrate all the codebase to the new solution.

Keep on dreaming and doing awesome stuff.

Sincerly,

Dominik.



Leave a comment

Log in with itch.io to leave a comment.