Search Unity

uMMORPG Official Thread

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

  1. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    @vis2k ,

    Quick question;
    Im a little stuck, esentially im trying to create a DoT (Damage Over Time) skill however when i try to store an Entity target in SkillTemplate.cs :
    Code (CSharp):
    1.  
    2. [HideInInspector] public Entity target;
    3.  
    and then in BuggySkill.cs i have the public Entity target and do the get;set:
    Code (CSharp):
    1.  
    2.     public Entity target {
    3.         get { return SkillTemplate.dict[name].target; }
    4.         set { target = value; }
    5.     }
    6.  
    Once i try to create a character i get the following:
    Code (csharp):
    1.  
    2. InvalidOperationException: To be XML serializable, types which inherit from IEnumerable must have an implementation of Add(System.Object) at all levels of their inheritance hierarchy. UnityEngine.Transform does not implement Add(System.Object).
    3. System.Xml.Serialization.TypeData.get_ListItemType ()
    4. System.Xml.Serialization.TypeData.get_ListItemTypeData ()
    5. System.Xml.Serialization.TypeData..ctor (System.Type type, System.String elementName, Boolean isPrimitive, System.Xml.Serialization.TypeData mappedType, System.Xml.Schema.XmlSchemaPatternFacet facet)
    6. System.Xml.Serialization.TypeData..ctor (System.Type type, System.String elementName, Boolean isPrimitive)
    7. System.Xml.Serialization.TypeTranslator.GetTypeData (System.Type runtimeType, System.String xmlDataType)
    8. System.Xml.Serialization.TypeTranslator.GetTypeData (System.Type type)
    9. System.Xml.Serialization.XmlReflectionImporter.GetReflectionMembers (System.Type type)
    10. System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    11. System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    12. Rethrow as InvalidOperationException: There was an error reflecting type 'Entity'.
    13. System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    14. System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    15. System.Xml.Serialization.XmlReflectionImporter.ImportElementInfo (System.Type cls, System.String defaultName, System.String defaultNamespace, System.Type defaultType, System.Xml.Serialization.XmlTypeMapMemberElement member, System.Xml.Serialization.XmlAttributes atts)
    16. System.Xml.Serialization.XmlReflectionImporter.CreateMapMember (System.Type declaringType, System.Xml.Serialization.XmlReflectionMember rmember, System.String defaultNamespace)
    17. System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    18. Rethrow as InvalidOperationException: There was an error reflecting field 'target'.
    19. System.Xml.Serialization.XmlReflectionImporter.ImportClassMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    20. System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    21. Rethrow as InvalidOperationException: There was an error reflecting type 'Skill'.
    22. System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    23. System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    24. System.Xml.Serialization.XmlReflectionImporter.ImportListMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace, System.Xml.Serialization.XmlAttributes atts, Int32 nestingLevel)
    25. System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    26. Rethrow as InvalidOperationException: There was an error reflecting type 'System.Collections.Generic.List`1[[Skill, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]'.
    27. System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Xml.Serialization.TypeData typeData, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    28. System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    29. System.Xml.Serialization.XmlSerializer..ctor (System.Type type, System.Xml.Serialization.XmlAttributeOverrides overrides, System.Type[] extraTypes, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace)
    30. System.Xml.Serialization.XmlSerializer..ctor (System.Type type)
    31. Extensions.WriteElementObject (System.Xml.XmlWriter writer, System.String localName, System.Object value) (at Assets/uMMORPG/Scripts/Extensions.cs:36)
    32. Database.CharacterSave (.Player player) (at Assets/uMMORPG/Scripts/Database.cs:100)
    33. NetworkManagerMMO.CreateCharacter (System.String account, System.String charName, .Player playerPrefab) (at Assets/uMMORPG/Scripts/NetworkManagerMMO.cs:380)
    34. NetworkManagerMMO.OnServerCharacterCreate (UnityEngine.Networking.NetworkMessage netMsg) (at Assets/uMMORPG/Scripts/NetworkManagerMMO.cs:286)
    35. UnityEngine.Networking.NetworkConnection.InvokeHandler (Int16 msgType, UnityEngine.Networking.NetworkReader reader, Int32 channelId) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkConnection.cs:197)
    36. UnityEngine.Networking.NetworkServer.InvokeHandlerOnServer (UnityEngine.Networking.ULocalConnectionToServer conn, Int16 msgType, UnityEngine.Networking.MessageBase msg, Int32 channelId) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkServer.cs:1636)
    37. UnityEngine.Networking.ULocalConnectionToServer.Send (Int16 msgType, UnityEngine.Networking.MessageBase msg) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/LocalConnections.cs:83)
    38. UnityEngine.Networking.NetworkClient.Send (Int16 msgType, UnityEngine.Networking.MessageBase msg) (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkClient.cs:462)
    39. NetworkManagerMMOUI.OnButtonCharacterCreationCreate () (at Assets/uMMORPG/Scripts/NetworkManagerMMOUI.cs:194)
    40. UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:144)
    41. UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:621)
    42. UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:756)
    43. UnityEngine.Events.UnityEvent.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:53)
    44. UnityEngine.UI.Button.Press () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:35)
    45. UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:44)
    46. UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:52)
    47. UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:269)
    48. UnityEngine.EventSystems.EventSystem:Update()
    49.  
    any suggestions is greatly appreciated.
    -J
     
  2. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    @vis2k

    Any chance that you could provide an example for a Heal Over Time, Damage Over Time skills?

    Also, would you consider adding UMA as the character creation option? (or make it as a paid plugin?)

    Thanks,
    -J
     
  3. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress Info: V1.15 has been submitted to the Asset Store. Changes can be seen in the first post (maintenance).

    I did just look at it, but couldn't find any issues. Does it also happen for you in a fresh uMMORPG V1.14? Do you use Unity 5.3.4f1? Did you modify anything in the project?

    Don't add something dynamic like an Entity to SkillTemplate. All the Template scripts are just ScriptableObjects - things that only live inside your Project Directory and are never added to the Scene or to the Game World. They contain item definitions etc.

    Dynamic things like remaining cooldowns are added to the 'Skill/Item/Quest' scripts, which contain all the dynamic stuff while also referring to the templates for the more static things that never change.

    Adding UMA would increase the overall complexity and come with a whole lot of licensing issues (I assume), so I won't do that just yet.
     
  4. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    I use Unity 5.3.4f1: I have seen that issue from v1.11 to present v1.14. Basically, run around killing mobs then circle back to loot and rinse and repeat you will then note that the items in the loot window start to stack up. ill try to make a video if your unable to replicate it.
    ** Forgot to mention, this only happens when its fully built, i.e. dedicated server and clients. doesnt happen when running from editor with Server&Play

    I will circle back and try again, when you say Skill/Item/Quest; your referring to the struct correct?.. I was essentially trying to add a target to skill so in UIRefresh i could then cycle thru and update a visual indicator of the DoT on the enemy.

    Also whats your opinion on using Invoke() like the hpregen server side for handling DoT/HoTs?

    Understood, if you would consider a payment please PM me a quote for how long and how much.

    Thanks again for all your help and hard work!
    -J
     
    Last edited: Apr 13, 2016
  5. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Oh I see, will try it again in a build soon. I meant the Item.cs/(Buggy)Skill.cs/Quest.cs structs, yes. But even then, you probably shouldn't add a target to it, especially not of type Entity. It is used in UNET's SyncListStruct, which only allows for simple types such as float, int, string etc.

    Damage over time is tricky. You would need a new 'DamageOverTime' struct and then use a SyncListStruct of 'damageOverTimes' in each entity. Then when an entity is attacked with a category='DamageOverTime' skill, then the entity gets a new entry into the damageOverTimes list. Then you also deal that damage either in Update (once a second or so) or with a Invoke (don't forget to cancel it). Perhaps you could also add a 'Update1s' function to your Entity class that is called once a second (via Invoke), so that you can then use Update1s in Player/Monster/Npc to do Damage Over Time.

    About UMA: perhaps you can ask again in a few months. I am 100% busy right now, working on uMMORPG and another project. The uMMORPG core features have the highest priority for now.
     
  6. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Hello, can you add particle effects to the attack skill or a way to add particle effects to skills at all? And a way to add sound to the skills please.
     
  7. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress Info: updated WebGL demo to the latest uMMORPG version and fixed / reported some bugs.
    The most critical UNET bug for us can now be seen publicly: https://issuetracker.unity3d.com/is...lash-readbytes-out-of-range-errors-in-clients , so everyone please go ahead and vote on it.

    I looked into this today, and it's a UNET bug where SyncListStruct.Clear isn't synced if the entity was hidden while calling it. I reported it as #788537 (you can see it in the first post too). I will include a workaround in uMMORPG V1.16. There was another issue where clients would never see loot gold, which is fixed in V1.16 too. Thanks a lot for reporting it, this will help a lot of people!
     
  8. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    Thats awesome!, i removed the Hide() / Show() seems to work nicely. i also added SyncVar to lootGold on the Monster.cs.

    Thanks again for all your hard work!, i personally love this asset! so far its been the one thats gotten me the closest in providing a playable conceptual demo of what i would like to see become an MMO one day, so sincerely thank you!

    -J
     
  9. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
  10. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    You are welcome!

    uMMORPG's chat is based on noobchat and it uses UNET, so there is no reason to integrate noobchat seperately, it just makes things more complicated.
    noobchat was intended as a drop-in IRC chat for people who don't have any chat yet.
     
  11. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    @vis2k

    wanted your opinion on the following: I made my Heal Over Time by using StartCoroutine(), basically from UpdateCASTING() i call StartCoroutine() and use the following:
    Code (csharp):
    1.  
    2.     // used for heal over time
    3.     IEnumerator WaitForHoT(Skill skill, float waitTime) {
    4.         while (skill.HotTimeRemaining() > 0) {
    5.             if (this.hp > 0) {
    6.                 DealHealAt(this, skill.hotAmount);
    7.                 yield return new WaitForSeconds(waitTime);
    8.             } else {
    9.                 skill.hotTimeEnd = 0f;
    10.                 break;
    11.             }
    12.         }
    13.         yield return null;
    14.     }
    15.  
    the waitTime is my HOT interval so for example a player can cast a 30sec duration HoT that heals for 30secs every X amount of secs.

    DealHealAt() is basically a heal version of DealDamageAt(), over all it works really well, but i wanted to run it by you to get your opinion if you dont mind?

    Thanks,
    -J
     
  12. rastinrastini

    rastinrastini

    Joined:
    Jul 8, 2010
    Posts:
    158
    Hi
    1- do you have any benchmark about player online in an server with specific hardware?
    2- has any release date for pvp?
    Thankful.
     
  13. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    If it works and if you like the code, then keep it :)

    Hey,
    1. Not yet, simply because I can't connect many players from my laptop (it would take a few very powerful computers to get to 100 or 1000 players). I did test 1000 monsters on a cheap VPS server though, and that worked fine.
    2. There is no release date for anything. I usually just work on whatever excites me the most. We discussed a simple PvP implementation a few posts ago though, so feel free to browse through the previous posts, perhaps that helps already.
     
  14. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    @vis2k,

    Not sure if anyone has reported taking multiple quests from different npc's as a bug, basically once you accepted a quest from an npc and move to the next the npcQuestButtonAction.interactable remained set to false since it was set by player.quests[idx].IsFinished(), i added the following insice UpdateNpcQuest().

    Code (csharp):
    1.  
    2.                 // accept
    3.                 npcQuestButtonAction.GetComponentInChildren<Text>().text = "Accept";
    4.                 npcQuestButtonAction.onClick.SetListener(() => {
    5.                     player.CmdAcceptQuest();
    6.                 });
    7.                 npcQuestButtonAction.interactable = (idx == -1 && npc.quest.name != null);
    8.  
    just added so if the player doesnt have the quest but the npc has one to offer reset the npcQuestButtonAction back to True so players can Accept them.

    -J
     
  15. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    I am not 100% sure what you mean. I just tried to add another NPC and give him a completely new quest. I was able to accept both quests from both Npcs without any issues.
    Could you give me a step by step description so that I can try it myself and see the issue?
     
  16. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    Yep no problem; (new install ummorpg v1.14)

    Step 1. Create Alchemist A and Alchemist B
    Step 2. Go inside uMMORPG --> ScriptableObjects --> Quests
    Step 2a. Add a new Quest
    Step 3. Give Alchemist A one quest and Alchemist B the new quest made in step 2a.
    Step 4. place both alchemist in the scene
    Step 5. Play Scene
    Step 6. Interact with Alchemist A and Accept his quest.
    Step 7. Interact with Alchemist B and note that the Accept button is "greyed" out since .IsFinished() had set the button interactable to false since the first quest has not yet been completed.

    In UpdateNpcQuest() inside UIRefresh inside the accept code block i added the following:
    Code (csharp):
    1.  
    2. npcQuestButtonAction.interactable=(idx ==-1&& npc.quest.name!=null);
    3.  
    which sets the button back to true if the player doesnt have the quest being offered by the npc in order to accept it.

    -J
     
    mischa2k likes this.
  17. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress Info: working on V1.16, I replaced all TextMeshes with UI Canvas+Text today. This looks a bit cleaner and Entity names/damage popups won't be visible through walls anymore.

    Oh, a missing .interactable reset, can confirm. Will be fixed in V1.16. Thanks a lot!
     
    Cyance likes this.
  18. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Update: V1.15 is now on the Asset Store!
    Changes can be seen in the first post. I will submit V1.16 now.
     
    Cyance likes this.
  19. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    Thank you!

    could you elaberate a little more, im trying to merge the v1.15 changes into my project and i got stuck on this one.

    Thanks,
    -J
     
  20. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Go to Edit -> Project Settings -> Player, select WebGL. There you can set the API Compatibility Level to .NET 2.0 Subset and select Strip Engine Code. Those are the default settings. I changed them a while ago to work around a UNET WebGL crash, but that seems to be fixed now.
     
  21. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    Excellent, ill have to give that a try. i have only been focusing on Win, Mac, Linux and Android.

    Thanks again!
    -J
     
  22. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    @vis2k

    I decided to give WebGL a try, i noted an issue that im not sure its a bug or intended:

    in NetworkManager --> Network Info --> Use WebSockets

    If i check "Use WebSockets" then build my headless Linux server, the cpu usage remains 100% without any clients connected (Ubuntu 14.04).

    The above only occurs when i select Use WebSockets, otherwise if i remove the checkbox my Linux server runs fine but WebGL clients can not connect.

    Is this normal behavior, meaning does WebGL clients require their own server build that uses WebSockets?

    I tried it on the default v1.15 as well, and have the same results.
    -J
     
  23. JMyerscough

    JMyerscough

    Joined:
    Jul 12, 2012
    Posts:
    117
    @vis2k

    Hi,
    I haven't purchased uMMO yet, but I was wondering: How easy/hard would it be to change it to an FPS, or more specifically, UFPS?

    Thanks
     
  24. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    @vis2k

    BUG:

    I noticed because RefreshLocation() in Player.cs destroys the object and then its re-instantiated it causes particles that are attached to items (i.e. weapons, shields etc..) to not play/show.

    Thanks,
    -J
     
  25. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress Info: one more of our UNET bugs can be voted on in the issue tracker now: https://issuetracker.unity3d.com/is...-synced-to-clients-if-the-object-was-disabled

    Could you try a fresh UNET project like move.zip from here: http://forum.unity3d.com/threads/unet-sample-projects.331978/ and see if it happens there too?
    Note: you probably have to add the 'if IsHeadless then start server' part too though.

    You could build on the archer class and make the camera first person. Note that we don't have WSAD movement yet because we are waiting for a UNET feature. Also keep in mind that the most popular multiplayer FPS games use prediction so that movement etc. isn't delayed on the client. This is a challenge and there is no UNET feature for that (yet).
    Normally RefreshLocation would only be called when actually equipping/unequipping something, so it wouldn't be a problem. Right now it's called in Update all the time because of this UNET bug: https://issuetracker.unity3d.com/is...-still-has-old-value-inside-callback-function
    So all we have to do is wait for 5.3.5 and then I'll revert to the old RefreshLocation code that works properly. I hope you can wait that long :)
     
    Last edited: Apr 20, 2016
  26. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    Thanks, ill give this a try.

    LOL i have plenty of other stuff on my todo list, i can absolutely wait for .5 :)

    Thanks,
    -J
     
  27. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress Info: I ran out of things to fix for V1.17, so it's time for a new feature that has been requested a lot: PvP!
    I am really happy with the implementation, because it was incredibly simple and requires almost no code changes because it makes use of the already existing buff system.

    Here is how PvP works (inspired by a MMORPG I played a long time ago):
    • If you attack someone innocent, then you will become a Offender for 1 minute
      • Attacking or killing an offender has no penalty
    • If you kill someone innocent, then you will become a Murderer for 1 hour
      • Attacking or killing a murderer has no penalty
      • Murderers lose 1% health per second, which makes surviving difficult
    • The offender and murderer status are just buffs that can easily be changed without writing code:
      • 2016-04-20_murdererbuffs.png
    In other words: people can attack other people any time. But attacking someone innocent makes you an offender/murderer, which means that others can attack you without penalty, so you will most likely be killed and lose a lot of valuable experience.


    2016-04-20_offender.png
    2016-04-20_murderer.png
     
    Last edited: Apr 21, 2016
    Cyance, carsenk and VValdus like this.
  28. VValdus

    VValdus

    Joined:
    Mar 15, 2016
    Posts:
    6
    Very Nice !!!!!!!!!

    Good job !! :cool::cool:

    have you think to create a list of connection (Player name connected) ?
     
  29. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Thanks. You can take a look at the PlayerChat component to learn how to find all connected players.
     
  30. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    I just finished trying out that move project, i built it for Linux headless and Use WebSockets to make a baseline to work from, all worked well no high cpu usage and i was able to connect additional 'balls' (lol).

    The moment i added the following into my own NetworkManagerMMO : NetworkManager, rebuilt and ran it, the CPU spiked up 100% just like in my previous post:
    Code (csharp):
    1.  
    2.     void Awake() {
    3.         // headless mode? then automatically start a dedicated server
    4.         // (because we can't click the button in headless mode)
    5.         if (IsHeadless()) {
    6.             print("headless mode detected, starting dedicated server");
    7.             StartServer();
    8.         }
    9.     }
    10.  
    After remarking one component at a time and checking, the culprit was StartServer();, the moment i commented out StartServer() like so:
    Code (csharp):
    1.  
    2.     void Awake() {
    3.         // headless mode? then automatically start a dedicated server
    4.         // (because we can't click the button in headless mode)
    5.         if (IsHeadless()) {
    6.             print("headless mode detected, starting dedicated server");
    7.             //StartServer();
    8.         }
    9.     }
    10.  
    The CPU went back to normal no more 100% usage.

    So basically when checking "Use WebSocket" AND having StartServer() in Awake() on a headless Linux the CPU seems to spike at 100%

    forgot to mention, without StartServer() no clients connect.

    -J
     
  31. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    I like that implementation!

    As a side note; any pointers on how to get NPC's to provide more than 1 quest at a time? i was going to use a SyncList and turn its current quests to [] but not sure if thats the best way to do it?

    -J
     
  32. Rowell

    Rowell

    Joined:
    Sep 22, 2014
    Posts:
    27
    In regards to PVP, is there a simple way to enable/disable it? A switch or setting somewhere?
    Or will that require code changes?
     
  33. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It's a UNET bug then. I suggest submitting a bug report with Unity 5.3.4f1 and sharing the case number with us, so we can all keep track of it.

    You can use public QuestTemplate[] quests; in the Npc class. Then you also have to draw it with the UIRefresh script though. This is kinda annoying, hence why I didn't do that yet.

    You could change the 'if target is Monster or Player' to 'if target is Monster' code in the Player's TryCastSkill function.
    I didn't consider that someone may not want PvP enabled. I will add some kind of option to enable/disable it if more people request that.
    Edit: I will include an option, it does make sense.
     
    Last edited: Apr 21, 2016
  34. Rowell

    Rowell

    Joined:
    Sep 22, 2014
    Posts:
    27
    Many thanks!
     
  35. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Update: V1.16 is now on the Asset Store! Changes can be seen in the first post.

    The next one will be submitted soon...
    Edit: V1.17 was submitted for review. Changes can be seen in the first post as well (mainly PvP).
     
    Last edited: Apr 22, 2016
  36. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    @visk2k

    I was working on my AoE spells and have the following working:
    Code (csharp):
    1.  
    2.                                     int layerMask = 1 << 9;
    3.                                     layerMask = ~layerMask;
    4.                                     Collider[] hitColliders = Physics.OverlapSphere(agent.transform.position, skill.radius, layerMask);
    5.                                     foreach (Collider hitCollider in hitColliders) {
    6.                                         if (hitCollider != null) {
    7.                                             var hit = hitCollider.GetComponentInParent<Monster>();
    8.                                             if (hit != null) {
    9.                                                 DealDamageAt(hit, newDmg);
    10.                                             }
    11.                                         }
    12.                                     }
    13.  
    The problem that i ran into was DealDamageAt() wasnt updating all of the targets dmg, i noticed that inside DealDamageAt() the base.DealDamageAt() was passing 'target' vice 'entity' once i replaced it with 'entity' all my targets dmg updated correctly.

    Code (csharp):
    1.  
    2.         public override void DealDamageAt(Entity entity, int n) {
    3.         // deal damage with the default function
    4.         base.DealDamageAt(target, n);
    5.  
    was there a reason for passing 'target' vice entity? or just an old typo?

    Thanks,
    -J
     
  37. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Nice find @jagatai33, I have read through this function countless times, but never noticed it. I resubmitted V1.17, it now passes the 'entity' parameter to the base function.

    By the way, you can use a 'public LayerMask layers;' variable instead of that bit magic. Unity will then show you a real layer selection with names and everything in the Inspector, I found that immensely helpful when working on the CameraMMO view blocking a long time ago. As a matter of fact, you can see the variable still commented out in the Script.
     
  38. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    thats so much cleaner, thanks for the tip!

    -J
     
  39. Udin89

    Udin89

    Joined:
    Jul 19, 2015
    Posts:
    15
    Can I change the network base from UNET to Photon? If it possible, is it hard?
     
  40. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    That's probably hard, because uMMORPG makes heavy use of UNET's SyncVars, SyncListStructs and Commands.
     
  41. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    @vis2k ,

    If you get a chance could you take a look at:
    Code (csharp):
    1.  
    2.   public SyncListQuest quests = new SyncListQuest();
    3.  
    if a player takes a quest then logs out, although the quest is properly saved in Database it wont show on players Quest logs which then wont allow a player to properly turn in back to NPC.

    It works fine "Server & Play" but not with client built. If i remember correctly you said there might be a UNET bug with SyncList structs not syncing correctly with clients?

    thanks,
    -J
     
  42. Udin89

    Udin89

    Joined:
    Jul 19, 2015
    Posts:
    15
    Thanks for the reply.
    Ok with the limitation of UNET, can I make a modified mmorpg so that player has mini game inside the main game (like casino game)?
     
  43. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Just tried it, the quest isn't synchronized to the client. It's the same UNET bug that causes skills not to be synchronized back in October already. The solution is to rename the Quest.cs file to BuggyQuest.cs. Please vote on the bug here: https://issuetracker.unity3d.com/is...with-certain-names-is-not-synced-with-clients

    I am sure that wouldn't be too hard. Just a UI and some Cmd/Rpc/SyncVars. The UI part would be the hardest here, the UNET part would be somewhat easy.
     
    Last edited: Apr 25, 2016
  44. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Update: V1.17 is now on the Asset Store! Changes can be seen in the first post (mainly PvP).
    V1.18 was submitted for review.
     
    Last edited: Apr 26, 2016
  45. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    Thanks!
     
  46. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Question can assets on the asset store be used??? such as NGUI UConstruct etc.. Also are we limited in tab target or can we make games with ESO style soft lock?? or even First person style like Darkfall..

    Also what have people been using for a backend??

    " * Database via XML"


    such as Game Sparks.
     
  47. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    You can use assets from the asset store, but you will have to find a way to make them work with uMMORPG yourself, unless someone else here tried them before.

    The game doesn't use tab target. You click a monster in order to target it.

    First person should be doable by changing the camera position. Note that there is no WSAD movement yet, because this requires movement prediction. We are kinda waiting for a UNET feature that makes that possible.

    I used SQLite before, but XML turned out to be faster and easier to use.
     
    CrandellWS likes this.
  48. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    can you please add PETS and MOUNTS?
     
    Cyance likes this.
  49. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    +1 i used MySQL, but after some testing turns out XML is much easier and cleaner, and since its XML its easier to plug into a web portal for character viewing etc...
     
    nonom likes this.
  50. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    Folks,

    Hoping someone could guide me in the right direction;

    basically im working on equipping skinnedmeshes, i have it working to the point that both local and remote players can see pants, shirts, gloves etc

    im using ClientRPC to update remote clients, my problem became once i added in the function to Show my skinnedmesh inside the RefreshLocations() so i can update when players login or new players enter the scene i then started getting "RPC Function called on client." errors.

    the part that confuses me is that everything works, i just keep getting those errors, has anyone encountered this or anything similar?

    thanks,
    -J