Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

cakeslice/MLAPI-Plus

 
 

Repository files navigation

MLAPI-Plus

MLAPI-Plus is a fork of MidLevel/MLAPI that will reflect all the changes I had to do to make it suitable for the fast-paced competitive multiplayer game I'm currently developing which uses a client/server architecture with dedicated servers.

I will be adding any features I need like client-side prediction and server reconciliation as well as changing anything that obstructs what the game needs to use the minimum bandwidth, to have as low latency as possible, the smoothest synchronization and minimum processing requirements to reduce server costs.

I will also develop some real world usage examples of the framework based on my game later on.

As for the default transport I removed the deprecated UNET and chose MidLevel/Ruffles because it looks like the best managed LLAPI out there and was made by the same developer of MLAPI. If the original developer is reading this, thank you for MLAPI and Ruffles, they're really good. 🙂

After the game's release into production I also intend to commit all bugs and problems I can fix as well as submitting pull requests to the original repository (if applicable).

Installation

Right now it's still in development but if you would like to try just add these two lines in the manifest.json of your Unity project:

{
    "com.cakeslice.mlapi": "https://github.com/cakeslice/MLAPI-Plus.git?path=/MLAPI",
    "com.cakeslice.mlapi_editor": "https://github.com/cakeslice/MLAPI-Plus.git?path=/MLAPI-Editor"
}

README of the original repository:

GitHub Release NuGet Release Github All Releases

Discord Build Status AppVeyor Tests

Licence Website Wiki Api

The Unity MLAPI (Mid level API) is a framework that simplifies building networked games in Unity. It offers low level access to core networking while at the same time providing high level abstractions. The MLAPI aims to remove the repetetive tasks and reduces the network code dramatically, no matter how many of the modular features you use.

Getting Started

To get started, check the Wiki. This is also where most documentation lies. Follow the quickstart, join our Discord and get started today!

Community and Feedback

For general questions, networking advice or discussions about MLAPI, please join our Discord Community or create a post in the Unity Multiplayer Forum.

Compatibility

The MLAPI supports all major Unity platforms. To use the WebGL platform a custom WebGL transport based on web sockets is needed.

MLAPI is compatible with Unity 2019 and newer versions.

Development

We follow the Gitflow Workflow. The master branch contains our latest stable release version while the develop branch tracks our current work.

Contributing

The MLAPI is an open-source project and we encourage and welcome contributions. If you wish to contribute, be sure to review our contribution guidelines

Issues and missing features

If you have an issue, bug or feature request, please follow the information in our contribution guidelines to submit an issue.

Example

Here is a sample MonoBehaviour showing a chat script where everyone can write and read from. This shows the basis of the MLAPI and the abstractions it adds.

public class Chat : NetworkedBehaviour
{
    private NetworkedList<string> ChatMessages = new NetworkedList<string>(new MLAPI.NetworkedVar.NetworkedVarSettings()
    {
        ReadPermission = MLAPI.NetworkedVar.NetworkedVarPermission.Everyone,
        WritePermission = MLAPI.NetworkedVar.NetworkedVarPermission.Everyone,
        SendTickrate = 5
    }, new List<string>());

    private string textField = "";

    private void OnGUI()
    {
        if (IsClient)
        {
            textField = GUILayout.TextField(textField, GUILayout.Width(200));

            if (GUILayout.Button("Send") && !string.IsNullOrWhiteSpace(textField))
            {
                ChatMessages.Add(textField);
                textField = "";
            }

            for (int i = ChatMessages.Count - 1; i >= 0; i--)
            {
                GUILayout.Label(ChatMessages[i]);
            }
        }
    }
}

License

MIT Licence

About

A game networking framework built for the Unity Engine to abstract game networking concepts.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.9%
  • PowerShell 0.1%