MLAPI Network Variables and object lifetime

Created by Client or Server

Player Lives as a Network Variable

The sum of the parts is more complex than the whole??

In order to keep a nice separation of concerns I have a number of components responsible for various features, e.g. UI Manager, Player Manager, and the player’s ship. Current I have ended up with a starting sequence that looks like this.

Object Lifetime’s not in sync
Display lives left message


I am sure there is a better way of doing this, please let me know, as I am still finding my way through MLAPI. But what is certain is that when you introduce a networking layer then you can no longer assume that the state of your items is in a nice easy to follow sequence. It is much better to consider everything is a multi-threaded scenario, i.e. assume everything is out of sequence, use some form of synchronisation signalling and code defensively.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store