The Playtypus Experiment #5

3 minute read

A word about networking

Hey there , It’s been a while !

This had been a few busy weeks. We have been focusing a LOT on Multiplayer and what that mean for the development.

First of all, I owe an apology to all the multiplayer games I’ve played and complained about their netcode saying: It’s not that complicated.

Welp, turns out it’s a nightmare to make a game running perfectly over a network.

My god, we are so much behind this initial plan that we will have to rethink our timeline a little bit…

So during the last few weeks we have been researching, first, a tool to help us make the game we want to make working in multiplayer.

We experimented with Netcode for Entities, beautifully made solution by the unity team, with a minor caveat… We can’t use it for our game.

You see, Netcode for Entities is great when it to make action packed games , like MOBA & Shooters, but it’s lacking a few key features we need to make a planetary factory synced in multiplayer.

We explored other option but after a while we had to come to the conclusion that we will need to create our own solution on top of Unity Transport.

What we think we need

So far here are our requirements :

  • Deterministic simulation on both client & server -> this is going to be a bigger nightmare we think.
  • Tick System -> Should be easy enough
  • Messaging System over the network -> Almost there
  • A Catch-up System -> We have a few ideas to limit the need for it.

The idea will be to have what’s called a LockStep Simulation, seeing that we do not have competition & we don’t care about cheating in our game ( have fun everyone ! ) There are actually no points having any safety at all in the game.

What we need tho is to be able to send input from a player to the server, and then replicate it over the network in a timely manner and that these input give you the same simulation result as to your friends.

Believe me when i’m saying this … it’s not easy.

What we do now ?

We are currently heavily experimenting with networking. We tinker here and there. We get some wins and some losses. But we are learning a lot in the process. The main issue is : it’s taking forever to get things working due to our inexperience as network developers.

We think we have the foundation for the messaging system between the client & server figured out. Not sure if it’s the best way of doing it but worst case we will be able to change that later.

Why is it taking that much time ? it’s because if that brick is not solid enough, anything we are gonna do on top of that is at risk of crumbling later down in the development of the game.

Once that part is wrapped we will move to the tick & catch up system.

Progress Report :

As I said we mostly focus on networking for now and it will be a while until this part is ready. Without that brick, no multiplayer in the game. If we continue developing more feature for the game without it’s going to be incrementally harder and harder to make things work together once we get there.

So the short version is :

  • Studied how things are done in Netcode for entities.
  • Experimenting to replicate what we need without polluting the solution with other useless features we don’t need.
  • Coding , Doing & redoing network stuff.

Hopefully it is going to continue in the right direction.

Take care everyone and see you next week !

Touhma

Updated: