MLAPI | game networking framework built for the Unity Engine | Networking library

 by   MidLevel C# Version: v12.1.7 License: MIT

kandi X-RAY | MLAPI Summary

kandi X-RAY | MLAPI Summary

MLAPI is a C# library typically used in Networking, Unity applications. MLAPI has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

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 offering 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.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              MLAPI has a low active ecosystem.
              It has 452 star(s) with 109 fork(s). There are 38 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 35 open issues and 160 have been closed. On average issues are closed in 18 days. There are 15 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of MLAPI is v12.1.7

            kandi-Quality Quality

              MLAPI has 0 bugs and 0 code smells.

            kandi-Security Security

              MLAPI has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              MLAPI code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              MLAPI is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              MLAPI releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              MLAPI saves you 15910 person hours of effort in developing the same functionality from scratch.
              It has 31689 lines of code, 0 functions and 246 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MLAPI
            Get all kandi verified functions for this library.

            MLAPI Key Features

            No Key Features are available at this moment for MLAPI.

            MLAPI Examples and Code Snippets

            No Code Snippets are available at this moment for MLAPI.

            Community Discussions

            QUESTION

            Duplicating ScritableObjects with Values per Script Unity
            Asked 2022-Feb-06 at 16:26

            I am making a Multiplayer Game with MLAPI. The problem is, i have a ability system so every ability get executed over an ScritableObject. The problem is, if i have for example five Players in the scene all Players are referenced to the same ScritableObject. And so when somebody execute a ability. The other players are also doing it. So my Question is can I duplicate my default ability ScritableObject so that every player has its own abilities ScritableObject but with the same Values as the default ability ScritableObject. I must do that over Script. I know i could create a new ScritableObject and then make a method who paste my values. But maybe somebody has a better idea??????????

            ...

            ANSWER

            Answered 2022-Feb-06 at 16:26

            Afaik you can use Instantiate also for cloning ScriptableObject on runtime! Only you can of course not use any component taking more then the original parameter (which makes sense).

            And the same way as ScriptableObject.CreateInstance this will of course not create an asset but only a runtime instance.

            Source https://stackoverflow.com/questions/71007776

            QUESTION

            "Using MLAPI" gives error message, even when I have MLAPI installed
            Asked 2022-Jan-24 at 13:48

            I have MLAPI (https://docs-multiplayer.unity3d.com/docs/migration/install/index.html) installed with Tanks multiplayer (https://assetstore.unity.com/packages/templates/tutorials/tanks-multiplayer-mlapi-photon-mirror-69172#description), and when I import the tanks multiplayer code for MLAPI, I get the error: "error CS0246: The type or namespace name 'MLAPI' could not be found (are you missing a using directive or an assembly reference?)", even though it is installed, and I don't know what to do

            image of error message

            image of the packages

            ...

            ANSWER

            Answered 2022-Jan-24 at 13:48

            you need to import MLAPI like so using Unity.Netcode;

            Source https://stackoverflow.com/questions/70626434

            QUESTION

            Call a generic method with a specific type only known at run time and return that type?
            Asked 2021-Nov-03 at 13:45

            I am trying to set up a networked event system in my Unity Project that allows triggering events on other clients. The event also is supposed to pass an EventArgs-type specific to that event.

            However, apparently System.EventArgs is not Serializable and thus can not be directly sent over the MLAPI Network. Therefore I convert the class to a string with Unity's JsonUtility class and instead send that string. Additionally, I send another string which is the specific eventArgsType.ToString().

            On client side, I am then converting the eventArgsType to a Type with GetType, and would then like to Deserialize the data-string into the correct eventArgs class. Which I currently do by nasty if-else case comparing to the possible eventArgs-Subtypes and then Deserialize as that. That works, but is extremely ugly and will get out of hand the more subtypes I have. But I am not quite sure of how to do that and would appreciate any tips.

            What I currently have:

            ...

            ANSWER

            Answered 2021-Nov-03 at 13:45

            As per the docs there is an overload of that FromJson method which takes a Type

            Source https://stackoverflow.com/questions/69825756

            QUESTION

            Can't destroy correctly object in Unity MLAPI
            Asked 2021-Nov-01 at 07:59

            I am trying to destroy specific object on mouse1 click. I am using Unity MLAPI 0.1.0. When I spawn object (SpawnPuzzlePieceServerRpc), I save it's network id into a NetworkVariable. Object then follows mouse cursor (MakeActivePuzzlePieceFollowMouseServerRpc). After that, if I press mouse 1 button, I want that spawned object to be destroyed. Method (DeleteActivePuzzlePieceServerRpc) destroys object both on host and client, however, method continues to be called for some reason, and throws KeyNotFoundException: The given key was not present in the dictionary. NetworkVariable (activePuzzlePieceNetId) seems to be updated to 0 (because of the error throwned constantly), so the method shouldn't be called again because of the condition in Update(). It feels like NetworkVariable is not syncing correctly here. What could be the problem and what am I doing wrong?

            Thanks in advance,

            ...

            ANSWER

            Answered 2021-Nov-01 at 07:59

            I don't think you can use NetworkVariables in a script inheriting from MonoBehaviour. You should use it in a script inheriting from NetworkBehaviour and add the NetworkObject component to the game object to which script belongs. You have to first make sure this network object is spawned across the network in order to use NetworkVariables inside it.

            Actually, you don't need to use NetworkVariable to spawn and destroy objects across the network.

            When you want to spawn a prefab, you can use a server RPC to spawn it on the server side

            Source https://stackoverflow.com/questions/69680229

            QUESTION

            Unity Multiplayer MLAPI Could not get NetworkObject for the NetworkBehaviour
            Asked 2021-Aug-15 at 05:58

            For my PlayerController script, I changed inheriting from MonoBehaviour to NetworkBehaviour

            ...

            ANSWER

            Answered 2021-Aug-15 at 05:58

            For some reason. There was a race condition that made GetComponentInParent return null. So I edited NetworkBehaviour.cs to use GetComponent instead.

            Source https://stackoverflow.com/questions/68788772

            QUESTION

            Mlapi RPC Attributes
            Asked 2021-Jul-18 at 04:33

            I was following the tutorial about 'Mlapi' in Unity. In the tutorial, I have a question when I studying about RPCs.

            So the question I have is

            1. When I make a method with the ServerRpc attribute how does the 'Mlapi' handle that method? According to 'Mlapi' documentation, All I have to do to call the ServerRpc function is just making a direct function call with parameters. But what happens when I call the method marked by ServerRpc? What I did was just calling the method marked by the ServerRpc attribute. But how the 'Mlapi' get method marked by the ServerRpc attribute or other Rpc attribute I wrote? And how does the 'Mlapi' call the method from the client and execute it on another machine?
            ...

            ANSWER

            Answered 2021-Jul-18 at 04:33

            RPC is a well-documented concept. You should look up some references. The RPC client "marshals" your parameters into a format that can be transmitted via network, and sends them with information that tells the other side which function you are calling. The RPC server on the other end "unmarshals" those parameters back into binary structures and calls the function. It then "marshals" the return value and ships it back to the client, where it gets "unmarshalled" back to you.

            The RPC server knows which services it is offering, so it's not just calling random functions.

            Source https://stackoverflow.com/questions/68426000

            QUESTION

            Failing to replace a url with sed in shell
            Asked 2021-Jun-17 at 14:08

            I'm having a bit of an issue with a shell script, replacing url in a json file with sed, with an url stored on a variable. The code is this:

            ...

            ANSWER

            Answered 2021-Jun-17 at 14:08

            As noted in the comments, using jq docs would be a much better solution to alter JSON

            An example using JQ where the temp.json looks like this

            Source https://stackoverflow.com/questions/68020192

            QUESTION

            How to avoid input detection when the game window isn't focused with Unity Input System?
            Asked 2021-Jun-02 at 15:13

            I'm using Unity 2020.1.3f and Input System 1.0.2 to create a simple racing multiplayer game with MLAPI 0.1.0 but whenever i start an instance of the game after building it and unfocus the window it still detecting my gamepad input (with keyboard does not happen), but when I play the game in Unity's game view and unfocus the editor it does not detect the input anymore. What can i do to only detect my gamepad input when the window is focused?

            ...

            ANSWER

            Answered 2021-Jun-02 at 15:13

            You could either detect loss of focus using the Unity Event function OnApplicationFocus(bool) (Docs) or by checking the current focus state with Application.isFocused (Docs). Then in your input logic ignore gamepad input if focus is false

            Source https://stackoverflow.com/questions/67807567

            QUESTION

            How to use Unity MLAPI to do high frequency broadcasting?
            Asked 2021-Mar-16 at 09:58

            My Unity project is using MLAPI framework(UNet Transport). I have a server and 3 clients. Server needs to send RPC message to all clients every frame. The data flow is about 2KB/frame for each client. My project is running at 60FPS. The delivery and sequence of messages are not necessary.

            However, server will pop up some warnings like "no free events for message" when running and then all connected clients disconnect automatically. Maybe the problem is broadcast frequency is too high and the message is too big. But I really need these.

            Is there any suggestion about NetworkConfig settings? Any suggestion is appreciated.

            Thanks a lot!

            update: My project is working with a motion capture system and only the server can receive the motion data. So Server needs to broadcast it to other clients.That's why I need to do it every frame.

            ...

            ANSWER

            Answered 2021-Mar-16 at 09:58

            I tried different settings of NetworkConfig, especially the MaxReceiveEventsPerTickRate and it just works fine now.

            Source https://stackoverflow.com/questions/66636432

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install MLAPI

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

            Support

            For bug reports or feature requests you want to propose, please use the Issue Tracker on GitHub. For general questions, networking advice or to discuss changes before proposing them, please use the Discord server.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/MidLevel/MLAPI.git

          • CLI

            gh repo clone MidLevel/MLAPI

          • sshUrl

            git@github.com:MidLevel/MLAPI.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Networking Libraries

            Moya

            by Moya

            diaspora

            by diaspora

            kcptun

            by xtaci

            cilium

            by cilium

            kcp

            by skywind3000

            Try Top Libraries by MidLevel

            Ruffles

            by MidLevelC#

            MLAPI.Puncher

            by MidLevelC#

            MLAPI.Relay

            by MidLevelC#

            MLAPI.ServerList

            by MidLevelC#

            MLAPI.Transports

            by MidLevelC#