Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Third Party Mirror - Open Source Networking for Unity

Discussion in 'Multiplayer' started by mischa2k, Aug 11, 2016.

  1. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,329
  2. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,329
    ThreadedTransport early version is ready for testing! :eek::eek::eek:
    https://github.com/MirrorNetworking/Mirror/pull/3582

    ThreadedTransport can be used to elevate any of our Transports out of main thread into a worker thread.
    Starting with Threaded Kcp!

    This frees the main update loop from any transport overhead!
    Also prepares for Encryption Transport, which would be too heavy for main thread.

    2023-08-09 - Threaded Transport V1.png
     
    akuno likes this.
  3. akuno

    akuno

    Joined:
    Dec 14, 2015
    Posts:
    73
  4. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,329
    Coming up soon, before we merge.
     
    akuno likes this.
  5. tuzun

    tuzun

    Joined:
    Apr 19, 2023
    Posts:
    3
    Hello everyone,

    I try to run dedicated server with Simple Network Transport script in Mirror, in these script I enable wss and ssl, however, the server is not starting and only I disable them server starts. I also use cert.pfx and cert.json files which are included ssl certification key files. Do you have any suggestions about this issue?
     
  6. delzhand

    delzhand

    Joined:
    Jul 20, 2012
    Posts:
    26
    I have two commands on my player object:

    Code (CSharp):
    1.     [Command]
    2.     public void CmdTest(string json) {
    3.         Debug.Log("no texture2d");
    4.     }
    5.  
    6.     [Command]
    7.     public void CmdTest2(string json, Texture2D image) {
    8.         Debug.Log("yes texture2d");
    9.     }
    When the commands are invoked from a client back to back, only the version without the texture2d actually generates a log message.

    Code (CSharp):
    1.         Texture2D image = Resources.Load<Texture2D>("Textures/test");
    2.         string tokenJson = GameSystem.Current().GetTokenParams();
    3.         Debug.Log("start tests");
    4.         // Pass along to server
    5.         Player.Self().CmdTest(tokenJson);
    6.         Player.Self().CmdTest2(tokenJson, image);
    7.         Debug.Log("end tests");
    8.  
    According to https://mirror-networking.gitbook.io/docs/manual/guides/data-types, "Mirror supports a number of data types you can use with these, including... Built-in Unity types that are structs under the hood (Color, Sprite, Texture2D, Ray, etc.)"

    So how come the command with a texture2d parameter doesn't work? The test image in only 21.4kb, would that matter?
     
  7. dannypb

    dannypb

    Joined:
    May 8, 2014
    Posts:
    11
    I've been working on a space game for.... years. I am retooling using Mirror. As I set up the game, I want to have one space scene where I load objects as directed from a database on the server side and build the scene. I only want objects from that loaded scene to be visible for the current scene. Other players will be in other versions of the same Unity scene, but I want each player to only see and interact with other players and items in their version of the scene.

    I thought there was an scene or instance ID in the Network Manager, but I see now there is not. Is there a way to manage scenes like this, or do I need to use additive scenes? I would really prefer to just take the scene data from a database and load in the objects for that scene as a player jumps to another system (scene). It is how I've done it in the past.

    thanks for your help.
     
  8. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,329
    Hey everyone, for questions it's best to use #help in our Discord:
    https://discord.gg/xVW4nU4C34
    That's where the team is checking every day. The thread here is mostly just myself.
     
  9. dutarus

    dutarus

    Joined:
    Nov 23, 2013
    Posts:
    4
    I've looked everywhere on this forum and could not find any solution on this particular issue. These errors appeared after I imported 3rd party software called Hathora so I could deploy my multiplayer demo. Would anyone be to help me find a solution? I would be most grateful!:)

    I am using Unity 2022.1.7f1.

    Error code CS0103
     

    Attached Files:

  10. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,329
    Threaded Transport & Threaded KCP are live! :eek::)
    https://github.com/MirrorNetworking/Mirror/pull/3582

    Performance critical games can use this to free KCP overhead from main thread!
    The ThreadedTransport abstraction allows us to do this for any other transport too.

    This also prepares for EncryptedTransport in the future, which would otherwise slow down the main thread!

    As usual, all free & open source!
    2023-08-29 - Threaded Transport, Threaded KCP.png
     
    Last edited: Aug 29, 2023
    akuno, hopeful and mgear like this.
  11. dfaeojl

    dfaeojl

    Joined:
    Sep 5, 2023
    Posts:
    4
    love this package
     
    mischa2k likes this.
  12. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,329
    Quick progress video on Prediction for Mirror.
    - Red lines are the history
    - Green lines are the corrections

    Videos hows stepping through a recorded session for debugging.
    Not release ready yet, just showing our progress.
     
    akuno likes this.
  13. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,329
    Hey everyone, we've received a lot of questions about Godot support in the last 24 hours.
    Mirror will stay on Unity for at least another 5 years due to some larger projects coming out.
    However, we are going to take a look at Godot this week just to see how it would fit.
    You can track updates here: https://discord.gg/uQH5qG4CAZ
    2023-09-13 - Godot.png
     
    no00ob, Quast, akuno and 1 other person like this.
  14. MihkelT

    MihkelT

    Joined:
    Sep 18, 2014
    Posts:
    21
    Player prefab does not spawn after "Recompile and Continue playing" in Unity

    Unity is set to "Recompile and continue playing". After a recompile I host a session in Mirror using KCP transport. The player prefab is not spawned. This only happens when recompiling. If I stop the player and start it, the player prefab spawns correctly. I'm calling OnApplicationQuit and Awake of both NetworkManager and KCPTransport after recompiling so they should be in their initialized state. But when hosting a game from HUD, it says:

    StartHost: Kcp: RecvBuf = 65536=>7361536 (112x) SendBuf = 65536=>7361536 (112x)

    And then just doesn't spawn the player prefab. Normally player prefab spawns right after that log message. If I exit play mode and start play mode, it spawns correctly. This only fails with "recompile and continue playing" after code changes.
     
  15. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,329
    Recompiling at runtime was never reliable, I wouldn't use it - especially for multiplayer games.
     
  16. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,329
    Made with Mirror: UNLEASHED

    2023-10-18 - 15-00-06@2x_compressed.jpg

    From original devs of World of Warcraft, Kingdoms of Amalur, and EverQuest comes a new family friendly fantasy adventure. Fight against the forces of darkness, explore a world consumed by wild magic, and build a stronghold with your friends to increase your power in a new world.

    Lead by the legendary Brian Birmingham & Irena Pereira, Unleashed is developing their next gen adventure game with Mirror!

    X
    : https://twitter.com/UnleashingGames/
    Web: https://www.unleashedgames.io/

    Super excited to have them on board!
     
    jesusluvsyooh, Quast, hopeful and 2 others like this.
  17. akuno

    akuno

    Joined:
    Dec 14, 2015
    Posts:
    73
    That is amazing!
     
    mischa2k likes this.
  18. PixCave

    PixCave

    Joined:
    Oct 4, 2018
    Posts:
    28
    Hello, I'm making a 2D fighting game. I will publish only for WebGL. Does Mirror have WebGL support? If it runs on WebGL, how is its performance? I used Photon PUN2 and Fusion, but their WebGL performance was extremely bad.
     
  19. jesusluvsyooh

    jesusluvsyooh

    Joined:
    Jan 10, 2012
    Posts:
    377
    Yes Mirror works on webgl, many do webgl games, heres one picture of 500 separate connections, all moving around in browser.
     

    Attached Files:

    PixCave likes this.
  20. PixCave

    PixCave

    Joined:
    Oct 4, 2018
    Posts:
    28
    How much latency would there be in a 2D fighting game in WebGL? Photon Fusion had incredible lag. The characters were moving forward by teleporting.
     
  21. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,329
    There is not going to be lag unless your network has lag, or your server is under too high load.
     
  22. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,329
    Great news: thanks to our friends at Edgegap, Mirror now ships with a built in cloud hosting plugin!
    https://mirror-networking.gitbook.io/docs/hosting/edgegap-hosting-plugin-guide

    Edgegap provides Mirror users with free 0.5 vCPU hosting, so you can launch your game into the cloud with just a few clicks.

    You don't need to deal with dedicated servers, Hetzner, Google Cloud, AWS, Virtual Machines anymore.

    Launch servers directly from Unity!



    Please beware, this is an early preview with lots of rough edges.
    If you encounter issues, please post in our Discord's #edgegap channel.
     
    hopeful likes this.