Search Unity

uMMORPG Official Thread

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

  1. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Update: V1.34 is now on the Asset Store! This is a great release with lots of improvements. Working on the next one already.

    Swimming is difficult if you want to do real 3D swimming, diving, etc.
    Just playing the swimming animation when walking through water is possible though. Use a water plane with a trigger and then check OnTriggerEnter+OnTriggerExit in the Player to set a 'bool swimming' to true/false (only if the collider is part of the water). Then pass it in LateUpdate to the animator like with the other variables that are being passed.

    Layers can be checked too of course.

    Note that you could have a 'defaultSpeed' variable that you set to agent.speed in Start and then simply set agent.speed = defaultSpeed + buffSpeed in Update. This way you don't have to hardcode the '5' either. And you may not need the skill name check.
     
    Last edited: Sep 14, 2016
  2. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class JBR_AI_CoverSystem : MonoBehaviour
    5. {
    6. // layer name you want to do something
    7.     public string NavLayer = "water";
    8.  
    9.  
    10.     public NavMeshAgent agent;
    11.     private int navAreaMaskID;
    12.  
    13.  
    14.     void CheckLayer()
    15.     {
    16.         navAreaMaskID = ~(1 << NavMesh.GetAreaFromName(NavLayer)); //< ignore everything but "Water"
    17.  
    18.         if (agent.SamplePathPosition(navAreaMaskID, 0.01f, out hit))
    19.         {
    20.  
    21.             Debug.Log("NavMesh  " + NavLayer + navAreaMaskID);
    22.  
    23.         }
    24.     }
    25.  
    26.  
    27. }
    finding out if the object is on a certain layer of navmesh
     
    Last edited: Sep 8, 2016
    nixter likes this.
  3. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    @vis2k Is there any way you could disconnect the system from UNET directly? We would like to change to a different networking backend but it will not be fun for updates from that point on. Maybe putting the data into custom classes and allowing us to override or overload that class?
     
  4. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    The HLAPI is open source, so you can replace either the LLAPI or the HLAPI with some effort.
    uMMORPG makes a lot of use of Rpcs, Commands, SyncVars and SyncLists. Those concepts are very powerful, it's just UNET's implementation that's not perfect. So a similar system wouldn't be too hard to use, as long as it has those concepts.

    Out of curiosity, which backend are you looking at?
     
  5. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    We have a system based on LLAPI called WakeNet that we are planning to open source soon. It has worked flawlessly on 2 of our games plus another (BlackWake) and is our 'go to' now for networking just from a stability standpoint.
     
  6. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    not sure if i should import the package on blank project file or there is a bug with latest update and unity 5.4.0 with latest patch. im getting an error message on editor like this:
    Assets/uMMORPG/Scripts/_OnGUI/GUIConsole.cs(15,7): error CS0101: The namespace `global::' already contains a definition for `LogEntry'


    Edit: seems after removing package from project and re-imported then it worked (had some errors during runtime but after saving project seems everything works again).
     
    Last edited: Sep 7, 2016
  7. nixter

    nixter

    Joined:
    Mar 17, 2012
    Posts:
    320
    GUIConsole.cs got moved to a separate folder. The error was caused because you still had the original in the Scripts folder. Removing it will get rid of the namespace conflict.
     
    mischa2k likes this.
  8. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress Info: improving some quest features. NPCs will have multiple quests in the next version, and quests will have a 'gather item' requirement.
    2016-09-08_npcmultiplequests_and_gatheritems.png
     
    cioa00, MHolmstrom and JBR-games like this.
  9. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    Seems that issue which i had for while is gone. I mean issue related headless linux server when it had a lot mobs with their nameoverlays enabled. Which overall caused memory leak in some point. Not sure at the moment if the TextMeshes usage has fixed it :p Either way the latest update seems quite ok, but ill take closer look during the weekend.

    Edit: Seems there is small lag between client and server, usually when archer is shooting an arrow. But i might assume it`s issue on my side, so ill try later upload headless server to one vps to see how things are working in there.
     
    Last edited: Sep 8, 2016
  10. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress Info: uMMORPG V1.35 was submitted to the Asset Store with multiple NPC quests, a few smaller adjustments and the final workaround for the UNET readstring/readbytes out of range bug that cost me so many days of my life. After browsing through the UNET code for the past few days, I can now trigger this bug whenever I want and as result learned how to avoid it completely.

    This is also my 500th Unity Forum post. Two reasons to celebrate.

    Okay, let me know!
     
    nixter likes this.
  11. nixter

    nixter

    Joined:
    Mar 17, 2012
    Posts:
    320
    Yeah, you're right! I definitely over-coded that. Here is the new code:

    Player.cs
    Code (CSharp):
    1.  
    2.     // The system now uses additive/subtractive system, not a multiplier
    3.     // i.e. buffCustomValue=5 means agent.speed(5) + buffSpeed(5) = new agent.speed(10)
    4.     public float defaultSpeed;
    5.     // Attribute to keep track of Buff Speeds
    6.     // See Start() for the initial setup
    7.     // See the LateUpdate() for the speed effect
    8.     public float buffSpeed
    9.     {
    10.         get
    11.         {
    12.             // calculate buff bonus
    13.             var buffBonus = (from skill in skills
    14.                              where skill.BuffTimeRemaining() > 0 &&
    15.                              skill.name == "SpeedBoost"
    16.                              select skill.buffCustomValue).Sum();
    17.             return buffBonus;
    18.  
    19.         }
    20.     }
    21.  
    22. ...
    23.  
    24.     void Start() {
    25. ...
    26.         defaultSpeed = agent.speed;
    27.     }
    28.  
    29. ...
    30.  
    31.     [ClientCallback]
    32.     void LateUpdate() {
    33. ...
    34.         agent.speed = defaultSpeed + buffSpeed;
    35.         GetComponent<Animator>().SetFloat("Speed", agent.velocity.magnitude);
    36.  
    No code is needed in NetworkNavMeshAgent.cs

    I still need the skill name check because I am using a generic holder for the float value. If I decide later to make a Speed Bonus float for the skill template then I could drop the name check.

    ------

    Another issue: The skillbar calculation for icons is having trouble because it is set to get it's data from the UISkills list. But remember, the player has skills that don't show up there: specifically the "Status____" skills.

    To test the problem, add three normal skills to a Player Prefab after the Offender and Murderer skills. You can just duplicate a skill like PreciseShot, so PreciseShot1, PreciseShot2 and PreciseShot3. Then in the game buy those three skills from the UISkills window.

    Guess what? You can't put PreciseShot1 or PreciseShot2 in the skillbar. You can't do this because it tried to count Offender as the next skill and Offender is not a valid skillbar button. You will be able to add PreciseShot3, but it will be the wrong skill. It will think that you are adding PreciseShot1.
     
  12. MHolmstrom

    MHolmstrom

    Joined:
    Aug 16, 2012
    Posts:
    115
    I have the same problem with skillbars.
    Also is there anyway you can use plugins or intregrate Dialog Engine or for example a ship controll system w/o to much coding just curious how flexibel uMmorog is. Do you plan on supporting some popular assets such as the hack n slash combat system or 3rd person controller that seems to be on top chart all the time? GRATZ on your 500:th post, keep'em comming! :)
    I'd like to share some screenshots soon enough. Also got the swiming working I used Tween for the float fx aswell, looks really good now. And the speedboost thing was just great! Just some minor changes and a new target !=this to make a neat charge attack. Next play around would be a leap kinda skill and fishingen, then I'm of to a ship controller, mig have a work around with a new item and simple equip the ship for mounting and ofc using speedbuff etc. Or a new player class or can you just have a prefab with a pos sync?
     
  13. nixter

    nixter

    Joined:
    Mar 17, 2012
    Posts:
    320
    UMMORPG is as flexible as any other Unity-based framework but it is up to you to code the connections between it and any other asset. vis2k is focused on the framework for now and will not be working on integrations for some time. You might have better luck asking the asset creators to make theirs compatible with UMMORPG.

    By coincidence, adding a more full-fledged conversation system to my UMMORPG project is what I'm planning to work on next. I'm probably going to be using Dialogue System for Unity, or perhaps Fungus. I'll post a tutorial / rundown on how I got it working when it's done.
     
  14. dbordzo

    dbordzo

    Joined:
    Aug 14, 2015
    Posts:
    34
    Do you know maybe something about UNET3 ? When do you think it will be realsed ?
     
  15. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Nice find. It will be fixed in V1.35 too.
    (Sorry for the late reply, had to figure out the best way to fix it first)

    Skillbar bug will be fixed in V1.35.
    As nixter explained, I am currently focusing on the core features. Getting them perfectly stable, fixing all existing issue before implementing new features.

    The simulation server is already on the roadmap: https://unity3d.com/unity/roadmap but with no exact date.

    Note that Phase 3 would require two things: code to split the game world between different servers, and physically hosting those servers. This is a hard problem to solve, and it's even harder to get it perfectly stable. Based on UNET's history, we should not get too excited just yet.

    There is a Plan B that I mentioned before here. I have a rather simple idea that would solve the problem too. We will get there one way or the other.
     
    Last edited: Sep 11, 2016
    nixter and dbordzo like this.
  16. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Update: V1.35 is now on the Asset Store. Changes can be seen in the first post!
     
    nixter and cioa00 like this.
  17. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    Seems even after importing asset to clean project im getting this kind error:
    It happens when i try click on npc quest list button
     
  18. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Is anyone else getting this error? It worked fine for me when I submitted V1.35. Are you 100% sure that it was a completely fresh project in a completely new location etc.?


    You can drag the SlotNpcQuest prefab from the Prefabs/UI folder into the Canvas/NpcQuests/UINpcQuest component in the Hierarchy to solve it.
     
  19. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    I will try later again during today evening. Can't test it out at the moment.
     
  20. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    I just created a new Unity project, went to the Asset Store and downloaded uMMORPG. It did work for me. Tried it on OSX with Unity 5.4.0f3.
     
  21. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    I just downloaded Unity 5.4.1 on my work laptop and tried with new project and seems everything works fine now. I guess it`s something with my pc then or something went really wrong during asset import :)
     
    mischa2k likes this.
  22. VE_GAME

    VE_GAME

    Joined:
    Mar 13, 2014
    Posts:
    41
    not seen in the WebGL Demo critical hit
    whether it is possible to make ?



    ps.I expect Kraft to purchase the asset:)
     
  23. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    You can easily modify the damage function in the Entity code, no problem.
    Crafting is on the roadmap, no planned date yet though.
     
  24. VE_GAME

    VE_GAME

    Joined:
    Mar 13, 2014
    Posts:
    41
    well thank you
     
  25. jjobby

    jjobby

    Joined:
    Nov 28, 2009
    Posts:
    161
  26. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Hello!

    I just bought an asset and the code is really well documented!

    Yet I have a problem (which is present in webdemo too) that I cant fix easily.

    When I click monster for the first time it is selected but character stays still and do not walk towards (debug shows that rayhit transform is floor - why monster is selected then??) when i click selected monster for the second time character moves closely and attacks as needed.

    How can it be fixed?

    In the end I want to achieve behaviour - when monster is clicked character walks towards it until monster is in the range of an attack or out of the range sight (if it is faster than character and moves away form him).

    Can you please briefly describe better solution to achieve that "pursuing" behaviour for the player.
     
  27. angeji_96

    angeji_96

    Joined:
    Oct 15, 2015
    Posts:
    8
    Help me please, why, when I click on the phone user interface, chat, the character moves in the pressing direction?
    And on the PC everything works fine
     
  28. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    You don't need any of the Unity multiplayer services at all. The matchmaker is more for session type games. The relay server is for people who want to host on their own computers. MMOs are usually hosted on a dedicated server.
    The CCU depends on how strong your computer is.
    Hey,
    this is a feature. The first click selects the monster/npc/player, the second click attacks it. This is useful when selecting players, where we often want to select them and then invite them to trade etc. (instead of attacking them immediately).

    For your behaviour you should take a look at Player.cs SelectionHandling function. There is a check like 'did we click the current target? then do things'. You can modify it to just 'do things' in any case, even if the clicked entity isn't a target yet.

    Which phone? Android/iOS?
     
  29. VE_GAME

    VE_GAME

    Joined:
    Mar 13, 2014
    Posts:
    41
    Do you plan to collect resources

    chopping wood?
    ore mining?
     
  30. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It's on the roadmap in the first post already as crafting. No planned date yet though!
     
  31. angeji_96

    angeji_96

    Joined:
    Oct 15, 2015
    Posts:
    8
    Android
     
  32. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Hi once again!
    Is there some road map on how to tackle learning an engine?

    The best way would probably be some stripped of almost everything version that you can iteratively update with stuff from full version going through some roadmap (just as a proposal).

    But even a simple ordered list of what code (and relative technology if there is) to go through would be great too.
     
    Last edited: Sep 20, 2016
  33. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Does it only happen when clicking the chat?

    Do you want to learn Unity or UNET or uMMORPG?
     
  34. MHolmstrom

    MHolmstrom

    Joined:
    Aug 16, 2012
    Posts:
    115
    Let's get some showcase going shall we? :)
    What are you working on with Ummorpg?
    Edit: How can I make skills work while moving thanks in advance!
     
    Last edited: Sep 20, 2016
  35. jjobby

    jjobby

    Joined:
    Nov 28, 2009
    Posts:
    161
    That's what I understand about CCU in Unity service. If we don't use Match Making or Relay server from Unity service and have our own server then we shouldn't be worry about CCU limit. What confuses me is that it said that we shouldn't use NetworkManager in the link I posted. It implies that the NetworkManager may trigger the Match Making API from using it and causes us to accidentally use Unity Multiplayer service. I'm not sure if this idea is true or not. That was my original question. But it seems I'm just overthinking about it.
     
  36. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    You would have to configure the matchmaker to use Unity services, and you would have to enter your services project ID in the project. So don't worry, you won't accidentally make use of those services.

    You would have to modify the state machines. Right now skills only work when standing. Take a look at the UpdateCasting state etc.
    Note that this introduces a few problems like 'cast-while-moving' animations etc.
     
  37. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    uMMORPG and maybe some UNET specifics along the way.

    My basic assumption about uMMORPG is that it is a learning project first (at least for me) And I sincerely believe that learning materials are much more valuable than for example new features (which are not too hard to implement while solid understanding of the engine is in place)

    So my suggestion is to ship more "educational" content starting from a simple ordered list of thing to go through to truly learn and understand concepts and ideas behind uMMORPG.
     
    Last edited: Sep 20, 2016
  38. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    I suggest starting here: https://docs.unity3d.com/Manual/UNet.html . Read through it a few times until you understand SyncVars/SyncLists/Cmds/Rpcs perfectly.

    When it comes to uMMORPG, there is no magic or anything. It's basically a NetworkManager (based on the original one but with character selection and character creation), a few Entities (Player/Npc/Monster), a few ScriptableObjects(Items,Quests,Skills) and a few helper scripts (UI, Utils, etc.). Also read through the uMMORPG documentation to get a better understanding about some technology choices. If you want a list of things to look through, I suggest: Npc.cs -> Entity.cs -> Monster.cs -> Player.cs, then ItemTemplate.cs->Item.cs, QuestTemplate.cs->Quest.cs and SkillTemplate.cs->Skill.cs and finally the NetworkManager. The UI code is rather boring.

    I completely agree with your point about learning project vs. features. I am also a big fan of simplicity and try to keep it as simple as possible.
     
    chrisnathan1983 and shamsfk like this.
  39. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Thank you!
     
  40. angeji_96

    angeji_96

    Joined:
    Oct 15, 2015
    Posts:
    8
    No, not only on the chat, it occurs for all UI
     
  41. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Do you have a second android phone where you can test it on? And can you test a different Unity version like 5.5?
    If it still doesn't work, let me know. I can test it too of course, installing android support takes a while though.
     
  42. angeji_96

    angeji_96

    Joined:
    Oct 15, 2015
    Posts:
    8
    Well, I'll check on the second phone and in the different versions of the Unity, and I'll write you
     
    mischa2k likes this.
  43. nixter

    nixter

    Joined:
    Mar 17, 2012
    Posts:
    320
    Found a bug. This seems to be in the last couple of versions (1.34 and 1.35).

    1) Create a new Archer
    2) Enter the world
    3) Remove bow from equipment by putting it in inventory - The bow prefab remains on the weapon mount.
    4) Put the bow icon back in the equipment slot - The bow disappears from the weapon mount.
    5) Attack a skeleton - The game will give warning "<Player>has no ProjectileMount. Can't fire the projectile."

    The same happens with the Warrior class, but they can still attack with an invisible sword.

    Seems like the add/remove prefab to WeaponMount code got messed up.
     
  44. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    This is a UNET bug that was reintroduced for the 2nd or 3rd time. Upgrade to Unity 5.4.1p1 (the patch version).
    The next uMMORPG version will also have the workaround for this bug for Unity version where it still happens. I'll probably keep it in there forever so we can simply add "if UNITY_5_4_something" if it gets reintroduced for a 4th time.
     
    nixter likes this.
  45. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Hello!

    1) Do you know anything of upcoming Server Library? (https://unity3d.com/unity/roadmap under EXPERIMENTAL PREVIEWS)

    I'm unable to find any meaningful info on a subject but it looks like it will affect your project and us as it's users to some extent at least.

    2) When building in headless mode is there any "feature strip"? I know it doesn't render anything, but it (or we?) probably should also strip every bit of logic possible like for example mechanim (provided that there are no events in it). I'm a bit afraid of all the unnecesarry logic that will spin on the server, have you researched that?

    3) What is the current estimations of maximum players per server (any configuration you have them on)?
     
    Last edited: Sep 23, 2016
  46. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    1.) Yes I know about it. We won't need it for uMMORPG. We will need the simulation server.

    2.) There is no feature strip except rendering. You could do feature strips like avoiding animations. I did not do that for uMMORPG to keep the code as clean as possible. As you can imagine, it would make it faster but lots of 'isHeadless' checks would also make everything more difficult for new developers.

    3.) I only tested it with 1000 monsters a while ago on a cheap VPS. CPU usage was 100% but things still worked fine. As for the server, 4 really fast cores should be enough. All our Unity scripts run in one thread. Some other things seem to be calculated in a few more threads by Unity, since the CPU usage does get >100% (>1 core) on my local computer at least. 32 cores would be overkill though. The final solution is the simulation server, so that we can split the game world into different server instances. I do also have another plan to split the game world between more CPU cores / servers, but I want to wait a bit longer first to see how the simulation server turns out.

    Hope that helps.
     
  47. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Oh thanks! and some more questions)

    4) Do you currently have some solution for multi-server setup? It is unavoidable thing to have while unity's logic is single threaded. I would like to look into buying something of that sort.

    5) I hear that you yourself is developing mmo and it's soon to be released, how is the experience on the unet side?

    http://ithare.com/unity-5-vs-ue4-vs-photon-vs-diy-for-mmo/ is quite helpful explaining some caveats and even concludes with unity being a somewhat viable choice but frankly at the moment I'm doubting unet as more than learning/hobby tool for mmos.

    Provided that I have some degree of experience with server side code (not gaming) would you still suggest to use unet for anything more than prototyping or to go some other route (golang in my case)?
     
  48. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    There could be some Stripper.cs) That is simply attached to the gameobject and on start it scans gameobject for the components to remove/disable. That is the way I'm gonna probably go.

    It should work reasonably well with only some overhead on server starting if object pooling is used (which should definitely be as I'm concerned)
     
  49. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    4) The solution still lives entirely in my head. I want to get uMMORPG perfectly done first. Then as the last feature I would implement my multi server solution if the simulation server still isn't released, or is released but too buggy. It's simply a poor time investment if I spend the next 6 months working on that multi server solution, just to see the simulation server released a day later, if you know what I mean.

    5.) I want to launch my own MMORPG some day, that's true. There is no secret code for it though, it's all uMMORPG. I want to get the code for the core features perfectly done first before I find a team, add the art, start a Kickstarter, etc. About my UNET experience: love and hate relationship. I love not having to worry about networking details myself and I love the overall "Cmd/Rpc/SyncVar/Server&Client are one" concept very much. I hate the bugs, especially the fact that my two critical bug reports are still open for about a year now. There are more networking fixes in recent Unity releases though, so while they do not communicate much, they do seem to fix bugs again.

    A stripper component makes sense. You can even use 'Destroy(this)' once the stripping was done, to leave overhead to a minimum.
     
  50. shamsfk

    shamsfk

    Joined:
    Nov 21, 2014
    Posts:
    307
    Yeah I totally do.

    1) What is a simulation server? Do you have some links with info about? Question on hand: if it is worth waiting and that question cant have no easy answer.

    2) By the way, do you know of a way to use LLAPI from outside of unity? Is it at all possible?
     
    Last edited: Sep 23, 2016