Search Unity

uMMORPG Official Thread

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

  1. xBeNjO

    xBeNjO

    Joined:
    Feb 6, 2014
    Posts:
    40


    Arrows spawn turn then fire at a weird angle, check my picture above :p
     
  2. joncrzo

    joncrzo

    Joined:
    Sep 26, 2015
    Posts:
    30
    That has been happening for some time now. I thought it was normal. And omg.. nice damage ha ha.
     
  3. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    Not sure what im doing wrong but when i drop a skill on the new skill bar it automatically adds it to that slot on the original bar. :(
     
  4. jjobby

    jjobby

    Joined:
    Nov 28, 2009
    Posts:
    161
    Hi vis2k, about handover player to other server, can you share your idea about it? We also want to ask your suggestion about WASD control. We need to develop prototype to present to our partners. The problem is that we don't know when Unity will update their network so we'd like to have a workaround for it before the deadline.
     
  5. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    I assume u double checked that all functions are included (i changed them during night couple times after i tested them on all kind variations).
     
  6. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    @cioa00
    I thought i did, but ill look throught it all again. I must have missed something if yours works, or im not on the current version maybe thats a possible issue. On v1.21 ? Was going to wait until 1.23 to upgrade since i have a handful of mods to transfer. Also was the player.cs correct set & get prefs? save and load function ?
    Thanks
     
  7. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    Tested and tried out on my work laptop and found out that i missed on important part. You need add new tag for SkillbarSlot2. Open tag combobox and add new tag with name SkillbarSlot2. And for othert skill bar numbers just choose that newly added tag.


    I`m using asset version 1.22 but that should work on version 1.21 too.
     
    Last edited: Jun 9, 2016
    JBR-games likes this.
  8. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    Oh my. I just noticed i copied-pasted wrong code line for LoadSkillbar. Inside the loop, there should be
    Code (CSharp):
    1. skillbartop[i] = PlayerPrefs.GetString(name + "_skillbartop_" + i, "");
    2.  
    I`m going to update my previous post too, so people won't get confused :p
     
  9. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    @cioa00

    yep setting the tag was the issue , works great now. thanks
     
  10. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    adding particles and sound to a spell casting

    have a particle as a prefab and add an audioSource to it with the audio clip to use. I maybe would also add the destroyAfter.cs so that it doesnt clutter up your scene.



    player.cs in void updatecasting() at each skill category ..example is "Heal"

    Code (CSharp):
    1.                     } else if (skill.category == "Heal") {
    2.                         // usability improvement: user should heal himself in he has
    3.                         // no target or if the target is not a player
    4.                         // (and that without actually switching targets)
    5.                         var castTarget = target;
    6.                         if (target == null || !(target is Player)) castTarget = this;
    7.                  
    8.                         // only if alive (can't just heal a dead player)
    9.                         if (castTarget.hp > 0) {
    10.                             //adds health if set
    11.                             castTarget.hp += skill.healsHp;
    12.                             //adds MP if set
    13.                             castTarget.mp += skill.healsMp;
    14.                             //adds buff time if set
    15.                             skill.buffTimeEnd = Time.time + skill.buffTime;
    16.                             // costs MP to cast spell if set
    17.                             mp -= skill.manaCosts;
    18.                             // costs health to cast spell if set
    19.                             hp -= skill.healthCosts;
    20. //added****************Visual particle effect **************************************************************************************************************************************************************************
    21.                             if (skill.effectPrefab != null)
    22.                             {
    23.                                 var posT = castTarget.tr.position;
    24.                                 var goEffect = (GameObject)Instantiate(skill.effectPrefab.gameObject, posT, Quaternion.identity);
    25.                                 NetworkServer.Spawn(goEffect);
    26.                             }
    27. //***********************************************************************************************************************************************************************************************
    need to add a gameobject to skilltemplete.cs
    Code (CSharp):
    1.   public GameObject effectPrefab;
    and also to buggyskill.cs

    Code (CSharp):
    1.  public GameObject effectPrefab
    2.     {
    3.         get { return SkillTemplate.dict[name].effectPrefab; }
    4.     }
    and add the prefab to the networkmanager >registered spawnable prefabs, so all players see and hear the spell cast
     
    Last edited: Jun 9, 2016
  11. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Good morning everyone.

    A few words about the new AoE feature in the next version:

    The Entity.DealDamageAt function now uses a third 'aoeRadius' parameter, so usage wise it's still almost the same. Inside that function we now attack the target and everything in 'aoeRadius' around the target. An aoeRadius of 0 means that we only attack the target.

    The function also returns the set of entities that were hit, just in case it's needed. For example, the Player class implements it's own DealDamageAt function, which checks if the player killed a monster. In case of AoE skills, it has to check if any of the monsters that were hit were killed, hence why Entity.DealDamageAt now returns the set of monsters that were hit.

    The Warrior's Strong Hit skill does have a small AoE radius now.

    Since it was asked a few times: I will add 'how to add another skillbar' to the How-To section when I get the chance.

    Also big thanks to the people who are helping out others here!

    I am sure it will be on the store very soon. I don't want to send around pending versions because then more people will ask for them, hence it takes more time, hence less time to do the actual work.

    Extra skill bars should be easy. For example, you could simply add a new UI panel and drag the last two slots of the current skillbar into it. And if you need more slots in total, then you can just add more slots in the Canvas, and in the player's skillbar definition.

    So what ciao suggested works too of course. I'd probably just use more slots and split them onto the skillbars, like 0..9 on skillbar 1 and 10..20 on skillbar 2 etc., because that wouldn't require a code change. This is the downside of the new UI system where adding more elements is not that easy anymore. This would have been very easy with the old OnGUI system, but no one seems to like that anymore.

    You are welcome.

    Will take a look at it, thanks.

    There are several ways to do that. First of all, UNET servers can't communicate with other UNET servers via UNET yet. So you would need another networking technology like TCP/IP. You could simply open a connection to the other server, send some kind of 'transfer player' packet and send the serialized player data to it (the same data that is saved in the XML file). You might also be able to use UNET's LLAPI to do that.

    WSAD itself is easy. Simply use the current movement functions and do something like 'if W pressed then move 1 unit forward'. The hard part is dealing with latency. If your client has a 500ms latency then this would feel really weird, hence it would need client side prediction or client side authority for movement. This is the hard part that comes with a lot of challenges.
    I will consider implementing the 'simple' WSAD movement that I just explained, so that we at least have something.
     
    JBR-games likes this.
  12. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    Oh yeah, i didn't tried that solution, but that makes sense and will be way easier way than what i were suggesting.
     
  13. xBeNjO

    xBeNjO

    Joined:
    Feb 6, 2014
    Posts:
    40
    What I used on my old project was an Account Server, that is the only thing that connects to a database. What would happen is the actual server would send a packet to it, with all the information and the Account Server would save it. Same for loading, The Account Server would send a packet to the main server and store it until the player leaves. That way I could have multiple servers all connecting to 1 account server with/for information. Hopefully vis2k's method will be out as soon as it's a possibility.

    This way the account server could be on a different computer or on the same too.
     
  14. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    So first off let me say that i have zero experience with networking, so my logic might be wrong. But i cant think of any real issue with making the player movement client side, as long as the server does a check that the player is in a legal location(on the navmesh), and player movement speed was with in correct range. (Cant travel more than X meters in one sec... Unless teleporting)
     
  15. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Imagine a small, thin door in front of a dungeon, that isn't supposed to be walkable by default. A hacker could stand next to that door and then send a movement packet that tells the server that he is suddenly on the other side of the door. Both your checks would still be valid, where the player is not in an invalid position (he is not inside the door), and the movement speed was also okay, because he just did two steps. This stuff is hard to do, and our current server sided NavMesh system makes it fool proof. We should get WSAD movement just as safe.
     
    JBR-games likes this.
  16. nixter

    nixter

    Joined:
    Mar 17, 2012
    Posts:
    320
    I noticed that the PC's equipment (Dark Sword and Sun Shield) cannot be examined in the Editor at runtime. Is this because they are structs? What is causing them to unviewable? Is it a case that they are being updated with Synchvars and need to be recreated frequently?
     
  17. bullardo

    bullardo

    Joined:
    Jan 5, 2013
    Posts:
    46
    Maybe horizontal and Vertical that way we can just work it in with the input system.
     
  18. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress Info: added 'How to add another Skillbar' to the online documentation. Will also be in the PDF file in the next version that I will submit.

    Do you mean that you want to change them while the game is running and then see the changes on the client? You could do that with a SyncListStruct and by changing ItemTemplate from class to struct. But I wouldn't recommend it, because your final game server won't have an Inspector where you can change things, so it would never happen. Unless you need some kind of NPC that has different items that are set by a script.
     
    Last edited: Jun 10, 2016
  19. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    @JBR games i tried your idea to add particles when player is casting buffs but im not sure at the moment why my particle stays between floor level. If im not wrong y position is wrong and i don't know how to change it. Do you have any idea how to set particles on middle of player.
     
  20. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Use GetComponentInChildren<Collider>().bounds.center instead of transform.position. You can see it in the Entity.DealDamageAt function. This is how damage popups are spawned in the center of an entity.
     
  21. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    Ah, i knew i should check already existing code :p Thank very much. I`ll give a try later when im back my pc.
     
  22. danielnetzer

    danielnetzer

    Joined:
    Jan 5, 2016
    Posts:
    29
    Hello everyone, first I would like to say that this Asset seems outstanding in all ways possible, the support, the nonestop updates (I just finished reading probably 100% of the documentation and this thread) and ofcourse the assets themselves. as I'm about to purchase it there is 1 thing I would like to understand as I understood from this forum the UNET system uses a single thread, wouldent it mean small game worlds by default as the fastest and strongest core cant hold more then a few thousands of CCU's?

    btw does anyone know when the latest version with the Area of Effect Skills system will be available on the asset store?
     
    Last edited: Jun 10, 2016
  23. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    I had a similar issue and made an empty gameobject and added the particle to that with the needed offset & saved it as the prefab.
     
  24. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Thanks. Our Unity scripts run in one thread, yes. Right now this means that there is a CCU limit somewhere. The UNET developers plan on developing a simulation server, which will be able to split the world into different smaller servers. Hence that problem will be solved automatically soon, without us having to do anything. This is explained by Erik somewhere in the end of this video:


    AoE skills should be out any time soon now. It usually takes about one week for smaller updates.
     
    Last edited: Jun 10, 2016
  25. danielnetzer

    danielnetzer

    Joined:
    Jan 5, 2016
    Posts:
    29
    thank you very much for the reply Vis, will look into this video right away, if I purchase the asset now i'll be able to download the update once the asset is updated? I just feel like the AoE is almost the last must have feature that I actually need so I can replicate from.
     
  26. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Yes, you can download the update for free afterwards. Watch out for Version 1.23!
     
  27. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    @vis2k

    If you had to approach group/party would you mind sharing a general overview on how you would go about it? I setup a new class which servers as a SyncListStruct container for a group of players, unfortunately im having a tough time figuring out why clients do not get the updated SyncList, meaning if server side the SyncList uses Add() clients dont seem to get that update?

    not sure if im making sense?

    -J
     
  28. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    A suggestion, if i may. We are doing a pretty drastic overhaul of how the system is used and trying to stay within the base functionality and ran into an interesting limitation that we had to change. Instead of using a strongly typed item.category name for things like 'HasEquipmentWeapon' we moved to adding a bool value to the item class and template so that it can check for whether the item itself is a weapon. Our usage is that a player could have several items that are weapons but each is a unique category in itself (think melee and ranged if you want on the same character). We later added in a string that allows it to do the check for the category as well based on the skill. So you end up with "HasEquipmentWeapon(string weaponCategory)". This way you can have a mix of multiple ranged/melee on the same character if they have those categories available on their equipment.

    Expounding on the previous, instead of using a strongly typed name for the ProjectileMount, change that to use a locator inside of the weapon item itself. This way you can spawn a projectile from multiple places if need be based on different skills/weapons. A use case is that we are using non-humanoid models for the player and it can spawn an attack from the front or the back and found it easier to locate the projectile spawn point using the weapon item itself. What we did is use the HasEquipmentWeapon to return a transform as the spawn point of the projectile. It allows for a smaller search (instead of doing a recursive find on the whole object) and then gives a transform for that particular skill to fire from.

    Just a couple simple items that can expand the usability quite a bit.
     
  29. danielnetzer

    danielnetzer

    Joined:
    Jan 5, 2016
    Posts:
    29
    OldRod likes this.
  30. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Another item, Instead of only having a cast range on the Skill, we added a range to the Item as well. This allows us to have more options for upgrading the weapons and skills as a pair. As an example, a regular attack could have a range of 1000 but the player can only use a level 1 bow with a range of 5. Similarly they could have a level 100 bow with a range of 100 but their current skill only allows a range of 1. Also opens up the ability to add in some attacks like a 'bash' using a bow that only has a range of 1 and another skill for the regular attack with a higher range but have a single attack with a massive range of say 1k but the bow itself limits it to around 10. That way the player can upgrade their bow and not need to change their current attack skill.
     
    JBR-games likes this.
  31. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    Now that AOE will be live soon, i think that a party / group system that shares XP and Loot is one of the few remaining "Big" missing functions of the system.

    @danielnetzer
    thanks for the link, i need to start understand networking better and that looks like a good place to start.
     
    Last edited: Jun 10, 2016
    CaptainMurphy likes this.
  32. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I still see a need for a 'faction' system that allows players to join a larger team and allow for PVP roles to be based on those factions. Team A vs Team B vs Team C kind of stuff.

    Ok, another suggestion. Language file/files. Some way to change the text without having to go through and find every instance of 'Mana' or 'Health' and be able to change it to something else. Otherwise every update is going to be painful doing diffs to find all of those changes or otherwise having to override every class and use the new ones.
     
  33. danielnetzer

    danielnetzer

    Joined:
    Jan 5, 2016
    Posts:
    29
    well I would definitly say +1 on the Party system, since its not a very simple implementation as it'll require, Level checks, exp sharing, round robin/free for all/individual loot system(ESO Style).
     
  34. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Another change I just did to the skills is to allow for an ItemRangeModifier that applies to my previous range adjustment for the Item. This way you can make a skill like 'long shot' that adds 25% to the maximum range of an item without knowing its existing max range.

    @vis2k, any chance you could set up a repository so we can start doing pulls based on the latest stable branch? It would make it a lot easier for people to contribute code without having to send over a ton of files.
     
  35. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Sounds like this bug: https://issuetracker.unity3d.com/is...with-certain-names-is-not-synced-with-clients
    Implementing a party system is a bit difficult. You have to decide who owns the party, and synchronize all changes to other party members - even if they are not around (out of NetworkProximityChecker range). And handle cases where someone leaves the party, or the host leaves the party, etc.

    The categories are compared with a string.StartsWith check by the way. So you can have categories like 'Weapon' and 'WeaponSword' and so on.

    About the projectile mount: makes sense, will put that on my ToDo list and look into it.

    Thanks for sharing. I implemented a first WSAD movement version yesterday. It still needs optimisations though.

    Thanks for your suggestion. Will think about that too.

    Localization is a good point. Again, I'll have to think about that. It might overcomplicate the code, will see.

    I am not sure about the Asset Store terms and conditions when it comes to those things. Will have to look into that first.
     
  36. nixter

    nixter

    Joined:
    Mar 17, 2012
    Posts:
    320
    Thanks for replying. I'm not trying to edit the values yet, I've just never worked with Unity Structs before and I'm having trouble wrapping my head around how they work. But I now see that's not the issue.

    The Refresh Location method in Player is instantiating the weapons and armor constantly. That's a bug right?
     
  37. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It was a workaround for a UNET bug. This bug was fixed in 5.3.5, so the latest uMMORPG version doesn't have that workaround anymore and uses synclist callbacks again.
     
  38. nixter

    nixter

    Joined:
    Mar 17, 2012
    Posts:
    320
    Ahh. I see. I'm a couple of weeks behind on upgrading so I'll download the latest version and modify that section. Next month I'll do a full upgrade so I don't bother you with things that have been fixed.
     
  39. joncrzo

    joncrzo

    Joined:
    Sep 26, 2015
    Posts:
    30
    I think a party system while more complicated, it should be a higher priority than WASD.
     
  40. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress Info: basic WSAD movement is finished and will be in V1.24. It doesn't use any fancy features like client side prediction yet, but it's simple, short and it works! Will upload a new WebGL demo soon.

    Edit: WebGL demo was updated to V1.24. You can all try WSAD movement now.

    No problem.
     
    Last edited: Jun 11, 2016
  41. danielnetzer

    danielnetzer

    Joined:
    Jan 5, 2016
    Posts:
    29
    Hello vis,
    I have been investigating for a while about the XML database implementation in this asset cause I was curious to figure out what the complexity of such a database and what the meaning of having a server side folder for each and every single account in the game and I came across this article - http://programmers.stackexchange.com/questions/163082/using-xml-as-data-storage which made me wonder how hard will it be to transfer the entire databse implementation to a MySQL in terms of the Unity code?
     
  42. tequyla

    tequyla

    Joined:
    Jul 22, 2012
    Posts:
    335

    i have tried webgl demo and when i move character with WSAD movement, it slides on the floor 2 seconds without animation and after 2 seconds, the run animation comes.

    jump coming soon ?

    ++
     
  43. joncrzo

    joncrzo

    Joined:
    Sep 26, 2015
    Posts:
    30
    I think MySQL would be a better choice and the option to host the database server on a separate machine.

    We use XML at work to store information and the files get huge. It isn't pretty.

    Actually it is more like 1 single millisecond. You don't even see it unless you zoom all the way in. But when you notice it, you cant stop looking at it and it gets irritating ha ha. But it is probably because of the server & play.

    Now we have to wait for the version that has that update and test it outside of server & play.
     
    Last edited: Jun 11, 2016
  44. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It's not that hard to convert the Database to SQL. uMMORPG used SQLITE a while ago, but I removed it again because XML was better for our case. I also explained that a bit in the FAQ section of the first post:

    Why XML and not SQLITE/MYSQL? We want to avoid MYSQL because people shouldn't have to setup a MYSQL database to be able to run uMMORPG. SQLITE would solve that problem, but there are several reasons that speak for XML:
    • We don't have to worry about performance, because saving 1000 players takes about 30 seconds with optimized SQLITE (including transactions), but only 2 seconds with XML.
    • XML files are easy to use and humanly readable. We can just open any character file with a text editor and modify it.
    • We don't have to worry about SQL Injection.
    • We don't have to worry about creating a database file and setting up the tables.
    • We don't have to worry about transactions in order to make it fast.
    • C# supports XML by default, we don't have to include extra DLL files like we would for SQLITE.
    • We don't have to worry about database locks.
    • We don't have to serialize everything manually. C# can automatically serialize arbitrary objects to XML for us (like the Inventory), so we can modify items, skills and quests without ever changing the save/load code for them.
    • The XML database only needs 1/3 of the amount of code that the SQLITE database needs.
    • XPath and XQuery are excellent tools to search and modify large amounts of XML data (if needed).
    • In the end, SQLITE and XML are both just files on our hard drive, so we might as well pick the easiest solution.

    It might still need some Mecanim parameter tweaks.
    Jump isn't planned at the moment, this would make the movement system incredibly complicated.
     
    Last edited: Jun 11, 2016
  45. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    revised tab selection
     
    Last edited: Jun 11, 2016
    pushingpandas likes this.
  46. MHolmstrom

    MHolmstrom

    Joined:
    Aug 16, 2012
    Posts:
    115
    Any way to add hack n slash combat? Also when will the WASD movement be downloadable?
     
  47. MHolmstrom

    MHolmstrom

    Joined:
    Aug 16, 2012
    Posts:
    115
    Also, can you add a combo system for basic attacks? I mean one looping animation is kinda pale.
     
  48. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    http://blogs.unity3d.com/2015/02/11/having-fun-with-the-new-mecanim-features/

    use something like this to randomize a couple of attack animations. might also want to shorten your basic attack cast times, and make sure your animations are approximately the same as your cast times.

    Also have to see how the new WASD is set up but i think you could add a small collider trigger in front of your character and if an Enemy is in the trigger area then when you press your Attack button it would use the current attack system on the target, should need fairly little code change.
     
    Last edited: Jun 11, 2016
  49. danielnetzer

    danielnetzer

    Joined:
    Jan 5, 2016
    Posts:
    29
    try using a crosshair for the WASD will simplefy things and add 2 keys that act as Mouse left click and Mouse Right click along with that crosshair.
     
  50. Folei

    Folei

    Joined:
    Mar 13, 2016
    Posts:
    4
    Hello,

    I want to add some basics attributes to my players (dexterity, fire power, earth power , magic resistances etc).
    Of course, I follow the documentation in order to do it. But I have a compilation error due to the fact that it's not possible to have more than 32 SyncVar. Do you have a idea to solve it with "clean" code ?

    PS : I am sorry for my english ^^
     
    Last edited: Jun 12, 2016