Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

uMMORPG Official Thread

Discussion in 'Assets and Asset Store' started by mischa2k, Dec 29, 2015.

  1. dearamy

    dearamy

    Joined:
    Mar 17, 2015
    Posts:
    68
    After upgraded to 1.65, I got an error like this, and the console doesn't show anything. upload_2017-3-9_15-21-8.png
    FYI, I'm using Unity 5.5.2f1
     
    imwaynebailey and CrandellWS like this.
  2. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Rename the PlayerChat class to Chat and renamed the file to Chat.cs.
     
    CrandellWS likes this.
  3. CrandellWS

    CrandellWS

    Joined:
    Oct 31, 2015
    Posts:
    178
    yes the debug here seems minimally helpful as was true for the console error...



    though it is very direct.... you might think maxLength is null,



    Well, you would be right because chat is null.


    It wouldn't matter if, without a second thought you already looking at the all to familiar PlayerChat.cs file trying, to understand why maxLength is null.

    Wondering if this should be improved with perhaps stating what the null value actually was and something more like where is the file or class required or idk.

    I just think the error message here could be improved somehow.

    @vis2k what do you think of breaking each file name change updates into a 2 step process preupdate version bump where you put a null hatch in that will give us better error messages, then the desired changes... you could complete the series distribution by removing the null check on the following update or maybe leave it anyhow...idk What do you think?
     
    Last edited: Mar 9, 2017
  4. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    Hello guys I try make 2 teams player 1 vs player 2 i try duplicating the scrips player and rename to player 2, after rename 2 scripts, but many buggs, is any way that any help me or give tip how to do that?. THank you guys
     
  5. GrandAlchemist

    GrandAlchemist

    Joined:
    May 21, 2014
    Posts:
    10
    Definitely best to just have one Player script, and extend that to have groups/teams etc... It would take some work, but shouldn't be all that difficult.

    My advice would be to study the PvP Murder System and Combat logic within the Player script and add some additional checks to see which team the Player is on.
     
    mischa2k and luis29vm like this.
  6. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Aren't the Unity null error messages enough? They show you exactly the line that you need to focus on.
     
  7. MyNameJeff22

    MyNameJeff22

    Joined:
    Nov 27, 2016
    Posts:
    26
    i like the tab to target but how can i change it to target closest thing to cursor instead of character?
     
  8. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Modify the Player.TargetNearest function.
     
    MyNameJeff22 and Ronith like this.
  9. MyNameJeff22

    MyNameJeff22

    Joined:
    Nov 27, 2016
    Posts:
    26
    im new to unity and ummorpg. where can i find the Player.TargetNearest function?
     
  10. Ronith

    Ronith

    Joined:
    Feb 20, 2014
    Posts:
    69
    welcome to uMMORPG!
    I strongly recommend you familiarize yourself with c# and unity before you do any change in uMMORPG scripts. uMMORPG is easy to understand and a great learning pool to understand how a mmorpg core works. modify things step by step and make backups before every major change!

    you can find it in the Player.cs at the end of the file:
    Code (CSharp):
    1. // simple tab targeting
    2.     [Client]
    3.     void TargetNearest() {
    4.         if (Input.GetKeyDown(targetNearestKey)) {
    5.    
    6. ...
    7. ...
    8. ...
    9. ...
     
    Last edited: Mar 10, 2017
    CrandellWS, MyNameJeff22 and mischa2k like this.
  11. CrandellWS

    CrandellWS

    Joined:
    Oct 31, 2015
    Posts:
    178
    Yes for you and me...so @vis2k, I guess generally speaking no it should be clearer on why it errored... as in maybe something like

    "can not access `maxLength` of null object `chat`"
     
    Last edited: Mar 11, 2017
  12. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Yes I agree completely. But that's kind of up to Unity, I don't have source code access to their Debug.Log/Error/Warning code.
     
    CrandellWS likes this.
  13. MyNameJeff22

    MyNameJeff22

    Joined:
    Nov 27, 2016
    Posts:
    26
    thanks for the info.
    I found it after some help from the Discord group.
    I watched a few video tutorials on targeting to try and find the change Im looking for but no luck.
    all the tutorials im seeing use similar targeting but none of them are for targeting the enemy closest to mouse.

    can anyone give me an example of how they would do it?
     
  14. CrandellWS

    CrandellWS

    Joined:
    Oct 31, 2015
    Posts:
    178
    have a look at the Entity.cs file and check out the Method DealDamageAt(in Entity.cs) and then in the script see selectionHandling(IN Player.cs)

    (I have made changes but I think this original asset code)

    Perhaps you are looking to use something like the Physics.OverlapSphere ... get everything in a radius from a central point...

    Code (CSharp):
    1.  
    2.         // add all targets in AoE radius around main target
    3.         var colliders = Physics.OverlapSphere(entity.transform.position, aoeRadius); //, layerMask);
    4.         foreach (var co in colliders) {
    5.             var candidate = co.GetComponentInParent<Entity>();
    6.             // overlapsphere cast uses the collider's bounding volume (see
    7.             // Unity scripting reference), hence is often not exact enough
    8.             // in our case (especially for radius 0.0). let's also check the
    9.             // distance to be sure.
    10.             if (candidate != null && candidate != this && candidate.health > 0 &&
    11.                 Vector3.Distance(entity.transform.position, candidate.transform.position) < aoeRadius)
    12.                 entities.Add(candidate);
    13.         }

    If you combine that with some parts of the selectionHandling perhaps you can then figure out how to do what you want...

    Raycast will likely be helpful for what you are doing...

    Code (CSharp):
    1.  
    2.         var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    3.         RaycastHit hit;
    4.             if (Physics.Raycast(ray, out hit)) {
    5.                 // valid target?
    6.                 var entity = hit.transform.GetComponent<Entity>();
    7. ...
    8.  

    Here is some sample code that may help from http://answers.unity3d.com/questions/968855/touch-to-move.html

    Code (CSharp):
    1.  
    2. Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    3.                
    4. RaycastHit[] hits = Physics.RaycastAll(ray, 200);
    5. foreach(RaycastHit hit in hits) {
    6.                
    7.      if(hit.collider.CompareTag("Terrain")) Debug.Log(hit.point);
    8. }
    9.  
    So I am guessing at what you want but I think if you get your RayCast to hit point on the navmesh and then the use the Physics.OverlapSphere to get colliders(players, monsters or what \ever has a collider) within a chosen range.

    Let me know if that helps you or not...
     
    Last edited: Mar 11, 2017
    MyNameJeff22 and mischa2k like this.
  15. SkyLimitStudio

    SkyLimitStudio

    Joined:
    Oct 22, 2016
    Posts:
    15
    Hello. I have a little question. You have made a perfect MMO structure at the moment. Just what we need except for a little detail. We need up to 10 people maximum in a different lobby with the same server(we are using amazon EC2 free) . Is it possible that this can happen with this code somehow ? Or if it is not at the moment, will there be an update soon about that ? Thank you.

    And another remark. You cannot play with the same IP in the game. I log in with my phone and when i log in with my PC i can just watch(same happened on another network from another developer). Is it possible to stop the people from connecting with the same IP ?
     
  16. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    I am not sure what your question is. Do you need a lobby? There is a Network Lobby asset on the Asset Store, it's from Unity and it's for free, so that might be useful to you.
    If you are asking if it can handle 10 concurrent players, yes of course.

    You should be able to log in with the same IP. For example if you build two clients on your computer and start a server in the Editor, then you can log in with each client as long as each of them uses a different account name. If not, please let me know exactly what I have to do to reproduce the issue.
     
    CrandellWS likes this.
  17. MyNameJeff22

    MyNameJeff22

    Joined:
    Nov 27, 2016
    Posts:
    26

    Thank you very much!
    This is what I was looking for.
    I thought maybe there was a easy fix like add OnMouse or something.
    I think this is a little to much for me to try and do on my own.
    I was so hoping i didnt have to add a new game object on cursor with a new script
     
  18. SkyLimitStudio

    SkyLimitStudio

    Joined:
    Oct 22, 2016
    Posts:
    15
    So what happens is, I join with my phone with an .apk file, i made an .exe file and i started the game in the unity editor(3 players). My phone works perfectly, the .exe file works perfectly and in the editor i cannot move, i can just watch. I asked a fellow developer to test this out and send him an .apk and .exe file and he had the same glitch but on the phone. He could not move, he coud just see us move on the phone but his .exe file worked perfectly. They were on the same network. Same as me. When you use the same router something buggs. We get some errors like "IndexOutOfRangeException" or "playerControllerId of 0 already in use". Only things i did modify are the connection to the Amazon server.

    About the other question. I want to make it like the uMoba lobby system. Is it possible to copy it from there and paste it here ? I don't know which steps to do, to make it that way.

    And sorry but I have another question. I want to make the players, to be able to put objects on the ground. Build things. What do I have to do to make that and send them to the server as new objects. Sorry for asking so much questions but i am excited.
     
    Last edited: Mar 12, 2017
  19. Ronith

    Ronith

    Joined:
    Feb 20, 2014
    Posts:
    69
    A quick look at the gameplay of Canyonbreed. A few quests, crafting and failing at an end boss.
     
    jagatai33, Weblox, mischa2k and 2 others like this.
  20. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    You should post the exact error here. Also please try it in a fresh uMMORPG project and see if it still happens.

    For the lobby, check out the Network Lobby asset from the store and play around with it to see how it works. It's overly complicated though, so be ready for some frustration.

    You would send a command to the server like [Command] CmdPutItemOnGround(itemIndex), then the server removes it from the inventory and spawns some kind of item drop prefab on the ground.
     
  21. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Nice UI!
     
    Ronith likes this.
  22. SkyLimitStudio

    SkyLimitStudio

    Joined:
    Oct 22, 2016
    Posts:
    15

    Thank you very much. I tested it out on a new build and it was fixed. I refreshed the amazon server, opened a new port and put the new build just now i tested it on 3 of my android devices + .exe file + the unity editor and all my 5 accounts play together without a problem.

    I was thinking about a skill that creates a building. Is that possible with the current code without making it an Item ?


    Thank you for the awesome asset and answering all our questions, you are amazing. Keep up the good work !!!
     
  23. CrandellWS

    CrandellWS

    Joined:
    Oct 31, 2015
    Posts:
    178

    So the last 2 minutes of your video it looks like you are missing when firing because you are not close enough and then the after the character get's closer damage is done...

    How did you achieve this?
     
  24. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Just spawn the GameObject when using the skill or item. It's possible, but you'd have to implement it yourself for now.
     
  25. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    Hello @vis2k,
    We are using ICE Creature Control for our AI and are wondering how difficult it would be to use it along side uMMORPG.
    Would a complete integration be required to get the two to get along and behave with one another?
     
  26. Ronith

    Ronith

    Joined:
    Feb 20, 2014
    Posts:
    69
    nice idea, but this was a bug due a wrong collider near the door :)
     
  27. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Never used it, so I can't say. Anything that you want to integrate has to work with UNET though.
     
  28. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress: been tracking down two bugs in my other Navigation2D asset. Some people use that for their 2D MMORPGs here, so make sure to download V1.15 from the Asset Store after it is released. The tool works better with other assets like Tiled2Unity now.
     
  29. rickcollette

    rickcollette

    Joined:
    Mar 17, 2013
    Posts:
    304
    Is anyone handling multiple "zones" / continents (like EQ did), or massive worlds (16k x 16k) ?
     
  30. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    Hello Vis, are you going release the Web solution for administrate, our own project online? (the documentation)
     
  31. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    I use
    (World Creator Pro)
    https://www.assetstore.unity3d.com/en/#!/content/55073

    and
    (World Streamer)
    https://www.assetstore.unity3d.com/en/#!/content/36486

    World Creator Pro works out of the box with uMMORPG, World Streamer on the other hand took a lot of effort to get working correctly with UNET but if you have the time and some programming experience along with lots of patience you should be fine.

    I would also note the reason i ended up using World Streamer was due to Unitys native terrain size limits and floating point issues when you go beyond those limits, but i can say that using World Streamer allowed me a side bonus i wasnt expecting and thats being able to make huge worlds playable on mobile devices! which is why i also choose to use World Creator Pro as they have ( in my personal opinion ) a really nice and robust tiling system.

    Hope this helps.
    -J
     
    mischa2k likes this.
  32. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    We are waiting for UNET Phase 3, the master simulation server will make this possible without us having to worry about it.

    Other than that, try jagatai's answer.

    I only have a solution for the website/item mall/server integration, there is no user administration or anything. SQL queries should do just fine until your project grows bigger.
     
  33. MyNameJeff22

    MyNameJeff22

    Joined:
    Nov 27, 2016
    Posts:
    26
    just curious.. are all the bugs fixed now?
    examples
    wsda rubber banding
    auto clicker bug-duping items when looting
    npc death

    and any others ive missed
     
  34. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    The WSAD issues reported by tvirus are fixed, no one complained about that for a long time now.
    The auto clicker duping bug was fixed within the same day, it was a simple 'if slot[index].valid' check that was missing there, but nowhere else.
    Not sure what you mean with NPC death.
     
    MyNameJeff22 likes this.
  35. Ronith

    Ronith

    Joined:
    Feb 20, 2014
    Posts:
    69
    i agree with @vis2k , everything is fine. uMMORPG is a stressfree core engine without annoying bugs.
    looking forward to gather resources :)
     
    mischa2k and MyNameJeff22 like this.
  36. MyNameJeff22

    MyNameJeff22

    Joined:
    Nov 27, 2016
    Posts:
    26
    Thought someone reported npc's dieing
    thats great everything is bug free
    this is by far the best asset ive bought
    thanks again for the hard work
     
    P_Jong and mischa2k like this.
  37. rickcollette

    rickcollette

    Joined:
    Mar 17, 2013
    Posts:
    304
    I posted an update request for Unity Tech. I really hope that comes in pretty quick.

    I'll give that a try.
    Thanks!
     
  38. rickcollette

    rickcollette

    Joined:
    Mar 17, 2013
    Posts:
    304
    Awesome - was there any particular documentation you used to get it to work properly? I'm using Gaia, myself. But I didn't think world streamer would be a possibility.
     
  39. MyNameJeff22

    MyNameJeff22

    Joined:
    Nov 27, 2016
    Posts:
    26
    how can i make the skills autotarget nearest monster when you click on skill hot key
    right now you can spam skill button but if no target nothing happends
    I would like it to auto target and execute skill on nearest enemy
     
  40. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    They won't give you any information. It's pretty much a dead project I believe. Though probably release maybe late 2017 or 2018. I've already tried asking.
     
  41. zerjz

    zerjz

    Joined:
    Feb 3, 2017
    Posts:
    4
    vis2k, I have gotten entity damage parsed into the chat window, using the following code:

    AddMessage(new MessageInfo("", "", this + " attacks " + target + " for " + damageDealt + " damage.", "", new Color32(240, 238, 231, 255)));


    My problem is that instead of being parsed like this:

    Yourname attacks Enemyname for 10 damage

    It shows like this:

    Yourname (Player) attacks Enemyname (Monster) for 10 damage


    How can I remove that addition of the Entity "type" in my string?
     
  42. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress: the new warrior model is making slow and steady progress:
    imgpsh_fullsize.jpg

    Call the TargetNearest function before casting a skill.

    Use target.name etc.
     
    luis29vm likes this.
  43. PowerMan

    PowerMan

    Joined:
    Mar 17, 2017
    Posts:
    3
    Hey vis2k,
    Any chance of getting a step by step on running the server on windows 10 for people to call in and test the game out?
    There was something about running windows in batchmode but i dont know what that is nor how to do that. I am not too familiar with linux and so rather do windows if its possible? Can you help?
    Thanks,
    PM
     
  44. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Open the console in your game's directory, then run the command from the documentation. Then other people from your local network can connect already.

    If you want do that on your own computer, then you need to open a port in your router too. This is very risky though since everyone on the internet can then connect to your computer, I would advise against that. It's better to rent a VPS or dedicated server.
     
  45. bartuq

    bartuq

    Joined:
    Sep 26, 2016
    Posts:
    127
    This new model looks good.
    It is the announcement of "Equipping items with Skinned Meshes (Jackets, Pants etc.)"? :)
    Do you plan to make possibility using bow in warrior class? It would be nice.
     
    GrandAlchemist likes this.
  46. GrandAlchemist

    GrandAlchemist

    Joined:
    May 21, 2014
    Posts:
    10
    Those two things would be amazing, I would personally love to see ranged weapons on the warrior class as well!
     
  47. CrandellWS

    CrandellWS

    Joined:
    Oct 31, 2015
    Posts:
    178
    I think you want the gameObject.name function. I did a fast working sample only by adding the following 2 lines of code as the first 2 lines in the DealDamageAt method within the playscript

    Player.cs DealDamageAt(...
    Code (CSharp):
    1.         string message = this.name + " attacks " + entity.name + " for " + amount + " damage.";
    2.         GetComponent<Chat>().TargetMsgInfo(connectionToClient, message);
    The result is what you desired.

    Actually, I have this functionality partially working... Such as monster can outrun an arrow...but some tuning to do to get it fully working as desired... If my work day permits I will be getting that done this weekend.

    Also, set the projectiles to be 1 of 2 classes homing Type and Non Homing Type. Where the non homing will only fly straight... This way I can make my arrows fly straight like they really would but magic be tracking...
     
    mischa2k likes this.
  48. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It will have equipment parts yes, so at least I can start my research on skinned mesh equipping then.
    You can let the warrior use a bow by changing the required equipment type to 'Weapon' instead of 'WeaponSword'. But then you need all the animations too, which is why I didn't do that.
     
  49. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Why not do a UMA Integration into uMMORPG? Version 2.5 came out a day ago. Might be worth looking into :)

    Not to mention it is 100% free.
     
    CrandellWS likes this.
  50. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    I will put it on my ToDo list to do some research after the skinned mesh equipping.
     
    CrandellWS likes this.