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. Dismiss Notice

uMMORPG Official Thread

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

  1. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    If you mean the unequip stuff. The Equipment Screen, you can't left click the item to unequip them. Unlike the inventory, you can left click to equip.

    At the moment you have to drag from the equipment screen to inventory to unequip.
     
  2. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Oh I see. It only works the one way right now because it's very obvious into which slot the inventory item goes once you click on it. Maybe clicking on equipment makes sense too, although we don't usually see that in most MMOs. Will have to think about this for a while.
     
  3. Michealunity

    Michealunity

    Joined:
    Mar 15, 2015
    Posts:
    65
    Hi there is a way to create another EquipPanel for secondary item? I know that i can add to main Equipment Category but i need to implement in the other way.Which part of code i must copy and modify?
    Thanks!
     
  4. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Not exactly sure what you mean, but you could probably add another equipment list to the player and then make a new UI that draws it.
     
  5. Zhenite

    Zhenite

    Joined:
    Dec 6, 2016
    Posts:
    59
    Friends, if I increase the size of the floor, the character can not walk away, he is displaying the animation but he stands still and sometimes slides like he's in a corner.
    What is going on?
     
  6. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Go to Window->Navigation->Bake, then rebake the Navmesh!
     
  7. Zhenite

    Zhenite

    Joined:
    Dec 6, 2016
    Posts:
    59
    Sorry for the idiocy, I have not worked with Navmesh yet, I'm learning something new every day.
    I ask: Is it possible to do this at runtime?
    My project is for mobile using GPS, my terrain is created at runtime by downloading the information from google.
    Already working relatively well, I stopped my test because I ran into this difficulty.
     
  8. xBeNjO

    xBeNjO

    Joined:
    Feb 6, 2014
    Posts:
    40
    Not just yet, here's a road map:

    https://unity3d.com/unity/roadmap
     
    mischa2k likes this.
  9. aranthel09

    aranthel09

    Joined:
    Jul 17, 2015
    Posts:
    66
    Hi! I would like to know where exactly it sets the overlay UI above player's head to receive the name and replace the [NAME] component. I need to assign another string inside a copy of it. However, when I copy the component, it still receives the player name as default
     
  10. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Each entity has a NameOverlay child object. The name overlay text mesh has a TextMeshCopyName script that sets the text to the owner's name.
     
  11. N2KMaster

    N2KMaster

    Joined:
    Jul 15, 2013
    Posts:
    64
    new titles.png
    Now if i could find someone who can make them monsters and armor work for me.... Anyone interested in getting in on this with me. Pays cash....... :p
     
    aranthel09 likes this.
  12. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Good progress.
     
    Last edited: Dec 22, 2016
  13. aranthel09

    aranthel09

    Joined:
    Jul 17, 2015
    Posts:
    66
    I'm having a hard time trying to make it:

    all skills have a castTime. I want to pass the value of my player.CastTimeReduction to all the skills. I've tried declaring a Entity type variable on BuggySkill, and then initializing it receiving Entity on constructor. However, it still doesn't work. I wanted CastTimeReduction to be calculated on skill.CastTime, in order to show it correctly on UI and then calculated. Any hint on that?
     
  14. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Can't you just use a smaller cast time in the first place?
     
  15. aranthel09

    aranthel09

    Joined:
    Jul 17, 2015
    Posts:
    66
    Actually, no... because player.CastTimeReduction scales with the amount of Dexterity the player has.


    Code (CSharp):
    1. void CmdCastTimeReduction(){
    2.  
    3.         castTimeReduction = ( * 1.16f) + EcastTime;
    4.  
    5. }
    So, it's a value that varies a lot. I wanted skill.CastTime to be shown accordingly to this value. So, skill.CastTime would be something like that:


    Code (CSharp):
    1. public float castTime {
    2.         get {
    3.  
    4.             var temp = SkillTemplate.dict [name].levels [level - 1].castTime;
    5.  
    6.             return ( temp * entity.castTimeReduction / 100) ;
    7.    
    8.         }
    This way, each player has a "unique" castTime accordingly to his build. Depending on the amount of Dexterity they have, they get different CastTimeReduction value and thus changing the default castTime for each skill.

    EDIT: I've tried making something like this:


    Code (CSharp):
    1. [Command]
    2.     void CmdCastTimeReduction(){
    3.  
    4.         castTimeReduction= (CmdDex () * 1.16f) + EcastTime;
    5.         for (int i = 0; i < skills.Count; i++) {
    6.             var skill = skills [i];
    7.             skill.playerCastTimeReduction = castTimeReduction;
    8.             print (skill.playerCastTimeReduction);
    9.         }
    10.  
    11.     }
    However, besides causing a little bit of lag it even doesn't work. skill.PlayerCastTimeReduction is still read as "0" on BuggySkill.
     
    Last edited: Dec 22, 2016
  16. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    I suggest adding Debug.Log after every single line and logging every single value, then you will see where it went wrong.
     
  17. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,291
    Sorry i do not read thrue the whole thread.
    Can we now go from one scene to another scene with ummorpg?

    I know that this should be comming with unet but where can i read about it myself to not disturb you in the future?
    You are one of the few people who not the most about network and i have and want to use ummorpg for a project that should use also this feature of unet.
     
  18. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Someone asked this before, so I added it to the documentation: https://noobtuts.com/unity/uMMORPG-documentation#how-to-use-another-scene
     
  19. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,291
    @vis2k Thank you.
    I read that part but that is not what i want to know maybe i choose the wrong word becouse english is not my main language so i am sorry about that.
    By the way, could we not just save the same scene under a new name?

    Edit1:
    Or i simply misunderstand what i need ;)
    Yes you are right i need to jump from one to another server if i want what i ask for.

    Edit2:
    So i thought about streamin my level and use World Streamer together with your asset.
    Does this mean i need many server and that unet feature that is not there until now?

    I just want to use them together so i can make bigger world that load faster.
     
    Last edited: Dec 22, 2016
  20. bartuq

    bartuq

    Joined:
    Sep 26, 2016
    Posts:
    127
    It seems to me that it is not about swapping one scene. It is about creating few scenes and then journey between them. I did something like that in uMMORPG but I didn't check if it works well in multiplayer. I check it today / tomorrow and I write back.
     
  21. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Yea you can't have simultaneous scenes with UNET right now. Not by default anyway. You can of course write some code for the servers to talk to each other. This is challenging of course.

    The easiest solution is to wait. The UNET simulation server will be released eventually, which will solve this problem. And if not, then I will release some solution for uMMORPG anyway.

    You can always try it yourself though, in the worst case you will learn something new.
     
  22. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Progress Info: been working on the next set of networking improvements for V1.48. The unreliable channel will be used a lot more to reduce overall bandwidth load.

    I also added a item.tradable property because that was still missing. This is useful for cases where we don't want certain items to be tradable to other players, e.g. special item mall or quest items.
     
    nixter likes this.
  23. Michealunity

    Michealunity

    Joined:
    Mar 15, 2015
    Posts:
    65
    Hi, there is a way to remove (delete) an item directly from slot on EquipmentPanel? Which function i must call?
     
  24. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    Folks,

    Below are two quick code changes to allow players to un-equip gear back to into inventory. Basically the way players can equip gear by clicking from inventory, now a player can click to un-equip gear back into the inventory.

    First go into Player.cs and add the following:
    Code (CSharp):
    1.     [Command]
    2.     public void CmdRemoveEquipmentItem(int index) {
    3.         // validate
    4.         if ((state == "IDLE" || state == "MOVING" || state == "CASTING") &&
    5.             0 <= index && index < equipment.Count && equipment[index].valid) {
    6.             // check inventory for free slot and pass it to swapinventoryequip()
    7.             var item = equipment[index];
    8.             if (item.category.StartsWith("Equipment")) {
    9.                 for (int i = 0; i < inventory.Count; ++i)
    10.                     if (!inventory[i].valid)
    11.                         SwapInventoryEquip(i, index);
    12.             }
    13.         }
    14.     }
    Replace UIEquipment.cs with the following:
    Code (CSharp):
    1. // Note: this script has to be on an always-active UI parent, so that we can
    2. // always react to the hotkey.
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5.  
    6. public class UIEquipment : MonoBehaviour {
    7.     [SerializeField] KeyCode hotKey = KeyCode.E;
    8.     [SerializeField] GameObject panel;
    9.     [SerializeField] GameObject slotPrefab;
    10.     [SerializeField] Transform content;
    11.  
    12.     void Update() {
    13.         var player = Utils.ClientLocalPlayer();
    14.         if (!player) return;
    15.  
    16.         // hotkey (not while typing in chat, etc.)
    17.         if (Input.GetKeyDown(hotKey) && !UIUtils.AnyInputActive())
    18.             panel.SetActive(!panel.activeSelf);
    19.  
    20.         // only update the panel if it's active
    21.         if (panel.activeSelf) {
    22.             // instantiate/destroy enough slots
    23.             UIUtils.BalancePrefabs(slotPrefab, player.equipment.Count, content);
    24.  
    25.             // refresh all
    26.             for (int i = 0; i < player.equipment.Count; ++i) {
    27.                 var entry = content.GetChild(i).GetChild(0); // slot entry
    28.                 entry.name = i.ToString(); // for drag and drop
    29.                 var item = player.equipment[i];
    30.  
    31.                 // set category overlay in any case. we use the last noun in the
    32.                 // category string, for example:
    33.                 //   EquipmentWeaponBow => Bow
    34.                 //   EquipmentShield => Shield
    35.                 // (disable overlay if no category, e.g. for archer shield slot)
    36.                 if (player.equipmentTypes[i] != "") {
    37.                     entry.GetChild(0).gameObject.SetActive(true);
    38.                     string overlay = Utils.ParseLastNoun(player.equipmentTypes[i]);
    39.                     entry.GetComponentInChildren<Text>().text = overlay != "" ? overlay : "?";
    40.                 } else entry.GetChild(0).gameObject.SetActive(false);
    41.  
    42.                 if (item.valid) {
    43.                     // Added to move equipment back to inventory
    44.                     if (item.category.StartsWith("Equipment")) {
    45.                         int icopy = i; // needed for lambdas, otherwise i is Count
    46.                         entry.GetComponent<Button>().onClick.SetListener(() => {
    47.                             player.CmdRemoveEquipmentItem(icopy); // added to move equipment into open inventory slot
    48.                         });
    49.                     } else entry.GetComponent<Button>().onClick.RemoveAllListeners();
    50.                    
    51.                     // set state
    52.                     entry.GetComponent<UIShowToolTip>().enabled = item.valid;
    53.                     entry.GetComponent<UIDragAndDropable>().dragable = item.valid;
    54.                     // note: entries should be dropable at all times
    55.  
    56.                     // image
    57.                     entry.GetComponent<Image>().color = Color.white;
    58.                     entry.GetComponent<Image>().sprite = item.image;
    59.                     entry.GetComponent<UIShowToolTip>().text = item.Tooltip();
    60.                 } else {
    61.                     // remove listeners
    62.                     entry.GetComponent<Button>().onClick.RemoveAllListeners();
    63.  
    64.                     // set state
    65.                     entry.GetComponent<UIShowToolTip>().enabled = false;
    66.                     entry.GetComponent<UIDragAndDropable>().dragable = false;
    67.                     // note: entries should be dropable at all times
    68.                    
    69.                     // image
    70.                     entry.GetComponent<Image>().color = Color.clear;
    71.                     entry.GetComponent<Image>().sprite = null;
    72.                 }
    73.             }
    74.         }
    75.     }
    76. }
    77.  
    and thats it, now players can click to remove equipped gear back into the inventory.

    -J


     
    Natalynn, bartuq and mischa2k like this.
  25. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Just set the item.valid to false for that slot (has to happen on the server of course).
     
  26. bartuq

    bartuq

    Joined:
    Sep 26, 2016
    Posts:
    127
    ok, I tested move between scenes as multiplayer. It's working but:
    - player is on both scenes
    - player is on new scene, however, his position (x,y,z) will automatically change to position like on the first scene (it's probably because script copy position or something like that)

    If a player could be removed from the first scene after change scene it will be probably work. If I'm wrong please correct me.
     
  27. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    Each Scene will be the same coordinates, just different scene IDS. For the same position stuff, you will just have to update a players position to a new position on scene teleportation. Possibly asigning map ids in character files would also be good to do.


    Edit;
    Though what vis said, unity doesnt really like this scene switcher. .

    Wish unity can do this, or have a world manager server, that handles all the scenes.
     
    Last edited: Dec 23, 2016
  28. aranthel09

    aranthel09

    Joined:
    Jul 17, 2015
    Posts:
    66
    Just wanted to report that I made player.CastTimeReduction to be set to skills.

    I made a variable on SkillTemplates called Player templatePlayer;
    I made a read-only variable on BuggySkill to receive it from SkillTemplates, of course:

    Code (CSharp):
    1. public float playerCastTimeReduction {
    2.  
    3.         get { return SkillTemplate.dict [name].templatePlayer.castTime; }
    4.     }
    The castTime from skill also needed a bit of rework:


    Code (CSharp):
    1. public float castTime {
    2.         get {
    3.  
    4.             if (playerCastTimeReduction == 0) {
    5.  
    6.                 return SkillTemplate.dict [name].levels [level - 1].castTime;
    7.             } else {
    8.  
    9.                 var temp = SkillTemplate.dict [name].levels [level - 1].castTime;
    10.                 return temp * playerCastTimeReduction / 100;
    11.             }
    12.                return SkillTemplate.dict [name].levels [level - 1].castTime;
    13.  
    14.         }
    15.     }
    Then, made that on startLocalPlayer method on Player, I added:


    Code (CSharp):
    1. if (isLocalPlayer) {
    2.             for (int i = 0; i < skillTemplates.Length; i++) {
    3.                 var _skillTemplates = skillTemplates [i];
    4.                 _skillTemplates.templatePlayer = this;
    5.                 skillTemplates [i] = _skillTemplates;
    6.             }
    7. }
    Now I'm going to make players have custom attack speed aswell, received by Player script.

    And everything's working! To everyone who make wanna more customizable skill behavious, that's a way of doing that!
     
  29. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    uMMORPG One Year Anniversary
    Good morning everyone. As many of you know, I started working no uMMORPG around July 2015 and exactly one year ago on December 23 it was released on the Asset Store!

    uMMORPG has come a long way since then and today the quality is absolutely amazing. Thanks to all of you for testing it so thoroughly in all kinds of different environments and for reporting every tiny bug that you have found. I am proud to say that we fixed all of them. Even UNET itself got several improvements out of it.

    Like many of you, it all started a decade ago when I played my first MMO. The experience was so mesmerizing that words can hardly describe it. Ever since then I knew that I had to make my own MMORPG, no matter what it takes. The road to uMMORPG has been very long and bumpy, but necessary. I still greatly remember the days of learning C++ memory management, wrapping my head around Haskell's monads, feeling completely overwhelmed by all those math theorems in university and developing MMO servers in my free time with just about any programming language that you can think of. Most of all I remember the day when a friend of mine introduced me to Unity.

    I distinctly remember thinking: "maybe if uMMORPG sells once a month that's some extra motivation to keep going". Little did I know that it would be this successful and that I would wind up working on it full time.

    It's been a long year, working on uMMORPG on every one of those 365 days. The HLAPI bugs were driving me crazy some nights, and one or two people here were truly exhausting to deal with :). That being said, I am more enthusiastic about it today than ever before. I played my childhood MMO again today and compared it to uMMORPG. We are so close!

    Christmas is around the corner and this year I am not wishing for anything, because I already have everything right here. This has been the greatest year of my life, a dream come true.

    I want to thank all of you for being here and trusting in my work. I am looking forward to another great year with lots of improvements, like this new temple here:
    2016-12-23.jpeg

    Special thanks goes out to:
    @aabramychev for his work on the LLAPI
    @jagatai33, @xBeNjO and @MHolmstrom for sticking around for so long
    @cioa00 for posting his addons
    @Kuroato for posting the PHP Registration sample
    And the hundreds of people here who helped uMMORPG grow.
     
    Last edited: Dec 23, 2016
    xBeNjO, Codinablack, Zhenite and 3 others like this.
  30. aranthel09

    aranthel09

    Joined:
    Jul 17, 2015
    Posts:
    66
    Thank you for making the creation of MMORPGS something possible. I dare to say that, without your asset, (almost) none of us would be able to develop a MMORPG from scratch. So, we're all making eachother's dreams come true a little bit, altogether =]
     
    Zhenite likes this.
  31. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    The day when unity fixes these issues on there side to be able to do mmorpgs and add the ability for multiple scenes would be like christmas all over.

    Also vis, you know the network send rate for like projectiles, would turning that up cause issues? Cause it really helps on smoothing projectiles out.
     
  32. jagatai33

    jagatai33

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

    I can honestly say your asset has saved me (and im sure others as well) a monumental amount of development time while we build our own MMO dreams!

    I wish you and your family a wonderful holiday season along with the rest of the uMMORPG community!!

    Thank you so much!!
    -J
     
  33. Michealunity

    Michealunity

    Joined:
    Mar 15, 2015
    Posts:
    65
    Hi i added a total of 20 string to EquipmentTypes but the code instantiate only 12 slotEquipment and the rest are ignored and not instantiate the slot
     
  34. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Where did you add them? What does your Player component look like when the game is running?

    Yes we do!

    Shouldn't cause issues, it just takes more bandwidth.

    Thanks
     
  35. Michealunity

    Michealunity

    Joined:
    Mar 15, 2015
    Posts:
    65
    I added not in code but in the fields of the script Player.cs under the voice EquipmentTypes. When I run my game this field looks like i added and there is all the voice but for some kind of reason not instantiate at all.
    I notice also that in player SyncListItem "equipment" also after the modification of the number of fields still remain only 12 item and not 20 like i want.
     
  36. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    Hm, Would removing the navmesh pathfinder from WSAD be hard to do? I like to add jumping and stuff with WSAD. But keeping left click movement normal.

    Might look into changing it my self, would I have to modify any of the onSerialize and onDesiralise functions?
     
    Last edited: Dec 24, 2016
  37. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    So the equipmentTypes array does have the correct size?

    Jumping introduces a lot of problem. You will need a real physics, gravity, continous Rigidbodies, all kinds of checks to make sure people don't jump into places where they shouldn't. And you need client side prediction or similar.
     
  38. Michealunity

    Michealunity

    Joined:
    Mar 15, 2015
    Posts:
    65
    Yes the equipmentTypes has the correct size
     
  39. aranthel09

    aranthel09

    Joined:
    Jul 17, 2015
    Posts:
    66
    Why does it start to bug when adding new values to be written and read on XML?
     
  40. Michealunity

    Michealunity

    Joined:
    Mar 15, 2015
    Posts:
    65
    I try to create a new project and it works...I don't modify anything in the script...boh!
     
  41. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    Make sure to delete your character when modifying the database.

    Ive just thought of a better way for jumping. That I can actually do with the actual NavMesh with. Ill share that with you via private messaging.
     
    Last edited: Dec 24, 2016
    mischa2k likes this.
  42. Michealunity

    Michealunity

    Joined:
    Mar 15, 2015
    Posts:
    65
    I create a fresh project and this error shows up
     

    Attached Files:

  43. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    That error should of went away when the scripts updated, by unity script updater. Are you using unity 5.5p1-5.5p2? Those best versions for this currently, due to quest.cs and skills.cs.
     
  44. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    Yes, that error shows up if u have older unity version. On this thread first page on first post you can find changelog or check that on asset page when you click on version number.

    And the latest uMMORPG version is already 1.47

    Of the topic - merry christmas everyone :)
     
  45. Zhenite

    Zhenite

    Joined:
    Dec 6, 2016
    Posts:
    59
    Is it possible to put creatures in the game at runtime?
    I would like to make a system type the old games of pokemon where it was necessary to enter the bush to look for a creature to fight.
    Merry Christmas to everyone!
     
  46. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    It's possible, just use NetworkServer.Spawn(prefab).
     
    Zhenite and mischa2k like this.
  47. Codinablack

    Codinablack

    Joined:
    May 8, 2016
    Posts:
    12
    When I downloaded newest update fresh project it throws errors about the namespace "AI" not being part of unitytengine
     
  48. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Merry christmas everyone! I wish you all great holidays and lots of free time to write code!

    Did you try deleting the database folder and then creating a new character? CharacterCreate is where the equipment SyncList is populated based on the equipmentTypes amount.

    Delete the old database folder so it doesn't try to read the old stuff.

    Yes use 5.5.0p1.

    Use Unity 5.5.0p1, that works. Unity moved the NavMeshAgent stuff to UnityEngine.AI recently.
     
  49. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,327
    Update: uMMORPG V1.47 is now on the Asset Store:
    • NavMeshAgent.NearestValidDestination extensions added (used for WSAD movement)
    • UIDragAndDropable syntax improved
    • Object Initializers are used for network messages for simplicity
    • NetworkManager.IsValidAccount parameters renamed to not collide with member variables
    • Network Configuration optimizations for MMORPGs:
      • Max Buffered Packets
      • Min Update Timeout
      • Reactor Max Receive/Send Messages
      • Second channel changed to 'Unreliable Fragmented' for less important things
      • Projectile uses Channel 0 again
      • NetworkName uses Unreliable channel
      • NetworkNavMeshAgent uses Unreliable channel
      • Channels.DefaultUnreliable/DefaultReliable constants are used instead of hardcoding the channel indices
    • Player Drag and Drop: unsellable items can't be dragged into the NpcSell slot anymore
    • Player Drag and Drop: OnDragAndClear clears NpcSellSlot now too
    • UINpcTrading: sell slot tooltip is now hidden when there is no item in the slot
    • UINpcDialogue: opening the Buy / Sell menu also opens the player's inventory now
    • Utils 'using' statements sorted a bit better
     
    nixter and aranthel09 like this.
  50. Zhenite

    Zhenite

    Joined:
    Dec 6, 2016
    Posts:
    59
    Thanks for the help. Tell me, how do I destroy this gameobject later?