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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[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
    About your problem, I thing that the problem is on your spawn.
    If you have well put your new player as "Player" in MSpawn script, there is no reason for it spawns cubes.
    Have you well put your new player in the spawn which are on your maps ? (not only the one which is in Prefab folder).
    And have you well saved the scene and rebuild the game ?
    The way how change the player is explained in documentation, make a video would show exactly the same things, so I'll try to do it when I'll have time, but I don't think that it's very necessary.
     
  2. ks1966

    ks1966

    Joined:
    Feb 5, 2014
    Posts:
    32
    Yeah, actually what im did is that i changed my characters name to player.prefab. somehow one day, i could add a third person into game and at the same time with the cube, i coudl also control the third person. But somehow i could not change the came and replace the character with the new one.

    I did what shows in the pdf but the point is that i can not see what i am doing wriong. therefore it would be nice to see a video. for example this one, can you please simply change this player with the cube and record a video? it should be easy for you. than i can do the same. here this character for example: https://www.assetstore.unity3d.com/#/content/3012

    thanks, waiting for the short video..
     
  3. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Here it is:
     
    Last edited: Mar 7, 2014
  4. ks1966

    ks1966

    Joined:
    Feb 5, 2014
    Posts:
    32
    thank you so much, I really appreciate it :) One of the points that i was missing is the section that you created at the end of the script which you show after 5.15.

    As I build the game it works fine for windows, when I build it as webplayer, I hangs on the login screen after I write the username and the password, it just keeps saying "wait..." ? As i build the game, i also check the box "streamed". I tried once without checking the box, and once with checking the box, but still the same problem.

    Any thing I missed there? thanks.
     
    Last edited: Mar 8, 2014
  5. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Where did you put your builded scene ? It must be in the same web server as your php files, else the connection is blocked for security reasons. That's a blocking make by the WWW class with is used in the asset.
    So, if you build for webplayer and try to play directly in Editor, you'll have an error message.
     
  6. ks1966

    ks1966

    Joined:
    Feb 5, 2014
    Posts:
    32
    aha got it, I tried it locally, did not uploaded to website. I thought it would also work like the exe files, can pull the info from the database. Thank you very much, I really really appreciate your help, thanks! :)
     
  7. colorcraft

    colorcraft

    Joined:
    Jun 16, 2013
    Posts:
    41
    Is there a variable for The Current Player that's logged in the name of them??
     
  8. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Sure, in fact there is a full object.
    Everything you could need about the current player (userName, id, ip, is player login, is player in game...) is in MPlayerData script.
    You can access to this script from anywhere with this code:
    Code (csharp):
    1.  
    2. playerDataObj =  GameObject.Find ("PlayerData(Clone)"); // Get the playerData component
    3. playerDataSrc = playerDataObj.GetComponent<MPlayerData>(); // Get the playerData script
    4.  
    And if you need the userName for example, you can get it in this way:
    Code (csharp):
    1.  
    2. playerDataSrc.nameInGame;
    3.  
     
  9. ks1966

    ks1966

    Joined:
    Feb 5, 2014
    Posts:
    32
    sent you a pm my friend :)
     
  10. colorcraft

    colorcraft

    Joined:
    Jun 16, 2013
    Posts:
    41
    So my Inventory is made up of Variables and I was wondering if this is possible. So when you register a section in the database is created with the username and values for every item which are 0 by default then check if the player is logged in then use playerDataSrc.nameInGame; to fetch variables from the logged in user section of the database and also put in variables if the player finds an item?
     
  11. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Yes, it's totaly possible, but in fact I advice you to use the user's id instead the player's name in your database. In this way you can directly join your inventory table with the users' table using a foreign key. The user's id is in playerDataSrc.id.
     
  12. Spartan_Boy

    Spartan_Boy

    Joined:
    Jul 8, 2012
    Posts:
    38
    Hello there, seems to be a great asset, i haven't seen any example on the net though with mecanim sync working with this, has anyone tried and successfully brought it to life cause there doesn't seem to have a sample package ?
    THX
     
  13. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    That's right that the sample package doesn't contains animated player, but I have now done a full tutorial showing how doing the mecanim sync:


    And you can also watch this demo made by a user with his own animated player and scene (with the old version of the asset):
     
  14. colorcraft

    colorcraft

    Joined:
    Jun 16, 2013
    Posts:
    41
    Hmmm I seem to be getting the same login failed error every time i try login with the new Hosting Vps im using even if I get the password reset.

    Login Failed : Error on your password.
     
  15. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    That's a very behaviour.
    You didn't have this problem when you didn't use the VPS isn't it ?
    Can you check that the password are well saved in your database ?
     
  16. RenOli

    RenOli

    Joined:
    Jan 23, 2013
    Posts:
    102
    Hi,

    I would like to know if it will work on Android, iPhone, iPad and on PlayStation 3 system.

    Thank you very much.
     
  17. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    It has be designed for desktop PC and webplayer.
    It has been tested on Android and there were some bugs, I didn't test it in the other platforms.
    But you have to know that it's a Client-Server system: the host have to open his port on his router to be able to host a game, so I'm not sure that it's currently really adapted for mobile games.
     
  18. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,457
    @VirtuElle

    This makes the package much less attractive if a Fundamental Networking solution is not Mobile friendly. Just imagine yourself as a potential customer/developer who has to implement a stable and reliable networking solution. If you spend all of the time making your project work for this package and then the boss says, Ok, it's working fine on desktop and web, let's get it on Mobile. At this point, you will have to remake your entire project just to support Mobile. Not very nice. Please know that this is a Foundation framework and as such, should work on all Unity Platforms, no one wants to redo the job again and again. Just too painful.
     
  19. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    SOMEONE PLEASE HELP ME!
    I am following the installation video step by step i even used the same web hosting for sql and FTP, But for some reason i keep getting a register failed when i try to create a new account on the built game to test it. Any HELP would be appreciated thank you!
     
  20. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Ok, do you have an error message in console ?
    Have you well put the good url in the variable url in MOServer ?
    If you use alwaysdata, it's something as http://yourUserName.alwaysdata.net/ or http://yourUserName.alwaysdata.net/folder (with a "/" at the end, and without the "www" )

    You can try to register a user manually to know if the problem is on youy php scripts or C# scripts.
    For that, enter the url of your page saveUser.php in your web browser with these parameters:
    saveUser.php?userName=test&mail=test@test.com&pass=1234&privateIP=1234&sendMail=0

    You must have the message "Success" written on your screen, do you have it, or something else ?
     
  21. ReaList

    ReaList

    Joined:
    Mar 27, 2014
    Posts:
    13
    How MySQL will pull data? I could not find: S
     
  22. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi, I'm not sure that I understand your question.
    The that's the php pages which access to the database, and the game connects to these pages to pull the data. (the php files and database must be on a web hosting)
     
  23. fredr92

    fredr92

    Joined:
    Jul 8, 2013
    Posts:
    292
    Hi im looking for a multiplayer solution for my fps game. And your Asset Looks like a good choice. I have used the fps constructor , its the free one at the Asset store, are your Asset working with it ? And does anything Else need to be done too make it work? Thanks hope too hear back from you
     
  24. ReaList

    ReaList

    Joined:
    Mar 27, 2014
    Posts:
    13
    How will data extraction from a database ? How can I withdraw the sample data?

    Sorry,my english is not good...
     
  25. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    I'm sorry, but I still don't understand what do you mean exactly (... I don't know from where you are, but if you speak french, we can speak in french !)

    There are no sample data in the database. With the asset, you've got the SQL script to create the database (the tutorial explain how import it in database from PhpMyAdmin), and that's create an empty database.

    If you want delete the data that you put in database for tests, you can do it directly from PhpMyAdmin. Just login in PhpMyAdmin, select you database, click on the table users, click on "Operations" and click on "Empty the table (TRUNCATE)" in bottom right (caution: don't click in "Drop table", else it will delete the table).

    The tables games and users_has_games contains only data of the current games, so these tables are empty when there are no player in game.
    And the table users_exclusions will be automaticaly emptied if you delete all the users (because of foreign keys).

    I hope that answer to your question
     
  26. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,
    I have a lot of question about the asset's compatibility, and my answer is always the same: I didn't tested my asset with all the asset store, so I cannot guarantee you that it will be compatible.
    In absolute, I think that all assets ca be compatible with all others, but not without programming.
    I mean that make differents assets working together ask a certain programming job, that will not work instantly as magic !

    For example, change the player is something quite easy to do, I have done a video tutorial for this. But if you player comes from an other asset, and if you have no idea about how this player works and which scripts it uses, it can be a little harder to integrate it in MultiOnline...
     
  27. fredr92

    fredr92

    Joined:
    Jul 8, 2013
    Posts:
    292
    if u just tested if it Works i will buy Your package, its a free package and available at the assetstore, alot off Developers are using it, it might be helpfull for many. thanks
     
  28. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    I'm sorry but I'm alone and I have really a lot of work so I can't allow me to test my asset with all other, free or not.
    I know you ask me to test with only one, but I hope you'll understand that if I accept your request, I'll have to accept the tests requests of all other customer, and that's simply not possible.

    I have done my assets the less intrusive as possible, so that it must be compatible with many of other assets. But there will always have an integration job to do, usually easy if you have programming knowledge, maybe a little bit more harder in other case.
     
  29. fredr92

    fredr92

    Joined:
    Jul 8, 2013
    Posts:
    292
    No problem. I just looks at what multiplayer solutions there are, and i try the one i think i have a chance to get working. So its just a learning experiment, but i have not decided yet. Anyway I have made a singleplayer in a open world where items spawns, and enemies spawns, And was just wondering how this will be done with your asset? will you simply put the player prefab in the prefab folder, and name the player prefab the same as the one in the script that say instantiate player ? And what about gameobjects like exploding barrels, or spawned items, will they be visible for other players if nothing special done? and what about raycast and spawned enemies?
     
  30. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Maybe you can watch this tutorial which show all the steps to change the player and integrate a new animate player :


    It's not "put your player in a folder and change his name", but it's as easy as this, the only thing quite difficult can be to sync the animations, but I think (and I hope) that this tutorial explain well how do it.

    About the exploding barrels, or spawned items and all of it, no, it will not just work without done anything.
    In a multiplayer game, all events, and spawned objects must be "share" with the other players. So the functions must be called from RPC functions (more details about it), and the objects need a NetworkView, and must be instanciate across network, using Network.Instantiate.

    It's not very differents than a singleplayer game, but you have to use diffrents functions.
    MultiOnline is just a base, which provide you a multiplayer system, but you'll have to adapt your game to make it work as a multiplayer game.
    The big advantage of MultiOnline is that it's made using Unity network system, so that all Unity documentation and functions about network game works with it, and also all tutorials and Threads about Unity network system.
     
  31. fredr92

    fredr92

    Joined:
    Jul 8, 2013
    Posts:
    292
    Thanks :) its starting too make sense too me now
     
  32. ReaList

    ReaList

    Joined:
    Mar 27, 2014
    Posts:
    13
    Hi,

    Error Script, create new maps.

    ViewID not found during lookup. Strange behaviour may occur

    AllocatedID: 250' but the NetworkView doesn't exist
     
  33. Antarxes

    Antarxes

    Joined:
    Oct 2, 2013
    Posts:
    4
    Hi There,

    Great tool, I've had phenomenal success with my project. I'm stuck right now though at adding new maps and changing their names. Can you tell me where this functionality is?
     
  34. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,

    Did you well put the Spawn prefab on your map and build the game with this new map ?
    What happen exactly, does the main menu and the wairoom work correctly ? And does your new map appears or not ? And are the players spawned on it ?
     
  35. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,

    Everything about change maps is explained in documentation, part 5.2. There are only 3 steps:
    - Add the "Spawns" prefab on your map (and save it)
    - Open the scene WaitRoom, click on the "WaitRoom" gameObject and, on the inspector, add your map on the "Game maps scenes" list: click on "Add new map" and fill the new field with the name of the map (exactly the same as you called your map)
    - Open "Buid Settings", add your new map in the "Scenes in build", and build your game.

    If you just want rename a map, change the name of your scene, and change also the name in "Game maps scenes" from the "WaitRoom" inspector.
     
  36. TheDevGuy

    TheDevGuy

    Joined:
    Mar 3, 2014
    Posts:
    78
    I just have to say wow. Very easy and simple approach for users who arent familiar with network and online play.

    Just a quick question. Where is it located the registration email text so i can change what the player will receive when they register an account? Is it in the scripts or the PHP? And what do i need to do to save these changes for the users since i already uploaded the tutorial info.

    Thanks

    --
    Also now players cant connect, they get the error "Impossible to connect"
     
    Last edited: Apr 17, 2014
  37. Sergasteam

    Sergasteam

    Joined:
    Mar 1, 2013
    Posts:
    113
    VirtuElle, could you do in the next version with a choice of players autoselection random map, as is common in online games when selecting a quick game without the lobby and immediately start with the selected map players? And when I close my application immediately when my status on server 1, and when I go to the app again, the message that I'm already in the network, ie 1 status is not reset to 0 on the server. How to fix it?
     
    Last edited: Apr 17, 2014
  38. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Hi,

    Yes, the emails are in a php file: MOUser.class.php in functions folder.
    So, to change it, just modify the emails here (line 10 to 27), you can directly put html tags on it and some information about the player, look at documentation part 2.4 for more details.
    Once you have change your emails, save your php file and re-update it on your webhosting, and that's all.

    Aboout your error, does it appears when you were already connected with a player or not (I mean, you connect a player, close the window, and try to connect again this player) ?
    Can you connect again this player if you wait few minutes ?
    How did you logout ? Using "logout" button or just close the window ?

    If you didn't click on "Logout" button, your problem can come from two things possibles:
    - the "Calls interval" (documentation part 4.5) : maybe it doesn't work correctly with your webhosting, it may be blocked because of it send a lot of request.
    - the function OnApplicationQuit(): this function it automatically call when a player closes the window (it doesn't work with webplayer, that's why I added the "Calls interval" system. It your webhosting it too slow, the coroutine called in this functions may don't have the time to finish. I realized that's happend sometime with AlwaysData when the connection is too slow. So, AlwaysData is geat in development, but in production, I avice you a faster webhosting (as exemple, planethoster.net has good offers inexpensive).
     
  39. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    I add it to my to do list. I will probably add the choice of player or a team system, since you're not the first to ask for it, but I don't promise about the autoselection random map.

    So what happen when you have other players ? The host migration doesn't start ?
    Did you change anything in the scipts ? Do you have this problem with the sample version ?
     
  40. TheDevGuy

    TheDevGuy

    Joined:
    Mar 3, 2014
    Posts:
    78
    The error happens when i make a sample build of the game and another user trys to connect to my game on their build.

    This error doesnt happen when i open multiples of the exe on my own pc but only when another pc trys to connect to the game.
     
  41. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    In fact, I think that I didn't understood well your problem before.
    When you tell that player can't connect, you mean they can't join a game isn't it ? I thought before that you mean they cannot login.

    If yes, I think that's just a problem of port. The host must open the game port from his server, did you do it correctly ? If the port is not open, no player can joint the game, except yourself, of player which are in the same network as you.
     
  42. TheDevGuy

    TheDevGuy

    Joined:
    Mar 3, 2014
    Posts:
    78
  43. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    I don't know these hosts (except goDaddy, but only by name), so I cannot really telle you which is better. But I can advice you another, that's PlanetHoter (you can choose to host your website in canadian or french servers) they have a very good service.
    PlantetHoster and GoDaddy offer unlimited bandwidth, that's not the case of Edgegameservers.
    The main point to check, is that your webhosting has php PDO extension .I know that hostings in PlanetHoster have it, but I didn't find infornation about it in your two link. MultiOnline uses this extension, so if your webhosting doesn't has it, you'll have to re-code the MySQL functions.

    About port forward, I say in documentation that it's necessary to host a game, I didn't show how do it since it despends of your web provider. I found this tutoral which could help you: https://www.youtube.com/watch?v=usSpl0yJFnY
    To put it in a nutshell, you must enter the IP for your webserver in your web browser, so that you will access in your server admin. From there, you'll have to find the menu to open a port; and you open (choose the one you want) a port for your computer's IP in TCP and UDP, and that's all. After that; when you'll host a game from MultiOnline, you'll have to enter the port you opened in the field "game port".
     
  44. TheDevGuy

    TheDevGuy

    Joined:
    Mar 3, 2014
    Posts:
    78
    Thanks for the information.

    Also, does the other player need to have that port opened up in their router also? Or just the player hosting?

    If so, then it seems like alot of work to let players host if they have to physically go and open up ports for people to play.
     
  45. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    Only the host. That's a frequent client/server multiplayer system, and open port is quite easy to do.
     
  46. ReaList

    ReaList

    Joined:
    Mar 27, 2014
    Posts:
    13
    the problem isn`t the label, i dont know hoe to access the other players userName variable ? Text name above player's head username ?

    I'm sorry, I'm a little bad english :(
     
  47. TheDevGuy

    TheDevGuy

    Joined:
    Mar 3, 2014
    Posts:
    78
    Ok i opened the port and players "can" join the lobby without getting that impossible message. but when i start the map, for some reason they are all stuck in the lobby and some gui elements for them are removed from the lobby once i start the game.

    Very interested to see if its the webhost provider or my issue.
     
    Last edited: Apr 21, 2014
  48. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    The list off all the players of the current game, it's in MNetwork, look at the playerList it's a C# List, type of <MUser>.
    It is declared in MNetwork line 62.
     
  49. VirtuElle

    VirtuElle

    Joined:
    Jan 27, 2013
    Posts:
    458
    That's strange, and the host can load the map ?
    Have you well build the game with all your maps and give the .exe to the other players ?
     
  50. TheDevGuy

    TheDevGuy

    Joined:
    Mar 3, 2014
    Posts:
    78
    Yes i can load and join into the map once i start game, but the other players get left into the lobby for some reason.

    Yes other people have the exe..... thats how i have been testing this