Search Unity

[RELEASED] MultiLan : multiplayer network kit - V3 now available

Discussion in 'Assets and Asset Store' started by VirtuElle, Jul 13, 2013.

  1. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    MultiLan : multiplayer network kit - Version 3 is now available
    Add quickly and easily network multiplayer mode on your games

    Features :
    - Players host themselves the game : no server to manage
    - Lobby with the list of current games on the network (Windows computers only)
    - Game list with filters, sorting and search [new in V3]
    - Join a game by entering the host's IP address : for games internal or external of the network
    - Host can exculde players from his game
    - Players name display
    - Waiting room with players list, map preview and chat
    - In-game menus with player list and chat [new in V3]
    - Host migration management
    - Many parameters configurable from the inspector [new in V3]
    - Very easy to install
    - Works with Unity's Network class and C# scripting : doesn't require any other installation

    Adapt MultiLan to your needs:
    These modules may be enabled / disabled:
    - Game list filters
    - In-game chat
    - In-game players list
    - In-game exit button
    - View games menu
    - Join game from IP menu

    Compatibility :
    - Unity free and Unity pro
    - Fully compatible with MultiOnline Asset
    - Compatible with build for "PC,Mac,Linux Standalone"
    - Compatible with WebPlayer (except the list of current games)

    Pack includes :
    - 4 scenes : the menu, the waiting room and two examples game maps
    - All C# source code (commented)
    - Edition scripts : to manage the settings directly from Unity inspector
    - The prefabs you need to create easily your own multiplayer maps
    - Full documentation

    MultiLan is available on Unity Asset Store

    Screenshots:

    Multiplayer game, with player name display, player list and in-game chat


    Main menu:


    Lobby: list of the open games across your network. With filters, sorting and search:


    Join game from IP: allow to join a game external of your network, directly from the host's IP.


    Create a game: you can choose if your game is private or public


    Waitroom [host view] with chat.
    The host can exclude the others players, choose the map and start the game:
     
    Last edited: Jul 22, 2014
  2. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    The video demonstration is now available :

     
    Last edited: Jul 17, 2013
    Vaughnderrick likes this.
  3. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Last edited: Jul 17, 2013
  4. Yokil

    Yokil

    Joined:
    Sep 9, 2012
    Posts:
    26
    There is an error in the console at 2:00, it was resolved?
     
  5. Rabbit

    Rabbit

    Joined:
    Dec 30, 2012
    Posts:
    8
    This is a really great asset, and very well priced (I wish I found it before buying other networking assets). The code is very well written and it was VERY easy to add into my game, Thanks VirtuElle. I didn't look at this asset earlier because of the name MultiLan, I assumed that it was for LAN only :/
     
  6. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Thank you very much for observing. It was not an error which impede the good functioning of the application, but I have resolved this one, I'll upload the new version this evening.

    I'm really happy that you like it.
    About the name, I called it "MultiLan" because the list of currents games works only for the games of the network. But it's possible to join a game if your IP is external of the network, from the host's public IP.
     
  7. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    The new update is now available

    ChangeLog for v1.1.3 :
    • Fixed NetworkView error message which appears when a player find a game already started during the network game search (the one noticed by Yokil)
    • Fixed NetworkView error message which appears when a player joined a started game
    • Separate the player script on two differents scripts : MLPlayerMove and MLPlayerNetwork. In this way, it will be easier to modify the player's movements and functions
    • Add a parameter for host migration : if the game is already started when a host migration starts, only players in game can become new host (players still in waiting room cannot)
    • Add a message on the menu if a Windows error system prevents the network games search
    • Checks a player hosting capacity only once he have been accepted on a game
     
    Last edited: Aug 2, 2013
  8. AlanPT

    AlanPT

    Joined:
    Jul 31, 2013
    Posts:
    32
    Thank you VirtuElle, this was great. Really helped me out with a job I have with a tight deadline. Clearly written documentation too.

    I have a couple of questions though. For some reason the multiplayers can't see each other, where in the code should I be looking to fix that up?

    And do you (or anyone else reading this) have any experience in hooking it up to Photon Cloud? I want to be able to host it all online and inside a webpage. I have a feeling it should be straight forward.

    Thanks again.
     
  9. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    If your players can't see each other, I guess you use your own prefab player.
    Be sure that your player prefab have a NetworkView component (Add component / Miscellaneous / NetworkView) with the state Synchronisation on "Reliable Delta Compressed".
    And you must attach the script MLPlayerNetwork.cs on your player prefab.

    I am sorry but I cannot help you about it, I have not experience with Photon Cloud.
     
    Last edited: Aug 2, 2013
  10. AlanPT

    AlanPT

    Joined:
    Jul 31, 2013
    Posts:
    32
    Thanks, I rebuilt my player and its working again. My virtual world feels less lonely now.

    Just to be clear, if I wanted to use this over the internet I would just have to open a port on my router and port forward it to a computer on my network that has the unity project running on it?

    Will the following clients need to do the same on their networks?
     
  11. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    I'm not sure that I have good understand your question, but if you want to play with people which are not on your network, you juste have to open a port on your router and give your public IP and the game's port to the others players (so that they can join your game from the menu "Join game from IP").

    The others players needn't to open their port to join your game (if they don't open their ports, they just will not be able to become host in case of host migration, but as long as you are host, they can stay in game).

    But each player (internal or external at your network) must have the game on his computer (the .exe file and the data folder that you obtain when you build your game)
     
  12. rickbill

    rickbill

    Joined:
    Aug 2, 2013
    Posts:
    1
    can uSPEAK be used with multiLAN?
     
  13. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    I have never try uSpeak, but according their presentation on Asset Store, their asset supports all network major platforms :
    MultiLan works with Unity Networking system and C# scripting, so I guess that the two asset are compatible (but I didn't try)
     
  14. davados1

    davados1

    Joined:
    Apr 17, 2013
    Posts:
    4
    Will you be adding Java script versions for your asset package?
     
  15. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
  16. AlanPT

    AlanPT

    Joined:
    Jul 31, 2013
    Posts:
    32
    Hi one last little problem and I'll hassle you no more.

    Am I doing this right? I have attached this to my character, and to the Network View (which is also connected to the character). The animations are labelled correctly. My characters transform correctly, but when I start the walkMan animation it not only happens to my character it effects everyone I see, but from the other player's perspective they don't see me walking.

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class WalkingMove3: MonoBehaviour {
    5.  
    6.     void Start () {
    7.             }
    8.    
    9.  
    10.     void Update () {
    11.         if(Input.GetKey("a") || Input.GetKey("s") || Input.GetKey("d") || Input.GetKey("w"))
    12.     animation.CrossFade("walkMan");
    13.      
    14.         else
    15.     animation.CrossFade("idleMan");
    16.     }
    17.  
    18. void RunAnimation1() {
    19.    
    20.     networkView.RPC("SyncAnimation ", RPCMode.All, 0);
    21.         }
    22.  
    23.  
    24. void RunAnimation2() {
    25.  
    26.     networkView.RPC("SyncAnimation ", RPCMode.All, 1);
    27. }
    28.  
    29. [RPC]
    30. void SyncAnimation(int index) {
    31.     if(index == 0){
    32.         animation.Play("walkMan");
    33.     }
    34.     else if(index == 1){
    35.         animation.Play("idleMan"); }
    36.  
    37.     }
    38. }
    Thanks
     
  17. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    In fact your animation script is not totally right (your functions RunAnimation1 and RunAmination2 are never called), try like that :

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;    
    4.  
    5. public class WalkingMove3: MonoBehaviour {        
    6.  
    7.     void Update () {
    8.         if(Input.GetKey("a") || Input.GetKey("s") || Input.GetKey("d") || Input.GetKey("w")) {
    9.             RunAnimation1();
    10.         } else {
    11.             RunAnimation2();
    12.         }
    13.     }
    14.  
    15.     void RunAnimation1() {      
    16.         networkView.RPC("SyncAnimation", RPCMode.All, 0);
    17.     }
    18.  
    19.     void RunAnimation2() {    
    20.         networkView.RPC("SyncAnimation", RPCMode.All, 1);
    21.     }
    22.  
    23.     [RPC]
    24.     void SyncAnimation(int index) {
    25.         if(index == 0) {
    26.             animation.CrossFade("walkMan");
    27.         } else if(index == 1) {
    28.             animation.CrossFade("idleMan");    
    29.         }
    30.     }
    31. }
    32.  
    And for this :
    I guess you have added your script WalkingMove3 on your player prefab, so you must disabled this script for the others NetworkView, else the animation is played on everybody (as explain on the documention part 5.1, on the bottom of the page 21).
    Open the script MLPlayerNetwork, go on line 18 and add this :
    Code (csharp):
    1. this.GetComponent<WalkingMove3>().enabled = false;
    just after the line :
    Code (csharp):
    1. this.GetComponent<MLPlayerMove>().enabled = false;
     
  18. Stoerkodder

    Stoerkodder

    Joined:
    Apr 7, 2013
    Posts:
    1
    VirtuElle, thanks for the asset, it really pulled me out of a tight spot.
    I'd like to ask, how would you about resetting a scene and reloading all the players?
    And also, how would you automate creating and conecction on a LAN?
     
    Last edited: Aug 9, 2013
  19. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    The scenes are loading with the function Application.LoadLevel() and the players with the function Network.Instantiate().
    The game scene is not reloaded during or after host migration, the players are reloaded with Network.Instantiate() when a new host has been found.
    Look at the function StartGame() line 198 and OnDisconnectedFromServer() line 423 on the script MLNetwork and the script MLSpanw for more details about how does it work).

    The game creation and connexion work with Unity Network class (Untiy Network class documentation).The open network games are searched by scanning the LAN. For know exactly how does it work, look at the MLIpList script and read the document part 6.1 (page 25)
     
  20. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    i'm interested, but i need

    support for unity3d masterserver

    have ability for players to join best game from masterserver list based on user filters (more on filter later)

    and a game browser and that players can use to join a game which does filtering and sorting on categories (more of that with filtering)

    also have support for public games with both password and no password.

    so people who host game can say its public and it would register with masterserver

    regarding filters

    filters should be game name, level name, game more, ranked/not ranked, max ping, min/max players, no empty, no full, no password, etc.

    same for game browser sort columns.

    also needs to have join friend so it needs to have some sort of friends support. like add, remove, find, and join friend

    so it could use the master server to get list of servers and then go to each server and get list of players and then do filtering to join friend

    also have things like kick player, ban/unban and get list of banned players, ban/unban and get list of banned ipaddress. etc and other basic admin stuff like get/set password to join, get/set number of players, restart and shutdown the server, and things like add, remove and get list of levels that can be played, and add, remove and get list of levels being played.


    sort of the stuff u see in any fps out there

    is this something you are doing/going to do?
     
    Last edited: Aug 10, 2013
  21. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Many of these features are planned for the online version of MultiLan which will be available soon. They will be added gradually when the Asset will be available.
    But these features have not much interest for MultiLan since it work without MasterServer : it searches and displays only the games of your network.
     
  22. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    The new update is now available

    ChangeLog for v1.2.1:
    • Added map miniature in the waiting room
    • Overhaul of the scripts to make them more clear, easier to maintain and compatible with MultiOnline Asset
    • Game chat improvement
    • Menu inspector improvement
    The online version of MultiLan is now available here : MultiOnline on Asset Store
    With MultiOnline the players can join external games without enter the host's IP address. It work with a simple web hosting and is fully comptatible with this new version of MultiLan.
     
  23. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    MultiLan is fully compatible with MultiOnline Asset.
    Here is the interface you get when you install the two Assets together :
     
  24. jurangov

    jurangov

    Joined:
    Jul 22, 2012
    Posts:
    4
    Hi, this asset can be adapted to mobile??
     
  25. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hello,
    As written on description, the list currents game on the network work on Windows computers only : so it cannot be adapted to mobile.
     
  26. wmgcata

    wmgcata

    Joined:
    Jul 20, 2012
    Posts:
    169
    Is it possible to set up a dedicated server with this? Instead of players having to run one, could you have like 5 servers running with a maximum amount of players that could join? Basically the same like joining a world or realm like in an MMO. If this is possible, is this shown in the documentation on how to do it?

    Thanks

    Tim
     
  27. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    If you could you should work on another one for mobile. Would definitely buy that one. :)
     
  28. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    MultiLan is not made to operate in dedicated server. It's a light solution designed which operates on the principle that players themselves host the multiplayer games so that you do not have to install or pay for a game server.
    It is perfect for games that works on a principle of parts, but it is not really suitable a MMO game which requires a persistent world.
     
  29. wmgcata

    wmgcata

    Joined:
    Jul 20, 2012
    Posts:
    169
    Okay, thanks for the reply mate.
     
  30. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    CAUTION
    As-is from the Asset store this does not work on a Mac. I realize there's a (1)note about only listing Windows computers but in several places the code is WINDOWS ONLY.

    I was excited to check it out and use it in my project.... but not now :(

    Error is listed here:
     
  31. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    I'm sorry that you saw it only after have bought the Asset (yet it is written in the presentation of the asset on the forum and in the Asset Store).
    The menu "Join game from IP" will work on Mac, but not the list of network games (it need a Windows' DLL, you can read the documentation part 6.1 for more details).

    If you want I can explain you how disabled the menu "View network games" so that it will no more appears on your game and you could so use only the menu "Join game from IP".
    Else, if ultimately you don't want to use MultiLan, you can ask a refund, for that contact directly Unity here : assetstore@unity3d.com (It's Unity which manage refund, not publishers).

    You can also look at my second Asset, the online version of MultiLan called MultiOnline : it require a web hosting to centralize the players' game, and it will work on Mac
     
  32. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    @VirtuElle - thank-you for the reply. I have reached out to Unity.

    Best of luck on the store.
    :)

    Update: This is what I got back from Unity:
    So... looks like I'm stuck with it. Good to know for my future purchases. So please post any and all info so I can run MultiLan on my Mac - Thanks!!

    Update #2: VirtuElle has provided me with EXCELLENT customer support, as such I will be keeping and hopefully learning from the package. Thanks!
     
    Last edited: Sep 3, 2013
  33. colorcraft

    colorcraft

    Joined:
    Jun 16, 2013
    Posts:
    41
    I keep getting and Error saying.
    MLMenu does not contain a definition for ViewMultiInfoMessage

    Wtf I just installed it seriously.
     
  34. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    What is your version of MultiLan ?
    Can you double-click on the error from the console and tell me which script it open, and on which line you have the error please ?
     
  35. colorcraft

    colorcraft

    Joined:
    Jun 16, 2013
    Posts:
    41
    Iv fixed it :) I re-installed it the next day and it worked Thanks for your response though.

    One other question Im pretty new to Unity and I just purchased an Asset called FPS construct would it work with this just wanted to know im very noob Thanks.
     
    Last edited: Oct 11, 2013
  36. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Great, you had scripts of two differents version which was not compatible with each other (ViewMultiInfoMessage doesn't exist in V 1.2)

    I have a lot of question about the compatibility of MultiLan with other assets.
    In fact, MultiLan can be compatible with all other assets, but you will always have to work to make some differents Assets work together, and probably code. (since you will always have compatibility problems to resolve, such as example a same key used by each of the Assets).
    About FPS construct, I know that someone failed to operate the different menus together, so it's probably not the more easy to use with MultiLan.
     
  37. PsychoPsam

    PsychoPsam

    Joined:
    Aug 1, 2012
    Posts:
    34
    How would I detect if a player has hit me? How do I know where other players are? For example if I should a bullet what am I supposed to do network wise? I imagine I would do the following, but I'm just not sure.
    a) Spawn the prefab missle on the client at the players position
    b) Send a message[RPC] to inform everyone playerX spawned a missile.
    c) Somehow track each instance of those missiles regardless of who shot them with some sort of predictive movement code
    d) Wait for OnCollisionEnter for each player and the one who gets hit tells everyone else he got hit.
    e) If that player dies, tell everyone he died.
     
  38. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    In fact, it's easier than this : you juste have tu put a NetworkView on your missile prefab, and spawn it with Network.Instantiate.
    In this way both of the players will automatically see your missile, and they will see it moving automatically too.

    Yes - and maybe destroy your missile gameobject at this time.

    It depends of your game, but if a dead player is move off the game, you can simple disconnect him of the game with these functions :
    (it must be called from MNetwork script)

    Code (csharp):
    1. Network.Disconnect(); // Disconnect of the network
    2. CleanGame(); // Clean the game (remove all players objects)
    3. Destroy(this); // Destoy the NetworkManager
    4. Application.LoadLevel(mainMenuName); // Load the main menu
    5.  
    In this way he will be "properly" disconnect.

    When he well be disconnect with Network.Disconnect() function, the function OnPlayerDisconnected() will be automaticall call to the host. You can look at this function on MNetwork line 490, it's already parameter to tell to the other players that the player is out of the game and refresh the players' list. You can simply add a message to say "PlayerX is dead"
     
  39. PsychoPsam

    PsychoPsam

    Joined:
    Aug 1, 2012
    Posts:
    34
    Wow! What an awesomely quick and helpful response! You rock!.

    For item d) would I call OnCollisionEnter in NetworkView as well??

    Also - to update the player name I'm doing this in Update in MNetwork.cs. Is there a better place?

    Code (csharp):
    1. GUIText name = GameObject.Find ("HUD/PlayerName").GetComponent<GUIText>();;
    2.         name.text = playerDataSrc.nameInGame;
     
    Last edited: Nov 1, 2013
  40. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    I'm sorry but I don't really understand what do you want mean.
    OnCollisionEnter must be called from the player's script, and the player prefab has already his own networkview.

    Does the player's name need to be updated during the game ? If not, I think that you could call it directly on the Start() function.
    If you display it from Update() function, it will be refresh each frame, I'm not sure that it's necessary.
     
  41. flapstik1

    flapstik1

    Joined:
    May 12, 2013
    Posts:
    5
    idk whats happening the the player is moving on opposite clients Can I have help
    in team viewer please
     
    Last edited: Nov 3, 2013
  42. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    I'm sorry but I don't understand your question.
    Are you searching to do a team system ?
     
  43. flapstik1

    flapstik1

    Joined:
    May 12, 2013
    Posts:
    5
    Ok the problem I have is I want to make it so That you use Mouse movement to turn instead of A and D.

    And if I try add mouse movement out side the Player Movement script its all glitchy How would I get Mouse turn
    in the Player movement script??

    My Skype is Flapstik
     
  44. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    The playerMovment script is very basic, this script is given just for the sample.
    If you want a mouselook, you should look at Unity's Character Controller asset (you can import it in Asset/import package/Character controller).
    I think that the MouseLook.cs script does exactly what you want.
     
  45. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi there,

    Version 2 of MultiLan is now available in Unity Asset Store: You can get it here

    ChangeLog for version 2.0:
    • New menu system
    • New design in the game list with sort and search
    • Hosts can exclude players from their games
    • Compatibly with Webplayer (except the list of current games)
    • New host migration system which sorts the next host depending its IP
    Here is what it looks like now:
     
  46. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi there,

    Here some screenshots showing the menus you obtain when you use MultiLan with MultiOnline.
    Once you have installed to two assets, you can directly choose which one you want to use from the inspector, the main menu automatically adapts.

    Here we have chosen MultiLan and MultiOnline: we have the full multiplayer menu:
    $mutlipack2.jpg

    Here only MultiLan:
    $mutlipack3.jpg

    And here only MultiOnline:
    $mutlipack4.jpg
     
  47. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Nice work virtuelle - I was also able to make a simple shooting game with network.instantiate and the demo scenes within minutes :)
    Great asset - I'll definitely save up for the multionline one too!
     
  48. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Thanks, I'm glad that you enjoy it !
     
  49. felipejoys

    felipejoys

    Joined:
    Dec 21, 2013
    Posts:
    1
    Sorry if this is a dumb question, I'm a newcomer. How well does this work under 2D devlopment? Just as good?
     
  50. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458

    Hi, it will work in 2D development exactly in the same way.