Boss with Nested Objects

My Xevious Boss is an object with five child, or nested, objects. To convert this into an MLAPI object I added a NetworkObject to each node, i.e. one for the root Boss and one each for the nested objects. When I instantiate the boss, or in MLAPI terms Spawn the boss, the root object would have a network Id but all the nested objects would just be set to zero. I have seen this before and I have previously worked-around the problem by making the root act as a relay/proxy for the children. …


German Tunic

A typical way of creating a character for your game is to take a 3D model of a person and craft the clothing onto it. That works well. However, it can be a little expensive if you want to create variations. For example, I have a Second World War German soldiers tunic, how can I easily make multiple variants of people wearing that tunic?

Reallusion

In this example I am using Reallusion Character Creator that allows me to import my Tunic as separate stand-alone object. Once imported I have converted it into a Character Creator Accessory. The accessory understands the spatial…


Today I was slapped in the face by MLAPI.

I have been happily testing Xevious using each individual level since essentially the levels contain the different types of enemies I need to make “network-ware”. However when I tried a complete run-through of the game it did NOT work.

Levels & the hierarchy

I have currently set up Xevious to use a level mechanism where all the levels are in the hierarchy, but only one is active. What I did not appreciate is that MLAPI makes optimisations based upon if the objects are active or not.

Inactive in the hierarchy, and not spawned

Therefore whilst my current level objects are all…


Orange Bomb Target

In my previous article I wrote about synchronising the bullets. Xevious has a secondary fire, a bomb that is dropped onto a bomb target. I.e. when you drop a bomb there are two objects created, a target and a bomb. Both of these must be synced between the players. Previously I have used two different mechanisms; a) Only create the objects on the Server and let MLAPI sync the Network Transform and Animations to the clients b) Sync the trigger of the “Drop Bomb” event and let the clients control their own local versions. The game rules for Xevious is…


Who gets the points?

In my previous article I talked about how you can achieve better performance by creating projectiles locally when compared with creating a server instance and keeping them synchronised with the clients. But what happens when the projectile actually hits something, who gets the points associated with killing the enemy?

Projectile Ownership

Whilst there are some subtleties in scoring (e.g. if player 2 hits the big baddy 99/100 times but player 1 has the last shot, how do you score that?) the basic problem is knowing who fired the shot that hit the enemy. In Xevious my projectiles have an IProjectile interface/contract. …


In my previous articles and video I demonstrated how to synchronize the enemy between the co-op players. Essentially it is about the Server using MLAPI Network Object and Network Transform.

Simplified Enemy Network Sequences

This works well for the enemy because the majority of the logic (firing, moving, etc.) is all held within the server and then distributed to the clients. However, player logic is different. The clients receive the player’s input and move the local player. This is then synced back to the server and distributed to the other players.


Recently I was reading a plea for help where someone was getting a, “your file is too large to upload” style error message from Git. That made me question, are we using Git correctly?

What is Git?

Whilst Git came from Linux as a source repository it has now taken on a life of its own. Honestly, I cannot definitively answer this question, but I can offer up some possible overlapping rationales. Note, many of these rationales apply equally well to other source repositories, not just Git.

Version Separation


In my previous article I talked about the basic mechanisms behind synchronising the flying enemies in multiplayer Xevious. I know that the ground enemy will require additional work. The problem is that the ground enemy need to be positioned relatively to the scrolling background. For fixed positions you can get away with ignoring this issue because the Server instance will have created the enemy and correctly set up the parent child relationship.

Ground Enemy Parent/Child structure

Then by adding the basic Network Transform object the world space position will, fortunately, be correct. Although still suffering because I have not changed the Min Meters setting.


My experiments with MLAPI for implementing multiplayer in Xevious continues with testing the syncing of enemies.

The basic synchronisation

The core of sync’ing enemies with MLAPI is to spawn them.

The important point is that Spawn can only be done on the Server. When the spawn occurs the object is replicated to the clients. However, in order for the spawn to work it must have a Network Object component.

Network Object Component

With just these basic components in place the Toroid Enemy ship can be spawned on the server and replicated to the client. …


Previously I implemented a quick multi-player test of Xevious using Photon V2. Whilst Photon seems really good for creating Battle Royale style cloud based multiplayer games, I want something that is more local-network-only. With this in mind I turned to Unity’s new (in-preview), MLAPI multiplayer networking.

MLAPI shares some common features with Photon, e.g. there are objects to help sync transforms and animations. There is also a NavMeshAgent sync too. Where it seems to really differ is it is more IP client/server based, rather than cloud Lobby/Room based.

Networking modes

MLAPI makes heavy use of modes. …

Paul Marsh

Unity, VR, Enterprise and .Net Developer

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