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
    I gather all the good addons in the documentation already: https://noobtuts.com/unity/MMORPG#community-addons .
    You can post your addon where ever you like, I'll just link to it.

    What are collectible resources?
     
  2. krill156

    krill156

    Joined:
    Jun 28, 2014
    Posts:
    6
    Strictly forbidden within the MaNGOS Team, I my self have never accepted donations for the servers i ran.. a 10$/month/60-100$/year/ unix vps or home host is all that was needed to run everything so money on my part was never an issue.. the servers i ran ended up not getting very popular or just getting dossed to hell by the other bigger servers so i ended up just saying f*ck it on running servers.

    There are a few big servers i administrated that did take money how ever.. but blizzard is no where near even close to touching those servers.. Russian hosted.. Russian ran.

    I left MaNGOS and the Emulation Scene not too long ago and i'm not ever looking back.. It's not Big ol bad blizzard you have to worry about or those refunds you mention..its the other 3000 servers with more money, security and DDOSing power.

    If something bad happens to a server, the owner doesn't even have to give you a refund.. Because illegal server.
     
    Last edited: Jan 20, 2017
  3. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    something used in 99 % of mmo where there is crafting:
    playing a an animation while hiting a tree which will give wood, playing a mining animation when clicking on a copper node which will give coper ore for example
     
    GOLDY00 likes this.
  4. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    It would be good to have some sort of item entity for interactive/collectible objects.
     
    GOLDY00 likes this.
  5. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    One step after another :)
     
    Zhenite likes this.
  6. michaelbeers

    michaelbeers

    Joined:
    Aug 19, 2015
    Posts:
    18
    @vis2k Currently Iam making an CMS based on Symfony 3.2.2, maby i will release a Bundle for UMMORPG aswell
     
    mischa2k likes this.
  7. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    Seems uMMORPG v1.53 is already available :) Yey, crafting....
     
    Ronith and mischa2k like this.
  8. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Update: V1.53 is now on the Asset Store:
    • Crafting
    • UICharacterCreation dropdownCurrent variable renamed to currentClass for consistency
    • Player.CmdTradeOfferAccept 'else' syntax simplified

    I submitted it 12 hours ago, that's weird.

    Good luck!
     
    Zhenite, cioa00 and camta005 like this.
  9. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Hi all, long time! Wish I had more time to play with uMMORPG but just recently started a new job and it's been taking up lots of my time. Hopefully will be back to in the game soon enough.

    @vis2k i'm happy to see uReg Plugin listed as a Community Add-on! It's an honor to contribute this is awesome project. Hopefully it's been helpful to some.
     
    camta005 and mischa2k like this.
  10. Ronith

    Ronith

    Joined:
    Feb 20, 2014
    Posts:
    69
    thank you @vis2k for the 1.53 release, i am really happy with the craftingscript. it is as imagined it! :)
     
  11. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    Thank you for the Update
     
  12. Ronith

    Ronith

    Joined:
    Feb 20, 2014
    Posts:
    69
    seach for VIGOR POTION in the recipes-folder and check the inspector. it should be self explanatory.
     
    mischa2k likes this.
  13. luis29vm

    luis29vm

    Joined:
    Oct 25, 2016
    Posts:
    164
    thank you I see how it works :) cheers
     
  14. aranthel09

    aranthel09

    Joined:
    Jul 17, 2015
    Posts:
    66
    Finally the Crafting System update is out!!! Can't wait to play around with it
     
    GOLDY00 likes this.
  15. ianmhart

    ianmhart

    Joined:
    Mar 16, 2014
    Posts:
    28
    i wish we have tutorial adding joystick controller.
     
  16. Wansyth

    Wansyth

    Joined:
    Aug 14, 2013
    Posts:
    12
    Thank you for the crafting system!

    Is there a way for users to figure out which recipes are possible that I'm missing?
     
    Last edited: Jan 21, 2017
  17. mischa2k

    mischa2k

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

    Welcome back.

    You are welcome.

    You are welcome.

    Indeed.

    You can find lots of tutorials for this on the internet, there's no networking or anything weird involved.

    My approach would be to let them figure it out by themselves, which adds mystery to the game. You can also create a UI that shows all recipes though.
     
  18. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    For those who want to add level requirement for certain craft options, here is one way to deal it.

    Code (CSharp):
    1. // open Scripts\RecipeTemplate.cs
    2. // add before bool CanCraftWith
    3. public int requiredLevel;
    4.  
    5. // find boolCanCraftWith
    6. // add new parameter int plevel
    7. // and wrap it content inside if-else condition so result would be like this
    8.     public bool CanCraftWith(List<ItemTemplate> items, int plevel) {
    9.         // items list should not be touched, since it's often used to check more
    10.         // than one recipe. so let's just create a local copy.
    11.         if(requiredLevel <= plevel) {
    12.             items = new List<ItemTemplate>(items);
    13.          
    14.             // make sure that we have at least one ingredient
    15.             if (ingredients.Any(it => it != null)) {
    16.                 // each ingredient in the list?
    17.                 foreach (var ingredient in ingredients)
    18.                     if (ingredient != null)
    19.                         if (!items.Remove(ingredient)) return false;
    20.              
    21.                 // and nothing else in the list?
    22.                 return items.Count == 0;
    23.             } else return false;          
    24.         } else return false;
    25.     }
    26.  

    Code (CSharp):
    1. // open file Scripts\_UI\UICrafting.cs
    2. // find line var recipe = RecipeTemplate.dict.Values.ToList().Find(r => r.CanCraftWith(items));
    3. // add new parameter player.level so the result would look like
    4.  
    5.             var recipe = RecipeTemplate.dict.Values.ToList().Find(r => r.CanCraftWith(items, player.level)); // good enough for now
    6.  
    Code (CSharp):
    1. // open file Scripts\Player.cs
    2. // find method CmdCraft
    3. // find line var recipe = RecipeTemplate.dict.Values.ToList().Find(r => r.CanCraftWith(item));
    4. // add additional parameter level
    5. // result should look like
    6.             var recipe = RecipeTemplate.dict.Values.ToList().Find(r => r.CanCraftWith(items, level)); // good enough for now
    7.  
     
    GOLDY00 and camta005 like this.
  19. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    @vis2k i found out tiny bug (well, "feature" :D). Try make new recipe, add two hp potions as ingredients and try crafting. After crafting, one hp potion will be left on the crafting window and you can't move that potion back to inventory either.
     
  20. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Thanks for letting me know. I wasn't able to reproduce it, I selected the Vigor Potion recipe and replaced the Mana Potion ingredient with a Health Potion, so that it requires two Health Potions. Crafting still worked fine.
    Can you tell me step by step what to do to reproduce it?
     
  21. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    I tried now with new project and it seems to be working. I guess somehow it just bugged out during previous testing periods.
     
  22. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Alright
     
  23. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    I`ve noticed that when you have stack with items then u need to separate them before you can drag them to crafting window. But that is just fine.
     
  24. cioa00

    cioa00

    Joined:
    May 31, 2016
    Posts:
    203
    Oh and when you put items on crafting window and close it and then you re-open it. Then items stay in the crafting window. Not sure if its better idea just clean slots on crafting window when it has been closed.
     
  25. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    I notice that happened to me sorta. I had to remove the entire uMMORPG to fix it. Though my issue was the crafting UI was missing the slot's where the inventory items go. So I had to remove the entire project to fix that.
     
  26. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress: I reimplemented the XML database with SQLite for testing reasons. XML is still a great fit for the current set of features, but SQLite might be better for the future:
    • Server instances (UNET Phase 3) will require one central database. Modifying the SQLite code to connect to a MYSQL database only requires a few lines of code.
    • There is value in being able to run queries like 'remove all items with name XYZ from database' or 'find all players at level 70' easily. XML has XQuery, but nobody seems to know that.
    • I want to implement a shadow delete feature, where deleted characters remain in the database forever. This will be really useful when people accidentally delete their characters and want them back.
    • The account system will be much easier in a SQL database. With our XML system, each account is currently a folder. If we want to store more account info like passwords, then we need an additional accountinfo.xml file inside the folder, which would be a bad design.
    • SQLite is still simple enough to use. For those who don't know, it's just a file that can be used like a SQL database.
    • There will always be forbidden file names like 'COM', SQLite doesn't care about that
    • We can use all kinds of special characters like @ and / for account names without having to worry about the underlying file system
    • My CMS / item mall solution would require a global list of data that can be searched and modified quickly, without loading / saving the whole thing each time
    • People still keep requesting a SQL solution all the time
    If anyone can think of reasons why XML would be better for the list of reasons given above, please let me know.

    Yes, this can be a good thing if players just want to close the window for a second, or it can be annoying. Will see.

    We had this problem with the npc quest slot a while ago after an update. There seems to be some kind of Unity bug that disconnects the prefab link in some cases when uploading it to the store / downloading it from the store.
     
    Sarrivin, Tiny-Tree and cioa00 like this.
  27. Ronith

    Ronith

    Joined:
    Feb 20, 2014
    Posts:
    69
    This will break the easy-to-use thing, what uMMORPG made the best choice in the asset store. :-/ I worked many times with sql bases, but never with sqlLite.
     
  28. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Read about SQLite, there is no way I'd add if it wasn't simple to use. You don't have to rent a server and setup a database like with MYSQL or similar. SQLite is just a file, it would still work immediately when you press the play button, without any additional setup.
     
  29. Zhenite

    Zhenite

    Joined:
    Dec 6, 2016
    Posts:
    59
    @vis2k
    Could not there be a configuration field that could choose between XML, MySQL or MongoDB?
    I think SQLite will not have any advantages over XML, at least MySQL will support external connections, and Mongo is certainly the fastest and easiest option to cluster if necessary.
     
    jonkuze likes this.
  30. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    I think there are two main issues with switching to SQLite.

    1. Speed
    The existing system uses the computer's own file system to store data, with folders essentially being used as an account index, and a small number of small files that are in each account folder. To summarize, It's lightning fast. Compare that to the single file system of SQLite, it is going to be much slower once there are a decent number of players in the database. You yourself have already found this out according to the docs: "Saving 1000 players took about 30 seconds with SQLITE and only 2 seconds with XML". Not only will SQLite be slower, it will also be more CPU intensive. The more players in the database the more noticeable this will be.

    2. Concurrency
    SQLite can handle multiple concurrent reads, but it is locked as soon as any data is written to the database. Compare this to a multiple file system on a SSD hard drive, which can handle concurrent reads/writes.

    SQLite would be better for relational queries, and I am guessing that you have hit some sort of brick wall with the CMS system that has something to do with that sort of query. Perhaps there is a way that you could restructure the XML file system that would help the issue (whatever it is). For example you could put all data for a single player in a single file, instead of having separate character files and a password file. You could even use the account name as the name of this one file, instead of using folders, meaning that all data for a single player is in a single file, making it more efficient to search for relational queries, while not sacrificing the speed of the existing system for reading and writing to accounts.
     
  31. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    Here's some issues I've had with SQL from past experience.
    • SQL Injections & Other SQL Hacks - Main Issue.
    • Backing up the database for a case of roll-backs, slow since large data.
    • Possibly slow on reading large query's, like viewing the tables?
    Stuff I liked about SQL.
    • Organized & Clean.
    • Easy to search and find stuff.
    • Look's Nice.
    Personally, sticking with XML would be best; Since the database is only using Accounts & Characters. Though if reading NPC Data and Items from SQL, then i'm up for the change.

    Edit: Overall, I'm up for the change. As long theirs an great anti-injection.
     
    Last edited: Jan 21, 2017
  32. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    Ultimately the best solution would be to implement something like MySQL or PostgreSQL. You could keep the XML database and have a configurable option to use XML or SQL. That way you keep the user friendly simplicity of XML, but have the SQL option.
     
    Last edited: Jan 21, 2017
    Zhenite likes this.
  33. jagatai33

    jagatai33

    Joined:
    Feb 2, 2016
    Posts:
    165
    Im all for SQLite, long term its a much better option and will allow for a much simpler integration towards full blown SQL environments for live server setups.

    -J
     
  34. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    could you try to code it to make it almost support external DB ? or multiple server could use a common DB?

    one thing that would be cool would b e to separate some logic for example if user don't want to use STR STAM but other name, we have to rechange the files after each updates which make progress very tedious.
    making the stats inside files like the items would be really great. so we just assign them to entity class to read static data like

    assetfile
    {
    statName,maxValue,perLevelIncrease
    }
     
    Last edited: Jan 22, 2017
  35. GOLDY00

    GOLDY00

    Joined:
    Mar 16, 2013
    Posts:
    139
    Now that you have crafting you have to have at least gather items like minting chopping wood etc etc and interaction with object like doors or stuff like that
     
  36. mischa2k

    mischa2k

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

    I am suprised by the database responses, so let's talk about some concerns first:
    We don't need a configuration field as long as the Database function names and parameters stay the same. Then we can just replace the existing Database.cs file with our XML/SQLite/Mongo/MYSQL/... scripts. Simple and stupid :)

    Speed: it's as fast as XML now. I used one transaction per character save before, which was already pretty good. The trick was to use one transaction to save all characters at once, which is 10x faster. Saving 100 characters took 3.6 seconds before, now it takes 380ms. With XML it takes 370ms. So there is no real difference anymore.

    Concurrency: true in theory, not useful for our case though. All our Unity scripts run in one thread, and saving XML also happens in one thread. We could use a C# thread to save all characters, but I'd argue that this is very risky and there is value in saving them all at once before doing anything else. Race conditions, item duping, etc.

    Brick wall: see below.

    SQL Injections: won't happen with the sqlite library, we use parameters like this:
    Code (CSharp):
    1. Query("SELECT * FROM characters WHERE name=@name", new SqliteParameter("@name", charName))
    Backups: it's just a file that you duplicate. This might actually be faster than XML, where there are many smaller files to duplicate. But it will take a long time before backups take more than a couple of seconds anyway.

    Large queries: I haven't looked through the SQLite implemention, but I am pretty sure that it uses data structures that are optimized for that. An MMO database is nothing in comparison to the SQL servers of large organizations, and those still have to be fast.

    Having a configurable option would work. This needs an abstract IDatabase class and there would be several implementations to worry about all the time. If we want to keep the code short and simple, then just replacing the Database.cs script is the best solution. No additional code (no additional bugs), no additional abstraction (mental overhead), nothing to worry about.

    See below.




    Now let me explain again why we might run into a dead end with XML for the next features that will come, this time in more detail:
    • Server instances / UNET Phase 3: we will definitely need to split the game world between several servers if we want to support large amounts of players. All of those server instances should be connected to the same database, otherwise a guild might exist on Instance A but not on Instance B etc.
      • XML: is file based. If all instances are supposed to connect to one database, then we would have to use some kind of network drive to read/write the XML files. This would be really complicated, prone to fail and probably slow.
      • SQLite: is file based too, but the step to using a centralized MYSQL server is trivial. We just have to import the 'MYSQL' instead of 'SQLITE' library and modify the connection string to look for a database server instead of a sqlite file.
      • This is really the main argument here. XML won't work with server instances, we will have to replace it at some point.
    • Account system: everyone will need this system for their own MMO.
      • XML: accounts are folders right now. We will need additional data like account passwords or a banned flag. Where do we store that? In the folder name? In a 'account.xml' file inside the folder? But what if someone creates a character with the name "account", this would result in another account.xml file in the same folder. How do we get the list of characters for the account? Return the amount of files - 1? What if the file disappears? We could have an extra 'Accounts' folder in the database, which only the account xml files. If we create or delete a character, we would have to read and write the whole file each time. We would also need an 'Account' class so C# can serialize it automatically. Either way, the design would be messy and far from simple or elegant.
      • SQLite: accounts can be saved in a table.
    • Special account names: my planned CMS / item mall might need email addresses as account names. Emails contain "." and "@" and "/" and all kinds of weird characters.
      • XML: how to we make sure that we can always create xml files with those characters without running into unwanted effects?
      • SQLite: strings are escaped automatically.
    • Guilds: we will need a way to "find all players in guild XYZ".
      • XML: we could add a player.guild property. Then we would have to open every single player file to check it. This is costly. We could have a guilds.xml file that references the player names. But what if we rename or delete a player?
      • SQLite: SELECT name FROM players WHERE guild=XZY.
    • CMS / item mall: we will need an item mall in our MMORPGs if we don't want to go bankrupt in the first year.
      • XML: it's doable for the solution that I have in mind. It's not elegant though, because it will also require saving some additional data for each account. It would also need a way to search that data easily, which we can't with XML unless we use XQuery/XPath. I am sure a few people here know how to work with XQuery and XPath, but the majority would be overwhelmed.
      • SQLite: my solution can be stored in a new table. We can search it with SELECT * FROM table WHERE ...
    • And lastly, Convenience. this is a matter of preference. Eventually we will need to "find all accounts that purchased something since June" or "find all players with more than a million gold" or "teleport all players in world XYZ". This would also work with XQuery, but it can be really frustrating if you never used it before.

    The whole topic is still open for discussion and I really don't want to break anyone's project, unless it's really worth it. I think it would be.
     
    Natalynn and Ronith like this.
  37. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
  38. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    Can players run their own servers?
    If so can this thus be used as a base regular RPG that has multiplayer?
    eg. something like Dark Souls or Minecraft/Terraria (without the digging)
     
  39. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    That doesn't split the game world between server instances as far as I see it.

    Yes, players can host servers on their own computer too. If they want someone else to connect over the local network, it will work fine. If they want someone to connect over the internet, they either have to host the server on the internet or use Unity's multiplayer services (the relay server and/or matchmaking).

    It's designed around UNET, but you can still just press the 'Play & Host' button and it will look like a single player game (that others could connect to). If you extend it then you have to deal with some Networking of course.
     
  40. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    this plugin have 2 modes, create room by users, or persistant server instances that player can travel between using portals
     
  41. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    How well does it work?
    Either way, I won't add someone elses asset to uMMORPG. That would be illegal :)
     
  42. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    well i already tested with 4 clients so its not a stress test but it just work well, of course just would be great to get some inspiration for the design.
     
    mischa2k likes this.
  43. bartuq

    bartuq

    Joined:
    Sep 26, 2016
    Posts:
    127
    Thanks for the crafting.

    Can I use ingredients amount? I see few lines to uncheck in UICrafting.cs but how to change RecipeTemplate.cs?
    How about skills like blacksmithing etc. can be placed as SkillTemplate?
     
  44. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    320
    It's very relevant with multiple servers/instances connected to a central database.

    This is a good point, if you implement SQLite then changing over to MySQL will be painless. Perhaps you could implement that as a configurable option, so it really is painless :)

    I agree completely that XML is not a great long term solution, but neither is SQLite for some of the same reasons. It would actually make sense though, particularly if you add the option to choose between SQLite or MySQL. SQLite for those that want to keep it simple and user friendly, and MySQL for those who want to run multiple servers in one large connected world.

    If it makes converting over to MySQL easier, then SQLite is a good idea.
     
    Last edited: Jan 22, 2017
    mischa2k likes this.
  45. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    I want to wait a while and see if anyone finds bugs in the current crafting system before I add any more features. Stability is important.

    Of course, instances would use MYSQL then, which can deal with concurrency just fine.
     
  46. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    Vis, The sql works with Sql server management right? Its more an advanced tool used in mmos.
     
  47. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    What do you mean?
    You can view and modify the sqlite file with a lot of tools if that's what you are asking. There is a firefox plugin, adminer, phpliteadmin, sqlite file browser, ...
     
    Last edited: Jan 22, 2017
  48. Natalynn

    Natalynn

    Joined:
    Apr 21, 2013
    Posts:
    197
    Oh, phpmyadmin. That's good, I use that currently with XAMPP.
     
  49. MyNameJeff22

    MyNameJeff22

    Joined:
    Nov 27, 2016
    Posts:
    26
    Im not a programmer and the simplicity of this asset is the soul reason I desided to purchase Ummorpg vs any other option. I hope in the future that this asset will continue to be as simple as possible for us non coders. I know Vis has to take everything into consideration when adding new things to this and i think its great that your working on a built in item mall and account database. No doubt a must have for low budget projects like mine. I hope these new changes dont make things harder for us users that are not programmers
     
    Ronith likes this.
  50. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Phpmyadmin was more for MYSQL though, now that I think about it. Adminer, Phpliteadminer, etc. are all fine for SQLITE. And if you have the file on your local computer then any sqlite file browser will do just fine.

    Thank you, that is great to hear. Simplicity will always remain the #1 goal.
    There are a few more features that I definitely want to add and that everyone will need (like the item mall), but uMMORPG won't become bloated (hence why I reject a lot of suggestions here all the time).