Search Unity

[RELEASED] MultiOnline : multiplayer online kit - V3 now available

Discussion in 'Assets and Asset Store' started by VirtuElle, Aug 16, 2013.

  1. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    MultiOnline : multiplayer online kit - Version 3 is now available
    Add easily an online multiplayer mode to your games.

    Main features :
    - Works with a simple web hosting
    - Lobby with the list of the open games : players can join it without enter the host's IP
    - Game list with filters, sorting and search
    - Blacklist
    - Players online account
    - Waiting room with players list, map preview and chat
    - Host migration management
    - Two hosting mode available: player host and dedicated server (you can use the both, or one of your choice) [new in V3]
    - Friend list [new in V3]
    - Dedicated server option [new in V3]
    - Players name display [new in V3]
    - In-game menus with player list and chat [new in V3]
    - Many parameters configurable from the inspector [new in V3]

    Easy to install:

    Automated Installation for the MySQL tables [new in V3]

    Adapt MultiOnline to your needs:

    These modules may be enabled / disabled:
    - Blacklist
    - Friend list
    - Game list filters
    - In-game chat
    - In-game players list
    - In-game exit button
    - Create game menu
    - Dedicated server

    Compatibility :
    - Unity free and Unity pro
    - Fully compatible with MultiLan Asset
    - Compatible with build for "PC,Mac,Linux Standalone"
    - Compatible with Webplayer

    Requirement :
    - Web hosting with PHP 5 and MySQL.

    Some goods web hosting:
    - AlwaysData [free plan]: the one I use in the installation tutorial
    - PlanetHoster: allow you to host your website on canadian servers or french servers
    - Infomaniak: Swiss made ;)

    How does it work ?
    MultiOnline works with Unity's Network class and C# scripting.
    The web hosting is used to register the players and centralize the open games. In this way players can see the list of all the open games around the world and join it directly without enter the host's IP address.

    Pack includes :
    - 5 scenes : the menu, the waiting room and two examples game maps
    - All C# source code (commented)
    - Edition scripts : to manage the settings directly from the Unity inspector
    - The prefabs you need to create easily your own multiplayer maps
    - All you need for install MultiOnline on your web hosting (MySQL build and PHP scritps)
    - Full documentation

    MultiOnline V3 is available on Unity Asset Store

    Webplayer demo:
    Demo
    Dedicated server scene demo

    Video tutorials :
    Installation tutorial
    Change player tutorial


    Screenshots:

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




    Main menu:



    Lobby with filters, sorting and search:



    Waitroom [host view] with chat and buttons to add player in friend list
    The host can exclude the others players, choose the map and start the game:




    Friend list with sorting, search and button to directly join the game where your friend plays:



    Blacklist with sorting and search:



    Dedicated server, allow to host a game without be a player:
     
    Last edited: Jul 22, 2014
  2. Master_Chief

    Master_Chief

    Joined:
    Feb 11, 2013
    Posts:
    22
    Hi, i just bought this kit, would it be possible for you to put out a tutorial on how to set this up? (The SQL side)
     
    RealSoftGames likes this.
  3. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hello,
    There is already a full installation tutorial on documentation (part 2.3, page 5 for MySQL database install), each step is explained and shown with screenshot.
    The tutorial was made so that everyone be able to install the script without needing to know PHP or MySQL.
    But if there is anything your don't understand or if you need more help, feel free to ask it here, I'll answer you.
     
  4. Master_Chief

    Master_Chief

    Joined:
    Feb 11, 2013
    Posts:
    22
    Ah thankyou, quite handy! Im stuck at a point though, im setting up the SQL side, and when i press execute i get this error:

     
  5. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    So is this the only thing I have to buy. I don't have to go to photon or somewhere else to pay for servers.
     
  6. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    The problem is that there is no database selected. I'm sorry it's my fault : I have forgotten this step on the documentation, I will re-upload this evening.

    The missing step is : just before click on "SQL" (in PhpMyAdmin top menu) and past your code, you have to select your database from PhpMyAdmin's left sidebar.
     
    Last edited: Aug 19, 2013
  7. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    You just need a standard web hosting with PHP5 and MySQL (it can be a shared hosting).
    With MultiOnline the players host themselves the games. The web hosting centralizes all the open games around the world so that each player can join it easily.
     
  8. Master_Chief

    Master_Chief

    Joined:
    Feb 11, 2013
    Posts:
    22
    Ah yes thankyou, i followed the rest of the documentation and i seem to think i have it all in the right place, but when i run, i try to register, and it just says error, i dont get an error in the console, just ingame. By changing in MOserver my website url i got console errors such as 404 not found etc, but i believe this is the right one, any ideas?
     
  9. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Are you sure that all the PHP files are on your web hosting ?
    Did you put these PHP files on a folder on your web hosting ?
    If yes, you must enter the url of this folder in the "url" variable in MOServer with a slash on the end, like that "http://www.yourdomain.com/folder/".
    Else, if you put the PHP files in the root, you must enter the url with a slash on the end, like that : "http://www.yourdomain.com/"

    You can try to go on the php files from your web browser to be sure that the pages are on the good place (it will write some messages like "|emptyName|emptyMail|emptyPass", that's normal, but if you have a 404 error or something like that is that your php files are not online)
     
  10. Master_Chief

    Master_Chief

    Joined:
    Feb 11, 2013
    Posts:
    22
    Thankyou for the replys you have been extremly helpful, ive got the registration working now, after i complete it says i can log in now, but then when i go to log in, i get the error Login Failed: Any ideas?

    Edit: Also no errors in the console.
     
    Last edited: Aug 20, 2013
  11. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    First, we will check that your player have been correctly registered.

    For that go on PhpMyAdmin, select your database from the left sidebar, and select the table "users" from this same sidebar.
    You must have a menu "Browse" on top menu, click on it :
    $support_en.jpg
    Do you have the list of your users ? And can you see your new user on this list ?

    If yes, you will try to connect your user manually, for this go on the page logUser.php from your web browser with the three URL login parameters.
    The URL with login parameters is this one : logUser.php?userName=yourUsername&pass=yourPassword&privateIP=123456 you just have to fill the URL fields with your user's username and password.
    And tell me what is written on your screen.
     
    Last edited: Aug 20, 2013
  12. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    Could you make a video with shared hosting, to show the steps to get it going. I will buy if you show how easy it is to setup.
     
  13. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Thank you for your suggestion, the video installation tutorial is now available :


    For this tutorial I used the free shared hosting of AlwaysData.
     
  14. Shigidy

    Shigidy

    Joined:
    Dec 14, 2011
    Posts:
    441
    This is awesome!!!!! Will be buying soon. Thanks for a great plugin.
     
  15. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    Looks great!

    The answer to my main question lied in the install video :)
    Sadly it requires a lot of work to set it up; I was hoping that it would work like a P2P network, so there is no need to have a central host.

    It would be awesome if all that you need to do is to put up a server like you would do for a torrent protocol; then all the clients talk to each other at their convenience, re-broadcasting the clients list.

    Thanks!
     
    Last edited: Aug 21, 2013
  16. Master_Chief

    Master_Chief

    Joined:
    Feb 11, 2013
    Posts:
    22
    Alright so the players didn't register properly, but it says they have on my client..
     
  17. Master_Chief

    Master_Chief

    Joined:
    Feb 11, 2013
    Posts:
    22
    Alright so the players didn't register properly, but it says they have on my client..
     
  18. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Ok, so your problem comes from the database.
    Are you sure that you put correctly your database's login informations on the PHP script MODb.class.php ?
    Did you change anything on your database (colonnes or indexes) ?

    Try to register a user manually : go on the page saveUser.php from your web browser with these URL parameters : "saveUser.php?userName=test&mail=test@test.com&pass=1234&privateIP=1234&sendMail=0 "
    and tell me what is written on your screen.

    You could maybe try to reinstall by following the video tutorial
     
    Last edited: Aug 21, 2013
  19. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    I foresee thereafter to orient MultiOnline on a community aspect and the centralization will facilitate the management of that, that's why I have choosen this method.

    About the web installation, if you watch the video you will see that it takes only 5 minutes.
     
    Last edited: Aug 22, 2013
  20. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    MultiOnline is fully compatible with MultiLan Asset.
    Here is the interface you get when you install the two Assets together :
     
    Last edited: Aug 22, 2013
  21. Ali-Nagori

    Ali-Nagori

    Joined:
    Apr 9, 2010
    Posts:
    151
    first of all this plugins surely are time saver +amazing.

    but for the time being ,can you make a simple overview how to communicate with other players in the map ,
    i just gave it a quick look around your code at RefreshGameStatus from MOSerever.cs there is a string parameter gameStatus which is passed to the server , but for the sake of argument lets say if the other attacks and shoots a projectile how that can be achieved for the other players in the map to interact with it.
     
  22. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    In fact, you normally don't have to work with MOServer functions since MultiOnline works in this way :
    - The web hosting is only used to register all the open games so that players can join it directly without enter the host's IP.
    - The MOServer class manages all the communcations between the game and the web hosting, but you don't need to worry about it.
    - The RefreshGameStatus() function (in MOServer) is just used for change the game status from "waiting" to "in game", this function is call only once : when the host starts the game to update the game status on the web server (the string parameter gameStatus can have the value "0" for "waiting" or "1" for "in game").

    - The communications between players work with Unity's Network class and NetworkView, nothing else.
    So to communicate with the other players you just have to use RPC functions.

    I hope that it's answered to your questions, if you have any other question about MultiOnline working, feel free to ask it.
     
  23. YuriHeupa

    YuriHeupa

    Joined:
    Aug 30, 2013
    Posts:
    1
    Can i work with this in a RTS game with many units, moved by the AI based on prior user input, with exact synchronisation across systems, sending time stamped user input over TCP and resimulate locally to have the game algorithms keep state synchronised? I don't know how to make the multiplayer part and that's the reason why i am interested in your product, i hope it's my solution to work with it, what i have to do to adapt my single player project to run in network? my greatest doubt is whether i need to change your code, because my idea is to make one of the players be the server and all the others just send updates of inputs to the server where the logic is all processed and returned to the clients for rendering updates, and also i want to let the players can join the game even with it running, it's all possible?

    Thanks
     
  24. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    MultiOnline is a base for develop a network game, it is done to be able to be adapted at any game type.
    So it may be e adapted for a RTS game quite easily.

    That's exactly the way how MultiOnline works, so you'll have nothing to change in the network's scripts.

    You'll just need to change some things to adapt the current player's script for a RTS game because the sample script is done to manage only one player.
    So you'll have to attach a NetworkView and the players' script on each of your units, and create somewhere an array where you will register all the active units' positions (in order to reload them correctly after an host migration).
    And when you create a new unit in game, you must instantiate it across network with Network.Instantiate function.
    You'll want also maybe adapt the current spawn for your RTS game (because it currently work as in a FPS).

    For the interactions between units, you'll just have to use RPC functions, as I explain in my previous reply.

    I think that if you program in C #, you should succeed to adapt MultiOnline to your game quite easily.

    There is a parameter directly on inspector where you can choose if you allow players to join a started game or not, so you can define it easily.
     
  25. JohnRock

    JohnRock

    Joined:
    Jun 15, 2013
    Posts:
    3
    Hi,

    I am interesting this package. Do you have any trial version ? Do you have Javascript demo ? Thanks !
     
  26. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    I currently don't offer trial version or demo.
    But you can watch the video demonstration which show well how does MultiOnline work.


    And for more precision about how install it, you can watch the installation tutorial which shows the complete installation process.
     
  27. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    When I try to run my Project with MultiOnline in Unity, it Fails to Login because of the following Error:
    "SecurityException: No valid crossdomain policy available to allow access"

    How can I Test in Unity? It seems to work just fine when I upload the WebPlayer Build to my WebHost, see here: http://kuroato.com/mogame/

    Also, another issue I have is the Games in Lobby DO NOT END when there is NO HOST or if HOST ENDS THE GAME,or If I CLOSE THE BROWSER.

    If you try to Login Now, you will see 3 Games Running, but I can't re-connect to them because obviously there is NO HOST, so if there is NO HOST why is it still showing up in the Lobby?
     
    Last edited: Sep 13, 2013
  28. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    That's normal : when you build for webplayer, you cannot use the WWW class, except if the web pages you load are in the same domain as your webplayer (WWW class is used on MOServer, in each function).
    But you must can build for "PC, MAC Linux Standalone" and run your .exe game without any error, it isn't the case ?

    The webplayer does not seem to support the function OnApplicationQuit() which is used to delete and logout automatically players when they close the game's window (it is call on MPlayerData, line 26). So, if a player just close his web browser without exit game and logout, he will stay registred in game, and his status will stay as "login". (I will try to resolve this problem for the new version).

    BUT, if a player exits a game by click on "Exit", button, he must exits the game correctly, and the game must be deleted from database if the player was the host.
    I tested it on your and I saw that it doesn't work as it should.

    Could you please build your game for "PC, MAC Linux Standalone", (or play it from Unity Editor after have select this option on the build panel), and try to create a new game and exit it, and tell me if your game is well deleted on your database or not ?
    In this way I will know if your problem come especially from the webplayer or not, and I could help you easier.
     
  29. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    OK, I see building for PC works just fine, I am able to Login and also Create Game, upon exit of Game the Game is removed from the Lobby. I guess it's just an issue with the Browser.

    Also note. i just tried the browser version again, and it seems that if I press ESC and exit the game, the Player properly leaves the game and the Game does Close. I think the real issue is if a User Navigates away from the WebPage, or Close the WebBrowser.

    There needs to be some kind of code I guess included that checks for active connection in the Web Browser somehow, so if the Player does Close the Browser Window, the Player will be Logged out Automatically upon Closing the Browser Window. Otherwise the Player will not be able to Log back in, and the Previous Game Session will Remain Open if that player was the Host.
     
    Last edited: Sep 14, 2013
  30. JohnRock

    JohnRock

    Joined:
    Jun 15, 2013
    Posts:
    3
    Thank for your reply ! Do you have any JavaScript examples ? My project is JavaScript.
     
  31. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Yes, the function for that is OnApplicationQuit() , but it doesn't work with the webplayer. When a player close his web browser, the game is finish and no more logout script can be called, that's all the problem.
    I will try find a solution for that for the new version, to make MultiOnline fully compatible with webplayer. Waiting for that, I will send you today some scripts modifications that could make your game work in the webplayer.
     
  32. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    No, I'm sorry to tell you that scripts are all in C# (since I work in C# only)
    But if you usually use JavaScript (unityScript), this website may help you for conversion: http://www.m2h.nl/files/js_to_c.php
     
  33. JohnRock

    JohnRock

    Joined:
    Jun 15, 2013
    Posts:
    3
    Thank for your reply ! It is useful. Is it support IOS / Android on Unity Free ? Because our existing project is base on this version.

     
    Last edited: Sep 19, 2013
  34. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    MultiOnline currently doesn't support Android / IOS builds.
    I'll maybe try to add it for a new version, or develop a multiplayer Asset especially for mobiles.
     
  35. localhost

    localhost

    Joined:
    Dec 9, 2012
    Posts:
    43
    VirtuElle, i purchased it this morning.
    Set it all up, used the same host you did (alwaysdata)

    Its a good kit but i'm having a problem:

    It loads so slow, when logging in/registering/joining a game, it takes one minute to two minutes.

    Is their anyway to make it faster like it was for you in the video?

    Because it's making it hard to work with through the slow speed..

    Thanks
     
  36. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    The speed will first depend of your web connection. Do you have a broadband connection?

    Further AlwaysData hosts the websites in France, so if you are not in Europa, it can maybe be quite slow (I'm in Switzerland, and connections/registrement/joining game take never more 2 or 3 seconds for me).
    You can find a free hosting which hosts websites from your continent, it must be faster. For example, you can maybe find something better for you from this list.

    Note that free web hosting are always slower than paying web hosting, it's very useful for testing, but depending your needs, you could maybe choose a paying shared web hosting (there are very cheap offers).
     
  37. localhost

    localhost

    Joined:
    Dec 9, 2012
    Posts:
    43
    I have broadband,

    I tried some other hosts, in Australia generally with 1gbps etc.

    Still the same issue, i'll try paid hosting next

    Thanks
     
  38. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Ok,
    If you have the same problem with australian hostings I'm not sure that a paid hosting could change anything.
    Rather it looks like a problem of internet access, or maybe a problem with your firewall or antivirus which could maybe slow shipments of data. Or even a spyware problem.
    I have never encountered this problem and I do not really see from where it could come.

    The best thing to do first would be to test the script from an other computer which as not the same ISP as you, to see if it's as slow as on your own computer.
     
  39. localhost

    localhost

    Joined:
    Dec 9, 2012
    Posts:
    43
    Thanks i will try that, thanks for the kit, its so easy to work with and my game is going well with it.

    I tried creating a local host with mysql etc. worked perfectly but its still slow, it freezes for a few seconds when playing thefn says wait for half a minute, (faster then connecting to another host),lm going to try on another computer and ISP, its a very good kit to work with, highly easy to work with :)

    Also the variables are quite convient, it saved the name to PlayerPrefs, so that was quite easy to modify and make a chat.

    Thank you for the kit :)

    Also, how could i make it that it logs out automatically or something, because i never click exit game > logout, so i get the error when trying to login saying im already logged in, then i have to go set the value to 0 in the SQL database, which is quite annoying :p, Any tips?
     
  40. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    How did you build your game ?
    Did you built it for desktop computer or for webplayer ?
    The script have an automatic logout system with Unity function OnApplicationQuit, normally, it logout your player automatically when he closes the game's window. But it is currently not compatible with the webplayer (thats why MultiOnline is sold as not compatible with webplayer).
    I am currently working on a new version which must resolved that, but it is not yet ready.

    But for this time, you can work around the problem by replacing a line in the PHP script MOUser.class.php (on functions folder) :
    Line 136 (on logUser() function), replace this :

    PHP:
    if($pass == $check->pass  (!$check->login ||
        
    mktime($check->hour$check->minute$check->second$check->month$check->day$check->year) < time()-(3600*12))) {
    By that :

    PHP:
    if($pass == $check->pass){
    It will no more check if the player which try to login is already logged or not, instead it will "crush" the previous (or current) session of the player.
     
  41. localhost

    localhost

    Joined:
    Dec 9, 2012
    Posts:
    43
    Thanks works good! :)
     
  42. ZeoWorks

    ZeoWorks

    Joined:
    Dec 13, 2012
    Posts:
    76
    This is looking very nice! So do player servers not show if they have not port-forward? :)
     
  43. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    I'm not sure that I understand your question, but the game's host have to open the game's port on his router.
    But the other players needn't to know his IP or the port which he uses to join his game.
     
  44. Enuniq

    Enuniq

    Joined:
    Oct 17, 2013
    Posts:
    10
    Hey guys!

    So, I am thinking of buying this asset. But, I have a few questions:
    Btw, I am quite new to multiplayer with unity.

    1. Can this be used instead of Photon Cloud/SFS/ElectroServers/etc?
    2. Where does the bandwidth/hosting come from? My own hosting? (Similar to Photon Cloud, they host it)
    3. (Similar to 2.) Is there a CCU limit, or is my own server the limit?

    I love that it you can have sign up/ sign in with this!

    Thanks,
    E
     
  45. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    Yes, MultiOnline is designed to replace this type of games servers
    The hosting come from the players : they host directly themselves the games. In this way you needn't a game server
    You just need a webhosting which register all the active games, so that players can join it directly, without have to know the host's IP or the used port.
    This web hosting can be a free hosting, as AlwaysData which I use in the video installation tutorial
    There is no CCU limit, the only one limit is bandwidth of players which hosting games
     
  46. TakMarche

    TakMarche

    Joined:
    Jul 21, 2012
    Posts:
    36
    I followed all the step in the documentations and the video as well and gotten to the point where it would tell me:
    "Registration completed successfully. You can login now"
    But when I try to login I get an error. Checked the database and it didn't save / register you information either. Check my database settings and it's all correct. I don't know what to do now?
     
  47. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    Your problem comes probably from the URL of your PHP pages.

    First, check that your PHP pages are well on your web hosting.
    For that, enter the link of your page on your web browser (for the page saveUser.php, it's something as : www.yourwebsite.com/folder/saveUser.php or www.yourwebsite.com/saveUser.php if you have put the PHP script directly at the root of your website).
    You must see a text like this one "|emptyName|emptyMail|emptyPass".
    If your have a 404 error, or a server error, it's that your web pages are not correctly placed on your web hosting, so try to place it correctly.

    If you have no error, the problem comes probably from the URL that you have put on "MOServer".
    Check your variable "url" line 13 : it must contain the URL of the folder where you have put the PHP scripts, and end by a slash (example : http://www.domain.com/MultiOnline/"). If you have put your PHP files at the root, the URL must also end by a slash (example : http://www.domain.com[B]/[/B]).
     
  48. Djspun

    Djspun

    Joined:
    Aug 13, 2013
    Posts:
    3
    what are you using to web host with dreamweaver thats the only thing that is not explained in your tutorial
     
  49. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    Dreamweaver is just a FTP software, used to upload the files on the website (hosted at alwaysData). I don't explain how use it since there is a lot of FTP softwre and you can use the one of your choice.
    You can use a free FTP software, as FileZilla for example,(downloadable here), that's a nice FTP software easy to use (you have a little tutorial here if you need it)

    Edit
    I found back a step by step tutorial that I had done for someone else which wanted use FileZilla, you can find it useful.
    You can download it directly here: View attachment $FileZilla tutorial2.zip
    It contains 13 printscreen which show how set and use FileZilla.
     
    Last edited: Oct 24, 2013
  50. Djspun

    Djspun

    Joined:
    Aug 13, 2013
    Posts:
    3
    thanks alot i cant wait to use this i was also wondering if you no if this is useable with unirpg im just gonna wing it and try to get it working some how :p prob just gonna add it to the game i have via tele that load up the online and re upload the map and one character every one can use one style character idm :p